Skip to content

Commit

Permalink
Tighter futility margins, based on tuning
Browse files Browse the repository at this point in the history
Bench: 5530025
  • Loading branch information
SapphireBrand committed Jun 17, 2017
1 parent 2c237da commit 3e81c40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/search.cpp
Expand Up @@ -70,7 +70,11 @@ namespace {
// Razoring and futility margin based on depth
// razor_margin[0] is unused as long as depth >= ONE_PLY in search
const int razor_margin[] = { 0, 570, 603, 554 };
Value futility_margin(Depth d) { return Value(150 * d / ONE_PLY); }

const int FutilityConstant = -40;
const int FutilityMaterialSlope = -27;
const int FutilityDepthSlope = 102;
inline Value futility_margin(Depth d, Value nonPawnMaterial) { return Value(FutilityDepthSlope * d / ONE_PLY + (FutilityMaterialSlope * (int)nonPawnMaterial) / 327680 + FutilityConstant); }

// Futility and reductions lookup tables, initialized at startup
int FutilityMoveCounts[2][16]; // [improving][depth]
Expand Down Expand Up @@ -733,7 +737,7 @@ namespace {
// Step 7. Futility pruning: child node (skipped when in check)
if ( !rootNode
&& depth < 7 * ONE_PLY
&& eval - futility_margin(depth) >= beta
&& eval - futility_margin(depth, pos.non_pawn_material()) >= beta
&& eval < VALUE_KNOWN_WIN // Do not return unproven wins
&& pos.non_pawn_material(pos.side_to_move()))
return eval;
Expand Down

0 comments on commit 3e81c40

Please sign in to comment.