Bug in Stockfish 1.6?

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

Moderator: Ras

Uri Blass
Posts: 10900
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Bug in Stockfish 1.6?

Post by Uri Blass »

I think that it is not a bug but a design decision.

Many programs behave in the same way and give draw evaluation for repetitions(the fact that you need to repeat the position 3 times is not relevant because not evaluating first repetition as a draw can cause other problems in games and the program may play ugly and not try to change things from better position and simply make silly repeats.

Many programmers choose the simple solution of evaluating first repetition as a draw because it fix or prevent ugly moves in playing chess.

I see no reason to mention stockfish when probably most programs behave in the same way.

Uri
Uri Blass
Posts: 10900
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Bug in Stockfish 1.6?

Post by Uri Blass »

Eelco de Groot wrote:
zullil wrote:
govert wrote:well, the position in itself (the FEN) does not have any information about three-fold repetition, right?

So, i suggest that the ones of you that cannot reproduce the bug step back a few positions and then feed each move at a time into stockfish.

Maybe that will reproduce it...
Correct, there is no repetition information in the fen. My point was that Stockfish does analyze the position correctly in isolation. When I read that Stockfish behaved correctly under Scid, I assumed this was an Arena issue. But now I see the incorrect Stockfish behavior when I run it under the Sigma Chess GUI. I assume the incorrect behavior would also appear under Scid, if one replayed the game from the beginning with Stockfish monitoring and analyzing. I don't have Scid installed on this machine, so I can't test.

In any case, there does appear to be a bug in Stockfish, since the incorrect behavior is appearing under two different GUIs.
It is debatable if it is a real bug or a missing feature, but I am just wondering if there are other engines not reporting 0.00? Shredder 11 does give a PV very close to 0.00 so that is one approach still counting the twofold repetition as a draw I think. Rybka clones I heard do not?

Glaurung and Naum 3.1, Rybka 2.3.2a all report simply 0.00 in the Shredder UCI interface, no PV and I would have expected Stockfish in SCID to do the same? Analyzing the position from the pgn, the GUI should feed the full game info to the engine and on the basis of that the engine should detect a twofold repetition, counting that as a draw. Threefold repetition is not yet built in.

Eelco
The GUI does not need to give the full game.
The opposite
It is better that the GUI does not give the full game except naybe cases that one position repeated twice in the game before the relevant position(so repeating it third time is a draw)

The reason is that the game give no important information for the engine in case that there was no repetition and can only confuse the engine to believe that some repeat of games position is a draw.

Edit:
In this specific game the position after Nxf7+ repeated twice but no earlier position repeated twice so again there is no reason to give the game

Edit 2:The relevant moves after the last capture are
30...Kg8 31. Nh6+ Kh8 32.
Nf7+ Kg8 33. Nh6+ Kh8

If you analyze move 32 of black there is no reason to give the game because it is impossible to have a situation when white need to repeat the root position to win so the game can only confuse the engine.

I see the point of giving the game only after move 32 of black.
royb
Posts: 566
Joined: Thu Mar 09, 2006 12:53 am

Re: Bug in Stockfish 1.6?

Post by royb »

zullil wrote:
govert wrote:well, the position in itself (the FEN) does not have any information about three-fold repetition, right?

So, i suggest that the ones of you that cannot reproduce the bug step back a few positions and then feed each move at a time into stockfish.

Maybe that will reproduce it...
Correct, there is no repetition information in the fen. My point was that Stockfish does analyze the position correctly in isolation. When I read that Stockfish behaved correctly under Scid, I assumed this was an Arena issue. But now I see the incorrect Stockfish behavior when I run it under the Sigma Chess GUI. I assume the incorrect behavior would also appear under Scid, if one replayed the game from the beginning with Stockfish monitoring and analyzing. I don't have Scid installed on this machine, so I can't test.

In any case, there does appear to be a bug in Stockfish, since the incorrect behavior is appearing under two different GUIs.
I'm not sure what the real issue is, but I did load the PGN into SCID and (this time) then stepped forward a move at a time while running Stockfish-1.6.3 (64-bit) in analysis mode. When I got to the position after White's 32nd move, the problem did not appear:

1 +1.49 32.... Kg8 (0.00)
2 +1.41 32.... Kg8 33.Nh6+ Kh8 34.Be5 Qg6 35.Qxg6 hxg6 36.Bg4 Rc7 37.Be6 Rxc4 38.Nf7+ Kg8 39.Kh2 Rxe6 40.dxe6 Rc6 41.Nd8 Rc2 42.Kg3 Nc5 43.Bb8 Be7 44.Nc6 Kf8 45.Ne5 Rc3+ 46.Kg4 Rxa3 47.Nxg6+ Ke8 (0.00)
3 +1.93 32.... Kg8 33.Nh6+ Kh8 34.Be5 Qg6 35.Qxg6 hxg6 36.Bg4 Rc7 37.Be6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d6 39.f4 Qf7 40.Nc6 Ra8 41.Be6 Nxe6 42.Bxd6 Nc5 43.Ne5 Qf5 44.Bxc5 bxc5 45.g4 Qf6 (38.02)

Not sure if that helps shed any light on the real issue or not.

Roy
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Bug in Stockfish 1.6?

Post by zamar »

As others have pointed out, this is most likely only a repetition issue. Stockfish judges 2-fold repetitions as draws.

When running stockfish directly from command line and feeding it directly with fen, I cannot observe any problems.

setoption name Threads value 1
position fen 2r1rb1k/p1B2Npp/1p6/3P4/2P5/Pn4QP/2q1BPP1/4R1K1 b - - 4 32
go infinite
info depth 1
info depth 1 score cp -149 time 14 nodes 1 nps 71 pv h8g8
info depth 2
info depth 2 score cp -165 time 14 nodes 95 nps 6785 pv h8g8 f7d6 e8e2 e1e2 c2e2 d6c8 e2c4
info depth 3
info depth 3 score cp -193 time 14 nodes 544 nps 38857 pv h8g8 f7h6 g8h8 c7e5
info depth 4
info depth 4 score cp -197 time 15 nodes 919 nps 61266 pv h8g8 f7h6 g8h8 c7e5 c2g6
info depth 5
info depth 5 score cp -181 time 15 nodes 1536 nps 102400 pv h8g8 f7h6 g8h8 c7e5 c2g6 g3g6 h7g6
info depth 6
info depth 6 score cp -202 time 16 nodes 2663 nps 166437 pv h8g8 f7h6 g8h8 c7e5 c2g6 g3g6 h7g6 h6f7 h8g8
info depth 7
info depth 7 score cp -202 time 30 nodes 20099 nps 669966 pv h8g8 f7h6 g8h8 c7e5 c2g6 h6g4 e8e5 g4e5 g6g3 f2g3 f8c5 g1h2 c5a3
info depth 8
info depth 8 score cp -181 lowerbound time 41 nodes 36087 nps 880170 pv h8g8 f7h6 g8h8 c7e5 c2g6 h6g4 b3c5 g3f4 h8g8 d5d6 c5d7
info depth 9
info depth 9 score cp -157 time 67 nodes 68918 nps 1028626 pv h8g8 f7h6 g8h8 c7e5 c2g6 h6g4 b3c5 g4e3 c5d7 g3g6 h7g6 e5b2 f8d6 e2g4
info depth 10
info depth 10 score cp -206 upperbound time 147 nodes 168978 nps 1149510 pv h8g8 f7h6 g8h8 c7e5 c2g6 g3g6 h7g6 e2g4 c8c4 d5d6 h8h7 h6f7
info depth 11
info depth 11 score cp -218 time 258 nodes 309706 nps 1200410 pv h8g8 f7h6 g8h8 c7e5 c2d2 f2f4 b3d4 e2h5 e8e5 h6f7 h8g8 f4e5 f8c5 g1h1 d4f5
info depth 12
info nodes 1260000 nps 1241379 time 1015 hashfull 1
info depth 12 score cp -197 time 1305 nodes 1626120 nps 1246068 pv h8g8 f7h6 g8h8 c7e5 c2d2 f2f4 b3d4 e2g4 e8e5 h6f7 h8g8 f7e5 f8c5 g1h2 c8f8 e1e4 d2c1 h3h4 d4f5 g4f5 f8f5 h2h3 c1h1 g3h2
info depth 13
info currmove h8g8 currmovenumber 1
info nodes 2550000 nps 1256157 time 2030 hashfull 37
info depth 13 score cp -177 time 2461 nodes 3110464 nps 1263902 pv h8g8 f7h6 g8h8 c7e5 c2d2 f2f4 e8e5 h6f7 h8g8 f7e5 f8c5 g1h1 c8f8 e5d7 b3c1 d7c5 c1e2 g3f2 b6c5 f2e2 d2e2 e1e2 f8f4 e2e7 a7a6 d5d6 f4c4
info depth 14
info currmove h8g8 currmovenumber 1
info nodes 3870000 nps 1275123 time 3035 hashfull 149
info nodes 5190000 nps 1280848 time 4052 hashfull 328
info nodes 6540000 nps 1290959 time 5066 hashfull 491
stopinfo nodes 7890000 nps 1300263 time 6068 hashfull 634
Joona Kiiski