@DeConscious said in #1:
I am currently researching how different chess engines evaluate positions for a project. I noticed how it appears that by default most engines retain positional evaluation after they make a move, thus speeding up calculation significantly.
However when you enter analysis mode in Lichess and analyze a position with an engine it appears to restart its evaluation from depth 6 to 22/23 every time you make a move. I thought it would instead be more efficient to start from a lower depth such as around 19.
Is there any reason why SF is configured like this on Lichess? Other than the small potential to catch a better line.
Or am I misunderstanding how all engines analyze?
Stockfish is using an iterative deepening (https://www.chessprogramming.org/Iterative_Deepening) algorithm.
It starts at depth of 1-ply ever time you ask it to do a search. It is so fast, that you don't see that in the GUI.
So it is not something that Lichess can control; it is how Stockfish works.
Here is part of an example I just did on a position in another thread.
$ stockfish
Stockfish 14.1 by the Stockfish developers (see AUTHORS file)
position fen 8/2p3k1/1p1p1pP1/1P1P1Pb1/PpP5/4pK2/2B5/8 w - - 0 56
setoption name MultiPV value 5
go depth 50
info string NNUE evaluation using nn-13406b1dcbe0.nnue enabled
info depth 1 seldepth 1 multipv 1 score cp 26 nodes 57 nps 28500 tbhits 0 time 2 pv f3e2
info depth 1 seldepth 1 multipv 2 score cp 15 nodes 57 nps 28500 tbhits 0 time 2 pv c2d3
info depth 1 seldepth 1 multipv 3 score cp 13 nodes 57 nps 28500 tbhits 0 time 2 pv c2d1
info depth 1 seldepth 1 multipv 4 score cp 0 nodes 57 nps 28500 tbhits 0 time 2 pv c2b1
info depth 1 seldepth 1 multipv 5 score cp 0 nodes 57 nps 28500 tbhits 0 time 2 pv c2e4
info depth 2 seldepth 2 multipv 1 score cp 86 nodes 139 nps 69500 tbhits 0 time 2 pv f3e2 b4b3 c2b3
info depth 2 seldepth 2 multipv 2 score cp 66 nodes 139 nps 69500 tbhits 0 time 2 pv c2b3 e3e2
info depth 2 seldepth 2 multipv 3 score cp 55 nodes 139 nps 69500 tbhits 0 time 2 pv c2d1 b4b3 d1b3
...
and on it goes until it gets to depth 50 when it prints the 5 best lines....
info depth 50 seldepth 21 multipv 1 score cp 567 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv c2d3 b4b3 a4a5 b6a5 c4c5 d6c5 b5b6 e3e2 d3e2 c7b6 d5d6 g5f4 f3f4 b3b2 e2d3 c5c4 d6d7 c4d3
info depth 50 seldepth 24 multipv 2 score cp 512 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv a4a5 b6a5 c4c5 d6c5 c2d3 c5c4 d5d6 c7d6 b5b6 c4d3 b6b7 d3d2 f3e2 d6d5 b7b8q d2d1q e2d1 e3e2 d1e2
info depth 50 seldepth 16 multipv 3 score cp 512 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv c4c5 d6c5 a4a5 b6a5 c2d3 c5c4 d5d6 c7d6 b5b6 c4d3 b6b7 d3d2 f3e2 d6d5 b7b8q d2d1q e2d1
info depth 50 seldepth 17 multipv 4 score cp 96 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv c2d1 b4b3 d1b3 g5f4 b3d1 f4e5 a4a5 b6a5 c4c5 d6c5 f3e3 c5c4 d1e2 g7h8 e2c4 a5a4 e3d3
info depth 50 seldepth 17 multipv 5 score cp 90 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv c2b3 g5f4 c4c5 d6c5 b3c4 e3e2 f3e2 f4d6 e2e3 d6e5 c4a2 e5d6 a2b3 c5c4 b3c4 g7g8 e3d3
bestmove c2d3 ponder b4b3
Lichess either show the lines from a cache on the cloud, or depending on the browser and settings, does the "go depth ..."
at a value that will get a quick answer.
@DeConscious said in #1:
> I am currently researching how different chess engines evaluate positions for a project. I noticed how it appears that by default most engines retain positional evaluation after they make a move, thus speeding up calculation significantly.
>
> However when you enter analysis mode in Lichess and analyze a position with an engine it appears to restart its evaluation from depth 6 to 22/23 every time you make a move. I thought it would instead be more efficient to start from a lower depth such as around 19.
> Is there any reason why SF is configured like this on Lichess? Other than the small potential to catch a better line.
> Or am I misunderstanding how all engines analyze?
Stockfish is using an iterative deepening (https://www.chessprogramming.org/Iterative_Deepening) algorithm.
It starts at depth of 1-ply ever time you ask it to do a search. It is so fast, that you don't see that in the GUI.
So it is not something that Lichess can control; it is how Stockfish works.
Here is part of an example I just did on a position in another thread.
$ stockfish
Stockfish 14.1 by the Stockfish developers (see AUTHORS file)
position fen 8/2p3k1/1p1p1pP1/1P1P1Pb1/PpP5/4pK2/2B5/8 w - - 0 56
setoption name MultiPV value 5
go depth 50
info string NNUE evaluation using nn-13406b1dcbe0.nnue enabled
info depth 1 seldepth 1 multipv 1 score cp 26 nodes 57 nps 28500 tbhits 0 time 2 pv f3e2
info depth 1 seldepth 1 multipv 2 score cp 15 nodes 57 nps 28500 tbhits 0 time 2 pv c2d3
info depth 1 seldepth 1 multipv 3 score cp 13 nodes 57 nps 28500 tbhits 0 time 2 pv c2d1
info depth 1 seldepth 1 multipv 4 score cp 0 nodes 57 nps 28500 tbhits 0 time 2 pv c2b1
info depth 1 seldepth 1 multipv 5 score cp 0 nodes 57 nps 28500 tbhits 0 time 2 pv c2e4
info depth 2 seldepth 2 multipv 1 score cp 86 nodes 139 nps 69500 tbhits 0 time 2 pv f3e2 b4b3 c2b3
info depth 2 seldepth 2 multipv 2 score cp 66 nodes 139 nps 69500 tbhits 0 time 2 pv c2b3 e3e2
info depth 2 seldepth 2 multipv 3 score cp 55 nodes 139 nps 69500 tbhits 0 time 2 pv c2d1 b4b3 d1b3
...
and on it goes until it gets to depth 50 when it prints the 5 best lines....
info depth 50 seldepth 21 multipv 1 score cp 567 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv c2d3 b4b3 a4a5 b6a5 c4c5 d6c5 b5b6 e3e2 d3e2 c7b6 d5d6 g5f4 f3f4 b3b2 e2d3 c5c4 d6d7 c4d3
info depth 50 seldepth 24 multipv 2 score cp 512 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv a4a5 b6a5 c4c5 d6c5 c2d3 c5c4 d5d6 c7d6 b5b6 c4d3 b6b7 d3d2 f3e2 d6d5 b7b8q d2d1q e2d1 e3e2 d1e2
info depth 50 seldepth 16 multipv 3 score cp 512 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv c4c5 d6c5 a4a5 b6a5 c2d3 c5c4 d5d6 c7d6 b5b6 c4d3 b6b7 d3d2 f3e2 d6d5 b7b8q d2d1q e2d1
info depth 50 seldepth 17 multipv 4 score cp 96 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv c2d1 b4b3 d1b3 g5f4 b3d1 f4e5 a4a5 b6a5 c4c5 d6c5 f3e3 c5c4 d1e2 g7h8 e2c4 a5a4 e3d3
info depth 50 seldepth 17 multipv 5 score cp 90 nodes 76980067 nps 2361206 hashfull 1000 tbhits 0 time 32602 pv c2b3 g5f4 c4c5 d6c5 b3c4 e3e2 f3e2 f4d6 e2e3 d6e5 c4a2 e5d6 a2b3 c5c4 b3c4 g7g8 e3d3
bestmove c2d3 ponder b4b3
Lichess either show the lines from a cache on the cloud, or depending on the browser and settings, does the "go depth ..."
at a value that will get a quick answer.