Stockfish bug

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

stevenaaus
Posts: 608
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Stockfish bug

Post by stevenaaus »

This seems a bug on my linux 64 bit system. Current git and Stockfish 3 erroneously gives a score of 0 at the end pos of this game (A curtailed game from Naka vs Topalov).
If you merely set fen to the position, there is no problem.

[Event "Makedonia Palace GP"]
[Site "Thessaloniki GRE"]
[Date "2013.05.29"]
[Round "7"]
[White "Nakamura, Hi"]
[Black "Topalov, V."]
[Result "1-0"]
[WhiteElo "2775"]
[BlackElo "2793"]
[ECO "B92"]
[EventDate "2013.05.22"]
[PlyCount "147"]

1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.Be2 e5 7.Nb3 Be7 8.O-O
O-O 9.Be3 Be6 10.Qd3 Nbd7 11.Nd5 Bxd5 12.exd5 Nc5 13.Nxc5 dxc5 14.Bf3 Qc7
15.c4 g6 16.Rae1 h5 17.Bg5 Ne8 18.Bxe7 Qxe7 19.Qe3 Nd6 20.b3 Rfc8 21.Qxe5
Qxe5 22.Rxe5 Re8 23.Rxe8+ Rxe8 24.Rc1 a5 25.Kf1 Kg7 26.h4 b6 27.g3 Kf6 28.
Be2 Re7 29.Rc3 Re8 30.Ke1 Ra8 31.Bd1 Re8+ 32.Kf1 Ke5 33.Bc2 Kf6 34.f3 Re7
35.Kf2 Re8 36.Re3 Rxe3 37.Kxe3 Kg7 38.Kf4 f6 39.g4 a4 40.Bd3 axb3 41.axb3
Kh6 42.g5+ Kg7 43.gxf6+ Kxf6 44.Ke3 g5 45.hxg5+ Kxg5 46.f4+ Kh6 47.Kf3 Kg7
48.Kg3 Kh6 49.Kh4 Ne8 50.f5 Nd6 51.f6 Nf7 52.Be2 Nd6 53.Bxh5 b5 54.cxb5
Nxb5 55.Be2 Nd4 56.Bh5 1-0

Code: Select all

Scid vs. PC <--> Engine communication log file
Engine&#58; Stockfish git
Command&#58; stockfish
Arguments&#58;  
Directory&#58; /usr/bin
Date&#58; Thu May 30 18&#58;44&#58;27 EST 2013

Note&#58; First line from engine seen; sending it initial commands now.
Scid  &#58; uci
Engine&#58; Stockfish 300513 64 by Tord Romstad, Marco Costalba and Joona Kiiski
Engine&#58; id name Stockfish 300513 64
Engine&#58; id author Tord Romstad, Marco Costalba and Joona Kiiski
Engine&#58; option name Use Debug Log type check default false
Engine&#58; option name Use Search Log type check default false
Engine&#58; option name Search Log Filename type string default SearchLog.txt
Engine&#58; option name Book File type string default book.bin
Engine&#58; option name Best Book Move type check default false
Engine&#58; option name Contempt Factor type spin default 0 min -50 max 50
Engine&#58; option name Mobility &#40;Midgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Mobility &#40;Endgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Pawn Structure &#40;Midgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Pawn Structure &#40;Endgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Passed Pawns &#40;Midgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Passed Pawns &#40;Endgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Space type spin default 100 min 0 max 200
Engine&#58; option name Aggressiveness type spin default 100 min 0 max 200
Engine&#58; option name Cowardice type spin default 100 min 0 max 200
Engine&#58; option name Min Split Depth type spin default 4 min 4 max 12
Engine&#58; option name Max Threads per Split Point type spin default 5 min 4 max 8
Engine&#58; option name Threads type spin default 4 min 1 max 64
Engine&#58; option name Use Sleeping Threads type check default true
Engine&#58; option name Hash type spin default 32 min 1 max 8192
Engine&#58; option name Clear Hash type button
Engine&#58; option name Ponder type check default true
Engine&#58; option name OwnBook type check default false
Engine&#58; option name MultiPV type spin default 1 min 1 max 500
Engine&#58; option name Skill Level type spin default 20 min 0 max 20
Engine&#58; option name Emergency Move Horizon type spin default 40 min 0 max 50
Engine&#58; option name Emergency Base Time type spin default 200 min 0 max 30000
Engine&#58; option name Emergency Move Time type spin default 70 min 0 max 5000
Engine&#58; option name Minimum Thinking Time type spin default 20 min 0 max 5000
Engine&#58; option name Slow Mover type spin default 100 min 10 max 1000
Engine&#58; option name UCI_Chess960 type check default false
Engine&#58; option name UCI_AnalyseMode type check default false
Engine&#58; uciok
Scid  &#58; stop
Scid  &#58; isready
Engine&#58; readyok
Scid  &#58; position startpos moves e2e4 c7c5 g1f3 d7d6 d2d4 c5d4 f3d4 g8f6 b1c3 a7a6 f1e2 e7e5 d4b3 f8e7 e1g1 e8g8 c1e3 c8e6 d1d3 b8d7 c3d5 e6d5 e4d5 d7c5 b3c5 d6c5 e2f3 d8c7 c2c4 g7g6 a1e1 h7h5 e3g5 f6e8 g5e7 c7e7 d3e3 e8d6 b2b3 f8c8 e3e5 e7e5 e1e5 c8e8 e5e8 a8e8 f1c1 a6a5 g1f1 g8g7 h2h4 b7b6 g2g3 g7f6 f3e2 e8e7 c1c3 e7e8 f1e1 e8a8 e2d1 a8e8 e1f1 f6e5 d1c2 e5f6 f2f3 e8e7 f1f2 e7e8 c3e3 e8e3 f2e3 f6g7 e3f4 f7f6 g3g4 a5a4 c2d3 a4b3 a2b3 g7h6 g4g5 h6g7 g5f6 g7f6 f4e3 g6g5 h4g5 f6g5 f3f4 g5h6 e3f3 h6g7 f3g3 g7h6 g3h4 d6e8 f4f5 e8d6 f5f6 d6f7 d3e2 f7d6 e2h5 b6b5 c4b5 d6b5 h5e2 b5d4 e2h5
Scid  &#58; go infinite
Engine&#58; info depth 1 seldepth 1 score cp 0 nodes 27 nps 27000 time 1 multipv 1 pv d4b5
Engine&#58; info depth 2 seldepth 2 score cp 0 nodes 43 nps 43000 time 1 multipv 1 pv d4b5
Engine&#58; info depth 3 seldepth 2 score cp 0 nodes 63 nps 63000 time 1 multipv 1 pv d4b5
Engine&#58; info depth 4 seldepth 2 score cp 0 nodes 80 nps 80000 time 1 multipv 1 pv d4b5
Engine&#58; info depth 5 seldepth 2 score cp 0 nodes 102 nps 102000 time 1 multipv 1 pv d4b5
Engine&#58; info depth 6 seldepth 2 score cp 0 nodes 127 nps 127000 time 1 multipv 1 pv d4b5
Engine&#58; info depth 7 seldepth 2 score cp 0 nodes 156 nps 156000 time 1 multipv 1 pv d4b5
Engine&#58; info depth 8 seldepth 2 score cp 0 nodes 326 nps 163000 time 2 multipv 1 pv d4b5
Engine&#58; info depth 9 seldepth 2 score cp 0 nodes 395 nps 197500 time 2 multipv 1 pv d4b5
Engine&#58; info depth 10 seldepth 2 score cp 0 nodes 489 nps 244500 time 2 multipv 1 pv d4b5
Engine&#58; info depth 11 seldepth 2 score cp 0 nodes 638 nps 319000 time 2 multipv 1 pv d4b5
Engine&#58; info depth 12 seldepth 2 score cp 0 nodes 849 nps 283000 time 3 multipv 1 pv d4b5
Engine&#58; info depth 13 seldepth 2 score cp 0 nodes 1187 nps 395666 time 3 multipv 1 pv d4b5
Engine&#58; info depth 14 seldepth 2 score cp 0 nodes 1586 nps 528666 time 3 multipv 1 pv d4b5
Engine&#58; info depth 15 seldepth 2 score cp 0 nodes 2030 nps 507500 time 4 multipv 1 pv d4b5
Engine&#58; info depth 16 seldepth 2 score cp 0 nodes 3492 nps 698400 time 5 multipv 1 pv d4b5
Engine&#58; info depth 17 seldepth 2 score cp 0 nodes 4413 nps 882600 time 5 multipv 1 pv d4b5
Engine&#58; info depth 18 seldepth 2 score cp 0 nodes 7193 nps 1198833 time 6 multipv 1 pv d4b5
Engine&#58; info depth 19 seldepth 2 score cp 0 nodes 8536 nps 1219428 time 7 multipv 1 pv d4b5
Engine&#58; info depth 20 seldepth 2 score cp 0 nodes 10406 nps 1300750 time 8 multipv 1 pv d4b5
Engine&#58; info depth 21 seldepth 2 score cp 0 nodes 14495 nps 1449500 time 10 multipv 1 pv d4b5
Engine&#58; info depth 22 seldepth 2 score cp 0 nodes 22646 nps 1742000 time 13 multipv 1 pv d4b5
Engine&#58; info depth 23 seldepth 2 score cp 0 nodes 36929 nps 2051611 time 18 multipv 1 pv d4b5
Engine&#58; info depth 24 seldepth 2 score cp 0 nodes 59729 nps 2297269 time 26 multipv 1 pv d4b5
Engine&#58; info depth 25 seldepth 2 score cp 0 nodes 86252 nps 2613696 time 33 multipv 1 pv d4b5
Engine&#58; info depth 26 seldepth 2 score cp 0 nodes 115372 nps 2563822 time 45 multipv 1 pv d4b5
Engine&#58; info depth 27 seldepth 2 score cp 0 nodes 157568 nps 2670644 time 59 multipv 1 pv d4b5
Engine&#58; info depth 28 seldepth 2 score cp 0 nodes 201914 nps 2804361 time 72 multipv 1 pv d4b5
Engine&#58; info depth 29 seldepth 2 score cp 0 nodes 218098 nps 2832441 time 77 multipv 1 pv d4b5
Engine&#58; info depth 30 seldepth 2 score cp 0 nodes 283605 nps 2836050 time 100 multipv 1 pv d4b5
Engine&#58; info depth 31 seldepth 2 score cp 0 nodes 381763 nps 3006007 time 127 multipv 1 pv d4b5
Engine&#58; info depth 32 seldepth 2 score cp 0 nodes 474321 nps 3021152 time 157 multipv 1 pv d4b5
Engine&#58; info depth 33 seldepth 2 score cp 0 nodes 633108 nps 3149791 time 201 multipv 1 pv d4b5
Engine&#58; info depth 34 seldepth 2 score cp 0 nodes 777914 nps 3241308 time 240 multipv 1 pv d4b5
Engine&#58; info depth 35 seldepth 2 score cp 0 nodes 990178 nps 3402673 time 291 multipv 1 pv d4b5
Engine&#58; info depth 36 seldepth 2 score cp 0 nodes 1185136 nps 3475472 time 341 multipv 1 pv d4b5
Engine&#58; info depth 37 seldepth 2 score cp 0 nodes 1819773 nps 3729043 time 488 multipv 1 pv d4b5
Engine&#58; info depth 38 seldepth 2 score cp 0 nodes 2561741 nps 4165432 time 615 multipv 1 pv d4b5
Engine&#58; info depth 39 seldepth 2 score cp 0 nodes 3223510 nps 4326859 time 745 multipv 1 pv d4b5
Engine&#58; info depth 40 seldepth 2 score cp 0 nodes 4483985 nps 4632215 time 968 multipv 1 pv d4b5
Engine&#58; info depth 41 seldepth 2 score cp 0 nodes 5073278 nps 4587050 time 1106 multipv 1 pv d4b5
Engine&#58; info depth 42 seldepth 2 score cp 0 nodes 10100607 nps 5142875 time 1964 multipv 1 pv d4b5
Engine&#58; info depth 43 seldepth 2 score cp 0 nodes 10595634 nps 5111256 time 2073 multipv 1 pv d4b5
Scid  &#58; stop
Scid  &#58; quit
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Stockfish bug

Post by Henk »

Does stockfish use special hardware or assembly language ?
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Stockfish bug

Post by Evert »

I haven't looked at the game itself, but from the move list it seems that it's possible to follow up on Bh5 with a repetition, which would be scored as a draw. I think this is a well-known (and documented) short-coming of the way repetition draws are handled.
Uri Blass
Posts: 10281
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Stockfish bug

Post by Uri Blass »

No bug

repetition is evaluated as a draw and Nb5 forced repetition.

It is not a draw by the chess rules and you need the position to occur 3 times for it
but stockfish like most programs is designed to play and not to analyze and for playing it is better to evaluate repetition as a draw otherwise the program may analyze useless lines that it make no progress(and cases when the best moves is to repeat and win later almost do not happen because it means that the program did a mistake earlier in the game).
stevenaaus
Posts: 608
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Re: Stockfish bug

Post by stevenaaus »

No, it's definitely a bug. There is no draw by repetition.
This is stopping me from using Stockfish as my preferred engine, as I'm hitting this bug everyday.

Here's another example. Blacks 35th move

[Event "5. Capo d'Orso Open 2013"]
[Site "Porto Mannu ITA"]
[Date "2013.06.03"]
[Round "3.2"]
[White "Rombaldoni, Axel"]
[Black "Caoili, Arianne"]
[Result "1-0"]
[WhiteElo "2484"]
[BlackElo "2219"]
[ECO "A86"]
[EventDate "2013.06.01"]
[WhiteTitle "IM"]
[BlackTitle "WIM"]
[Opening "Dutch"]
[Variation "Leningrad variation"]
[WhiteFideId "815837"]
[BlackFideId "5201179"]

[pgn]1.c4 f5 2.d4 Nf6 3.g3 g6 4.Bg2 Bg7 5.Nh3 d6 6.d5 e5 7.dxe6 Na6 8.Nc3 Nc5
9.Ng5 O-O 10.Nd5 Nxe6 11.Nxe6 Bxe6 12.Nxf6+ Qxf6 13.Bxb7 Rab8 14.Bd5 Qf7
15.O-O Bxb2 16.Bxb2 Rxb2 17.Qd3 Bxd5 18.cxd5 f4 19.a4 Re8 20.Rfe1 Re5 21.
Qd4 Rbxe2 22.Rxe2 Rxe2 23.Qxa7 fxg3 24.hxg3 Qxd5 25.Qb8+ Kf7 26.Qxc7+ Re7
27.Qc1 Re5 28.Qc7+ Re7 29.Qc8 Qd4 30.Rc1 Qxa4 31.Qh8 h5 32.Rc8 Ke6 33.Qg8+
Kf5 34.Qf8+ Ke6 35.Qg8+ {Stockfish eval is (erroneously) Kf5 cp 0} 35...
Kf5 36.Qd5+ Re5 37.Rf8+ Kg4 38.Qf3+ Kg5 39.Qf6+ Kg4 40.Qh4# 1-0
[/pgn]

Code: Select all

Note&#58; First line from engine seen; sending it initial commands now.
Scid  &#58; uci
Engine&#58; Stockfish 110613 64 by Tord Romstad, Marco Costalba and Joona Kiiski
Engine&#58; id name Stockfish 110613 64
Engine&#58; id author Tord Romstad, Marco Costalba and Joona Kiiski
Engine&#58; option name Use Debug Log type check default false
Engine&#58; option name Use Search Log type check default false
Engine&#58; option name Search Log Filename type string default SearchLog.txt
Engine&#58; option name Book File type string default book.bin
Engine&#58; option name Best Book Move type check default false
Engine&#58; option name Contempt Factor type spin default 0 min -50 max 50
Engine&#58; option name Mobility &#40;Midgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Mobility &#40;Endgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Pawn Structure &#40;Midgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Pawn Structure &#40;Endgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Passed Pawns &#40;Midgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Passed Pawns &#40;Endgame&#41; type spin default 100 min 0 max 200
Engine&#58; option name Space type spin default 100 min 0 max 200
Engine&#58; option name Aggressiveness type spin default 100 min 0 max 200
Engine&#58; option name Cowardice type spin default 100 min 0 max 200
Engine&#58; option name Min Split Depth type spin default 4 min 4 max 12
Engine&#58; option name Max Threads per Split Point type spin default 5 min 4 max 8
Engine&#58; option name Threads type spin default 4 min 1 max 64
Engine&#58; option name Use Sleeping Threads type check default true
Engine&#58; option name Hash type spin default 32 min 1 max 8192
Engine&#58; option name Clear Hash type button
Engine&#58; option name Ponder type check default true
Engine&#58; option name OwnBook type check default false
Engine&#58; option name MultiPV type spin default 1 min 1 max 500
Engine&#58; option name Skill Level type spin default 20 min 0 max 20
Engine&#58; option name Emergency Move Horizon type spin default 40 min 0 max 50
Engine&#58; option name Emergency Base Time type spin default 200 min 0 max 30000
Engine&#58; option name Emergency Move Time type spin default 70 min 0 max 5000
Engine&#58; option name Minimum Thinking Time type spin default 20 min 0 max 5000
Engine&#58; option name Slow Mover type spin default 100 min 10 max 1000
Engine&#58; option name UCI_Chess960 type check default false
Engine&#58; option name UCI_AnalyseMode type check default false
Engine&#58; uciok
Scid  &#58; stop
Scid  &#58; isready
Engine&#58; readyok
Scid  &#58; position startpos moves c2c4 f7f5 d2d4 g8f6 g2g3 g7g6 f1g2 f8g7 g1h3 d7d6 d4d5 e7e5 d5e6 b8a6 b1c3 a6c5 h3g5 e8g8 c3d5 c5e6 g5e6 c8e6 d5f6 d8f6 g2b7 a8b8 b7d5 f6f7 e1g1 g7b2 c1b2 b8b2 d1d3 e6d5 c4d5 f5f4 a2a4 f8e8 f1e1 e8e5 d3d4 b2e2 e1e2 e5e2 d4a7 f4g3 h2g3 f7d5 a7b8 g8f7 b8c7 e2e7 c7c1 e7e5 c1c7 e5e7 c7c8 d5d4 a1c1 d4a4 c8h8 h7h5 c1c8 f7e6 h8g8 e6f5 g8f8 f5e6 f8g8
Scid  &#58; go infinite
Engine&#58; info depth 1 seldepth 1 score cp 0 nodes 72 nps 72000 time 1 multipv 1 pv e6f5
Engine&#58; info depth 2 seldepth 2 score cp 0 nodes 85 nps 85000 time 1 multipv 1 pv e6f5
Engine&#58; info depth 3 seldepth 2 score cp 0 nodes 110 nps 110000 time 1 multipv 1 pv e6f5
Engine&#58; info depth 4 seldepth 2 score cp 0 nodes 202 nps 202000 time 1 multipv 1 pv e6f5
Engine&#58; info depth 5 seldepth 2 score cp 0 nodes 265 nps 265000 time 1 multipv 1 pv e6f5
Engine&#58; info depth 6 seldepth 2 score cp 0 nodes 385 nps 385000 time 1 multipv 1 pv e6f5
Engine&#58; info depth 7 seldepth 2 score cp 0 nodes 627 nps 313500 time 2 multipv 1 pv e6f5
Engine&#58; info depth 8 seldepth 2 score cp 0 nodes 1505 nps 752500 time 2 multipv 1 pv e6f5
Engine&#58; info depth 9 seldepth 2 score cp 0 nodes 1744 nps 872000 time 2 multipv 1 pv e6f5
Engine&#58; info depth 10 seldepth 2 score cp 0 nodes 2189 nps 729666 time 3 multipv 1 pv e6f5
Engine&#58; info depth 11 seldepth 2 score cp 0 nodes 3013 nps 1004333 time 3 multipv 1 pv e6f5
Engine&#58; info depth 12 seldepth 2 score cp 0 nodes 4933 nps 1233250 time 4 multipv 1 pv e6f5
Engine&#58; info depth 13 seldepth 2 score cp 0 nodes 7418 nps 1483600 time 5 multipv 1 pv e6f5
Engine&#58; info depth 14 seldepth 2 score cp 0 nodes 22679 nps 1889916 time 12 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 15 seldepth 2 score cp 0 nodes 57073 nps 2282920 time 25 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 16 seldepth 2 score cp 0 nodes 104853 nps 2995800 time 35 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 17 seldepth 2 score cp 0 nodes 141213 nps 3138066 time 45 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 18 seldepth 2 score cp 0 nodes 221880 nps 3413538 time 65 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 19 seldepth 2 score cp 0 nodes 376435 nps 3921197 time 96 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 20 seldepth 2 score cp 0 nodes 562218 nps 4195656 time 134 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 21 seldepth 2 score cp 0 nodes 963466 nps 4099855 time 235 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 22 seldepth 2 score cp 0 nodes 1587845 nps 4326553 time 367 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 23 seldepth 2 score cp 0 nodes 2242030 nps 4413444 time 508 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 24 seldepth 2 score cp 0 nodes 3538609 nps 4536678 time 780 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 25 seldepth 2 score cp 0 nodes 4255789 nps 4546783 time 936 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 26 seldepth 2 score cp 0 nodes 6103870 nps 4585927 time 1331 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 27 seldepth 2 score cp 0 nodes 6645872 nps 4596038 time 1446 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 28 seldepth 2 score cp 0 nodes 7048234 nps 4609701 time 1529 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 29 seldepth 2 score cp 0 nodes 7530937 nps 4617374 time 1631 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 30 seldepth 2 score cp 0 nodes 8682012 nps 4630406 time 1875 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 31 seldepth 2 score cp 0 nodes 9877732 nps 4637432 time 2130 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 32 seldepth 2 score cp 0 nodes 12075229 nps 4687588 time 2576 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 33 seldepth 2 score cp 0 nodes 13507212 nps 4691633 time 2879 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 34 seldepth 2 score cp 0 nodes 15490103 nps 4719714 time 3282 multipv 1 pv e6f5 c8f8
Engine&#58; info depth 35 currmove e6f5 currmovenumber 1
Engine&#58; info depth 35 currmove e7f7 currmovenumber 2
Scid  &#58; stop
Scid  &#58; quit
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Stockfish bug

Post by tpetzke »

The move 35. ... Kf5 repeats the position after move 33. Since it is very common for engines to score the first repetition of a position as DRAW I guess this just works as designed.

The move 34. Qf8 is not the best. An engine would probably not have played it or if it played it once stockfish assumes it will then play it also a 2nd time.

Thomas...
stevenaaus
Posts: 608
Joined: Wed Oct 13, 2010 9:44 am
Location: Australia

Re: Stockfish bug

Post by stevenaaus »

tpetzke wrote:The move 35. ... Kf5 repeats the position after move 33. Since it is very common for engines to score the first repetition of a position as DRAW I guess this just works as designed.
Thomas...
Hmmm. Yes - i've seen a few engines do this. But for game analysis, it is just wrong.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Stockfish bug

Post by Sven »

stevenaaus wrote:No, it's definitely a bug. There is no draw by repetition.
This is stopping me from using Stockfish as my preferred engine, as I'm hitting this bug everyday.
I would agree that it is a bug. I have not checked whether 35...Kf5 is the optimal move but showing a score of 0 although the opponent can mate in 9 plies should be considered as wrong. It is also possible that this leads to actually missing a real draw: you play a move of which you think it is a draw due to erroneously scoring it as 0 but in fact you get mated, while another move would save the draw for you.

I think that the fix should be simple: scoring the first repetition of a position as a draw during search should always be restricted to cases where a position is repeated that belongs to the search tree. Implementing this should be possible with no measurable overhead: the loop that checks backward for repetitions in steps of two plies should stop when reaching or crossing the root node of the current search. If I am not completely mistaken then such a fix would lead to correctly finding that 35...Kf5 results in being mated in 9 more plies, and therefore possibly playing a better move if there is one. (So this is not just an "analysis vs. game playing" case!)

Uri and Thomas are right as well when stating that the first repetition should be scored as a draw to avoid useless calculation, BUT with the restriction above (which makes the important difference). The case where repeating a game position for the first time in order to win is rare of course but it is not the only case where the restriction above is relevant, see my remark above.

Sven
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Stockfish bug

Post by tpetzke »

Yes, I agree. I gave both positions to my engine and iCE scored them also as draws.

The underlying assumption is that if my opponent plays in a position 34. Qf8 once (which enables a DRAW by repetition) he will do so also a 2nd time because he obviously does not realize this will become a draw.

For engines this assumption works pretty well. Humans are less predictable.

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

Re: Stockfish bug

Post by Uri Blass »

stevenaaus wrote:No, it's definitely a bug. There is no draw by repetition.
This is stopping me from using Stockfish as my preferred engine, as I'm hitting this bug everyday.
No
It is not a bug because stockfish is not designed for you.

A bug is something that does not perform as the programmer expect.
Not something that does not perform as you expect.

Programmer of stockfish care about playing strength and not about analysis
and if you have no way to fix it that improve playing strength it is going to behave in the same way in the future.