From: Marco Costalba Date: Mon, 16 May 2011 08:59:51 +0000 (+0200) Subject: Prefer ttMove to tte->move() in search() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=6624105b5b075ec5c7646818f45aad1f75ed64aa Prefer ttMove to tte->move() in search() Avoids aliasing problems due to TT overwrites. Node changes becuase of IID. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index 58a82d9d..0fbdab56 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -871,8 +871,8 @@ namespace { search(pos, ss, alpha, beta, d); ss->skipNullMove = false; - ttMove = ss->bestMove; tte = TT.probe(posKey); + ttMove = tte ? tte->move() : MOVE_NONE; } split_point_start: // At split points actual search starts from here @@ -885,8 +885,7 @@ split_point_start: // At split points actual search starts from here singularExtensionNode = !Root && !SpNode && depth >= SingularExtensionDepth[PvNode] - && tte - && tte->move() + && ttMove != MOVE_NONE && !excludedMove // Do not allow recursive singular extension search && (tte->type() & VALUE_TYPE_LOWER) && tte->depth() >= depth - 3 * ONE_PLY; @@ -949,7 +948,7 @@ split_point_start: // At split points actual search starts from here // on all the other moves but the ttMove, if result is lower than ttValue minus // a margin then we extend ttMove. if ( singularExtensionNode - && move == tte->move() + && move == ttMove && ext < ONE_PLY) { Value ttValue = value_from_tt(tte->value(), ss->ply);