From c80d52c845357db880817d6ed91d02986b5d5384 Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Fri, 17 Mar 2017 14:45:27 -0700 Subject: [PATCH] History stat bonus: Move condition to bonus calculation about 0.5% speedup. No functional change Closes #1034 --- src/movepick.h | 6 ------ src/search.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/movepick.h b/src/movepick.h index 0ef2c89b..e1a2e6df 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -39,9 +39,6 @@ struct HistoryStats { void clear() { std::memset(table, 0, sizeof(table)); } void update(Color c, Move m, Value v) { - if (abs(int(v)) >= 324) - return; - Square from = from_sq(m); Square to = to_sq(m); @@ -68,9 +65,6 @@ struct Stats { void update(Piece pc, Square to, Move m) { table[pc][to] = m; } void update(Piece pc, Square to, Value v) { - if (abs(int(v)) >= 324) - return; - table[pc][to] -= table[pc][to] * abs(int(v)) / 936; table[pc][to] += int(v) * 32; } diff --git a/src/search.cpp b/src/search.cpp index cb16798d..88af0840 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -82,7 +82,7 @@ namespace { // History and stats update bonus, based on depth Value stat_bonus(Depth depth) { int d = depth / ONE_PLY ; - return Value(d * d + 2 * d - 2); + return d > 17 ? VALUE_ZERO : Value(d * d + 2 * d - 2); } // Skill structure is used to implement strength limit -- 2.39.2