]> git.sesse.net Git - stockfish/commitdiff
Remove Gain Stats
authorStefan Geschwentner <stgeschwentner@gmail.com>
Mon, 18 May 2015 20:58:13 +0000 (13:58 -0700)
committerGary Linscott <glinscott@gmail.com>
Mon, 18 May 2015 20:59:30 +0000 (13:59 -0700)
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

src/movepick.h
src/search.cpp

index 44fc51f6263d73ca5a88919ff044e3e6b256cc12..3c285c983ca52f195ad31d767d6b48611b4b346b 100644 (file)
 
 
 /// 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
index d419cd30ede15e192142b040de9caf14d8b8005c..814a96d98cb66abed49d617566001b350d349798 100644 (file)
@@ -134,7 +134,6 @@ namespace {
   Value DrawValue[COLOR_NB];
   HistoryStats History;
   CounterMovesHistoryStats CounterMovesHistory;
-  GainsStats Gains;
   MovesStats Countermoves;
 
   template <NodeType NT, bool SpNode>
@@ -188,7 +187,6 @@ void Search::reset () {
   TT.clear();
   History.clear();
   CounterMovesHistory.clear();
-  Gains.clear();
   Countermoves.clear();
 }
 
@@ -643,7 +641,7 @@ namespace {
         }
     }
 
-    // Step 5. Evaluate the position statically and update parent's gain statistics
+    // Step 5. Evaluate the position statically
     if (inCheck)
     {
         ss->staticEval = eval = VALUE_NONE;
@@ -672,17 +670,6 @@ namespace {
     if (ss->skipEarlyPruning)
         goto moves_loop;
 
-    if (   !pos.captured_piece_type()
-        &&  ss->staticEval != VALUE_NONE
-        && (ss-1)->staticEval != VALUE_NONE
-        && (move = (ss-1)->currentMove) != MOVE_NULL
-        &&  move != MOVE_NONE
-        &&  type_of(move) == NORMAL)
-    {
-        Square to = to_sq(move);
-        Gains.update(pos.piece_on(to), to, -(ss-1)->staticEval - ss->staticEval);
-    }
-
     // Step 6. Razoring (skipped when in check)
     if (   !PvNode
         &&  depth < 4 * ONE_PLY
@@ -915,8 +902,7 @@ moves_loop: // When in check and at SpNode search starts from here
           // Futility pruning: parent node
           if (predictedDepth < 7 * ONE_PLY)
           {
-              futilityValue =  ss->staticEval + futility_margin(predictedDepth)
-                             + 128 + Gains[pos.moved_piece(move)][to_sq(move)];
+              futilityValue =  ss->staticEval + futility_margin(predictedDepth) + 256;
 
               if (futilityValue <= alpha)
               {