diff --git a/src/search.cpp b/src/search.cpp index d2a90283c..9924b0cec 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -141,6 +141,16 @@ void update_all_stats(const Position& pos, Move TTMove, int moveCount); +bool isShuffling(Move move, Stack* const ss, const Position& pos) { + if (type_of(pos.moved_piece(move)) == PAWN || pos.capture_stage(move) + || pos.rule50_count() < 10) + return false; + if (pos.state()->pliesFromNull <= 6 || ss->ply < 20) + return false; + return move.from_sq() == (ss - 2)->currentMove.to_sq() + && (ss - 2)->currentMove.from_sq() == (ss - 4)->currentMove.to_sq(); +} + } // namespace Search::Worker::Worker(SharedState& sharedState, @@ -1114,7 +1124,7 @@ moves_loop: // When in check, search starts here // and lower extension margins scale well. if (!rootNode && move == ttData.move && !excludedMove && depth >= 6 + ss->ttPv && is_valid(ttData.value) && !is_decisive(ttData.value) && (ttData.bound & BOUND_LOWER) - && ttData.depth >= depth - 3) + && ttData.depth >= depth - 3 && !isShuffling(move, ss, pos)) { Value singularBeta = ttData.value - (53 + 75 * (ss->ttPv && !PvNode)) * depth / 60; Depth singularDepth = newDepth / 2;