X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=e07134c4f69bfeec31d3bf3b20565309f509f198;hp=fac0444c2f650c8e557cd739bd96c23a35f605fb;hb=b177e6dd91a176ca3b49c0a35a21d1cad8d17dfa;hpb=d9dc9dbd65263f8644afcc1fc632e9201ad20c70 diff --git a/src/search.cpp b/src/search.cpp index fac0444c..e07134c4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -982,7 +982,7 @@ namespace { 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; @@ -1182,6 +1182,7 @@ namespace { 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() @@ -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(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)