]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Update pawn history based on static eval difference
[stockfish] / 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