Skip to content

Commit

Permalink
Make razor margin depth independent
Browse files Browse the repository at this point in the history
STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 37171 W: 6680 L: 6587 D: 23904

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 11632 W: 1574 L: 1442 D: 8616

bench: 5098576
  • Loading branch information
tomtor authored and ceebo committed Feb 2, 2018
1 parent e8e4b64 commit 5e22f9f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ namespace {
const int skipPhase[] = { 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7 };

// 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 };
const int razor_margin = 600;
Value futility_margin(Depth d) { return Value(150 * d / ONE_PLY); }

// Futility and reductions lookup tables, initialized at startup
Expand Down Expand Up @@ -654,12 +653,12 @@ namespace {
// Step 6. Razoring (skipped when in check)
if ( !PvNode
&& depth < 4 * ONE_PLY
&& eval + razor_margin[depth / ONE_PLY] <= alpha)
&& eval + razor_margin <= alpha)
{
if (depth <= ONE_PLY)
return qsearch<NonPV, false>(pos, ss, alpha, alpha+1);

Value ralpha = alpha - razor_margin[depth / ONE_PLY];
Value ralpha = alpha - razor_margin;
Value v = qsearch<NonPV, false>(pos, ss, ralpha, ralpha+1);
if (v <= ralpha)
return v;
Expand Down

0 comments on commit 5e22f9f

Please sign in to comment.