]> git.sesse.net Git - stockfish/commitdiff
Revert "Retire Rml full PV search at depth == 1"
authorMarco Costalba <mcostalba@gmail.com>
Sat, 1 Oct 2011 22:39:39 +0000 (23:39 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 2 Oct 2011 06:40:46 +0000 (07:40 +0100)
Yet another random crash source !

Hopefully this is the last one.

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

index 1f848183481a573cf59710f2993a1c4fb890a1f2..36f57b424646caa60bae5be859d51bd04b441e65 100644 (file)
@@ -534,10 +534,8 @@ namespace {
 
         Rml.bestMoveChanges = 0;
 
-        // MultiPV iteration loop. At depth 1 perform at least 2 iterations to
-        // get a score of the second best move for easy move detection.
-        int e = Min(Max(MultiPV, 2 * int(depth == 1)), (int)Rml.size());
-        for (MultiPVIteration = 0; MultiPVIteration < e; MultiPVIteration++)
+        // MultiPV iteration loop
+        for (MultiPVIteration = 0; MultiPVIteration < Min(MultiPV, (int)Rml.size()); MultiPVIteration++)
         {
             // Calculate dynamic aspiration window based on previous iterations
             if (depth >= 5 && abs(Rml[MultiPVIteration].prevScore) < VALUE_KNOWN_WIN)
@@ -1012,7 +1010,8 @@ split_point_start: // At split points actual search starts from here
                    << " currmovenumber " << moveCount + MultiPVIteration << endl;
       }
 
-      isPvMove = (PvNode && moveCount == 1);
+      // At Root and at first iteration do a PV search on all the moves to score root moves
+      isPvMove = (PvNode && moveCount <= (RootNode && depth <= ONE_PLY ? MAX_MOVES : 1));
       givesCheck = pos.move_gives_check(move, ci);
       captureOrPromotion = pos.move_is_capture_or_promotion(move);