official-stockfish / Stockfish

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

Faulty analysis - too big change of position value #5208

Closed hpojak closed 4 months ago

hpojak commented 4 months ago

Describe the issue

After a while, Stockfish suggests 33. Bf8 as the best move for black (evalued about -3). If black moves Bf8, Stockfish suggests 34. e5 as the best move for white (evalued about +0). So at once, the value changes 3 units. If black instead chooses the second best move 33. Ra2, then the value of white's best move is close to -3.

Expected behavior

The value of the best move should not change drastically, as much as 3 units. If the first move suggestion is correct, than the value of the best move for white should be about -3. Or at least I believe so, but I'm not a Stockfish expert.

Steps to reproduce

PGN notation follows:

1.e4 e5 2.f4 exf4 3.Nf3 g5 4.Bc4 g4 5.O-O gxf3 6.Qxf3 Qf6 7.d3 Nc6 8.Bxf4 d6 9.Nc3 Nge7 10.Nb5 Kd8 11.d4 Ng6 12.Qg3 Nxf4 13.Rxf4 Qg6 14.Qf2 Be7 15.Bxf7 Qh6 16.h4 Rf8 17.Rf1 Bd7 18.a4 a6 19.Nc3 Qg7 20.Ne2 Kc8 21.c3 Nd8 22.Bc4 Rxf4 23.Nxf4 b5 24.axb5 axb5 25.Be2 c6 26.Nd3 Qg6 27.Bf3 Kc7 28.Qe1 Qg7 29.Kh1 Nf7 30.g3 Nh6 31.Nf4 Ng4 32.Rg1 Qg8 33.Qe2 1-0

Anything else?

Using scid as frontend. Using NNUE nn-5af11540bbfe.nnue. Hash memory 30, threads 9. Sorry I can't get the exact version of Stockfish, but it was probably the latest available on Jan 30, 2024.

Operating system

Linux

Stockfish version

Version 16, stockfish-ubuntu-x86-64-avx2, downloaded Jan 30, 2024

R-Goc commented 4 months ago

Can't replicate on Windows x86-64-bmi2, current stockfish version dev-20240501-be142337 (Evalfile nn-ae6a388e4a1a.nnue and nn-baff1ede1f90.nnue). Steps taken: position fen r4bq1/2kb3p/2pp4/1p2P3/3P1NnP/2P2BP1/1P2Q3/6RK b - - 0 34 setoption name Threads value 8 setoption name Hash value 8096 go depth 50

output: info depth 50 seldepth 91 multipv 1 score cp 420 nodes 39819859582 nps 7482726 hashfull 1000 tbhits 0 time 5321571 pv d6e5 d4e5 a8e8 g1d1 g4e5 e2e3 g8a2 e3d4 a2a6 f3h5 e8e7 c3c4 c7b7 c4b5 c6b5 h1g1 a6a7 d4a7 b7a7 b2b3 d7c6 g1f1 e5d7 f4e2 a7b6 e2d4 c6e4 h5f3 d7f6 f3e4 f6e4 f1g2 e7d7 d1f1 f8b4 d4b5 b6b5 g3g4 b4d6 g4g5 b5c6 g5g6 h7g6 h4h5 g6h5 g2h3 d7g7 f1c1 c6b7 c1f1 g7g4 f1f5

Eval has an upward trend with depth. Please provide the depth you reached or number of nodes. Edit: Retested with threads 9 and hash 30MB, and can't replicate either. Tested up to depth 35. info depth 35 seldepth 57 multipv 1 score cp 353 nodes 266578345 nps 5774843 hashfull 1000 tbhits 0 time 46162 pv d6e5 d4e5 a8e8 g1d1 g4e5 f3h5 g8g3 h5e8 g3f4 e8d7 f4h4 e2h2 h4h2 h1h2 e5d7 h2g3 h7h6 d1e1 d7b6 g3g4 f8d6 g4f5 b6a4 e1e2 c6c5 e2c2 c5c4 f5g6 d6f4 g6f5 f4g5 f5e5 c7c6 e5d4 g5f6 d4e4 c6d6 c2d2 d6e6 bestmove d6e5 ponder d4e5

hpojak commented 4 months ago

Unfortunately I can't replicate the error myself, neither via scid, nor stockfish/UCI. There is a risk that a bug resides within scid, instead. But I can't tell.