Try to prune also when approximateEval < beta
authorMarco Costalba <mcostalba@gmail.com>
Tue, 1 Dec 2009 10:48:28 +0000 (11:48 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 1 Dec 2009 10:49:33 +0000 (11:49 +0100)
Now we always try to filter out moves, we will have
more wasted evaluation calls, but also more pruned
nodes.

After 786 games

Mod vs Orig +196 =413 -177 +8 ELO

Verified also against Rybka it increases score to 50-51%

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

index 4b93a210b59ed218c3d7081653e736801eb6f391..5bbc0abd2d58514870af54133786b3595dcdc563 100644 (file)
@@ -1517,19 +1517,16 @@ namespace {
               continue;
 
           // Value based pruning
-          if (approximateEval < beta)
-          {
-              if (futilityValue == VALUE_NONE)
-                  futilityValue = evaluate(pos, ei, threadID) + FutilityValueMargin;
+          if (futilityValue == VALUE_NONE)
+              futilityValue = evaluate(pos, ei, threadID) + FutilityValueMargin;
 
-              futilityValueScaled = futilityValue - moveCount * IncrementalFutilityMargin;
+          futilityValueScaled = futilityValue - moveCount * IncrementalFutilityMargin;
 
-              if (futilityValueScaled < beta)
-              {
-                  if (futilityValueScaled > bestValue)
-                      bestValue = futilityValueScaled;
-                  continue;
-              }
+          if (futilityValueScaled < beta)
+          {
+              if (futilityValueScaled > bestValue)
+                  bestValue = futilityValueScaled;
+              continue;
           }
       }