From 5af8179647b9e80353cb8f532990cae572ba6412 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Mon, 26 Nov 2012 16:13:36 +0100 Subject: [PATCH] Update bestValue when futility pruning In qsearch we should update the bestValue as we do in case of futilityValue < beta, also when pruning moves with non-positive see. Spotted by Lucas Braesch Bench: 5695710 --- src/search.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 6d332c5e..3116e80e 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1217,9 +1217,7 @@ split_point_start: // At split points actual search starts from here if (futilityValue < beta) { - if (futilityValue > bestValue) - bestValue = futilityValue; - + bestValue = std::max(bestValue, futilityValue); continue; } @@ -1227,7 +1225,10 @@ split_point_start: // At split points actual search starts from here if ( futilityBase < beta && depth < DEPTH_ZERO && pos.see(move) <= 0) + { + bestValue = std::max(bestValue, futilityBase); continue; + } } // Detect non-capture evasions that are candidate to be pruned -- 2.39.2