From d49b3738bc89353a9318d54af400f02c91d2d69a Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Sun, 24 Mar 2024 14:02:27 +0300 Subject: [PATCH] Tweak the stats bonus and malus For depth 1 we don't have a negative score anymore. Passed STC: https://tests.stockfishchess.org/tests/view/65fb055c0ec64f0526c5024f LLR: 2.95 (-2.94,2.94) <0.00,2.00> Total: 117120 W: 30468 L: 30023 D: 56629 Ptnml(0-2): 526, 13759, 29539, 14216, 520 Passed LTC: https://tests.stockfishchess.org/tests/view/65fdca4b0ec64f0526c5293f LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 54816 W: 13955 L: 13595 D: 27266 Ptnml(0-2): 30, 6046, 14897, 6404, 31 closes https://github.com/official-stockfish/Stockfish/pull/5134 Bench: 1876428 --- src/search.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index f0e7f847f24..e1508a7f06d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -74,10 +74,10 @@ Value to_corrected_static_eval(Value v, const Worker& w, const Position& pos) { } // History and stats update bonus, based on depth -int stat_bonus(Depth d) { return std::min(223 * d - 332, 1258); } +int stat_bonus(Depth d) { return std::clamp(245 * d - 320, 0, 1296); } // History and stats update malus, based on depth -int stat_malus(Depth d) { return std::min(536 * d - 299, 1353); } +int stat_malus(Depth d) { return (d < 4 ? 554 * d - 303 : 1203); } // Add a small random component to draw evaluations to avoid 3-fold blindness Value value_draw(size_t nodes) { return VALUE_DRAW - 1 + Value(nodes & 0x2); } @@ -1709,7 +1709,7 @@ void update_all_stats(const Position& pos, if (!pos.capture_stage(bestMove)) { - int bestMoveBonus = bestValue > beta + 173 ? quietMoveBonus // larger bonus + int bestMoveBonus = bestValue > beta + 168 ? quietMoveBonus // larger bonus : stat_bonus(depth); // smaller bonus // Increase stats for the best move in case it was a quiet move