Skip to content

Commit

Permalink
Tweak static eval history update
Browse files Browse the repository at this point in the history
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 official-stockfish#4952

Bench: 1392883
  • Loading branch information
locutus2 authored and rn5f107s2 committed Jan 14, 2024
1 parent 53c74e3 commit cb64933
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit cb64933

Please sign in to comment.