Tweak futility margins
authorMarco Costalba <mcostalba@gmail.com>
Thu, 25 Dec 2008 11:05:45 +0000 (12:05 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 25 Dec 2008 11:05:45 +0000 (12:05 +0100)
Less prune at the bottom and at the middle, a bit more
at the top.

After 747 games: +215 =345 -187 +13 elo

Also introduced a vector of margins, now that start to be a lot
it is a more flexible solution.

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

index 54ff467c1e563314ffed6804744fb1226ee555cf..c583e7b647af3d83a3c4389c33ebc08d2c761ae2 100644 (file)
@@ -167,6 +167,8 @@ namespace {
   Value FutilityMargin0 = Value(0x80);
   Value FutilityMargin1 = Value(0x100);
   Value FutilityMargin2 = Value(0x200);
+  const Value FutilityMargins[6] = { Value(0x120), Value(0x220), Value(0x250),
+                                     Value(0x280), Value(0x320), Value(0x360) };
 
   // Razoring
   Depth RazorDepth = 4*OnePly;
@@ -1321,9 +1323,8 @@ namespace {
           {
               if (futilityValue == VALUE_NONE)
                   futilityValue =  evaluate(pos, ei, threadID)
-                                + (depth < 2 * OnePly ? FutilityMargin1 :
-                                + (depth < 6 * OnePly ? FutilityMargin2 + (depth - 2*OnePly) * 32
-                                                      : FutilityMargin2 + (depth - 2*OnePly) * 64));
+                                 + FutilityMargins[int(depth)/2 - 1]
+                                 + 32 * (depth & 1);
 
               if (futilityValue < beta)
               {