]> git.sesse.net Git - stockfish/commitdiff
Do less depth reduction in null move pruning for complex positions
authorMichael Chaly <Vizvezdenec@gmail.com>
Mon, 7 Feb 2022 10:32:21 +0000 (13:32 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 7 Feb 2022 16:30:35 +0000 (17:30 +0100)
This patch makes us reduce less depth in null move pruning if complexity is high enough.
Thus, null move pruning now depends in two distinct ways on complexity,
while being the only search heuristic that exploits complexity so far.

passed STC
https://tests.stockfishchess.org/tests/view/61fde60fd508ec6a1c9f7754
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 170000 W: 45555 L: 45027 D: 79418
Ptnml(0-2): 760, 19352, 44359, 19658, 871

passed LTC
https://tests.stockfishchess.org/tests/view/61fe91febf46cb834cbd5c90
LLR: 2.96 (-2.94,2.94) <0.50,3.00>
Total: 145272 W: 39182 L: 38651 D: 67439
Ptnml(0-2): 127, 14864, 42157, 15327, 161

closes https://github.com/official-stockfish/Stockfish/pull/3923

bench 4461945

src/search.cpp

index 6ca3b56ec924c5d825a5032bce201c0fd8bb0a66..426f7937220936592a530fe88ca030ce55ad1cec 100644 (file)
@@ -776,7 +776,9 @@ namespace {
     // Step 7. Razoring.
     // If eval is really low check with qsearch if it can exceed alpha, if it can't,
     // return a fail low.
-    if (!PvNode && depth <= 6 && eval < alpha - 400 - 300 * depth * depth)
+    if (   !PvNode
+        && depth <= 6
+        && eval < alpha - 400 - 300 * depth * depth)
     {
         value = qsearch<NonPV>(pos, ss, alpha - 1, alpha);
         if (value < alpha)
@@ -805,8 +807,8 @@ namespace {
     {
         assert(eval - beta >= 0);
 
-        // Null move dynamic reduction based on depth and value
-        Depth R = std::min(int(eval - beta) / 205, 3) + depth / 3 + 4;
+        // Null move dynamic reduction based on depth, eval and complexity of position
+        Depth R = std::min(int(eval - beta) / 205, 3) + depth / 3 + 4 - (complexity > 500);
 
         ss->currentMove = MOVE_NULL;
         ss->continuationHistory = &thisThread->continuationHistory[0][0][NO_PIECE][0];