Skip to content

Commit 65c3bb8

Browse files
Jerry Donald Watsonsnicolet
authored andcommitted
Use evaluation trend to adjust futility margin
Adjust futility margin in the child node based on whether the static evaluation is improving. STC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 15271 W: 3157 L: 2958 D: 9156 http://tests.stockfishchess.org/tests/view/5a9f2f8c0ebc590297cb6216 LTC: LLR: 2.97 (-2.94,2.94) [0.00,5.00] Total: 6617 W: 1053 L: 908 D: 4656 http://tests.stockfishchess.org/tests/view/5a9f98390ebc590297cb6241 Ideas for future work: - Tune the new margins. - Try to get this idea to work for futility pruning in parent nodes as well. Bench: 5779242
1 parent 6d8f583 commit 65c3bb8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/search.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ namespace {
6969
// Razor and futility margins
7070
const int RazorMargin1 = 590;
7171
const int RazorMargin2 = 604;
72-
Value futility_margin(Depth d) { return Value(150 * d / ONE_PLY); }
72+
Value futility_margin(Depth d, bool improving) {
73+
return Value((175 - 50 * improving) * d / ONE_PLY);
74+
}
7375

7476
// Futility and reductions lookup tables, initialized at startup
7577
int FutilityMoveCounts[2][16]; // [improving][depth]
@@ -678,6 +680,10 @@ namespace {
678680
ss->staticEval, TT.generation());
679681
}
680682

683+
improving = ss->staticEval >= (ss-2)->staticEval
684+
/* || ss->staticEval == VALUE_NONE Already implicit in the previous condition */
685+
||(ss-2)->staticEval == VALUE_NONE;
686+
681687
if (skipEarlyPruning || !pos.non_pawn_material(pos.side_to_move()))
682688
goto moves_loop;
683689

@@ -702,7 +708,7 @@ namespace {
702708
// Step 8. Futility pruning: child node (skipped when in check)
703709
if ( !rootNode
704710
&& depth < 7 * ONE_PLY
705-
&& eval - futility_margin(depth) >= beta
711+
&& eval - futility_margin(depth, improving) >= beta
706712
&& eval < VALUE_KNOWN_WIN) // Do not return unproven wins
707713
return eval;
708714

0 commit comments

Comments
 (0)