]> git.sesse.net Git - stockfish/commitdiff
Different searchedMoves system
authorJoona Kiiski <joona.kiiski@gmail.com>
Sun, 16 Jan 2011 23:29:44 +0000 (01:29 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 23 Jan 2011 07:36:47 +0000 (08:36 +0100)
After 8751 games on russian cluster
Mod- Orig: 1426 - 1323 - 6002  ELO +4 (+- 2.9) LOS 86%

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 6d75cc3de34b7ee44021fd6b78b330791a8fb807..a3238a33f37c965874b3998bc1e42b24af75d03a 100644 (file)
@@ -793,7 +793,7 @@ namespace {
     Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
     bool isPvMove, isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
     bool mateThreat = false;
     Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
     bool isPvMove, isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
     bool mateThreat = false;
-    int moveCount = 0;
+    int moveCount = 0, playedMoveCount = 0;
     int threadID = pos.thread();
     SplitPoint* sp = NULL;
 
     int threadID = pos.thread();
     SplitPoint* sp = NULL;
 
@@ -1027,7 +1027,7 @@ split_point_start: // At split points actual search starts from here
       else if (move == excludedMove)
           continue;
       else
       else if (move == excludedMove)
           continue;
       else
-          movesSearched[moveCount++] = move;
+          moveCount++;
 
       if (Root)
       {
 
       if (Root)
       {
@@ -1142,6 +1142,9 @@ split_point_start: // At split points actual search starts from here
       // Step 13. Make the move
       pos.do_move(move, st, ci, moveIsCheck);
 
       // Step 13. Make the move
       pos.do_move(move, st, ci, moveIsCheck);
 
+      if (!SpNode && !captureOrPromotion)
+          movesSearched[playedMoveCount++] = move;
+
       // Step extra. pv search (only in PV nodes)
       // The first move in list is the expected PV
       if (isPvMove)
       // Step extra. pv search (only in PV nodes)
       // The first move in list is the expected PV
       if (isPvMove)
@@ -1321,7 +1324,7 @@ split_point_start: // At split points actual search starts from here
         if (    bestValue >= beta
             && !pos.move_is_capture_or_promotion(move))
         {
         if (    bestValue >= beta
             && !pos.move_is_capture_or_promotion(move))
         {
-            update_history(pos, move, depth, movesSearched, moveCount);
+            update_history(pos, move, depth, movesSearched, playedMoveCount);
             update_killers(move, ss->killers);
         }
     }
             update_killers(move, ss->killers);
         }
     }
@@ -1833,8 +1836,7 @@ split_point_start: // At split points actual search starts from here
 
         assert(m != move);
 
 
         assert(m != move);
 
-        if (!pos.move_is_capture_or_promotion(m))
-            H.update(pos.piece_on(move_from(m)), move_to(m), -bonus);
+        H.update(pos.piece_on(move_from(m)), move_to(m), -bonus);
     }
   }
 
     }
   }
 
@@ -1844,11 +1846,11 @@ split_point_start: // At split points actual search starts from here
 
   void update_killers(Move m, Move killers[]) {
 
 
   void update_killers(Move m, Move killers[]) {
 
-    if (m == killers[0])
-        return;
-
-    killers[1] = killers[0];
-    killers[0] = m;
+    if (m != killers[0])
+    {
+        killers[1] = killers[0];
+        killers[0] = m;
+    }
   }
 
 
   }