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
&& cmh[pos.moved_piece(move)][to_sq(move)] < VALUE_ZERO)
continue;
&& 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)
// Futility pruning: parent node
if (predictedDepth < 7 * ONE_PLY)