X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=8088ff76c94ce36418d7307347ab16d211ae350e;hp=4cce6a9171de9139d8e51e717d966af819912492;hb=bc6a6e04a07423433342085397a03af881ebe080;hpb=e5ffe9959c40a5ec6c4bca83a5a48070cae7fa5b diff --git a/src/search.cpp b/src/search.cpp index 4cce6a91..8088ff76 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -534,8 +534,10 @@ namespace { Rml.bestMoveChanges = 0; - // MultiPV iteration loop - for (MultiPVIteration = 0; MultiPVIteration < Min(MultiPV, (int)Rml.size()); MultiPVIteration++) + // 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++) { // Calculate dynamic aspiration window based on previous iterations if (depth >= 5 && abs(Rml[MultiPVIteration].prevScore) < VALUE_KNOWN_WIN) @@ -1000,8 +1002,7 @@ split_point_start: // At split points actual search starts from here << " currmovenumber " << moveCount + MultiPVIteration << endl; } - // 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)); + isPvMove = (PvNode && moveCount == 1); givesCheck = pos.move_gives_check(move, ci); captureOrPromotion = pos.move_is_capture_or_promotion(move);