constexpr bool PvNode = nodeType != NonPV;
constexpr bool rootNode = nodeType == Root;
+ // Dive into quiescence search when the depth reaches zero
+ if (depth <= 0)
+ return qsearch<PvNode ? PV : NonPV>(pos, ss, alpha, beta);
+
// Check if we have an upcoming move that draws by repetition, or
// if the opponent had an alternative move earlier to this position.
if ( !rootNode
return alpha;
}
- // Dive into quiescence search when the depth reaches zero
- if (depth <= 0)
- return qsearch<PvNode ? PV : NonPV>(pos, ss, alpha, beta);
-
assert(-VALUE_INFINITE <= alpha && alpha < beta && beta <= VALUE_INFINITE);
assert(PvNode || (alpha == beta - 1));
assert(0 < depth && depth < MAX_PLY);
// Check if we have an upcoming move that draws by repetition, or
// if the opponent had an alternative move earlier to this position.
- if ( depth < 0
- && alpha < VALUE_DRAW
+ if ( alpha < VALUE_DRAW
&& pos.has_game_cycle(ss->ply))
{
alpha = value_draw(pos.this_thread());