X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=bd482eaeb769d1a63f6e55c17903e29c797c38bb;hp=fa483fbcd839682d761951c586c1c966c1dcc48b;hb=c254861ee6317dd5824cc1bc4800cb81bd906e19;hpb=9ab0e1bb13b8f4768dfe3a728c68a710a07fca2f diff --git a/src/search.cpp b/src/search.cpp index fa483fbc..bd482eae 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1434,12 +1434,11 @@ namespace { assert(tte->static_value() != VALUE_NONE); evalMargin = tte->static_value_margin(); - bestValue = tte->static_value(); + ss->eval = bestValue = tte->static_value(); } else - bestValue = evaluate(pos, evalMargin); + ss->eval = bestValue = evaluate(pos, evalMargin); - ss->eval = bestValue; update_gains(pos, (ss-1)->currentMove, (ss-1)->eval, ss->eval); // Stand pat. Return immediately if static value is at least beta @@ -1458,7 +1457,7 @@ namespace { deepChecks = (depth == -ONE_PLY && bestValue >= beta - PawnValueMidgame / 8); // Futility pruning parameters, not needed when in check - futilityBase = bestValue + FutilityMarginQS + evalMargin; + futilityBase = ss->eval + evalMargin + FutilityMarginQS; enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMidgame; } @@ -1498,11 +1497,10 @@ namespace { } } - // Detect blocking evasions that are candidate to be pruned + // Detect non-capture evasions that are candidate to be pruned evasionPrunable = isCheck && bestValue > value_mated_in(PLY_MAX) && !pos.move_is_capture(move) - && pos.type_of_piece_on(move_from(move)) != KING && !pos.can_castle(pos.side_to_move()); // Don't search moves with negative SEE values @@ -1545,11 +1543,6 @@ namespace { ValueType vt = (bestValue <= oldAlpha ? VALUE_TYPE_UPPER : bestValue >= beta ? VALUE_TYPE_LOWER : VALUE_TYPE_EXACT); TT.store(pos.get_key(), value_to_tt(bestValue, ply), vt, d, ss->bestMove, ss->eval, evalMargin); - // Update killers only for checking moves that fails high - if ( bestValue >= beta - && !pos.move_is_capture_or_promotion(ss->bestMove)) - update_killers(ss->bestMove, ss); - assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE); return bestValue;