This is the only "correct" exact value we can store.
Otherwise there could be spurious failed high/low nodes.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Value bestValue = staticValue;
if (bestValue >= beta)
Value bestValue = staticValue;
if (bestValue >= beta)
+ {
+ // Update transposition table before to leave
+ TT.store(pos, value_to_tt(bestValue, ply), depth, MOVE_NONE, VALUE_TYPE_EXACT);
if (bestValue > alpha)
alpha = bestValue;
if (bestValue > alpha)
alpha = bestValue;
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
- // Update transposition table
- TT.store(pos, value_to_tt(bestValue, ply), depth, MOVE_NONE, VALUE_TYPE_EXACT);
-
// Update killers only for good check moves
Move m = ss[ply].currentMove;
if (alpha >= beta && ok_to_history(pos, m)) // Only non capture moves are considered
// Update killers only for good check moves
Move m = ss[ply].currentMove;
if (alpha >= beta && ok_to_history(pos, m)) // Only non capture moves are considered