]> git.sesse.net Git - stockfish/commitdiff
History pruning exponential limit
authorMarco Costalba <mcostalba@gmail.com>
Sat, 14 Nov 2009 16:38:22 +0000 (17:38 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 23 Nov 2009 19:59:21 +0000 (20:59 +0100)
Use an exponenital law instead of a linear one for
history pruning.

This should prune more at low depths and a bit less
at high depths.

After 965 games

Mod vs Orig +233 =504 -228 +2 ELO

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

index b420fb905203770005d92c9725b27ae99c4b938f..b5f37cb8a66b0678d4099de5bc11bbffe0425c60 100644 (file)
@@ -1388,6 +1388,9 @@ namespace {
     if (tte && (tte->type() & VALUE_TYPE_EVAL))
         futilityValue = value_from_tt(tte->value(), ply) + FutilityMargins[int(depth) - 2];
 
+    // Move count pruning limit
+    const int MCLimit = 3 + (1 << (3*int(depth)/8));
+
     // Loop through all legal moves until no moves remain or a beta cutoff
     // occurs.
     while (   bestValue < beta
@@ -1412,8 +1415,23 @@ namespace {
           && !captureOrPromotion
           &&  move != ttMove)
       {
+          //std::cout << std::endl;
+          //for (int d = 2; d <= 14; d+=2)
+          //    std::cout << d / 2 << ", " << 3+(1 << (3*d/8)) << std::endl;
+          //std::cout << std::endl;
+/*
+            3 + (1 << (3*int(depth)/8))
+
+            1 * onePly - > moveCount >= 4
+            2 * onePly - > moveCount >= 5
+            3 * onePly - > moveCount >= 7
+            4 * onePly - > moveCount >= 11
+            5 * onePly - > moveCount >= 11
+            6 * onePly - > moveCount >= 19
+            7 * onePly - > moveCount >= 35
+*/
           // History pruning. See ok_to_prune() definition
-          if (   moveCount >= 2 + int(depth)
+          if (   moveCount >= MCLimit
               && ok_to_prune(pos, move, ss[ply].threatMove, depth)
               && bestValue > value_mated_in(PLY_MAX))
               continue;