Skip to content

Commit 94abc2a

Browse files
tomtorsnicolet
authored andcommitted
Reintroduce depth 2 razoring (with additional margin)
The first depth 2 margin triggers the verification quiescence search. This qsearch() result has to be better then the second lower margin, so we only skip the razoring when the qsearch gives a significant improvement. Passed STC: LLR: 2.95 (-2.94,2.94) [0.00,5.00] Total: 32133 W: 7395 L: 7101 D: 17637 http://tests.stockfishchess.org/tests/view/5a93198b0ebc590297cc8942 Passed LTC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 17382 W: 3002 L: 2809 D: 11571 http://tests.stockfishchess.org/tests/view/5a93b18c0ebc590297cc89c2 This Elo-gaining version was further simplified following a suggestion of Marco Costalba: STC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 15553 W: 3505 L: 3371 D: 8677 http://tests.stockfishchess.org/tests/view/5a964be90ebc590297cc8cc4 LTC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 13253 W: 2270 L: 2137 D: 8846 http://tests.stockfishchess.org/tests/view/5a9658880ebc590297cc8cca How to continue after this patch? Reformating the razoring code (step 7 in search()) to unify the depth 1 and depth 2 treatements seems quite possible, this could possibly lead to more simplifications. Bench: 5765806
1 parent 59d1037 commit 94abc2a

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/search.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ namespace {
6666
const int SkipSize[] = { 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4 };
6767
const int SkipPhase[] = { 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7 };
6868

69-
// Razoring and futility margins
70-
const int RazorMargin = 590;
69+
// Razor and futility margins
70+
const int RazorMargin1 = 590;
71+
const int RazorMargin2 = 604;
7172
Value futility_margin(Depth d) { return Value(150 * d / ONE_PLY); }
7273

7374
// Futility and reductions lookup tables, initialized at startup
@@ -680,9 +681,20 @@ namespace {
680681

681682
// Step 7. Razoring (skipped when in check)
682683
if ( !PvNode
683-
&& depth <= ONE_PLY
684-
&& eval + RazorMargin <= alpha)
685-
return qsearch<NonPV, false>(pos, ss, alpha, alpha+1);
684+
&& depth <= ONE_PLY)
685+
{
686+
if (eval + RazorMargin1 <= alpha)
687+
return qsearch<NonPV, false>(pos, ss, alpha, alpha+1);
688+
}
689+
else if ( !PvNode
690+
&& depth <= 2 * ONE_PLY
691+
&& eval + RazorMargin2 <= alpha)
692+
{
693+
Value ralpha = alpha - RazorMargin2;
694+
Value v = qsearch<NonPV, false>(pos, ss, ralpha, ralpha+1);
695+
if (v <= ralpha)
696+
return v;
697+
}
686698

687699
// Step 8. Futility pruning: child node (skipped when in check)
688700
if ( !rootNode

0 commit comments

Comments
 (0)