X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;fp=src%2Fsearch.cpp;h=fad43b624dc86009fa8980d24981a6bb9c25c5e0;hp=bd3da5a23b1bd0662488beaa807d0e093688e146;hb=9be0360aa414556f231873ce2348f9c1f00d1713;hpb=a069a1bbbfb60abddbe3fe5276b06f35f783f41c diff --git a/src/search.cpp b/src/search.cpp index bd3da5a2..fad43b62 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1618,6 +1618,9 @@ Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) { return mated_in(ss->ply); // Plies to mate from the root } + if (abs(bestValue) < VALUE_TB_WIN_IN_MAX_PLY) + bestValue = bestValue >= beta ? (3 * bestValue + beta) / 4 : bestValue; + // Save gathered info in transposition table tte->save(posKey, value_to_tt(bestValue, ss->ply), pvHit, bestValue >= beta ? BOUND_LOWER : BOUND_UPPER, ttDepth, bestMove, ss->staticEval);