mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
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
This commit is contained in:
@@ -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<FakeSplit>(pos, ss, alpha, beta, &bestValue, &bestMove,
|
||||
depth, moveCount, &mp, NT, cutNode);
|
||||
|
||||
if (Signals.stop || thisThread->cutoff_occurred())
|
||||
return VALUE_ZERO;
|
||||
|
||||
if (bestValue >= beta)
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user