mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
History stat bonus: Move condition to bonus calculation
about 0.5% speedup. No functional change Closes #1034
This commit is contained in:
committed by
Joona Kiiski
parent
c076216a32
commit
c80d52c845
@@ -39,9 +39,6 @@ struct HistoryStats {
|
|||||||
void clear() { std::memset(table, 0, sizeof(table)); }
|
void clear() { std::memset(table, 0, sizeof(table)); }
|
||||||
void update(Color c, Move m, Value v) {
|
void update(Color c, Move m, Value v) {
|
||||||
|
|
||||||
if (abs(int(v)) >= 324)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Square from = from_sq(m);
|
Square from = from_sq(m);
|
||||||
Square to = to_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, Move m) { table[pc][to] = m; }
|
||||||
void update(Piece pc, Square to, Value v) {
|
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] -= table[pc][to] * abs(int(v)) / 936;
|
||||||
table[pc][to] += int(v) * 32;
|
table[pc][to] += int(v) * 32;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace {
|
|||||||
// History and stats update bonus, based on depth
|
// History and stats update bonus, based on depth
|
||||||
Value stat_bonus(Depth depth) {
|
Value stat_bonus(Depth depth) {
|
||||||
int d = depth / ONE_PLY ;
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user