From eac2d080a3279358a79e35bfcecf016d01db97e4 Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Sun, 7 Jul 2024 22:25:10 +0300 Subject: [PATCH] Further simplify stat bonuses Based on recent simplification by linrock Since it completely removed any special bonuses based on values difference and made it flat stat_bonus(depth + 1) I got an idea that we might as well remove all (depth + 1) bonuses and make them usual depth bonuses. Also removes weird negative bonus for depth 1 as a side effect. Passed STC: https://tests.stockfishchess.org/tests/view/6689d817eca84f4d25863746 LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 18080 W: 4789 L: 4552 D: 8739 Ptnml(0-2): 46, 1987, 4727, 2244, 36 Passed LTC: https://tests.stockfishchess.org/tests/view/6689daa4eca84f4d258639d7 LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 109062 W: 27548 L: 27417 D: 54097 Ptnml(0-2): 58, 11983, 30293, 12164, 33 Passed direct LTC vs linrock patch: https://tests.stockfishchess.org/tests/view/668a46f8eca84f4d25866fe9 LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 100002 W: 25351 L: 25209 D: 49442 Ptnml(0-2): 54, 11119, 27529, 11229, 70 closes https://github.com/official-stockfish/Stockfish/pull/5461 Bench 1175744 --- src/search.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index d22761e3..ac0e59b5 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -86,7 +86,7 @@ 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::clamp(190 * d - 298, 20, 1596); } +int stat_bonus(Depth d) { return std::min(190 * d - 108, 1596); } // History and stats update malus, based on depth int stat_malus(Depth d) { return (d < 4 ? 736 * d - 268 : 2044); } @@ -1782,7 +1782,7 @@ void update_all_stats(const Position& pos, Piece moved_piece = pos.moved_piece(bestMove); PieceType captured; - int quietMoveBonus = stat_bonus(depth + 1); + int quietMoveBonus = stat_bonus(depth); int quietMoveMalus = stat_malus(depth); if (!pos.capture_stage(bestMove))