diff --git a/src/search.cpp b/src/search.cpp index 50585eb13..b9321de75 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1443,10 +1443,10 @@ moves_loop: // When in check, search starts here moveCount != 0 ? depth : std::min(MAX_PLY - 1, depth + 6), bestMove, unadjustedStaticEval, tt.generation()); - // Adjust correction history + // Adjust correction history if the best move is not a capture + // and the error direction matches whether we are above/below bounds. if (!ss->inCheck && !(bestMove && pos.capture(bestMove)) - && ((bestValue < ss->staticEval && bestValue < beta) // negative correction & no fail high - || (bestValue > ss->staticEval && bestMove))) // positive correction & no fail low + && (bestValue < ss->staticEval) == !bestMove) { auto bonus = std::clamp(int(bestValue - ss->staticEval) * depth / (8 + (bestValue > ss->staticEval)),