]> git.sesse.net Git - stockfish/commitdiff
Simplification: do razoring only for depth 1
authorDU-jdto <SNP_Tiranasta@hotmail.com>
Sat, 24 Feb 2018 12:06:18 +0000 (13:06 +0100)
committerStéphane Nicolet <cassio@free.fr>
Sat, 24 Feb 2018 12:12:04 +0000 (13:12 +0100)
The razoring heuristic is quite a drastic pruning technique,
using a depth 0 search at internal nodes of the search tree
to estimate the true value of depth n nodes. This patch limits
this razoring to the case of internal nodes of depth 1.
Author: Jarrod Torriero (DU-jdto)

STC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 8043 W: 1865 L: 1716 D: 4462
http://tests.stockfishchess.org/tests/view/5a90a9290ebc590297cc86c1

LTC:
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 32890 W: 5577 L: 5476 D: 21837
http://tests.stockfishchess.org/tests/view/5a90c8510ebc590297cc86d5

Opportunities opened by this patch: it would be interesting to
know if it brings Elo to re-introduce razoring or soft razoring
at depth >= 2, maybe using a larger margin to compensate for the
increased pruning effect.

Bench: 5227124

src/search.cpp

index 57bd381165c3d8e5bff9cae6dacf7e9c516ffce9..23608f7a379570ff72d27a42816ead695e82e7f5 100644 (file)
@@ -667,17 +667,9 @@ namespace {
 
     // Step 7. Razoring (skipped when in check)
     if (   !PvNode
 
     // Step 7. Razoring (skipped when in check)
     if (   !PvNode
-        &&  depth < 3 * ONE_PLY
+        &&  depth <= ONE_PLY
         &&  eval + RazorMargin <= alpha)
         &&  eval + RazorMargin <= alpha)
-    {
-        if (depth <= ONE_PLY)
-            return qsearch<NonPV, false>(pos, ss, alpha, alpha+1);
-
-        Value ralpha = alpha - RazorMargin;
-        Value v = qsearch<NonPV, false>(pos, ss, ralpha, ralpha+1);
-        if (v <= ralpha)
-            return v;
-    }
+        return qsearch<NonPV, false>(pos, ss, alpha, alpha+1);
 
     // Step 8. Futility pruning: child node (skipped when in check)
     if (   !rootNode
 
     // Step 8. Futility pruning: child node (skipped when in check)
     if (   !rootNode