]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Revert so called "fromNull patch"
[stockfish] / src / search.cpp
index c574058df4be545a297dc83f74da0c43203c4ecb..dc82d34d312b4d3966984f685fa447ef68ede848 100644 (file)
@@ -602,11 +602,6 @@ namespace {
                  ss->staticEval, ss->evalMargin);
     }
 
-    // Handling of UCI command 'mate in x moves'. We simply return if after
-    // 'x' moves we still have not checkmated the opponent.
-    if (PvNode && !RootNode && !inCheck && Limits.mate && ss->ply > 2 * Limits.mate)
-        return eval;
-
     // Update gain for the parent non-capture move given the static position
     // evaluation before and after the move.
     if (   (move = (ss-1)->currentMove) != MOVE_NULL
@@ -1114,7 +1109,7 @@ split_point_start: // At split points actual search starts from here
     Key posKey;
     Move ttMove, move, bestMove;
     Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
-    bool givesCheck, enoughMaterial, evasionPrunable, fromNull;
+    bool givesCheck, enoughMaterial, evasionPrunable;
     Depth ttDepth;
 
     // To flag BOUND_EXACT a node with eval above alpha and no available moves
@@ -1123,7 +1118,6 @@ split_point_start: // At split points actual search starts from here
 
     ss->currentMove = bestMove = MOVE_NONE;
     ss->ply = (ss-1)->ply + 1;
-    fromNull = (ss-1)->currentMove == MOVE_NULL;
 
     // Check for an instant draw or maximum ply reached
     if (pos.is_draw<false, false>() || ss->ply > MAX_PLY)
@@ -1161,13 +1155,7 @@ split_point_start: // At split points actual search starts from here
     }
     else
     {
-        if (fromNull)
-        {
-            // Approximated score. Real one is slightly higher due to tempo
-            ss->staticEval = bestValue = -(ss-1)->staticEval;
-            ss->evalMargin = VALUE_ZERO;
-        }
-        else if (tte)
+        if (tte)
         {
             // Never assume anything on values stored in TT
             if (  (ss->staticEval = bestValue = tte->static_value()) == VALUE_NONE
@@ -1211,7 +1199,6 @@ split_point_start: // At split points actual search starts from here
       // Futility pruning
       if (   !PvNode
           && !InCheck
-          && !fromNull
           && !givesCheck
           &&  move != ttMove
           &&  enoughMaterial