X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=2fd842070cfe2720217eb6f8876aa02ba61075a7;hp=a4b2e7e40ac4c0b36a03a433426c27c9af928960;hb=b508f9561cc2302c129efe8d60f201ff03ee72c8;hpb=aa88261a8f509fdabfe235042de1c1ea7a39a399 diff --git a/src/search.cpp b/src/search.cpp index a4b2e7e4..2fd84207 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -676,7 +676,7 @@ namespace { if ( !PvNode && eval >= beta && ss->staticEval >= beta - 36 * depth / ONE_PLY + 225 - && (ss->ply >= thisThread->nmp_ply || ss->ply % 2 == thisThread->pair)) + && (ss->ply >= thisThread->nmp_ply || ss->ply % 2 != thisThread->nmp_odd)) { assert(eval - beta >= 0); @@ -698,21 +698,18 @@ namespace { if (nullValue >= VALUE_MATE_IN_MAX_PLY) nullValue = beta; - if (depth < 12 * ONE_PLY && abs(beta) < VALUE_KNOWN_WIN) + if (abs(beta) < VALUE_KNOWN_WIN && (depth < 12 * ONE_PLY || thisThread->nmp_ply)) 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; + thisThread->nmp_odd = ss->ply % 2; 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; + + thisThread->nmp_odd = thisThread->nmp_ply = 0; if (v >= beta) return nullValue;