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

MaxGain based futility pruning for captures

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Joona Kiiski 2010-01-21 22:45:38 +02:00 committed by Marco Costalba
parent 5b2fc1e1c0
commit 6247f27a05

View file

@ -1556,6 +1556,28 @@ namespace {
// Update current move
movesSearched[moveCount++] = ss[ply].currentMove = move;
// Futility pruning for captures
Color them = opposite_color(pos.side_to_move());
if ( useFutilityPruning
&& !dangerous
&& pos.move_is_capture(move)
&& !pos.move_is_check(move, ci)
&& !move_is_promotion(move)
&& move != ttMove
&& !move_is_ep(move)
&& (pos.type_of_piece_on(move_to(move)) != PAWN || !pos.pawn_is_passed(them, move_to(move)))) // Do not prune passed pawn captures
{
int preFutilityValueMargin = 0;
if (newDepth >= OnePly)
preFutilityValueMargin = 112 * bitScanReverse32(int(newDepth) * int(newDepth) / 2);
if (ss[ply].eval + pos.endgame_value_of_piece_on(move_to(move)) + preFutilityValueMargin + ei.futilityMargin + 90 < beta)
continue;
}
// Futility pruning
if ( useFutilityPruning
&& !dangerous