From 3cfaef74311e943298a9a82bce5717d272338e66 Mon Sep 17 00:00:00 2001 From: Stefan Geschwentner Date: Sun, 31 Dec 2023 18:45:48 +0100 Subject: [PATCH] Tweak static eval history update Modify the applied static eval bonus for main and pawn history with different factors for positive and negative values. Passed STC: https://tests.stockfishchess.org/tests/view/659132e179aa8af82b957bb0 LLR: 2.93 (-2.94,2.94) <0.00,2.00> Total: 12512 W: 3308 L: 3027 D: 6177 Ptnml(0-2): 32, 1372, 3189, 1609, 54 Passed LTC: https://tests.stockfishchess.org/tests/view/65913e3d79aa8af82b957cd2 LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 35946 W: 9128 L: 8809 D: 18009 Ptnml(0-2): 19, 3879, 9862, 4190, 23 closes https://github.com/official-stockfish/Stockfish/pull/4952 Bench: 1392883 --- src/search.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/search.cpp b/src/search.cpp index 1ec77bcd93b..8e48b1647ba 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -772,6 +772,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo if (is_ok((ss - 1)->currentMove) && !(ss - 1)->inCheck && !priorCapture) { int bonus = std::clamp(-13 * int((ss - 1)->staticEval + ss->staticEval), -1652, 1546); + bonus = bonus > 0 ? 2 * bonus : bonus / 2; thisThread->mainHistory[~us][from_to((ss - 1)->currentMove)] << bonus; if (type_of(pos.piece_on(prevSq)) != PAWN && type_of((ss - 1)->currentMove) != PROMOTION) thisThread->pawnHistory[pawn_structure_index(pos)][pos.piece_on(prevSq)][prevSq]