mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
MaxGain based futility pruning for captures
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
committed by
Marco Costalba
parent
5b2fc1e1c0
commit
6247f27a05
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user