]> git.sesse.net Git - stockfish/commitdiff
Fix output of PV lines with invalid scores #2439
authorjoergoster <osterj165@googlemail.com>
Fri, 6 Dec 2019 09:11:45 +0000 (10:11 +0100)
committerStéphane Nicolet <cassio@free.fr>
Sun, 8 Dec 2019 23:16:55 +0000 (00:16 +0100)
As reported on the forum it is possible, on very rare occasions, that we are
trying to print a PV line with an invalid previousScore, although this line
has a valid actual score. This patch fixes output of PV lines with invalid
scores in a MultiPV search. This is a follow-up patch to 8b15961 and makes
the fix finally complete.

The reason is the i <= pvIdx condition which probably is a leftover from the
times there was a special root search function. This check is no longer needed
today and prevents PV lines past the current one (current pvIdx) to be flagged
as updated even though they do have a valid score.

https://github.com/official-stockfish/Stockfish/commit/8b15961349e18a9ba113973c53f53913d0cd0fad
https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/PrnoDLvMvro

No functional change.

src/search.cpp

index e8ca5c5896d3302edf467b5cedfc11519fb169cd..a6c93b43550722e5c4584816497b1768d3b3ce4d 100644 (file)
@@ -1741,7 +1741,7 @@ string UCI::pv(const Position& pos, Depth depth, Value alpha, Value beta) {
 
   for (size_t i = 0; i < multiPV; ++i)
   {
-      bool updated = (i <= pvIdx && rootMoves[i].score != -VALUE_INFINITE);
+      bool updated = rootMoves[i].score != -VALUE_INFINITE;
 
       if (depth == 1 && !updated)
           continue;