]> git.sesse.net Git - stockfish/commitdiff
Simplify a bit futility marging formula
authorMarco Costalba <mcostalba@gmail.com>
Wed, 21 Apr 2010 19:42:34 +0000 (20:42 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 23 Apr 2010 17:52:22 +0000 (18:52 +0100)
Should be a very minor change, but there is a small
functional change because futility_margin() is used in more
places then in the pruning formula.

After 999 games at 1+0
Mod vs Orig +167 =678 -154  +5 ELO

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

index 5cca911bdaf266ee3affa144368912c4af622064..b2b2414ae68eb47f6d2de2101e5bcc198d7f9aa7 100644 (file)
@@ -560,7 +560,7 @@ void init_search() {
       for (int j = 0; j < 64; j++) // j == moveNumber
       {
           // FIXME: test using log instead of BSR
-          FutilityMarginsMatrix[i][j] = (i < 2 ? 0 : 112 * bitScanReverse32(i * i / 2)) - 8 * j;
+          FutilityMarginsMatrix[i][j] = (i < 2 ? 0 : 112 * bitScanReverse32(i * i / 2)) - 8 * j + 45;
       }
 
   // Init futility move count array
@@ -1480,7 +1480,7 @@ namespace {
           // Value based pruning
           Depth predictedDepth = newDepth - nonpv_reduction(depth, moveCount); // We illogically ignore reduction condition depth >= 3*OnePly
           futilityValueScaled =  ss[ply].eval + futility_margin(predictedDepth, moveCount)
-                               + H.gain(pos.piece_on(move_from(move)), move_to(move)) + 45;
+                               + H.gain(pos.piece_on(move_from(move)), move_to(move));
 
           if (futilityValueScaled < beta)
           {
@@ -1838,7 +1838,7 @@ namespace {
           // Value based pruning
           Depth predictedDepth = newDepth - nonpv_reduction(sp->depth, moveCount);
           futilityValueScaled =  ss[sp->ply].eval + futility_margin(predictedDepth, moveCount)
-                                     + H.gain(pos.piece_on(move_from(move)), move_to(move)) + 45;
+                               + H.gain(pos.piece_on(move_from(move)), move_to(move));
 
           if (futilityValueScaled < sp->beta)
           {