official-stockfish / Stockfish

A free and strong UCI chess engine
https://stockfishchess.org/
GNU General Public License v3.0
11.65k stars 2.29k forks source link

Checkmate blunder at relatively high depth #5024

Closed PavelChess closed 9 months ago

PavelChess commented 9 months ago

Describe the issue

  1. d4 Nf6 2. c4 e6 3. Nf3 Bb4+ 4. Nbd2 O-O 5. a3 Be7 6. g3 d5 7. Bg2 b6 8. b3 c5 9. Bb2 Bb7 10. O-O Nbd7 11. cxd5 exd5 12. e3 Rc8 13. Qe2 Re8 14. Rfc1 Bd6 15. dxc5 bxc5 16. b4 c4 17. Qd1 Bc7 18. Nb1 a5 19. Nc3 axb4 20. axb4 Bd6 21. Rcb1 Ne5 22. Ra7 Qb6 23. Ra2 Nd3 24. Na4 Qd8 25. Bd4 Qe7 26. Ne1 Ne5 27. Nc3 h5 28. Nb5 Bb8 29. Bh3 h4 30. Bxc8 Bxc8 31. Nc3 Bg4 32. f3 Bf5 33. Rba1 Qxb4 34. Ng2 h3 35. Nf4 Qb3 36. Kf2 Qb7 37. Ra6 Rc8 38. Rb6 Qe7 39. Ra2 Bc7 40. Rb5 Qe8 41. Rc5 Ned7 42. Rxc7 Rxc7 43. g4 Be6 44. g5 Nh7 45. Nb5 Rc6 46. Qa1 c3 47. Bxc3 Qe7 48. Bxg7 Qxg5 49. Ra8+ Ndf8 50. Nd4 Rc8 51. Ndxe6 Rc2+ 52. Kf1 Qg3 53. hxg3 0-1

51th move Ndxe6 is grave blunder in won position. I tried latest version from 26 january: at depth 28: ... info depth 28 currmove a1c1 currmovenumber 47 info depth 27 seldepth 51 multipv 1 score cp 291 nodes 3309202 nps 423279 hashfull 21 tbhits 0 time 7818 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 h2c2 d7e5 f7g7 a8a7 g7g8 e5g4 h3h2 g4h2 c2h2 a7a5 d5d4 e3d4 g8f7 a5e5 f7f6 e5e2 h2h4 e2d2 f6f5 e1e2 f5f4 e2d3 h4h1 d4d5 f4e5 d3e3 e5d6 f3f4 h1h3 e3e4 h3h8 e4f3 h8f8 bestmove d4e6 ponder c8c2

SF need at least depth 29 to see that it loses, and then it chooses right move Rxc8,

Expected behavior

SF should see at lower depth that opponent mates by force, because this was a position that opponent every move threatens mate in 1 or gives a check.

Steps to reproduce

setoption name hash value 1024 position fen R1r2nk1/5pBn/4b3/3p2q1/3N1N2/4PP1p/5K1P/Q7 w - - 0 51 go depth 28

Anything else?

No response

Operating system

Windows

Stockfish version

Stockfish16 / fcbb02ff

Disservin commented 9 months ago

There is actually little we can do about these things, mate finding is a topic on it's own and if we were able to spot every mate which would follow after move x, we would have solved chess. See https://github.com/vondele/matetrack.

Spots mate after 3379347 nodes ``` Stockfish dev-20240126-fcbb02ff by the Stockfish developers (see AUTHORS file) position fen R1r2nk1/5pBn/4b3/3p2q1/3N1N2/4PP1p/5K1P/Q7 w - - 0 51 go searchmoves d4e6 info string NNUE evaluation using nn-baff1ede1f90.nnue info string NNUE evaluation using nn-baff1edbea57.nnue info depth 0 seldepth 8 multipv 1 score cp 103 nodes 14 nps 14000 hashfull 0 tbhits 0 time 1 pv d4e6 info depth 1 seldepth 3 multipv 1 score cp 103 nodes 18 nps 9000 hashfull 0 tbhits 0 time 2 pv d4e6 info depth 2 seldepth 3 multipv 1 score cp 103 nodes 22 nps 11000 hashfull 0 tbhits 0 time 2 pv d4e6 info depth 3 seldepth 8 multipv 1 score cp 108 nodes 36 nps 18000 hashfull 0 tbhits 0 time 2 pv d4e6 info depth 4 seldepth 8 multipv 1 score cp 119 nodes 58 nps 29000 hashfull 0 tbhits 0 time 2 pv d4e6 info depth 5 seldepth 9 multipv 1 score cp 117 nodes 343 nps 171500 hashfull 0 tbhits 0 time 2 pv d4e6 g5h4 f2e2 c8a8 a1a8 f7e6 g7b2 info depth 6 seldepth 8 multipv 1 score cp 117 nodes 367 nps 122333 hashfull 0 tbhits 0 time 3 pv d4e6 g5h4 f2e2 c8a8 a1a8 f7e6 g7b2 info depth 7 seldepth 8 multipv 1 score cp 117 nodes 436 nps 145333 hashfull 0 tbhits 0 time 3 pv d4e6 g5h4 f2e2 c8a8 a1a8 f7e6 g7b2 info depth 8 seldepth 10 multipv 1 score cp 137 nodes 1100 nps 275000 hashfull 0 tbhits 0 time 4 pv d4e6 g5h4 f2f1 c8a8 a1a8 f7e6 g7d4 h4g5 info depth 9 seldepth 10 multipv 1 score cp 132 nodes 1191 nps 297750 hashfull 0 tbhits 0 time 4 pv d4e6 g5h4 f2f1 c8a8 a1a8 f7e6 g7d4 h4g5 a8e8 info depth 10 seldepth 17 multipv 1 score cp 162 nodes 7997 nps 799700 hashfull 3 tbhits 0 time 10 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 info depth 11 seldepth 18 multipv 1 score cp 175 nodes 9727 nps 884272 hashfull 4 tbhits 0 time 11 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 info depth 12 seldepth 26 multipv 1 score cp 99 nodes 16972 nps 1060750 hashfull 6 tbhits 0 time 16 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7e5 g8f7 f4h3 f8d7 a8a7 f7e8 info depth 13 seldepth 20 multipv 1 score cp 103 nodes 20485 nps 1024250 hashfull 7 tbhits 0 time 20 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7e5 g8f7 f4h3 f8d7 a8a7 f7e8 e5d6 c2c4 info depth 14 seldepth 26 multipv 1 score cp 161 nodes 38064 nps 1153454 hashfull 17 tbhits 0 time 33 pv d4e6 g5h4 f2f1 c8c2 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 info depth 15 seldepth 25 multipv 1 score cp 168 nodes 55174 nps 1283116 hashfull 21 tbhits 0 time 43 pv d4e6 g5h4 f2f1 c8c2 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 f7g7 a8a4 h2b2 a4g4 g7f7 info depth 16 seldepth 23 multipv 1 score cp 175 nodes 59159 nps 1286065 hashfull 23 tbhits 0 time 46 pv d4e6 g5h4 f2f1 c8c2 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 f7g7 a8a4 d5d4 a4d4 info depth 17 seldepth 31 multipv 1 score cp 200 nodes 97304 nps 1390057 hashfull 33 tbhits 0 time 70 pv d4e6 g5h4 f2f1 c8c2 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 h2c2 d7e5 f7g7 a8a7 g7g8 e5g4 h3h2 g4h2 c2h2 a7d7 h2h5 f3f4 info depth 18 seldepth 36 multipv 1 score cp 213 nodes 120826 nps 1404953 hashfull 36 tbhits 0 time 86 pv d4e6 g5h4 f2f1 c8c2 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 h2c2 d7e5 f7g7 a8a7 g7g8 e5g4 h3h2 g4h2 c2h2 a7d7 h2h5 e1d2 g8f8 info depth 19 seldepth 40 multipv 1 score cp 242 nodes 394533 nps 1535147 hashfull 115 tbhits 0 time 257 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 h2c2 d7e5 f7g7 a8a7 g7g8 e5g4 h3h2 g4h2 c2h2 a7a5 d5d4 e3d4 h2b2 a5e5 g8f7 e5e2 b2b4 e2d2 f7e6 e1f2 b4b8 f2e3 info depth 20 seldepth 44 multipv 1 score cp 242 nodes 431349 nps 1529606 hashfull 125 tbhits 0 time 282 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 h2c2 d7e5 f7g7 a8a7 g7g8 e5g4 h3h2 g4h2 c2h2 a7a5 d5d4 e3d4 h2b2 a5e5 g8f7 e5e2 b2b4 e2d2 f7e6 e1f2 b4b8 d2e2 e6d5 info depth 21 seldepth 44 multipv 1 score cp 293 nodes 709168 nps 1579438 hashfull 200 tbhits 0 time 449 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 f7g7 d7e5 d5d4 e3d4 h2b2 a8a7 g7h6 e5g4 h6g5 a7h7 info depth 22 seldepth 49 multipv 1 score cp 300 nodes 1018676 nps 1559993 hashfull 295 tbhits 0 time 653 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 h2g2 e1f1 g2g3 a8h8 g3f3 f1e2 f3g3 e2f2 g3g2 f2f3 g2a2 d7e5 f7e6 e5d3 d5d4 d3f4 e6f5 info depth 23 seldepth 39 multipv 1 score cp 310 nodes 1519775 nps 1539792 hashfull 436 tbhits 0 time 987 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 h2g2 e1f1 g2g3 a8h8 g3f3 f1e2 f3g3 e2f2 g3g2 f2f3 g2d2 h8h3 d5d4 d7e5 f7e6 e5c4 d2d1 info depth 24 seldepth 50 multipv 1 score cp 312 nodes 2412979 nps 1558771 hashfull 635 tbhits 0 time 1548 pv d4e6 c8c2 f2f1 g5h4 a1e1 h4e1 f1e1 f7e6 g7f8 h7f8 f4e6 g8f7 e6f8 c2h2 f8d7 f7g7 d7e5 d5d4 a8a7 g7g8 e3d4 h2c2 e5g4 h3h2 g4h2 c2h2 a7e7 h2a2 e7e2 a2a4 e2d2 g8f7 e1f2 f7e6 d2e2 e6f5 e2e5 f5f4 e5e4 f4g5 info depth 25 seldepth 50 multipv 1 score mate -8 nodes 3379347 nps 1566688 hashfull 771 tbhits 0 time 2157 pv d4e6 c8c2 f2f1 g5g3 h2g3 h3h2 a8f8 h7f8 f4e2 h2h1q f1f2 h1h2 f2f1 h2e2 f1g1 e2g2 ```

SF should see at lower depth that opponent mates by force, because this was a position that opponent every move threatens mate in 1 or gives a check.

I dont get this? After Nd4xe6, there is only one correct move for black Rc2+, all other moves give white the advantage back.

joergoster commented 9 months ago

Nd4xe6 leads to a forced loss (White will get mated). SF takes some time to realize this and switch to a better move. No real issue, although I don't like it takes that long.