Permalink
Browse files

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>
  • Loading branch information...
1 parent 007285b commit 942c18ef6620967921049ba24f25e08d710c947e @mcostalba committed Jan 12, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/history.cpp
View
@@ -75,8 +75,12 @@ void History::failure(Piece p, Square to, Depth d) {
assert(square_is_ok(to));
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;
}

0 comments on commit 942c18e

Please sign in to comment.