]> git.sesse.net Git - stockfish/commitdiff
Use cut-off checks in qsearch as killer moves
authorMarco Costalba <mcostalba@gmail.com>
Mon, 10 Nov 2008 10:06:46 +0000 (11:06 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 10 Nov 2008 18:19:40 +0000 (19:19 +0100)
Killers should not be captures, but checks are not
and are produced also in qsearch.

Use this information, will be useful for move ordering.

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

index 97ed196acede459112754e6892f2b88fba8a75cc..e2032638b8650ce112968c4329ea4b08e77ee10e 100644 (file)
@@ -1469,6 +1469,18 @@ namespace {
     // Update transposition table
     TT.store(pos, value_to_tt(bestValue, ply), depth, MOVE_NONE, VALUE_TYPE_EXACT);
 
     // Update transposition table
     TT.store(pos, value_to_tt(bestValue, ply), depth, MOVE_NONE, VALUE_TYPE_EXACT);
 
+    // Update killers only for good check moves
+    Move m = ss[ply].currentMove;
+    if (alpha >= beta && ok_to_history(pos, m)) // Only non capture moves are considered
+    {
+        // Wrong to update history when depth is <= 0
+
+        if (m != ss[ply].killer1)
+        {
+            ss[ply].killer2 = ss[ply].killer1;
+            ss[ply].killer1 = m;
+        }
+    }
     return bestValue;
   }
 
     return bestValue;
   }