X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=94c03619a39e8c818739316096f1acfc87b08574;hb=84451191f3e16be2d532353b4df3d870b84b4f5d;hp=8b45130a4319b71e16c4815802d6d9ede427e5fa;hpb=2ed3358fafdd7189637b9db4d20d7fb725b7a122;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 8b45130a..94c03619 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1379,13 +1379,18 @@ namespace { if (nullValue >= value_mate_in(PLY_MAX)) nullValue = beta; - if (depth < 6 * OnePly) - return nullValue; + // Do zugzwang verification search for high depths, don't store in TT + // if search was stopped. + if ( ( depth < 6 * OnePly + || search(pos, ss, beta, depth-5*OnePly, ply, false, threadID) >= beta) + && !AbortSearch + && !TM.thread_should_stop(threadID)) + { + assert(value_to_tt(nullValue, ply) == nullValue); - // Do zugzwang verification search - Value v = search(pos, ss, beta, depth-5*OnePly, ply, false, threadID); - if (v >= beta) + TT.store(posKey, nullValue, VALUE_TYPE_LOWER, depth, MOVE_NONE); return nullValue; + } } else { // The null move failed low, which means that we may be faced with // some kind of threat. If the previous move was reduced, check if