No Polyglot 1.4.39b- problem

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

No Polyglot 1.4.39b- problem

Postby H.G.Muller » 23 Aug 2009, 21:39

Just in case anyone might have seen a thread here created by me which I just deleted:

Sorry about causing panic, there is NO, repeat NO problem whatsoever with polyglot. It was all my own fault:

There was a typo in the WB options for the shortcut to start Fruit. In stead of having -sUCI for the second engine, it had -fUCI. And even if WB does not startup the second engine, it does interpret the WB options that go with it at WB startup. So starting Fruit as first engine in the oldfashioned way, with -fcp "polyglot fruit.ini" would actually see the -fUCI erroneously tagged to the second engine. So it would think polyglot was a UCI engine, and invoke another polyglot to run it.

So indeed, I have always been running Fruit through two polyglots in series. I guess you can do that, now that polyglot understands UCI at its GUI end. :twisted: You would never notice. Except now that Polyglot exports its own options. Then the Polyglot options of the second are added to the UCI options of the first...

What an inceadibly stupid mistake, that took me an entire evening of debugging to figure it out. :( I can only hope I didn't waste any of your time...
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: No Polyglot 1.4.39b- problem

Postby F.Huber » 23 Aug 2009, 23:22

H.G.Muller wrote:..there is NO, repeat NO problem whatsoever with polyglot..

Well, unfortunately that's not true! :(

With 1.4.39b I get the following error messages (2 windows):
1) Error writing to first chess program: Die Pipe wurde beendet.
2) Error: first chess program (polyglot C:\X\\polyglot_1st.ini) exited unexpecedly.

Did not happen with the previous 1.4.38b ...
User avatar
F.Huber
 
Posts: 229
Joined: 27 Sep 2004, 14:29
Location: Austria

Re: No Polyglot 1.4.39b- problem

Postby Michel » 24 Aug 2009, 10:45

With 1.4.39b I get the following error messages (2 windows):
1) Error writing to first chess program: Die Pipe wurde beendet.
2) Error: first chess program (polyglot C:\X\\polyglot_1st.ini) exited unexpecedly.



I apologize.

The ini file parsing was rewritten (to prepare for PG saving its own ini files) so perhaps some glitch has crept in.

Could you please post the PG log file?

Thanks in advance,
Michel
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: No Polyglot 1.4.39b- problem

Postby Michel » 24 Aug 2009, 11:02

Ok I noticed what the problem is.

Polyglot_1st contains

BookFile =

My new parsing algorithm does not accept empty values since they are redundant
(they are basically a form of comment and PG already has proper comment characters ; and #).

But since it is WB who writes these files I assume I will have to adapt PG. I need to think how to best do this.

So meanwhile please use 1.38b (I am traveling and have only intermittent internet connection).

EDIT: the fix appears to be trivial but I have to test it bit to see if it causes no other problems.
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: No Polyglot 1.4.39b- problem

Postby F.Huber » 24 Aug 2009, 11:34

Michel wrote:Ok I noticed what the problem is.
Polyglot_1st contains
BookFile =

Yes, this caused the error.
If I remove this from winboard.exe (with a small patch) it works again.
My new parsing algorithm does not accept empty values since they are redundant

Well, "not accept" should of course not mean that PG crashes. :wink:
But since it is WB who writes these files I assume I will have to adapt PG. I need to think how to best do this.

But there has also to be changed something in WB of course, because as it is now the user has no influence on what WB writes into Polyglot_1st.ini (I'm talking about these Book, BookFile, Hash, Nalimov ... entries).
User avatar
F.Huber
 
Posts: 229
Joined: 27 Sep 2004, 14:29
Location: Austria

Re: No Polyglot 1.4.39b- problem

Postby H.G.Muller » 24 Aug 2009, 11:56

F.Huber wrote:But there has also to be changed something in WB of course, because as it is now the user has no influence on what WB writes into Polyglot_1st.ini (I'm talking about these Book, BookFile, Hash, Nalimov ... entries).

You can set all that stuff in the Options -> Global Settings menu. Of course that doen't help you when you crash at startup because the "engine" cannot handle the current values, but then the trick is to start up with another engine, use the menu to change the offending value, (save setting if that is not done by default on exit), and restart WB again with the engine you want.

A bit cumbersome, perhaps, but like you say: engines are not supposed to crash. And I should add that we do not intend to distribute WinBoard without a winboard.ini file that already initializes these parameters to valid values. We could change the compiler defaults, but for a opening book it is not clear what default value you should choose. So an empty string is a kind of natural choice.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: No Polyglot 1.4.39b- problem

Postby Michel » 24 Aug 2009, 12:00

Code: Select all
Well, "not accept" should of course not mean that PG crashes. :wink:


Well if you execute polyglot on the command line you see that it exits cleanly.

./polyglot polyglot_1st.ini
PolyGlot 1.4.39b by Fabien Letouzey.
ini_parse(): Syntax error in "polyglot_1st.ini": line 5

WB does not relay this message to the user. Sadly PG would also not log this since
before knowing if logging is enabled it has to to parse the configfile first....
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: No Polyglot 1.4.39b- problem

Postby F.Huber » 24 Aug 2009, 12:06

H.G.Muller wrote:You can set all that stuff in the Options -> Global Settings menu.

In the meantime I've also found this option in winboard.ini: /polyglotBook=""
Entering here e.g. "book.bin" also solves the problem.
(you see, I'm not yet really a WB expert ... :wink: )
User avatar
F.Huber
 
Posts: 229
Joined: 27 Sep 2004, 14:29
Location: Austria

Re: No Polyglot 1.4.39b- problem

Postby Michel » 24 Aug 2009, 12:09

So an empty string is a kind of natural choice.


Well an empty string means using the default value so it is redundant.

If you want to emphasize the existence of a certain option without specifying its value the usual thing is to comment the relevant line out

; BookFile=

Or even

; BookFIle = book.bin

to indicate what the default is.

This being said I will change the new ini file parsing algorithm of PG such that it accepts empty values again.
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: No Polyglot 1.4.39b- problem

Postby H.G.Muller » 24 Aug 2009, 14:42

Michel wrote:Well if you execute polyglot on the command line you see that it exits cleanly.

./polyglot polyglot_1st.ini
PolyGlot 1.4.39b by Fabien Letouzey.
ini_parse(): Syntax error in "polyglot_1st.ini": line 5

WB does not relay this message to the user. Sadly PG would also not log this since
before knowing if logging is enabled it has to to parse the configfile first....

If an engine wants to give error mesages a user can see, you should prefix them with "tellusererror " in WB protocol. Sending just any string is a protocol violation...

I could suppress writing the BookFile setting in the polyglot_1st.ini when it is an empty string, if all Polyglot versions guarantee that this is the default value. But I guess this would be largely wasted effort, since in the next version of WB I will probably drop the writing of ini files altogether, and use the facility you offer in 1.4.39b to pass all parameters through the command line. (It would be nice if it would understand empty string there, though.) And, like I said, normally the install will contain a small opening book and the BookFile will point to that, so the problem would not occur in the current version as we distribute it. It is only because a offered a bare winboard.exe as alpha version that this problem surfaces.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: No Polyglot 1.4.39b- problem

Postby Michel » 24 Aug 2009, 15:05

"tellusererror " in WB protocol.


Ok thanks for pointing that out. But this error probably occurs before pg has received the xboard command. so pg would have to queue the error message.
I will not think about that for the moment since it is not a big problem.

I have adapted the parser so that if ignores empty values.

(it's not posted yet and will likely not happen for a couple of days since according to your post the problem is not urgent, so I prefer to do a bit more testing).
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: No Polyglot 1.4.39b- problem

Postby Volker Pittlik » 25 Aug 2009, 12:27

Michel wrote:...
I have adapted the parser so that if ignores empty values.
...


Maybe non empty values are a problem to:

Code: Select all
StartChildProcess (dir="/home/volker/schach/polyglot") ./polyglot spike.ini
10147 >second: xboard
protover 2
10148 <second: PolyGlot 1.4.39b by Fabien Letouzey.
10148 <second: ini_parse(): Syntax error in "spike.ini": line 21
xboard: Error: second chess program (./polyglot spike.ini) exited unexpectedly
GameEnds(37, Error: second chess program (./polyglot spike.ini) exited unexpectedly, 2)
10148 >first : quit
10151 >second: quit
Achdukacke!


The spike.ini (working for years):

Code: Select all
[PolyGlot]
EngineName = Spike 1.2 Turin
EngineDir = /home/volker/schach/spike
EngineCommand = ./spike

Log = false
LogFile = spike.log
Resign = true

ResignMoves = 3
ResignScore = 800
Book = true
BookFile = /home/volker/schach/polyglot/performance.bin

[Engine]
Hash = 64
MultiPV = 1
Hash = 64
Learn Positions = false
Learn Filename = learnfile    ############this is line 21 in the original
NalimovPath /media/GB/nalimov/ 
NalimovCache = 32
UCI_Chess960 = false
Threads = 1


vp
User avatar
Volker Pittlik
 
Posts: 1031
Joined: 24 Sep 2004, 10:14
Location: Murten / Morat, Switzerland

Re: No Polyglot 1.4.39b- problem

Postby Michel » 25 Aug 2009, 12:56

NalimovPath /media/GB/nalimov/


I am sorry but there is an equality sign missing in that line. If this worked before then it was an accident.
How should PG be able to distinguish the value from the name without equality signs?

Anyway thanks for helping to test the new parser.
After putting in the missing equality sign the config file parses fine.
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: No Polyglot 1.4.39b- problem

Postby Volker Pittlik » 25 Aug 2009, 13:37

Michel wrote:...
I am sorry but there is an equality sign missing in that line.


Thanks.

Michel wrote:...How should PG be able to distinguish the value from the name without equality signs?


Hm, I can think about some options but would you really like to implement that now?

vp
User avatar
Volker Pittlik
 
Posts: 1031
Joined: 24 Sep 2004, 10:14
Location: Murten / Morat, Switzerland

Re: No Polyglot 1.4.39b- problem

Postby H.G.Muller » 25 Aug 2009, 21:29

Well, the ini-file syntax prescribes equal signs, so let's stick to the specs rather than change them.

One quick question to Michel:

Which Polyglot options are not supposed to go into the ini file? I suppress OptionFile, Chess960 and Affinity now. The latter because it does not seem to be exported to WinBoard. What about UCI? I guess it must always be false if you want to run Polyglot under WB, but it probably does not hurt to have it in the polyglot.ini?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: No Polyglot 1.4.39b- problem

Postby H.G.Muller » 26 Aug 2009, 21:24

I noticed another problem with Polyglot 1.4.38b (probably shared by 39b):

When you run a UCI engine with a polyglot.ini file under WinBoard, the default values of the options appear in the Engine-Settings dialog, rather than the values that currently apply. I think it would be more logical to show the user the current values. This is only possible if Polyglot does use these actual values in the feature commands it sends (from the polyglot.ini, and only if it was not set there, use its own or the engine default).

This is easily fixed by replacing opt->default_ by opt->value (3x !) in format_xboard_option_line (xboard2uci.c).
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: No Polyglot 1.4.39b- problem

Postby Michel » 26 Aug 2009, 23:29

This is only possible if Polyglot does use these actual values in the feature commands it sends (from the polyglot.ini, and only if it was not set there, use its own or the engine default).


I have to look. The idea is that the feature option commands are set in the following order (this is option->default)

engine default/config value/command line value

For PG options the engine default is replaced by the compile time default. If this does not work then it is a bug.

I track the current value of an option internally but I think this value will never be shown to the user (there is no command in the xboard
protocol to ask for the current value of an option and neither is there in the UCI protocol).
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: No Polyglot 1.4.39b- problem

Postby H.G.Muller » 27 Aug 2009, 07:10

The setting of the options does work as you describe and Polyglot sends them to the engine / uses them internally. It is just that when Polyglot sends the features it ignores the settings and aways sens the engine / compile-time defaults to WinBoard. So the engine will use different settings as the Engine Settings dialog shows.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: No Polyglot 1.4.39b- problem

Postby Michel » 27 Aug 2009, 12:39

I am probably stupid but can you give the precise commands that cause trouble?

I experimented with the option "ownbook". After executing the commands

xboard
protover 2

the feature option commands shows the currently applying value.

Executing

option ownbook = 1
option ownbook = 0

etc... it seemed that the currently applying value is sent to the engine each time.
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: No Polyglot 1.4.39b- problem

Postby H.G.Muller » 27 Aug 2009, 13:19

Yes, but it is not sent to WinBoard.

If you put in the polyglot.ini file

[Polyglot]
LogFile = foo.log
[Engine]
NullMove Pruning = Never

and you then open the Engine #1 Settings dialog in Winboard, you will see:

NullMove Pruning: Fail High
LogFile: polyglot.log

Because Polyglot has sent it

feature option="Polyglot LogFile -string polyglot.log"
feature option="NullMove Pruning -combo *Fail High /// Never /// Always"

in stead of

feature option="Polyglot LogFile -string foo.log"
feature option="NullMove Pruning -combo Fail High /// *Never /// Always"
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Next

Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 20 guests