From e57fba7fc9be461cbb97c063b269a1e231cdd284 Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Sun, 21 Jul 2024 13:15:12 +0200 Subject: [PATCH] Fix TB PV extension and MultiPV in the case of MultiPV, the first move of the Nth multiPV could actually turn a winning position in a losing one, so don't attempt to correct it. Instead, always perform the first move without correction. Fixes #5505 Closes https://github.com/official-stockfish/Stockfish/pull/5506 No functional change --- src/search.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 945f8b40..435af4b2 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1948,8 +1948,12 @@ void syzygy_extend_pv(const OptionsMap& options, std::list sts; + // Step 0, do the rootMove, no correction allowed, as needed for MultiPV in TB. + auto& stRoot = sts.emplace_back(); + pos.do_move(rootMove.pv[0], stRoot); + int ply = 1; + // Step 1, walk the PV to the last position in TB with correct decisive score - int ply = 0; while (size_t(ply) < rootMove.pv.size()) { Move& pvMove = rootMove.pv[ply];