xbord 4.4.0 (Mac) and -matchGames

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 14 Oct 2009, 19:15

Hi,

I've tried a two match game between two UCI engines, and after the first game the second didn't happen. Board shows the last position from the first game, the white clock runs into negative values and all processes are "hanging". I've tried with and without -xreuse -xreuse2 ...

Code: Select all
  501  6826  6825   0   0:00.57 ttys000    0:01.45 xboard -fcp ../Engines/Stockfish-1.5/stockfish -fUCI -scp ../Engines/Shredder-12/Shredder12Mac -sUCI -matchGames 2 -xreuse -xreuse2 -size 80,1,12,0,12,1 -coords -movesound -highlight -clock -xponder -usePolyglotBook true -saveGameFile ../pgn/xboard.pgn -pgnExtendedInfo true -trivialDraws true -polyglotBook ../Books/performance.bin -fNoOwnBookUCI -sNoOwnBookUCI -defaultPathEGTB ../Bases/Nalimov/ -smpCores 1 -defaultHashSize 512 -darkSquareColor #7085B6 -lightSquareColor #EFEFEF -whitePieceColor #FFFFFF -blackPieceColor #202020 -highlightSquareColor #FF0000 -lowTimeWarningColor #FF0000 -font -bitstream-bitstream vera sans-medium-r-*-*-*-*-*-*-*-*-*
  501  6873  6826   0   0:00.00 ttys000    0:00.01 polyglot ./polyglot_1st.ini
  501  6875  6873   0   0:00.01 ttys000    0:00.08 ../Engines/Stockfish-1.5/stockfish
  501  6876  6826   0   0:00.00 ttys000    0:00.00 polyglot ./polyglot_2nd.ini
  501  6877  6876   0   0:03.70 ttys000    0:06.05 ../Engines/Shredder-12/Shredder12Mac


Any suggestions?

Holger
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby Michel » 15 Oct 2009, 19:28

I think this is a bug with the use of a polyglot (GUI) book. I observed this also.
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 15 Oct 2009, 19:34

Michel wrote:I think this is a bug with the use of a polyglot (GUI) book. I observed this also.


That is :(

Can HGM confirm this?
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby H.G.Muller » 15 Oct 2009, 21:12

So the issue is that when using the GUI book in a match the second game does not start at all?

There was a problem with the white engine not being started when the first engine brought it out of book with its first move. But that has been fixed in git some time ago. I don't think this can be the cause of the behavior you describe, though. I will test to see if I can reproduce it; without debug file it is impossible to determine why th gam hangs.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 15 Oct 2009, 21:41

OK, where schould I sent the debug file?
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby Michel » 15 Oct 2009, 21:42

without debug file it is impossible to determine why th gam hangs.


I seem to recall that it occurred ***every*** time when using a GUI book together with matchGames. So it should not be difficult to debug.
Michel
 
Posts: 513
Joined: 01 Oct 2008, 12:15

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 15 Oct 2009, 22:27

H.G.Muller wrote: ... without debug file it is impossible to determine why th gam hangs.


Please give me an eMail where to send the stuff, attachement are not allowed in this forum :(

Last lines from debug file:

Code: Select all
1297136 >second: force
1297136 >first : computer
1297136 >first : name Shredder 12 x64
1297136 >second: computer
1297136 >second: name Stockfish 1.5.1 64bit
TC string = '+40/5'
mps=40 tc=300000 inc=0
TC string = '+40/5'
mps=40 tc=300000 inc=0
time odds: 1 1
1297136 >second: time 30000
1297136 >second: otim 30000
book key = 463b96181691fc9c
book move field = 731
book hit = d2d4
1297136 >second: force
1297136 >second: d2d4
nps: w=-1, b=-1
Ignoring move out of turn by first, gameMode 5, forwardMost 0
GameEnds(40, xboard exit, 2)
GE(40, xboard exit, 2) bare king k=16 color=22
1788907 >first : result * {xboard exit}
1788907 >second: result * {xboard exit}
1788956 >first : quit
1788956 >second: quit
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby H.G.Muller » 19 Oct 2009, 11:37

OK, got it. It was a combination of two bugs. The first, very stupid one was that in TwoMachinesEvent I probed the book for the initial position, and then, when it was a hit, let the first engine make it. This is fine if the first engine is white, but not so fine if the first engine plays black, as in the second game of the match. I had not recognized that TwoMachinesEvent is not only called from the menu when you start the match by clicking TwoMachines, but also from the routine NewMatchGame.

The second problem beame apparent when I fixed that: even when the correct engine makes the first book move, the move was ignored by WinBoard if I let the engine make it before it replies to the ping send after the new. So I really have to wait for the proper pong before simulating the engine making this move, which was not done.

The fix will go into the 4.4.1 release we will do shortly; I still have to put in some other fixes before I can post a working binary.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: xbord 4.4.0 (Mac) and -matchGames

Postby H.G.Muller » 20 Oct 2009, 16:47

There is a WinBoard beta version containing fixes for all known problems now at http://home.hccnet.nl/h.g.muller/winboard.zip .

For installing XBoard from source, the git repository at GNU will soon contain the sources of this version, and the 4.4.1.20091019 tar-ball will already contain most of it now.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 23 Oct 2009, 20:27

Hi HGM,

thanks for (all) your efforts. I've tried 4.4.1.20091022 and it plays the 2 game(s) but now I get some more errors ....

Code: Select all
xboard: Polyglot book not valid


I get this in the console and as X11 dialog box during the game. Game runs to the end without problem!?

Code: Select all
xboard: Can't open "../pgn/xboard.pgn": Too many open files
xboard: Match Stockfish 1.5.1 64bit vs. Shredder 12 x64: final score 0-1-1


Code: Select all
xboard: Can't open "../pgn/xboard.pgn": Too many open files


Last game (of 2) was not writen to the pgn file :(

Bye,
Holger
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 23 Oct 2009, 21:22

Second run gives the same results ...

Code: Select all
xboard: Polyglot book not valid
xboard: Can't open "../pgn/xboard.pgn": Too many open files
xboard: Match Stockfish 1.5.1 64bit vs. Shredder 12 x64: final score 1-0-1
xboard: Can't open "../pgn/xboard.pgn": Too many open files


Additional information:

1) "Polyglot book not valid" pops up during the beginning of the second game, even it seems that the book moves are played.
2) Only the first game is written to the PGN file, the second not.

Holger
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 23 Oct 2009, 22:06

I've run a third test with -debug, the file is on the way to you.

CORRECTION: This time the "Polyglot book not valid" error pops up during the second game _far_ after the book was left.

The "Too many open files" error is still the same.

Holger
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby H.G.Muller » 23 Oct 2009, 22:12

OK, there was an appalling bug: the book-probe code opened the book file, but never closed it. This quickly led to a situation where the maximum allowed number of files was opened, making it impossible to do new probes, or write PGN.

The version at http://home.hccnet.nl/h.g.muller/winboard.zip should fix this now.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 23 Oct 2009, 22:14

OK thanks. I'm too tired to test it now ... but will tomorrow.

Good night.
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 23 Oct 2009, 22:15

But I need the (x)board sources, not the win exe ;)
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby H.G.Muller » 24 Oct 2009, 09:14

Well, for as long as the patch is not yet committed to git:

just at the line

fclose(f);

two lines before the end (just before the return move_s;) in the file book.c.

Code: Select all
    if(appData.debugMode) fprintf(debugFP, "book move field = %d\n", entries[i].move);

    fclose(f);

    return move_s;
}


That should fix it.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 24 Oct 2009, 12:09

Works perfectly. Thanks.
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 24 Oct 2009, 13:27

Sorry, works perfectly only for two 2 game matches. At the third 2 game match the errors are popping up again.

Code: Select all
StartChildProcess (dir=".") polyglot ./polyglot_1st.ini
StartChildProcess (dir=".") polyglot ./polyglot_2nd.ini
xboard: Polyglot book not valid
xboard: Can't open "../pgn/xb-match.pgn": Too many open files
xboard: Match Stockfish 1.5.1 64bit vs. Shredder 12 x64: final score 1-0-1
xboard: Can't open "../pgn/xb-match.pgn": Too many open files


Perhaps another missing fclose?

Debug file is on the way!

Holger
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Re: xbord 4.4.0 (Mac) and -matchGames

Postby H.G.Muller » 24 Oct 2009, 14:24

Yes, you are right. There was another exit to the probe routine, in case of a book miss, some 30 lines earlier. Try this:

Code: Select all
    offset=find_key(f, key, &entry);
    if(entry.key != key) {
   fclose(f);
   return NULL;
    }


in stead of the

Code: Select all
    offset=find_key(f, key, &entry);
    if(entry.key != key) return NULL;


I couldn't find any other returns after the file was opened, so I guess this should cure it.

Windows must allow me an exceedingly large number of open files, because when I tested it, 3 games was no problem at all. :?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: xbord 4.4.0 (Mac) and -matchGames

Postby schlucke » 24 Oct 2009, 15:02

Don't know how the open file setting is in Windows and I concede that the default Mac OS X 10.6 settings are very restrictive:

Code: Select all
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 266
virtual memory          (kbytes, -v) unlimited


But anyway, it is a bug in xboard ... I'll try your suggestions.

Holger
schlucke
 
Posts: 20
Joined: 16 Apr 2009, 21:39

Next

Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 19 guests