X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=94c03619a39e8c818739316096f1acfc87b08574;hp=8b45130a4319b71e16c4815802d6d9ede427e5fa;hb=3a627381744ef649f134e8efc2a13c50ff0e0a0e;hpb=0e33fc6fd4641dbdbd9af775cc7b92536faef46d 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