From bee4f1cf09132375e1d151c4c0bccb2f9fc38d29 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Thu, 1 May 2014 16:25:17 +0200 Subject: [PATCH] Don't save stale value in TT after split If we return from split with a stale value due to a stop or a cutoff upstream occurred, then we exit moves loop and save a stale value in TT before returning search(). This patch, from Joona, fixes this. bench: 8678654 --- src/search.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index d4cac16d..dbc9f0c6 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -940,7 +940,7 @@ moves_loop: // When in check and at SpNode search starts from here // value of the search cannot be trusted, and we return immediately without // updating best move, PV and TT. if (Signals.stop || thisThread->cutoff_occurred()) - return VALUE_DRAW; + return VALUE_ZERO; if (RootNode) { @@ -997,6 +997,10 @@ moves_loop: // When in check and at SpNode search starts from here thisThread->split(pos, ss, alpha, beta, &bestValue, &bestMove, depth, moveCount, &mp, NT, cutNode); + + if (Signals.stop || thisThread->cutoff_occurred()) + return VALUE_ZERO; + if (bestValue >= beta) break; } -- 2.39.2