mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
In qsearch update TT only if returning from stand pat
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>
This commit is contained in:
parent
72af519e7f
commit
095a96b461
1 changed files with 4 additions and 3 deletions
|
@ -1450,7 +1450,11 @@ namespace {
|
|||
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);
|
||||
return bestValue;
|
||||
}
|
||||
|
||||
if (bestValue > alpha)
|
||||
alpha = bestValue;
|
||||
|
@ -1534,9 +1538,6 @@ namespace {
|
|||
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue