1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 09:13:08 +00:00

Make razor margin depth independent

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
This commit is contained in:
Tom Vijlbrief 2018-01-16 08:21:41 +01:00 committed by Marco Costalba
parent b61759e907
commit 5451687efb

View file

@ -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 }; 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 // Razoring and futility margin based on depth
// razor_margin[0] is unused as long as depth >= ONE_PLY in search const int razor_margin = 600;
const int razor_margin[] = { 0, 570, 603, 554 };
Value futility_margin(Depth d) { return Value(150 * d / ONE_PLY); } Value futility_margin(Depth d) { return Value(150 * d / ONE_PLY); }
// Futility and reductions lookup tables, initialized at startup // Futility and reductions lookup tables, initialized at startup
@ -654,12 +653,12 @@ namespace {
// Step 6. Razoring (skipped when in check) // Step 6. Razoring (skipped when in check)
if ( !PvNode if ( !PvNode
&& depth < 4 * ONE_PLY && depth < 4 * ONE_PLY
&& eval + razor_margin[depth / ONE_PLY] <= alpha) && eval + razor_margin <= alpha)
{ {
if (depth <= ONE_PLY) if (depth <= ONE_PLY)
return qsearch<NonPV, false>(pos, ss, alpha, alpha+1); 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); Value v = qsearch<NonPV, false>(pos, ss, ralpha, ralpha+1);
if (v <= ralpha) if (v <= ralpha)
return v; return v;