Skip to content

Commit e2fdf6f

Browse files
xu-shawnvondele
authored andcommitted
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 official-stockfish#6256 Bench: 2483704
1 parent 901ad7e commit e2fdf6f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/search.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,17 +1813,16 @@ void update_all_stats(const Position& pos,
18131813
Piece movedPiece = pos.moved_piece(bestMove);
18141814
PieceType capturedPiece;
18151815

1816-
int bonus = std::min(151 * depth - 91, 1730) + 302 * (bestMove == ttMove);
1817-
int quietMalus = std::min(798 * depth - 175, 2268) - 33 * quietsSearched.size();
1818-
int captureMalus = std::min(757 * depth - 134, 2129) - 28 * capturesSearched.size();
1816+
int bonus = std::min(151 * depth - 91, 1730) + 302 * (bestMove == ttMove);
1817+
int malus = std::min(951 * depth - 156, 2468) - 30 * quietsSearched.size();
18191818

18201819
if (!pos.capture_stage(bestMove))
18211820
{
18221821
update_quiet_histories(pos, ss, workerThread, bestMove, bonus * 957 / 1024);
18231822

18241823
// Decrease stats for all non-best quiet moves
18251824
for (Move move : quietsSearched)
1826-
update_quiet_histories(pos, ss, workerThread, move, -quietMalus * 1208 / 1024);
1825+
update_quiet_histories(pos, ss, workerThread, move, -malus);
18271826
}
18281827
else
18291828
{
@@ -1835,15 +1834,14 @@ void update_all_stats(const Position& pos,
18351834
// Extra penalty for a quiet early move that was not a TT move in
18361835
// previous ply when it gets refuted.
18371836
if (prevSq != SQ_NONE && ((ss - 1)->moveCount == 1 + (ss - 1)->ttHit) && !pos.captured_piece())
1838-
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
1839-
-captureMalus * 594 / 1024);
1837+
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq, -malus * 503 / 1024);
18401838

18411839
// Decrease stats for all non-best capture moves
18421840
for (Move move : capturesSearched)
18431841
{
18441842
movedPiece = pos.moved_piece(move);
18451843
capturedPiece = type_of(pos.piece_on(move.to_sq()));
1846-
captureHistory[movedPiece][move.to_sq()][capturedPiece] << -captureMalus * 1366 / 1024;
1844+
captureHistory[movedPiece][move.to_sq()][capturedPiece] << -malus * 1157 / 1024;
18471845
}
18481846
}
18491847

0 commit comments

Comments
 (0)