From: Marco Costalba Date: Sat, 3 Apr 2010 07:54:21 +0000 (+0100) Subject: Store score in TT when null search fails high X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=84451191f3e16be2d532353b4df3d870b84b4f5d;ds=sidebyside Store score in TT when null search fails high Use full depth, not reduced one. This allows to avoid to do a null search when in the same position and at the same or bigger depth the null search failed high. A very small increase, if any. After 963 games at 1+0 Mod vs Orig: +158 =657 -147 +4 ELO Signed-off-by: Marco Costalba --- 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 diff --git a/src/tt.cpp b/src/tt.cpp index 935336da..7efc6a09 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -125,6 +125,7 @@ void TranspositionTable::store(const Key posKey, Value v, ValueType t, Depth d, if (tte->key() && t == VALUE_TYPE_EV_LO) return; + // Preserve any exsisting ttMove if (m == MOVE_NONE) m = tte->move();