X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=f23db4c1919cf8b7db978b2c6cfee0fb2d494422;hb=3dfda1b28e14d1f3c2422fed5f203e305f58af28;hp=ff8764d8a808313da7d5650845c13496f45556f7;hpb=83eac08e7562d93787f75eccd4b7781c4bd45dd3;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index ff8764d8..f23db4c1 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -618,7 +618,6 @@ namespace { moveCount = captureCount = quietCount = ss->moveCount = 0; bestValue = -VALUE_INFINITE; maxValue = VALUE_INFINITE; - ss->distanceFromPv = (PvNode ? 0 : ss->distanceFromPv); // Check for the available remaining time if (thisThread == Threads.main()) @@ -1180,8 +1179,6 @@ moves_loop: // When in check, search starts from here // Step 15. Make the move pos.do_move(move, st, givesCheck); - (ss+1)->distanceFromPv = ss->distanceFromPv + moveCount - 1; - // Step 16. Late moves reduction / extension (LMR, ~200 Elo) // We use various heuristics for the sons of a node after the first son has // been searched. In general we would like to reduce them, but there are many @@ -1280,10 +1277,10 @@ moves_loop: // When in check, search starts from here r -= ss->statScore / 14790; } - // In general we want to cap the LMR depth search at newDepth. But for nodes - // close to the principal variation the cap is at (newDepth + 1), which will - // allow these nodes to be searched deeper than the pv (up to 4 plies deeper). - Depth d = std::clamp(newDepth - r, 1, newDepth + ((ss+1)->distanceFromPv <= 4)); + // In general we want to cap the LMR depth search at newDepth. But if + // reductions are really negative and movecount is low, we allow this move + // to be searched deeper than the first move. + Depth d = std::clamp(newDepth - r, 1, newDepth + (r < -1 && moveCount <= 5)); value = -search(pos, ss+1, -(alpha+1), -alpha, d, true);