lichess.org
Donate

Stockfish engine, odd behaviour.

A few times, I have seen the engine not showing the best reply to a move.
It will show a line, and after I do the move, it will then sometimes surprise me with a better answer to that move.
This is weird because the original line got searched to a higher depth.

You would think the higher depth line knew everything, or more.

Eg. 20 depth line, thinks one side is better, then next move it comes up with a new idea at 18 depth that refutes it, and it doesn't change at further depth. Odd, right?
Once you make a move, the engine can focus its computation on a much smaller set of lines. In addition, assuming you aren't turning the engine off in-between, it can take advantage of any cached analysis it has already done. It's not that unlikely that it would be able to consider a broader range of moves more deeply. You can generally back up to the previous move and it will take its newly cached positions into consideration.
It would make sense if it was a memory limitation. I'm running everything full (512 mb memory, 5 lines). It's still odd how it can find a better move at a lower depth to me.
512MB might be most your system can allocate to lichess web analysis, but it's far, far from maxing out stockfish, which has no problem running 64GB or more cache. You're actually reducing the strength of the engine by several hundred Elo by using multiple lines, rather than a single line.
I haven't seen anything worse than about a 2 depth difference though.
Right, I assumed that showing more lines didn't make any difference (e.g it just spits out what it's already thinking).
@guyza said in #6:
> Right, I assumed that showing more lines didn't make any difference (e.g it just spits out what it's already thinking).
Stockfish does not work that way - when it's instructed to look at multiple lines, it spreads its search much wider. Leela actually does work like this - showing multiple lines doesn't affect its strength, as it doesn't change how much search power it's applying to each line.
Try a different method. Add up all the depths choices.
Using the go command, these 3 moves appeared as candidate moves:

1. e2-e4 (appearance 11 times)
1. d2-d4 (appearance 19 times)
1. g1-f3 (appearance 2 times)

Now you can decide what you would consider to be best move. I would go by the number of times the engine considered it a good candidate move. After typing quit it said: Best move e2-e4 at depth 33.

That was not my pick, especially knowing it picked d2-d4 more often.
I'd rather want a move that fits in more depths, then one that does not.
The longest steak would be my choice.

Truncated results ...
depth 1 e2e4
Changed best move ...
depth 2 d2d4
Changed best move ...
depth 3 e2e4
Changed best move ...
depth 4 d2d4
depth 5 d2d4
Changed best move ...
depth 6 e2e4
Changed best move ...
depth 7 d2d4
Changed best move ...
depth 8 g1f3
depth 9 g1f3
Changed best move ...
depth 10 e2e4
depth 11 e2e4
depth 12 e2e4
depth 13 e2e4
Changed best move ...
depth 14 d2d4
depth 15 d2d4
depth 16 d2d4
depth 17 d2d4
depth 18 d2d4
depth 19 d2d4
depth 20 d2d4
depth 21 d2d4
depth 22 d2d4
depth 23 d2d4
depth 24 d2d4
depth 25 d2d4
depth 26 d2d4
depth 27 d2d4
depth 28 d2d4
Changed best move ...
depth 29 e2e4
depth 30 e2e4
depth 31 e2e4
depth 32 e2e4
Best move e2-e4, for depth 33.
@Toscani said in #8:
> Try a different method. Add up all the depths choices.

I wouldn't suggest using that method. Generally you should consider the strongest move, based on what the engine has been able to determine, to be the move at the highest depth. For example, consider the famous position 8/3P3k/n2K3p/2p3n1/1b4N1/2p1p1P1/8/3B4 w - - 0 1

Stockfish on my machine running to depth 43 gives 31 votes for Nxe3 and two votes for Nf6+, even though Nf6+ is the winning move.
For pure competitive chess, going with the most 'popular' move could work, it's not exactly principled, but it might get more wins.

This topic has been archived and can no longer be replied to.