]> git.sesse.net Git - stockfish/commitdiff
Use separated research counters in root_search()
authorMarco Costalba <mcostalba@gmail.com>
Sun, 7 Mar 2010 08:02:34 +0000 (10:02 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 13 Mar 2010 10:00:12 +0000 (11:00 +0100)
One for failing highs and one for failing lows, this
should reduce average window size in case of positions
that fail first high and then low (or the contrary).

After ~2000 games on Joona's quad we have:

Mod - Orig: 1012- 975 (+6 elo)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index b8cf5b908df2ba1780321588be3d0235ec40f2f3..1eddff5813f2d5afc45f106f53dd8c1278b4b7a2 100644 (file)
@@ -789,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)
@@ -929,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);
+                researchCountFH++;
+                *betaPtr = beta = Min(beta + AspirationDelta * (1 << researchCountFH), VALUE_INFINITE);
 
             } // End of fail high loop
 
@@ -1015,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);
+        researchCountFL++;
+        *alphaPtr = alpha = Max(alpha - AspirationDelta * (1 << researchCountFL), -VALUE_INFINITE);
 
     } // Fail low loop