Skip to content

Commit 8df1720

Browse files
committed
More aggressive post-futility pruning
1 parent f84f047 commit 8df1720

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/search.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,10 @@ namespace {
643643
&& !ss->skipNullMove
644644
&& depth < 4 * ONE_PLY
645645
&& !inCheck
646-
&& eval - FutilityMargins[depth][0] >= beta
646+
&& eval - FutilityMargins[depth][(ss-1)->futMc] >= beta
647647
&& abs(beta) < VALUE_MATE_IN_MAX_PLY
648648
&& pos.non_pawn_material(pos.side_to_move()))
649-
return eval - FutilityMargins[depth][0];
649+
return eval - FutilityMargins[depth][(ss-1)->futMc];
650650

651651
// Step 8. Null move search with verification search (is omitted in PV nodes)
652652
if ( !PvNode
@@ -852,6 +852,8 @@ namespace {
852852
// Update current move (this must be done after singular extension search)
853853
newDepth = depth - ONE_PLY + ext;
854854

855+
ss->futMc = 0;
856+
855857
// Step 13. Futility pruning (is omitted in PV nodes)
856858
if ( !PvNode
857859
&& !captureOrPromotion
@@ -874,6 +876,8 @@ namespace {
874876
// Value based pruning
875877
// We illogically ignore reduction condition depth >= 3*ONE_PLY for predicted depth,
876878
// but fixing this made program slightly weaker.
879+
ss->futMc = moveCount;
880+
877881
Depth predictedDepth = newDepth - reduction<PvNode>(depth, moveCount);
878882
futilityValue = ss->staticEval + ss->evalMargin + futility_margin(predictedDepth, moveCount)
879883
+ Gain[pos.piece_moved(move)][to_sq(move)];

src/search.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct Stack {
4747
Value staticEval;
4848
Value evalMargin;
4949
int skipNullMove;
50+
int futMc;
5051
};
5152

5253

0 commit comments

Comments
 (0)