]> git.sesse.net Git - stockfish/commitdiff
Streamline null search reduction formula
authorMarco Costalba <mcostalba@gmail.com>
Thu, 5 Jul 2012 10:48:17 +0000 (11:48 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 5 Jul 2012 10:48:17 +0000 (11:48 +0100)
Although a (little) functional change, we have no ELO change
but formula it is now more clear.

After 13019 games at 30"+0.05
Mod vs Orig 2075 - 2088 - 8856 ELO 0 (+- 3.4)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 9c1d0b5eca66e1e928accfaec998d3f3d426d2d1..72ab9a1228d36bc58deb8d40e0c92c45fb896f87 100644 (file)
@@ -708,16 +708,16 @@ namespace {
         ss->currentMove = MOVE_NULL;
 
         // Null move dynamic reduction based on depth
-        int R = 3 + (depth >= 5 * ONE_PLY ? depth / 8 : 0);
+        Depth R = 3 * ONE_PLY + depth / 4;
 
         // Null move dynamic reduction based on value
         if (refinedValue - PawnValueMidgame > beta)
-            R++;
+            R += ONE_PLY;
 
         pos.do_null_move<true>(st);
         (ss+1)->skipNullMove = true;
-        nullValue = depth-R*ONE_PLY < ONE_PLY ? -qsearch<NonPV>(pos, ss+1, -beta, -alpha, DEPTH_ZERO)
-                                              : - search<NonPV>(pos, ss+1, -beta, -alpha, depth-R*ONE_PLY);
+        nullValue = depth-R < ONE_PLY ? -qsearch<NonPV>(pos, ss+1, -beta, -alpha, DEPTH_ZERO)
+                                      : - search<NonPV>(pos, ss+1, -beta, -alpha, depth-R);
         (ss+1)->skipNullMove = false;
         pos.do_null_move<false>(st);
 
@@ -732,7 +732,7 @@ namespace {
 
             // Do verification search at high depths
             ss->skipNullMove = true;
-            Value v = search<NonPV>(pos, ss, alpha, beta, depth-R*ONE_PLY);
+            Value v = search<NonPV>(pos, ss, alpha, beta, depth-R);
             ss->skipNullMove = false;
 
             if (v >= beta)