Critter ponder bug in TB endgames

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Trahald
Posts: 70
Joined: Tue Dec 23, 2008 12:26 pm
Location: Australia

Critter ponder bug in TB endgames

Post by Trahald »

There seems to be a bug with the way Critter handles a ponder command in endgames where the engine is using tablebases.

It seems that the engine replies to a ponder with a bestmove before receiving a stop or ponderhit command from the GUI. The following was taken from an engine match in the Shredder Classic 4 GUI.

Code: Select all

Fri Jun 18 00:00:30 2010:   to Critter 0.70 64-bit [2 Core] (0): ucinewgame
Fri Jun 18 00:00:30 2010:   to Critter 0.70 64-bit [2 Core] (0): isready
Fri Jun 18 00:00:31 2010: from Critter 0.70 64-bit [2 Core] (0): readyok
Fri Jun 18 00:00:31 2010:   to Critter 0.70 64-bit [2 Core] (0): position fen 8/8/8/8/1p2P3/4P3/1k6/3K4 w - -
Fri Jun 18 00:00:31 2010:   to Critter 0.70 64-bit [2 Core] (0): go wtime 182000 btime 182000 winc 2000 binc 2000
Fri Jun 18 00:00:31 2010: from Critter 0.70 64-bit [2 Core] (0): info multipv 1 depth 2 seldepth 1 nodes 0 nps 0 hashfull 0 score mate 127 pv e4e5 b2a3 d1c1 a3a2 c1d2 b4b3 e5e6 b3b2 e6e7 b2b1q e7e8q b1b2 d2d3 b2b1 d3d4 b1b2 d4e4 b2e2 e4f4 e2f2 f4g5 f2g1 g5f6 g1f2 f6g7 f2b2 g7h7 b2b7 h7h6 b7b6 h6g5 a2b3 g5f5 b6c5 f5f6 b3c2 e8e4 c2c1 f6f7 c5h5 f7e7 h5c5 e7d7 c5a7 d7e8 a7b8 e8f7 b8c7 e4e7 c7c4 e7e6 c4c7 f7f6 c7c3 e6e5 c3c6 f6e7 c6b7 e7d8 b7a8 d8d7 a8a4 d7e7 a4b4 e7e6 b4c4 e5d5 c4c8 e6e7 c8c7 e7f6 c7c3 d5d4 c3c8 f6f7 c8b7 f7g6 b7c6 g6f5 c6b5 f5f4 b5f1 f4e4 f1g2 e4e5 g2g5 e5e6 g5g8 e6d7 g8f7 d7c6 f7e8 c6c7 e8f7 c7b6 f7b3 b6c6 b3e6 c6c5 e6c8 c5b4 c8b7 b4c3 b7c6 d4c4 c6f3 c3d4 c1d2 c4d3 d2e1 e3e4 f3f6 d4c5 f6e7 c5b6 e7e6 b6a5 e6a2 a5b5 a2b2 
Fri Jun 18 00:00:31 2010: from Critter 0.70 64-bit [2 Core] (0): bestmove e4e5 ponder b2a3
Fri Jun 18 00:00:31 2010:   to Critter 0.70 64-bit [2 Core] (0): position fen 8/8/8/8/1p2P3/4P3/1k6/3K4 w - - moves e4e5 b2a3
Fri Jun 18 00:00:31 2010:   to Critter 0.70 64-bit [2 Core] (0): go ponder wtime 183828 btime 182000 winc 2000 binc 2000
Fri Jun 18 00:00:31 2010: from Critter 0.70 64-bit [2 Core] (0): info multipv 1 depth 2 seldepth 1 nodes 0 nps 0 hashfull 0 score mate 126 pv e5e6 b4b3 d1c1 a3a2 c1d2 b3b2 e6e7 b2b1q e7e8q b1b2 d2d3 b2b1 d3d4 b1b2 d4e4 b2e2 e4f4 e2f2 f4g5 f2g1 g5f6 g1f2 f6g7 f2b2 g7h7 b2b7 h7h6 b7b6 h6g5 a2b3 g5f5 b6c5 f5f6 b3c2 e8e4 c2c1 f6f7 c5h5 f7e7 h5c5 e7d7 c5a7 d7e8 a7b8 e8f7 b8c7 e4e7 c7c4 e7e6 c4c7 f7f6 c7c3 e6e5 c3c6 f6e7 c6b7 e7d8 b7a8 d8d7 a8a4 d7e7 a4b4 e7e6 b4c4 e5d5 c4c8 e6e7 c8c7 e7f6 c7c3 d5d4 c3c8 f6f7 c8b7 f7g6 b7c6 g6f5 c6b5 f5f4 b5f1 f4e4 f1g2 e4e5 g2g5 e5e6 g5g8 e6d7 g8f7 d7c6 f7e8 c6c7 e8f7 c7b6 f7b3 b6c6 b3e6 c6c5 e6c8 c5b4 c8b7 b4c3 b7c6 d4c4 c6f3 c3d4 c1d2 c4d3 d2e1 e3e4 f3f6 d4c5 f6e7 c5b6 e7e6 b6a5 e6a2 a5b5 a2b2 b5c6 b2e5 
Fri Jun 18 00:00:31 2010: from Critter 0.70 64-bit [2 Core] (0): bestmove e5e6 ponder b4b3
This causes Shredder to stop responding, not sure if it is a known issue.
See how Rybka 3 handles the same position with the Nalimov TB's.

Code: Select all

Fri Jun 18 00:03:49 2010:   to Rybka 3 960 [2 Core] (0): ucinewgame
Fri Jun 18 00:03:49 2010:   to Rybka 3 960 [2 Core] (0): isready
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): readyok
Fri Jun 18 00:03:49 2010:   to Rybka 3 960 [2 Core] (0): setoption name UCI_Chess960 value false
Fri Jun 18 00:03:49 2010:   to Rybka 3 960 [2 Core] (0): position fen 8/8/8/8/1p2P3/4P3/1k6/3K4 w - -
Fri Jun 18 00:03:49 2010:   to Rybka 3 960 [2 Core] (0): go wtime 182000 btime 182000 winc 2000 binc 2000
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 1
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 2
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 2 time 17 nodes 7 nps 421 tbhits 22 

Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 3
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 3 score mate 126 time 17 nodes 9 nps 542 tbhits 23 pv e4e5
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 3 time 17 nodes 10 nps 602 tbhits 26 

Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 3 time 17 nodes 10 nps 602 tbhits 26 

Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): bestmove e4e5 ponder b2a2
Fri Jun 18 00:03:49 2010:   to Rybka 3 960 [2 Core] (0): position fen 8/8/8/8/1p2P3/4P3/1k6/3K4 w - - moves e4e5 b2a2
Fri Jun 18 00:03:49 2010:   to Rybka 3 960 [2 Core] (0): go ponder wtime 183579 btime 182000 winc 2000 binc 2000
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 1
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 2
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 2 time 48 nodes 12 nps 256 tbhits 38 

Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 3
Fri Jun 18 00:03:49 2010: from Rybka 3 960 [2 Core] (0): info depth 3 time 48 nodes 16 nps 341 tbhits 45 

Fri Jun 18 00:08:13 2010:   to Rybka 3 960 [2 Core] (0): stop
Fri Jun 18 00:08:13 2010: from Rybka 3 960 [2 Core] (0): info depth 3 time 264173 nodes 16 nps 0 tbhits 45 

Fri Jun 18 00:08:13 2010: from Rybka 3 960 [2 Core] (0): bestmove e5e6 ponder b4b3
Regards
Russell Murray
Russell Murray
User avatar
rvida
Posts: 481
Joined: Thu Apr 16, 2009 12:00 pm
Location: Slovakia, EU

Re: Critter ponder bug in TB endgames

Post by rvida »

Hi,

It looks like there is indeed a bug. Thank You for reporting. I will fix it in the next release.

Richard
Trahald
Posts: 70
Joined: Tue Dec 23, 2008 12:26 pm
Location: Australia

Re: Critter ponder bug in TB endgames

Post by Trahald »

I hope others will test this position to confirm or refute my findings because I've just encountered a similar problem with the Gaviota engine, same starting position (8/8/8/8/1p2P3/4P3/1k6/3K4 w - - 0 1), same GUI (Shredder Classic 4), Gaviota is running in UCI mode, everything goes fine for approx 55 moves, then Shredder hangs.

Checking the UCI log I see Gaviota has sent a bestmove command while it was pondering, before Shredder had sent it a ponderhit in this case. In the interests of space I've removed the info strings from the log. Still have the original though if required.

Code: Select all

Fri Jun 18 04:16:56 2010:   to Gaviota v0.75.7 [2 Core] (0): position fen 8/8/8/8/1p2P3/4P3/1k6/3K4 w - - moves e4e5 b4b3 e5e6 b2a3 e6e7 b3b2 d1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6 c7c3 d5d4 c3c8 f6f7 c8b7 f7g6 b7c6 g6f5 c6b5 f5f4 b5f1 f4e4 f1g2 e4e5 g2g5 e5e6 g5g8 e6d7 g8f7 d7d6 f7f8 d6c7 f8f7 c7b6 f7b3 b6c6 b3e6 c6c5 e6c8 c5b4 c8b7 b4c3 b7c6 d4c4 c6f3 c3d4 c1d2 e3e4 f3f2 d4d5
Fri Jun 18 04:16:56 2010:   to Rybka 3 960 [2 Core] (1): go wtime 226838 btime 288882 winc 2000 binc 2000
Fri Jun 18 04:16:57 2010: from Rybka 3 960 [2 Core] (1): bestmove f2f7 ponder d5c5
Fri Jun 18 04:16:58 2010: from Gaviota v0.75.7 [2 Core] (0): bestmove d5d4 ponder f7f2
Russell Murray
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Critter ponder bug in TB endgames

Post by michiguel »

Trahald wrote:I hope others will test this position to confirm or refute my findings because I've just encountered a similar problem with the Gaviota engine, same starting position (8/8/8/8/1p2P3/4P3/1k6/3K4 w - - 0 1), same GUI (Shredder Classic 4), Gaviota is running in UCI mode, everything goes fine for approx 55 moves, then Shredder hangs.

Checking the UCI log I see Gaviota has sent a bestmove command while it was pondering, before Shredder had sent it a ponderhit in this case. In the interests of space I've removed the info strings from the log. Still have the original though if required.

Code: Select all

Fri Jun 18 04:16:56 2010:   to Gaviota v0.75.7 [2 Core] (0): position fen 8/8/8/8/1p2P3/4P3/1k6/3K4 w - - moves e4e5 b4b3 e5e6 b2a3 e6e7 b3b2 d1c2 a3a2 e7e8q b2b1q c2c3 b1a1 c3d3 a1b1 d3d4 b1b2 d4e4 b2e2 e4f4 e2f2 f4g5 f2g3 g5f6 g3f2 f6g7 f2b2 g7h7 b2b7 h7h6 b7b6 h6g5 a2b3 g5f5 b6c5 f5f6 b3c2 e8e4 c2c1 f6f7 c5h5 f7e7 h5c5 e7d7 c5a7 d7e8 a7b8 e8f7 b8c7 e4e7 c7c4 e7e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to Rybka 3 960 [2 Core] (1): go wtime 226838 btime 288882 winc 2000 binc 2000
Fri Jun 18 04:16:57 2010: from Rybka 3 960 [2 Core] (1): bestmove f2f7 ponder d5c5
Fri Jun 18 04:16:58 2010: from Gaviota v0.75.7 [2 Core] (0): bestmove d5d4 ponder f7f2
It may be that Gaviota when it ponders, it reaches a conclusion before receiving ponderhit. It is clear that Gaviota will easily and quickly find the best move (it will be a tbhit), but it should wait anyway to send bestmove.
I will check the code to make sure this is the problem and I will fix it. It has nothing to do with TBs, it is a defficient implementation of the UCI's protocol by Gaviota.

Thanks,

Miguel
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Critter ponder bug in TB endgames

Post by michiguel »

michiguel wrote:
Trahald wrote:I hope others will test this position to confirm or refute my findings because I've just encountered a similar problem with the Gaviota engine, same starting position (8/8/8/8/1p2P3/4P3/1k6/3K4 w - - 0 1), same GUI (Shredder Classic 4), Gaviota is running in UCI mode, everything goes fine for approx 55 moves, then Shredder hangs.

Checking the UCI log I see Gaviota has sent a bestmove command while it was pondering, before Shredder had sent it a ponderhit in this case. In the interests of space I've removed the info strings from the log. Still have the original though if required.

Code: Select all

Fri Jun 18 04:16:56 2010:   to Gaviota v0.75.7 [2 Core] (0): position fen 8/8/8/8/1p2P3/4P3/1k6/3K4 w - - moves e4e5 b4b3 e5e6 b2a3 e6e7 b3b2 d1c2 a3a2 e7e8q b2b1q c2c3 b1a1 c3d3 a1b1 d3d4 b1b2 d4e4 b2e2 e4f4 e2f2 f4g5 f2g3 g5f6 g3f2 f6g7 f2b2 g7h7 b2b7 h7h6 b7b6 h6g5 a2b3 g5f5 b6c5 f5f6 b3c2 e8e4 c2c1 f6f7 c5h5 f7e7 h5c5 e7d7 c5a7 d7e8 a7b8 e8f7 b8c7 e4e7 c7c4 e7e6 c4c7 f7f6 c7c3 e6e5 c3c6 f6e7 c6b7 e7d8 b7a8 d8d7 a8a4 d7e7 a4b4 e7e6 b4c4 e5d5 c4c8 e6e7 c8c7 e7f6 c7c3 d5d4 c3c8 f6f7 c8b7 f7g6 b7c6 g6f5 c6b5 f5f4 b5f1 f4e4 f1g2 e4e5 g2g5 e5e6 g5g8 e6d7 g8f7 d7d6 f7f8 d6c7 f8f7 c7b6 f7b3 b6c6 b3e6 c6c5 e6c8 c5b4 c8b7 b4c3 b7c6 d4c4 c6f3 c3d4 c1d2 e3e4 f3f2 d4d5 f2f7
Fri Jun 18 04:16:56 2010:   to Gaviota v0.75.7 [2 Core] (0): go ponder wtime 226838 btime 288882 winc 2000 binc 2000
Fri Jun 18 04:16:56 2010:   to Rybka 3 960 [2 Core] (1): position fen 8/8/8/8/1p2P3/4P3/1k6/3K4 w - - moves e4e5 b4b3 e5e6 b2a3 e6e7 b3b2 d1c2 a3a2 e7e8q b2b1q c2c3 b1a1 c3d3 a1b1 d3d4 b1b2 d4e4 b2e2 e4f4 e2f2 f4g5 f2g3 g5f6 g3f2 f6g7 f2b2 g7h7 b2b7 h7h6 b7b6 h6g5 a2b3 g5f5 b6c5 f5f6 b3c2 e8e4 c2c1 f6f7 c5h5 f7e7 h5c5 e7d7 c5a7 d7e8 a7b8 e8f7 b8c7 e4e7 c7c4 e7e6 c4c7 f7f6 c7c3 e6e5 c3c6 f6e7 c6b7 e7d8 b7a8 d8d7 a8a4 d7e7 a4b4 e7e6 b4c4 e5d5 c4c8 e6e7 c8c7 e7f6 c7c3 d5d4 c3c8 f6f7 c8b7 f7g6 b7c6 g6f5 c6b5 f5f4 b5f1 f4e4 f1g2 e4e5 g2g5 e5e6 g5g8 e6d7 g8f7 d7d6 f7f8 d6c7 f8f7 c7b6 f7b3 b6c6 b3e6 c6c5 e6c8 c5b4 c8b7 b4c3 b7c6 d4c4 c6f3 c3d4 c1d2 e3e4 f3f2 d4d5
Fri Jun 18 04:16:56 2010:   to Rybka 3 960 [2 Core] (1): go wtime 226838 btime 288882 winc 2000 binc 2000
Fri Jun 18 04:16:57 2010: from Rybka 3 960 [2 Core] (1): bestmove f2f7 ponder d5c5
Fri Jun 18 04:16:58 2010: from Gaviota v0.75.7 [2 Core] (0): bestmove d5d4 ponder f7f2
It may be that Gaviota when it ponders, it reaches a conclusion before receiving ponderhit. It is clear that Gaviota will easily and quickly find the best move (it will be a tbhit), but it should wait anyway to send bestmove.
I will check the code to make sure this is the problem and I will fix it. It has nothing to do with TBs, it is a defficient implementation of the UCI's protocol by Gaviota.

Thanks,

Miguel
I was right with my hypothesis and (I think) I fixed the problem. I should probably release a bugfix. I also detected another deficiency (killers are erased from move to move since UCI resets positions from move to move). Maybe I should fix it too for that bugfix release.

Miguel
PS: BTW Russell, great bug report, you did more than 50% of the debugging process with it.
PS2: I do not know if users know how much programmers LOVE bug reports with a detailed observation of what happened. We hate to hear about them but... I personally love to fix them! It is like removing a stone from your shoe.