X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=4c7e1e463dc553ae53c2efee850c215fb5f24223;hp=aaff2f547dfd5c90c2cf9539a80957076728a2ef;hb=ec0a650dff9ad78eff89e0c7fb04491f79fa7945;hpb=f3809f2a18bd3a348ba80e1e07d014834603499b diff --git a/src/search.cpp b/src/search.cpp index aaff2f54..4c7e1e46 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1306,7 +1306,7 @@ namespace { tte = TT.retrieve(posKey); ttMove = (tte ? tte->move() : MOVE_NONE); - if (tte && ok_to_use_TT(tte, depth, beta, ply, nullStatus == ALLOW_NULLMOVE)) + if (tte && ok_to_use_TT(tte, depth, beta, ply, nullStatus != VERIFY_NULLMOVE)) { ss[ply].currentMove = ttMove; // Can be MOVE_NONE return value_from_tt(tte->value(), ply); @@ -1389,13 +1389,15 @@ namespace { // 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, FORBID_NULLMOVE, threadID) >= beta) + || search(pos, ss, beta, depth-5*OnePly, ply, VERIFY_NULLMOVE, threadID) >= beta) && !AbortSearch && !TM.thread_should_stop(threadID)) { assert(value_to_tt(nullValue, ply) == nullValue); - TT.store(posKey, nullValue, VALUE_TYPE_NS_LO, depth, MOVE_NONE); + if (!tte) + TT.store(posKey, nullValue, VALUE_TYPE_NS_LO, depth, MOVE_NONE); + return nullValue; } } else {