X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=8b3b8fb4864436c17c6964a24151a85db92f873f;hp=ed01e0dee04c89d4f31dd29264ad576a441df89f;hb=b53239d6410cfc87bf454370671390b04879ef05;hpb=be382bb0cf5927dc10ff9be882f6980a78d1484a diff --git a/src/search.cpp b/src/search.cpp index ed01e0de..8b3b8fb4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -681,7 +681,8 @@ namespace { // Step 8. Null move search with verification search (is omitted in PV nodes) if ( !PvNode && eval >= beta - && ss->staticEval >= beta - 36 * depth / ONE_PLY + 225) + && ss->staticEval >= beta - 36 * depth / ONE_PLY + 225 + && (ss->ply >= thisThread->nmp_ply || ss->ply % 2 == thisThread->pair)) { assert(eval - beta >= 0); @@ -707,8 +708,17 @@ namespace { return nullValue; // Do verification search at high depths + R += ONE_PLY; + // disable null move pruning for side to move for the first part of the remaining search tree + int nmp_ply = thisThread->nmp_ply; + int pair = thisThread->pair; + thisThread->nmp_ply = ss->ply + 3 * (depth-R) / 4; + thisThread->pair = (ss->ply % 2) == 0; + Value v = depth-R < ONE_PLY ? qsearch(pos, ss, beta-1, beta) : search(pos, ss, beta-1, beta, depth-R, false, true); + thisThread->pair = pair; + thisThread->nmp_ply = nmp_ply; if (v >= beta) return nullValue;