1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

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
This commit is contained in:
VoyagerOne 2016-02-14 19:45:10 +00:00 committed by Joona Kiiski
parent 56dd58e6f9
commit 744ed85a4d

View file

@ -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<PvNode>(improving, depth, moveCount);
predictedDepth = std::max(newDepth - reduction<PvNode>(improving, depth, moveCount), DEPTH_ZERO);
// Futility pruning: parent node
if (predictedDepth < 7 * ONE_PLY)