]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Revert last Only move extensions tweaks
[stockfish] / src / search.cpp
index 24ae2f631227ee0c412a31e21c44a8151dd74f26..5d803949112423dfe4b3ebe1570437d945b6b1c2 100644 (file)
@@ -527,18 +527,12 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
 
 
   // LSN filtering. Used only for developing purpose. Disabled by default.
-  if (UseLSNFiltering)
+  if (   UseLSNFiltering
+      && loseOnTime)
   {
       // Step 2. If after last move we decided to lose on time, do it now!
-      if (   loseOnTime
-          && myTime < LSNTime // double check: catches some very rear false positives!
-          && myIncrement == 0
-          && movesToGo == 0)
-      {
-          while (SearchStartTime + myTime + 1000 > get_system_time())
-              ; // wait here
-      } else if (loseOnTime) // false positive, reset flag
-          loseOnTime = false;
+       while (SearchStartTime + myTime + 1000 > get_system_time())
+           ; // wait here
   }
 
   // We're ready to start thinking. Call the iterative deepening loop function
@@ -547,7 +541,8 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
   // LSN filtering. Used only for developing purpose. Disabled by default.
   if (UseLSNFiltering)
   {
-      // Step 1. If this is sudden death game and our position is hopeless, decide to lose on time.
+      // Step 1. If this is sudden death game and our position is hopeless,
+      // decide to lose on time.
       if (   !loseOnTime // If we already lost on time, go to step 3.
           && myTime < LSNTime
           && myIncrement == 0
@@ -1163,7 +1158,7 @@ namespace {
       // To verify this we do a reduced search on all the other moves but the ttMove,
       // if result is lower then TT value minus a margin then we assume ttMove is the
       // only one playable. It is a kind of relaxed single reply extension.
-      if (   depth >= 4 * OnePly
+      if (   depth >= 8 * OnePly
           && move == ttMove
           && ext < OnePly
           && is_lower_bound(tte->type())
@@ -1173,8 +1168,7 @@ namespace {
 
           if (abs(ttValue) < VALUE_KNOWN_WIN)
           {
-              Depth d = Max(Min(depth / 2,  depth - 4 * OnePly), OnePly);
-              Value excValue = search(pos, ss, ttValue - SingleReplyMargin, d, ply, false, threadID, ttMove);
+              Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, ttMove);
 
               // If search result is well below the foreseen score of the ttMove then we
               // assume ttMove is the only one realistically playable and we extend it.
@@ -1466,7 +1460,7 @@ namespace {
       // To verify this we do a reduced search on all the other moves but the ttMove,
       // if result is lower then TT value minus a margin then we assume ttMove is the
       // only one playable. It is a kind of relaxed single reply extension.
-      if (   depth >= 4 * OnePly
+      if (   depth >= 8 * OnePly
           && !excludedMove // do not allow recursive single-reply search
           && move == ttMove
           && ext < OnePly
@@ -1477,13 +1471,12 @@ namespace {
 
           if (abs(ttValue) < VALUE_KNOWN_WIN)
           {
-              Depth d = Max(Min(depth / 2,  depth - 4 * OnePly), OnePly);
-              Value excValue = search(pos, ss, ttValue - SingleReplyMargin, d, ply, false, threadID, ttMove);
+              Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, ttMove);
 
               // If search result is well below the foreseen score of the ttMove then we
               // assume ttMove is the only one realistically playable and we extend it.
               if (excValue < ttValue - SingleReplyMargin)
-                  ext = (depth >= 8 * OnePly) ? OnePly : ext + OnePly / 2;
+                  ext = OnePly;
           }
       }