]> git.sesse.net Git - stockfish/commitdiff
Simplify aspirationDelta update rule
authorMarco Costalba <mcostalba@gmail.com>
Tue, 1 Mar 2011 12:15:13 +0000 (13:15 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 2 Mar 2011 21:01:30 +0000 (22:01 +0100)
After 7522 games:
Mod vs Orig 1229 - 1148 - 5145  ELO +3 (+- 4.5) LOS 83%

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

index 3f367d83bd0218fed704ad6d720d3c0eb2c9a2a9..d94128eb41c944bd34ec5d92432aad714e5efce5 100644 (file)
@@ -596,7 +596,7 @@ namespace {
     SearchStack ss[PLY_MAX_PLUS_2];
     Value bestValues[PLY_MAX_PLUS_2];
     int bestMoveChanges[PLY_MAX_PLUS_2];
     SearchStack ss[PLY_MAX_PLUS_2];
     Value bestValues[PLY_MAX_PLUS_2];
     int bestMoveChanges[PLY_MAX_PLUS_2];
-    int depth, researchCountFL, researchCountFH, aspirationDelta;
+    int depth, aspirationDelta;
     Value value, alpha, beta;
     Move bestMove, easyMove;
 
     Value value, alpha, beta;
     Move bestMove, easyMove;
 
@@ -625,7 +625,7 @@ namespace {
     // Iterative deepening loop
     while (++depth <= PLY_MAX && (!MaxDepth || depth <= MaxDepth) && !StopRequest)
     {
     // Iterative deepening loop
     while (++depth <= PLY_MAX && (!MaxDepth || depth <= MaxDepth) && !StopRequest)
     {
-        Rml.bestMoveChanges = researchCountFL = researchCountFH = 0;
+        Rml.bestMoveChanges = 0;
         cout << "info depth " << depth << endl;
 
         // Calculate dynamic aspiration window based on previous iterations
         cout << "info depth " << depth << endl;
 
         // Calculate dynamic aspiration window based on previous iterations
@@ -666,16 +666,16 @@ namespace {
             // otherwise exit the fail high/low loop.
             if (value >= beta)
             {
             // otherwise exit the fail high/low loop.
             if (value >= beta)
             {
-                beta = Min(beta + aspirationDelta * (1 << researchCountFH), VALUE_INFINITE);
-                researchCountFH++;
+                beta = Min(beta + aspirationDelta, VALUE_INFINITE);
+                aspirationDelta += aspirationDelta / 2;
             }
             else if (value <= alpha)
             {
                 AspirationFailLow = true;
                 StopOnPonderhit = false;
 
             }
             else if (value <= alpha)
             {
                 AspirationFailLow = true;
                 StopOnPonderhit = false;
 
-                alpha = Max(alpha - aspirationDelta * (1 << researchCountFL), -VALUE_INFINITE);
-                researchCountFL++;
+                alpha = Max(alpha - aspirationDelta, -VALUE_INFINITE);
+                aspirationDelta += aspirationDelta / 2;
             }
             else
                 break;
             }
             else
                 break;