From 466daf6fbafd1f58f064c2fa03d2fa2c1315c4f5 Mon Sep 17 00:00:00 2001 From: syzygy1 <3028851+syzygy1@users.noreply.github.com> Date: Tue, 18 Jun 2019 23:27:34 +0200 Subject: [PATCH] Partial revert of "Assorted trivial cleanups 5/2019". Since root_probe() and root_probe_wdl() do not reset all tbRank values if they fail, it is necessary to do this in rank_root_move(). This fixes issue #2196. Alternatively, the loop could be moved into both root_probe() and root_probe_wdl(). No functional change --- src/search.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/search.cpp b/src/search.cpp index d9543899..047a0892 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1713,4 +1713,10 @@ void Tablebases::rank_root_moves(Position& pos, Search::RootMoves& rootMoves) { if (dtz_available || rootMoves[0].tbScore <= VALUE_DRAW) Cardinality = 0; } + else + { + // Clean up if root_probe() and root_probe_wdl() have failed + for (auto& m : rootMoves) + m.tbRank = 0; + } } -- 2.39.2