]> git.sesse.net Git - stockfish/commitdiff
History stat bonus: Move condition to bonus calculation
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Fri, 17 Mar 2017 21:45:27 +0000 (14:45 -0700)
committerJoona Kiiski <joona@zoox.com>
Fri, 17 Mar 2017 21:46:47 +0000 (14:46 -0700)
about 0.5% speedup.

No functional change

Closes #1034

src/movepick.h
src/search.cpp

index 0ef2c89bb0d2b30ab0f23111106df0179eb061bd..e1a2e6df18d3386623ddce7ca77d4023f6a081ec 100644 (file)
@@ -39,9 +39,6 @@ struct HistoryStats {
   void clear() { std::memset(table, 0, sizeof(table)); }
   void update(Color c, Move m, Value v) {
 
   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);
 
     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) {
 
   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;
   }
     table[pc][to] -= table[pc][to] * abs(int(v)) / 936;
     table[pc][to] += int(v) * 32;
   }
index cb16798dc427fcc30162a9f346c0402aac680a95..88af08404d7cdae7c44d381f499763fd9877c119 100644 (file)
@@ -82,7 +82,7 @@ namespace {
   // History and stats update bonus, based on depth
   Value stat_bonus(Depth depth) {
     int d = depth / ONE_PLY ;
   // 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
   }
 
   // Skill structure is used to implement strength limit