]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Remove unused FailHigh flag
[stockfish] / src / search.cpp
index ff791b8ea903e85649c99ee651661f26e31f38f0..d1f29b8c404c6e50c3c4df964bd126a655c39a09 100644 (file)
@@ -209,7 +209,7 @@ namespace {
   int MaxSearchTime, AbsoluteMaxSearchTime, ExtraSearchTime, ExactMaxTime;
   bool UseTimeManagement, InfiniteSearch, PonderSearch, StopOnPonderhit;
   bool AbortSearch, Quit;
-  bool FailHigh, FailLow, Problem;
+  bool FailLow, Problem;
 
   // Show current line?
   bool ShowCurrentLine;
@@ -352,7 +352,7 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
 
   // Initialize global search variables
   Idle = StopOnPonderhit = AbortSearch = Quit = false;
-  FailHigh = FailLow = Problem = false;
+  FailLow = Problem = false;
   NodesSincePoll = 0;
   SearchStartTime = get_system_time();
   ExactMaxTime = maxTime;
@@ -896,7 +896,6 @@ namespace {
             }
 
             RootMoveNumber = i + 1;
-            FailHigh = false;
 
             // Save the current node count before the move is searched
             nodes = nodes_searched();
@@ -970,14 +969,7 @@ namespace {
                         value = -search(pos, ss, -alpha, newDepth, 1, true, 0);
 
                         if (value > alpha)
-                        {
-                            // Fail high! Set the boolean variable FailHigh to true, and
-                            // re-search the move using a PV search. The variable FailHigh
-                            // is used for time managment: We try to avoid aborting the
-                            // search prematurely during a fail high research.
-                            FailHigh = true;
                             value = -search_pv(pos, ss, -beta, -alpha, newDepth, 1, 0);
-                        }
                     }
                 }
 
@@ -2771,15 +2763,8 @@ namespace {
                            && !FailLow
                            &&  t > MaxSearchTime + ExtraSearchTime;
 
-    bool noProblemFound =   !FailHigh
-                         && !FailLow
-                         && !fail_high_ply_1()
-                         && !Problem
-                         &&  t > 6 * (MaxSearchTime + ExtraSearchTime);
-
     bool noMoreTime =   t > AbsoluteMaxSearchTime
-                     || stillAtFirstMove //FIXME: We are not checking any problem flags, BUG?
-                     || noProblemFound;
+                     || stillAtFirstMove;
 
     if (   (Iteration >= 3 && UseTimeManagement && noMoreTime)
         || (ExactMaxTime && t >= ExactMaxTime)
@@ -2801,15 +2786,8 @@ namespace {
                            && !FailLow
                            &&  t > MaxSearchTime + ExtraSearchTime;
 
-    bool noProblemFound =   !FailHigh
-                         && !FailLow
-                         && !fail_high_ply_1()
-                         && !Problem
-                         &&  t > 6 * (MaxSearchTime + ExtraSearchTime);
-
     bool noMoreTime =   t > AbsoluteMaxSearchTime
-                     || stillAtFirstMove
-                     || noProblemFound;
+                     || stillAtFirstMove;
 
     if (Iteration >= 3 && UseTimeManagement && (noMoreTime || StopOnPonderhit))
         AbortSearch = true;