1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00: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:
Marco Costalba 2014-05-01 16:25:17 +02:00
parent da91a34c09
commit bee4f1cf09

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 // value of the search cannot be trusted, and we return immediately without
// updating best move, PV and TT. // updating best move, PV and TT.
if (Signals.stop || thisThread->cutoff_occurred()) if (Signals.stop || thisThread->cutoff_occurred())
return VALUE_DRAW; return VALUE_ZERO;
if (RootNode) 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, thisThread->split<FakeSplit>(pos, ss, alpha, beta, &bestValue, &bestMove,
depth, moveCount, &mp, NT, cutNode); depth, moveCount, &mp, NT, cutNode);
if (Signals.stop || thisThread->cutoff_occurred())
return VALUE_ZERO;
if (bestValue >= beta) if (bestValue >= beta)
break; break;
} }