From: joergoster Date: Fri, 6 Dec 2019 09:11:45 +0000 (+0100) Subject: Fix output of PV lines with invalid scores #2439 X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=a6b5ba1b6404ce8aec8a2be8b7354dcb89cfda3f Fix output of PV lines with invalid scores #2439 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. --- diff --git a/src/search.cpp b/src/search.cpp index e8ca5c58..a6c93b43 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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;