mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Qsearch simplification. (#1828)
Don't do an extra TT update in case of a fail-high, but simply break off the moves loop and let the TT update at the end of qsearch do this job. Same workflow/logic as in our main search function now. Tested for no regression to be on the safe side. STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 30237 W: 6665 L: 6560 D: 17012 http://tests.stockfishchess.org/tests/view/5bf928e80ebc5902bced3f3a LTC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 51067 W: 8625 L: 8553 D: 33889 http://tests.stockfishchess.org/tests/view/5bf937180ebc5902bced3fdc No functional change.
This commit is contained in:
parent
bb58bc215c
commit
6ab92d2e1c
1 changed files with 6 additions and 11 deletions
|
@ -1395,21 +1395,15 @@ moves_loop: // When in check, search starts from here
|
||||||
|
|
||||||
if (value > alpha)
|
if (value > alpha)
|
||||||
{
|
{
|
||||||
|
bestMove = move;
|
||||||
|
|
||||||
if (PvNode) // Update pv even in fail-high case
|
if (PvNode) // Update pv even in fail-high case
|
||||||
update_pv(ss->pv, move, (ss+1)->pv);
|
update_pv(ss->pv, move, (ss+1)->pv);
|
||||||
|
|
||||||
if (PvNode && value < beta) // Update alpha here!
|
if (PvNode && value < beta) // Update alpha here!
|
||||||
{
|
|
||||||
alpha = value;
|
alpha = value;
|
||||||
bestMove = move;
|
else
|
||||||
}
|
break; // Fail high
|
||||||
else // Fail high
|
|
||||||
{
|
|
||||||
tte->save(posKey, value_to_tt(value, ss->ply), BOUND_LOWER,
|
|
||||||
ttDepth, move, ss->staticEval);
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1420,7 +1414,8 @@ moves_loop: // When in check, search starts from here
|
||||||
return mated_in(ss->ply); // Plies to mate from the root
|
return mated_in(ss->ply); // Plies to mate from the root
|
||||||
|
|
||||||
tte->save(posKey, value_to_tt(bestValue, ss->ply),
|
tte->save(posKey, value_to_tt(bestValue, ss->ply),
|
||||||
PvNode && bestValue > oldAlpha ? BOUND_EXACT : BOUND_UPPER,
|
bestValue >= beta ? BOUND_LOWER :
|
||||||
|
PvNode && bestValue > oldAlpha ? BOUND_EXACT : BOUND_UPPER,
|
||||||
ttDepth, bestMove, ss->staticEval);
|
ttDepth, bestMove, ss->staticEval);
|
||||||
|
|
||||||
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
|
assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
|
||||||
|
|
Loading…
Add table
Reference in a new issue