]> git.sesse.net Git - stockfish/commitdiff
Update pawn history based on static eval difference
authorMichael Chaly <Vizvezdenec@gmail.com>
Fri, 3 Nov 2023 11:03:12 +0000 (14:03 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Fri, 3 Nov 2023 21:50:05 +0000 (22:50 +0100)
Use the same logic as in main history but with 1/4 multiplier.

Passed STC:
https://tests.stockfishchess.org/tests/view/653c1282cc309ae8395615bf
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 306624 W: 77811 L: 77094 D: 151719
Ptnml(0-2): 975, 36411, 77830, 37114, 982

Passed LTC:
https://tests.stockfishchess.org/tests/view/654258e2cc309ae83956818d
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 99150 W: 24681 L: 24228 D: 50241
Ptnml(0-2): 56, 11107, 26792, 11568, 52

closes https://github.com/official-stockfish/Stockfish/pull/4859

bench 1330590

src/search.cpp

index aaf545d26580c0d42f852242677bb34483d13cc9..55d11003354b8da3e50c6c19648bc20bb86d721b 100644 (file)
@@ -745,6 +745,8 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
     {
         int bonus = std::clamp(-18 * int((ss - 1)->staticEval + ss->staticEval), -1812, 1812);
         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(pos)][pos.piece_on(prevSq)][prevSq] << bonus / 4;
     }
 
     // Set up the improving flag, which is true if current static evaluation is