]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Set IncrementalFutilityMargin to 8
[stockfish] / src / search.cpp
index 4b93a210b59ed218c3d7081653e736801eb6f391..96a945e666ed66b8d54acca97791cd37f1d665c5 100644 (file)
@@ -173,14 +173,14 @@ namespace {
 
   // If the TT move is at least SingleReplyMargin better then the
   // remaining ones we will extend it.
-  const Value SingleReplyMargin = Value(0x64);
+  const Value SingleReplyMargin = Value(0x20);
 
   // Margins for futility pruning in the quiescence search, and at frontier
   // and near frontier nodes.
   const Value FutilityMarginQS = Value(0x80);
 
   // Each move futility margin is decreased
-  const Value IncrementalFutilityMargin = Value(0x4);
+  const Value IncrementalFutilityMargin = Value(0x8);
 
   // Razoring
   const Depth RazorDepth = 4*OnePly;
@@ -402,13 +402,13 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
   Problem = false;
   ExactMaxTime = maxTime;
 
+  if (button_was_pressed("New Game"))
+      loseOnTime = false; // reset at the beginning of a new game
+
   // Read UCI option values
   TT.set_size(get_option_value_int("Hash"));
   if (button_was_pressed("Clear Hash"))
-  {
       TT.clear();
-      loseOnTime = false; // reset at the beginning of a new game
-  }
 
   bool PonderingEnabled = get_option_value_bool("Ponder");
   MultiPV = get_option_value_int("MultiPV");
@@ -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;
           }
       }
 
@@ -2526,8 +2523,8 @@ namespace {
     Value v = value_from_tt(tte->value(), ply);
 
     return   (   tte->depth() >= depth
-              || v >= Max(value_mate_in(100), beta)
-              || v < Min(value_mated_in(100), beta))
+              || v >= Max(value_mate_in(PLY_MAX), beta)
+              || v < Min(value_mated_in(PLY_MAX), beta))
 
           && (   (is_lower_bound(tte->type()) && v >= beta)
               || (is_upper_bound(tte->type()) && v < beta));