1
0
Fork 0

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
sf_5_base
Marco Costalba 2014-05-01 16:25:17 +02:00
parent da91a34c09
commit bee4f1cf09
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}