1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 17:19:36 +00:00

Allow negative history values

Don't clamp to zero if a move continues to fail.

After 946 games at 1+0
Mod vs Orig +208 =562 -176 +12 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-01-12 18:21:15 +01:00
parent 007285be2d
commit 942c18ef66

View file

@ -75,8 +75,12 @@ void History::failure(Piece p, Square to, Depth d) {
assert(square_is_ok(to)); assert(square_is_ok(to));
history[p][to] -= int(d) * int(d); history[p][to] -= int(d) * int(d);
if (history[p][to] < 0)
history[p][to] = 0; // Prevent history underflow
if (history[p][to] <= -HistoryMax)
for (int i = 0; i < 16; i++)
for (int j = 0; j < 64; j++)
history[i][j] /= 2;
} }