user30528: Normally the length (sequence of moves) of what stockfish info prints out as 'pv' matches the search depth, but sometimes it doesn't. When determines its length?

user15223: I'm not an expert on this, but my understanding is that every now and then as Stockfish searches there will be a so-called "fail high" or "fail low" which forces a re-search. Under these situations Stockfish might not know what the best PV is, but it does know the best move it has found is. That is when it outputs a 1-move PV.
See also aspiration windows on the Chessprogramming Wiki.

30528: <p>Normally the length (sequence of moves) of what stockfish info prints out as 'pv' matches the search depth, but sometimes it doesn't. When determines its length?</p>
 15223: <p>I'm not an expert on this, but my understanding is that every now and then as Stockfish searches there will be a so-called &quot;<a href="https://www.chessprogramming.org/Fail-High" rel="nofollow noreferrer">fail high</a>&quot; or &quot;<a href="https://www.chessprogramming.org/Fail-Low" rel="nofollow noreferrer">fail low</a>&quot; which forces a re-search. Under these situations Stockfish might not know what the best PV is, but it does know the best move it has found is. That is when it outputs a 1-move PV.</p>
<p>See also <a href="https://www.chessprogramming.org/Aspiration_Windows" rel="nofollow noreferrer">aspiration windows</a> on the Chessprogramming Wiki.</p>
