]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Prune moves with equal SEE in qsearch
[stockfish] / src / search.cpp
index d385e3eb7c4a07a8094465245e7286328d46c7af..3152260745f21b8cf2ed8af1ab5051825dc581c2 100644 (file)
@@ -209,10 +209,6 @@ namespace {
   // Minimum depth for use of singular extension
   const Depth SingularExtensionDepth[2] = { 8 * ONE_PLY /* non-PV */, 6 * ONE_PLY /* PV */};
 
-  // If the TT move is at least SingularExtensionMargin better than the
-  // remaining ones we will extend it.
-  const Value SingularExtensionMargin = Value(0x20);
-
   // Step 12. Futility pruning
 
   // Futility margin for quiescence search
@@ -1055,7 +1051,7 @@ split_point_start: // At split points actual search starts from here
 
           if (abs(ttValue) < VALUE_KNOWN_WIN)
           {
-              Value b = ttValue - SingularExtensionMargin;
+              Value b = ttValue - depth;
               ss->excludedMove = move;
               ss->skipNullMove = true;
               Value v = search<NonPV>(pos, ss, b - 1, b, depth / 2, ply);
@@ -1431,6 +1427,13 @@ split_point_start: // At split points actual search starts from here
                   bestValue = futilityValue;
               continue;
           }
+
+          // Prune moves with negative or equal SEE
+          if (   futilityBase < beta
+              && depth < DEPTH_ZERO
+              && bestValue > value_mated_in(PLY_MAX)
+              && pos.see(move) <= 0)
+              continue;
       }
 
       // Detect non-capture evasions that are candidate to be pruned