Simplify separate malus formulas

Passed Non-regression STC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 16352 W: 4336 L: 4090 D: 7926
Ptnml(0-2): 54, 1832, 4157, 2080, 53
https://tests.stockfishchess.org/tests/view/68a808f0b6fb3300203bca08

Passed Non-regression LTC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 94014 W: 24129 L: 23986 D: 45899
Ptnml(0-2): 47, 9917, 26934, 10064, 45
https://tests.stockfishchess.org/tests/view/68a8f45cb6fb3300203bcb5e

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

Bench: 2483704
This commit is contained in:
Shawn Xu
2025-08-24 19:55:35 +02:00
committed by Joost VandeVondele
parent 901ad7e7ee
commit e2fdf6f005
+4 -6
View File
@@ -1814,8 +1814,7 @@ void update_all_stats(const Position& pos,
PieceType capturedPiece; PieceType capturedPiece;
int bonus = std::min(151 * depth - 91, 1730) + 302 * (bestMove == ttMove); int bonus = std::min(151 * depth - 91, 1730) + 302 * (bestMove == ttMove);
int quietMalus = std::min(798 * depth - 175, 2268) - 33 * quietsSearched.size(); int malus = std::min(951 * depth - 156, 2468) - 30 * quietsSearched.size();
int captureMalus = std::min(757 * depth - 134, 2129) - 28 * capturesSearched.size();
if (!pos.capture_stage(bestMove)) if (!pos.capture_stage(bestMove))
{ {
@@ -1823,7 +1822,7 @@ void update_all_stats(const Position& pos,
// Decrease stats for all non-best quiet moves // Decrease stats for all non-best quiet moves
for (Move move : quietsSearched) for (Move move : quietsSearched)
update_quiet_histories(pos, ss, workerThread, move, -quietMalus * 1208 / 1024); update_quiet_histories(pos, ss, workerThread, move, -malus);
} }
else else
{ {
@@ -1835,15 +1834,14 @@ void update_all_stats(const Position& pos,
// Extra penalty for a quiet early move that was not a TT move in // Extra penalty for a quiet early move that was not a TT move in
// previous ply when it gets refuted. // previous ply when it gets refuted.
if (prevSq != SQ_NONE && ((ss - 1)->moveCount == 1 + (ss - 1)->ttHit) && !pos.captured_piece()) if (prevSq != SQ_NONE && ((ss - 1)->moveCount == 1 + (ss - 1)->ttHit) && !pos.captured_piece())
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq, update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq, -malus * 503 / 1024);
-captureMalus * 594 / 1024);
// Decrease stats for all non-best capture moves // Decrease stats for all non-best capture moves
for (Move move : capturesSearched) for (Move move : capturesSearched)
{ {
movedPiece = pos.moved_piece(move); movedPiece = pos.moved_piece(move);
capturedPiece = type_of(pos.piece_on(move.to_sq())); capturedPiece = type_of(pos.piece_on(move.to_sq()));
captureHistory[movedPiece][move.to_sq()][capturedPiece] << -captureMalus * 1366 / 1024; captureHistory[movedPiece][move.to_sq()][capturedPiece] << -malus * 1157 / 1024;
} }
} }