Revert "Adjust stand pat in qsearch on pv nodes"

This reverts commit d9ec82e743.

Bench: 1249544
This commit is contained in:
Disservin
2023-12-22 11:46:28 +01:00
parent 9be0360aa4
commit 358a853790

View File

@@ -1468,20 +1468,15 @@ Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {
ss->staticEval = bestValue = ss->staticEval = bestValue =
(ss - 1)->currentMove != MOVE_NULL ? evaluate(pos) : -(ss - 1)->staticEval; (ss - 1)->currentMove != MOVE_NULL ? evaluate(pos) : -(ss - 1)->staticEval;
// Stand pat. Return immediately if bestValue is at least beta at non-Pv nodes. // Stand pat. Return immediately if static value is at least beta
// At PvNodes set bestValue between alpha and beta instead
if (bestValue >= beta) if (bestValue >= beta)
{
if (!PvNode || abs(bestValue) >= VALUE_TB_WIN_IN_MAX_PLY)
{ {
if (!ss->ttHit) if (!ss->ttHit)
tte->save(posKey, value_to_tt(bestValue, ss->ply), false, BOUND_LOWER, tte->save(posKey, value_to_tt(bestValue, ss->ply), false, BOUND_LOWER, DEPTH_NONE,
DEPTH_NONE, MOVE_NONE, ss->staticEval); MOVE_NONE, ss->staticEval);
return bestValue; return bestValue;
} }
bestValue = std::min((alpha + beta) / 2, beta - 1);
}
if (bestValue > alpha) if (bestValue > alpha)
alpha = bestValue; alpha = bestValue;