]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Revert "Fix random moves when time < 10ms"
[stockfish] / src / search.cpp
index c9f1aee0685be46653a04758ed1693ef6f6f1995..e29f54498e1ce3bfd322b493fc73e641a8c3d873 100644 (file)
@@ -333,7 +333,7 @@ namespace {
     while (++depth <= MAX_PLY && !Signals.stop && (!Limits.depth || depth <= Limits.depth))
     {
         // Age out PV variability metric
-        BestMoveChanges *= 0.8;
+        BestMoveChanges *= 0.8f;
 
         // Save last iteration's scores before first PV line is searched and all
         // the move scores but the (new) PV are set to -VALUE_INFINITE.
@@ -780,7 +780,7 @@ moves_loop: // When in check and at SpNode search starts from here
 
     singularExtensionNode =   !RootNode
                            && !SpNode
-                           &&  depth >= (PvNode ? 6 * ONE_PLY : 8 * ONE_PLY)
+                           &&  depth >= 8 * ONE_PLY
                            &&  ttMove != MOVE_NONE
                            && !excludedMove // Recursive singular search is not allowed
                            && (tte->bound() & BOUND_LOWER)
@@ -835,7 +835,7 @@ moves_loop: // When in check and at SpNode search starts from here
           ext = ONE_PLY;
 
       else if (givesCheck && pos.see_sign(move) >= 0)
-          ext = ONE_PLY / 2;
+          ext = inCheck || ss->staticEval <= alpha ? ONE_PLY : ONE_PLY / 2;
 
       // Singular extension search. If all moves but one fail low on a search of
       // (alpha-s, beta-s), and just one fails high on (alpha, beta), then that move
@@ -937,7 +937,7 @@ moves_loop: // When in check and at SpNode search starts from here
 
       // Step 15. Reduced depth search (LMR). If the move fails high will be
       // re-searched at full depth.
-      if (    depth > 3 * ONE_PLY
+      if (    depth >= 3 * ONE_PLY
           && !pvMove
           && !captureOrPromotion
           &&  move != ttMove
@@ -1361,7 +1361,10 @@ moves_loop: // When in check and at SpNode search starts from here
     Square m2to = to_sq(second);
 
     // The piece is the same or second's destination was vacated by the first move
-    if (m1to == m2from || m2to == m1from)
+    // We exclude the trivial case where a sliding piece does in two moves what
+    // it could do in one move: eg. Ra1a2, Ra2a3.
+    if (    m2to == m1from
+        || (m1to == m2from && !squares_aligned(m1from, m2from, m2to)))
         return true;
 
     // Second one moves through the square vacated by first one