From 4fcfb0b4b7406004cd8adcf7de0b4acabe63c6c1 Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Sun, 27 Jul 2025 19:08:07 +0300 Subject: [PATCH] Tweak the logic for setting the improving flag Tweak the logic for setting the improving flag when the static evaluation is significantly higher than alpha. Passed STC: LLR: 2.93 (-2.94,2.94) <0.00,2.00> Total: 92320 W: 24057 L: 23664 D: 44599 Ptnml(0-2): 247, 10689, 23893, 11086, 245 https://tests.stockfishchess.org/tests/view/68860aba966ed85face248a1 Passed LTC: LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 281292 W: 72496 L: 71683 D: 137113 Ptnml(0-2): 135, 30289, 78995, 31082, 145 https://tests.stockfishchess.org/tests/view/6886168c966ed85face24962 closes https://github.com/official-stockfish/Stockfish/pull/6180 Bench: 3200439 --- src/search.cpp | 11 ++++++----- src/search.h | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 27a4bea67..9855d12e1 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -520,14 +520,15 @@ void Search::Worker::do_move(Position& pos, const Move move, StateInfo& st, Stac do_move(pos, move, st, pos.gives_check(move), ss); } -void Search::Worker::do_move(Position& pos, const Move move, StateInfo& st, const bool givesCheck, Stack* const ss) { - bool capture = pos.capture_stage(move); - DirtyPiece dp = pos.do_move(move, st, givesCheck, &tt); +void Search::Worker::do_move( + Position& pos, const Move move, StateInfo& st, const bool givesCheck, Stack* const ss) { + bool capture = pos.capture_stage(move); + DirtyPiece dp = pos.do_move(move, st, givesCheck, &tt); nodes.fetch_add(1, std::memory_order_relaxed); accumulatorStack.push(dp); if (ss != nullptr) { - ss->currentMove = move; + ss->currentMove = move; ss->continuationHistory = &continuationHistory[ss->inCheck][capture][dp.pc][move.to_sq()]; ss->continuationCorrectionHistory = &continuationCorrectionHistory[dp.pc][move.to_sq()]; } @@ -893,7 +894,7 @@ Value Search::Worker::search( } } - improving |= ss->staticEval >= beta + 87; + improving |= ss->staticEval >= beta + 94 * !PvNode; // Step 10. Internal iterative reductions // At sufficient depth, reduce depth for PV/Cut nodes without a TTMove. diff --git a/src/search.h b/src/search.h index a43649e94..07fc74317 100644 --- a/src/search.h +++ b/src/search.h @@ -298,7 +298,8 @@ class Worker { void iterative_deepening(); void do_move(Position& pos, const Move move, StateInfo& st, Stack* const ss); - void do_move(Position& pos, const Move move, StateInfo& st, const bool givesCheck, Stack* const ss); + void + do_move(Position& pos, const Move move, StateInfo& st, const bool givesCheck, Stack* const ss); void do_null_move(Position& pos, StateInfo& st); void undo_move(Position& pos, const Move move); void undo_null_move(Position& pos);