]> git.sesse.net Git - stockfish/commitdiff
Use evaluation margins also in main search
authorMarco Costalba <mcostalba@gmail.com>
Fri, 20 Aug 2010 07:49:13 +0000 (09:49 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 28 Aug 2010 11:07:15 +0000 (12:07 +0100)
For now keep FutilityMarginsMatrix[] unchanged, in
future we are going to reduce to compensate for extra
margin.

At this moment it is enough we don't have regressions.

After 9694 games on russian cluster
Mod - Orig 1608 - 1578 - 6508  ELO +1 (+- 2.8)

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

index fac0444c2f650c8e557cd739bd96c23a35f605fb..e07134c4f69bfeec31d3bf3b20565309f509f198 100644 (file)
@@ -982,7 +982,7 @@ namespace {
     Move ttMove, move, excludedMove, threatMove;
     Depth ext, newDepth;
     Value bestValue, value, oldAlpha;
     Move ttMove, move, excludedMove, threatMove;
     Depth ext, newDepth;
     Value bestValue, value, oldAlpha;
-    Value refinedValue, nullValue, futilityValueScaled; // Non-PV specific
+    Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
     bool isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
     bool mateThreat = false;
     int moveCount = 0;
     bool isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
     bool mateThreat = false;
     int moveCount = 0;
@@ -1182,6 +1182,7 @@ namespace {
     CheckInfo ci(pos);
     ss->bestMove = MOVE_NONE;
     singleEvasion = isCheck && mp.number_of_evasions() == 1;
     CheckInfo ci(pos);
     ss->bestMove = MOVE_NONE;
     singleEvasion = isCheck && mp.number_of_evasions() == 1;
+    futilityBase = ss->eval + margins[pos.side_to_move()];
     singularExtensionNode =   depth >= SingularExtensionDepth[PvNode]
                            && tte
                            && tte->move()
     singularExtensionNode =   depth >= SingularExtensionDepth[PvNode]
                            && tte
                            && tte->move()
@@ -1253,7 +1254,7 @@ namespace {
           // We illogically ignore reduction condition depth >= 3*ONE_PLY for predicted depth,
           // but fixing this made program slightly weaker.
           Depth predictedDepth = newDepth - reduction<NonPV>(depth, moveCount);
           // We illogically ignore reduction condition depth >= 3*ONE_PLY for predicted depth,
           // but fixing this made program slightly weaker.
           Depth predictedDepth = newDepth - reduction<NonPV>(depth, moveCount);
-          futilityValueScaled =  ss->eval + futility_margin(predictedDepth, moveCount)
+          futilityValueScaled =  futilityBase + futility_margin(predictedDepth, moveCount)
                                + H.gain(pos.piece_on(move_from(move)), move_to(move));
 
           if (futilityValueScaled < beta)
                                + H.gain(pos.piece_on(move_from(move)), move_to(move));
 
           if (futilityValueScaled < beta)