Remove Gain Stats

Additionally in futility pruning the margin is raised for compensation.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 48481 W: 9229 L: 9156 D: 30096

LTC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 32058 W: 5134 L: 5031 D: 21893

Bench: 8098149

Resolves #350
This commit is contained in:
Stefan Geschwentner
2015-05-18 13:58:13 -07:00
committed by Gary Linscott
parent 411e704fdf
commit e14046517e
2 changed files with 9 additions and 28 deletions

View File

@@ -30,14 +30,13 @@
/// The Stats struct stores moves statistics. According to the template parameter
/// the class can store History, Gains and Countermoves. History records how often
/// the class can store History and Countermoves. History records how often
/// different moves have been successful or unsuccessful during the current search
/// and is used for reduction and move ordering decisions. Gains records the move's
/// best evaluation gain from one ply to the next and is used for pruning decisions.
/// and is used for reduction and move ordering decisions.
/// Countermoves store the move that refute a previous one. Entries are stored
/// using only the moving piece and destination square, hence two moves with
/// different origin but same destination and piece will be considered identical.
template<bool Gain, typename T>
template<typename T>
struct Stats {
static const Value Max = Value(250);
@@ -54,10 +53,7 @@ struct Stats {
void update(Piece pc, Square to, Value v) {
if (Gain)
table[pc][to] = std::max(v, table[pc][to] - 1);
else if (abs(table[pc][to] + v) < Max)
if (abs(table[pc][to] + v) < Max)
table[pc][to] += v;
}
@@ -65,10 +61,9 @@ private:
T table[PIECE_NB][SQUARE_NB];
};
typedef Stats< true, Value> GainsStats;
typedef Stats<false, Value> HistoryStats;
typedef Stats<false, Move> MovesStats;
typedef Stats<false, HistoryStats> CounterMovesHistoryStats;
typedef Stats<Value> HistoryStats;
typedef Stats<Move> MovesStats;
typedef Stats<HistoryStats> CounterMovesHistoryStats;
/// MovePicker class is used to pick one pseudo legal move at a time from the