]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Reduce increase progression of aspiration window
[stockfish] / src / search.cpp
index 3eba90d9678b8cd843688f5e00b3648731726fc8..02fc41be309d85f3f654d19b200a635bfa55c24f 100644 (file)
@@ -373,6 +373,7 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
 
   // Initialize global search variables
   StopOnPonderhit = AbortSearch = Quit = AspirationFailLow = false;
+  MaxSearchTime = AbsoluteMaxSearchTime = ExtraSearchTime = 0;
   NodesSincePoll = 0;
   TM.resetNodeCounters();
   SearchStartTime = get_system_time();
@@ -647,8 +648,6 @@ namespace {
         // Initialize iteration
         Iteration++;
         BestMoveChangesByIteration[Iteration] = 0;
-        if (Iteration <= 5)
-            ExtraSearchTime = 0;
 
         cout << "info depth " << Iteration << endl;
 
@@ -790,15 +789,17 @@ namespace {
 
     EvalInfo ei;
     StateInfo st;
+    CheckInfo ci(pos);
     int64_t nodes;
     Move move;
     Depth depth, ext, newDepth;
     Value value, alpha, beta;
     bool isCheck, moveIsCheck, captureOrPromotion, dangerous;
-    int researchCount = 0;
+    int researchCountFH, researchCountFL;
+
+    researchCountFH = researchCountFL = 0;
     alpha = *alphaPtr;
     beta = *betaPtr;
-    CheckInfo ci(pos);
     isCheck = pos.is_check();
 
     // Step 1. Initialize node and poll (omitted at root, but I can see no good reason for this, FIXME)
@@ -930,8 +931,8 @@ namespace {
                 print_pv_info(pos, ss, alpha, beta, value);
 
                 // Prepare for a research after a fail high, each time with a wider window
-                researchCount++;
-                *betaPtr = beta = Min(beta + AspirationDelta * (1 << researchCount), VALUE_INFINITE);
+                *betaPtr = beta = Min(beta + AspirationDelta * (1 << researchCountFH), VALUE_INFINITE);
+                researchCountFH++;
 
             } // End of fail high loop
 
@@ -1016,8 +1017,8 @@ namespace {
             break;
 
         // Prepare for a research after a fail low, each time with a wider window
-        researchCount++;
-        *alphaPtr = alpha = Max(alpha - AspirationDelta * (1 << researchCount), -VALUE_INFINITE);
+        *alphaPtr = alpha = Max(alpha - AspirationDelta * (1 << researchCountFL), -VALUE_INFINITE);
+        researchCountFL++;
 
     } // Fail low loop