Skip to content

Commit

Permalink
Update 7 stat bonus/malus params
Browse files Browse the repository at this point in the history
Values found around 119k / 120k spsa games at 60+0.6:
https://tests.stockfishchess.org/tests/view/6683112a192114e61f92f87a

Passed STC:
https://tests.stockfishchess.org/tests/view/66838148c4f539faa0326897
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 40928 W: 10835 L: 10508 D: 19585
Ptnml(0-2): 139, 4802, 10254, 5131, 138

Passed LTC:
https://tests.stockfishchess.org/tests/view/668448a87a1863935cee42c6
LLR: 2.96 (-2.94,2.94) <0.50,2.50>
Total: 29208 W: 7559 L: 7253 D: 14396
Ptnml(0-2): 17, 3118, 8019, 3442, 8

closes official-stockfish#5439

bench 1138753
  • Loading branch information
linrock authored and vondele committed Jul 5, 2024
1 parent 6eb871a commit 29dbde7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ 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(186 * d - 285, 20, 1524); }
int stat_bonus(Depth d) { return std::clamp(191 * d - 285, 20, 1412); }

// History and stats update malus, based on depth
int stat_malus(Depth d) { return (d < 4 ? 707 * d - 260 : 2073); }
int stat_malus(Depth d) { return (d < 4 ? 727 * d - 260 : 1908); }

// Add a small random component to draw evaluations to avoid 3-fold blindness
Value value_draw(size_t nodes) { return VALUE_DRAW - 1 + Value(nodes & 0x2); }
Expand Down Expand Up @@ -1380,11 +1380,9 @@ Value Search::Worker::search(
+ 64 * (!ss->inCheck && bestValue <= ss->staticEval - 107)
+ 147 * (!(ss - 1)->inCheck && bestValue <= -(ss - 1)->staticEval - 75));


// proportional to "how much damage we have to undo"
if ((ss - 1)->statScore < -8000)
bonus += std::clamp(-(ss - 1)->statScore / 100, 0, 250);

// Proportional to "how much damage we have to undo"
if ((ss - 1)->statScore < -7850)
bonus += std::clamp(-(ss - 1)->statScore / 100, 0, 224);

update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
stat_bonus(depth) * bonus / 100);
Expand Down Expand Up @@ -1801,7 +1799,7 @@ void update_all_stats(const Position& pos,

if (!pos.capture_stage(bestMove))
{
int bestMoveBonus = bestValue > beta + 164 ? quietMoveBonus // larger bonus
int bestMoveBonus = bestValue > beta + 166 ? quietMoveBonus // larger bonus
: stat_bonus(depth); // smaller bonus

update_quiet_stats(pos, ss, workerThread, bestMove, bestMoveBonus);
Expand Down

0 comments on commit 29dbde7

Please sign in to comment.