From: VoyagerOne Date: Sun, 14 Feb 2016 19:45:10 +0000 (+0000) Subject: Fix futility pruning bug X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=744ed85a4dd3f478c4ce26e4257e64bf5c9abbdd Fix futility pruning bug PredictedDepth can be negative, causing the futility_margin to be negative. It will be very difficult to tweak moveCount pruning and reduction formula, as they are tuned to prevent this behavior. No functional change Resolves #587 --- diff --git a/src/search.cpp b/src/search.cpp index d61fca1b..f4c77847 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -969,7 +969,7 @@ moves_loop: // When in check search starts from here && cmh[pos.moved_piece(move)][to_sq(move)] < VALUE_ZERO) continue; - predictedDepth = newDepth - reduction(improving, depth, moveCount); + predictedDepth = std::max(newDepth - reduction(improving, depth, moveCount), DEPTH_ZERO); // Futility pruning: parent node if (predictedDepth < 7 * ONE_PLY)