5

I am learning how to use Stockfish to analyze my games, and I had a question on how to understand Stockfish's output.

Consider the screenshot when I request stockfish 12 to annotate my games inside SCID.

As the number in the square brackets refers approximately to the "advantage" (however that may be defined) I would have if I followed the moves in the suggested lines. This is why lines that have the same initial set of moves, have a different score when they diverge e.g. lines 9 and 10 in the output which have scores of 1.12 and 1.25 respectively.

But what I want to know is in what order does Stockfish suggest the various lines of output. Notice that the various lines list advantages not necessarily in increasing order. Here are my questions.

  1. Is the program, brute force checking through all possible lines of play (up to a prescribed depth) by both players and then suggesting the best lines of play found till now?

  2. Does it suggest what the advantage would be for the strongest lines of play i.e. "perfect" play for both black and white would be N number of moves down the line given a particular move by White?

Basically, the fact I am asking these two questions suggests, that I approximately (but not completely) understand what Stockfish is outputting. Sure, SCID annotates via arrows the best move at each position. But what EXACTLY are assumptions for each line of play that Stockfish is outputting? Clearly, it is not outputting disastrous lines of play, so it is not listing the advantages for ALL possible lines of play up to a certain depth.

Also, the lines are numbered from 1 to 21 in the output above, but why is line 2 missing?! The image has not been edited!

enter image description here

1 Answer 1

7

The above output from Stockfish is what's called the Primary Variation (PV), what it considers the best line of play for both sides. But the output is the PV at each search depth: 1 ply from the start position, 3 ply, all the way up to 21 plies.

So at a search depth of 21 plies (moves by both sides), it still considers 12. Bxc7 to be the best move in the current position, with an evaluation of the position resulting after those 21 plies to be +1.33 in White's favour.

If you want to see the evaluation of other moves, then hit the +V button in the toolbar. Click it once, and when Stockfish analyses the position again, it should show the two best variations at each search depth.

I tend to have Stockfish show either 4 or 6 variations, so I can see the relative scores between the moves -- to see if one move is significantly stronger than another.

Stockfish -- as with most "brute force" chess engines -- uses a min-max approach, which ensures that it's considering the best move for both sides. There's various algorithms for pruning and reducing the size of the tree as the search-depth grows, which could have the effect of ignoring what in the longer-term proves to be a stronger move.

If you are interested in the algorithms and patterns that make up Stockfish, try Stockfish on Chess Programming Wiki: which gives a breakdown of the board representation, the searching algorithms and the evaluation algorithms that Stockfish, as well as other engines, use.

1
  • A few notes, using Stockfish in 4 or 6 variation mode will slow it down A LOT. (the simple reason being that it now needs to provide an exact evaluation for those not-best moves instead of just an upper bound). As for terminology, I think you mean the right thing but I would describe plies as half-moves to make more clear that both sides moving constitutes two plies. Finally, PV stands for principle variation, not that it matters much.
    – koedem
    Commented Dec 3, 2020 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.