I'm trying to understand how a chess engine like Stockfish works. I use Stockfish 10 directly, without an UI.
For example, for this position (white to move)...
r3n1k1/1bpp2pp/pp2p3/2P1P3/R2P4/3B1rPq/7P/1Q3RK1 w - - - 0 26
...Stockfish (depth limited to 31) returns the following informations; I only kept the last lines, eliminating those where the depth was less than 31:
info depth 31 seldepth 47 multipv 1 score cp -771 lowerbound nodes 86977322 nps 1898570 hashfull 990 tbhits 0 time 45812 pv f1f3
info depth 31 seldepth 47 multipv 1 score cp -761 lowerbound nodes 87198087 nps 1898499 hashfull 990 tbhits 0 time 45930 pv f1f3
info depth 31 seldepth 47 multipv 1 score cp -790 upperbound nodes 99439222 nps 1905696 hashfull 992 tbhits 0 time 52180 pv f1f3 b7f3
info depth 31 seldepth 51 multipv 1 score cp -788 nodes 134293602 nps 1906577 hashfull 995 tbhits 0 time 70437 pv d4d5 f3f1 d3f1 h3h5 c5c6 d7c6 a4h4 h5e5 b1h7 g8f8 h4f4 e8f6 h7h8 f8f7 d5e6 e5e6 h8h5 f7e7 h5f3 a8e8 f4c4 b6b5 c4c2 e7d8 f3d3 d8c8 c2e2 f6e4 d3e3 c6c5 f1g2 c5c4 g2e4 b7e4 e3d4 b5b4
bestmove d4d5 weight f3f1
I don't understand what criteria allow Stockfish to say that d4d5
is the best move.
The line corresponding to d4d5...
info depth 31 seldepth 51 multipv 1 score cp -788 nodes 134293602 nps 1906577 hashfull 995 tbhits 0 time 70437 pv d4d5 f3f1 d3f1 h3h5 c5c6 d7c6 a4h4 h5e5 b1h7 g8f8 h4f4 e8f6 h7h8 f8f7 d5e6 e5e6 h8h5 f7e7 h5f3 a8e8 f4c4 b6b5 c4c2 e7d8 f3d3 d8c8 c2e2 f6e4 d3e3 c6c5 f1g2 c5c4 g2e4 b7e4 e3d4 b5b4
... proposes a score ("cp score") equal to -788 which is smaller e.g. than -771 (see the following line) by example:
info depth 31 seldepth 47 multipv 1 score cp -771 lowerbound nodes 86977322 nps 1898570 hashfull 990 tbhits 0 time 45812 pv f1f3
If it is not the cp score
that is decisive, what is the criterion used?
Any help would be appreciated !