Skip to content

Commit

Permalink
razoring simplification
Browse files Browse the repository at this point in the history
bench 1163093
  • Loading branch information
xu-shawn committed Dec 14, 2024
1 parent cf10644 commit c3c627e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ Value Search::Worker::search(

// Dive into quiescence search when the depth reaches zero
if (depth <= 0)
return qsearch < PvNode ? PV : NonPV > (pos, ss, alpha, beta);
return qsearch<PvNode ? PV : NonPV>(pos, ss, alpha, beta);

// Limit the depth if extensions made it too large
depth = std::min(depth, MAX_PLY - 1);
Expand Down Expand Up @@ -779,12 +779,8 @@ Value Search::Worker::search(
// Step 7. Razoring (~1 Elo)
// If eval is really low, check with qsearch if we can exceed alpha. If the
// search suggests we cannot exceed alpha, return a speculative fail low.
if (eval < alpha - 469 - 307 * depth * depth)
{
value = qsearch<NonPV>(pos, ss, alpha - 1, alpha);
if (value < alpha && !is_decisive(value))
return value;
}
if (!PvNode && eval < alpha - 469 - 307 * depth * depth)
return qsearch<NonPV>(pos, ss, alpha - 1, alpha);

// Step 8. Futility pruning: child node (~40 Elo)
// The depth condition is important for mate finding.
Expand Down

0 comments on commit c3c627e

Please sign in to comment.