Skip to content

Commit

Permalink
Join conditions for move sorting heuristics
Browse files Browse the repository at this point in the history
closes #5078

No functional change.
  • Loading branch information
gahtan-syarif authored and vondele committed Mar 3, 2024
1 parent 0c22d5b commit f77eddf
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/search.cpp
Expand Up @@ -607,20 +607,17 @@ Value Search::Worker::search(
&& (tte->bound() & (ttValue >= beta ? BOUND_LOWER : BOUND_UPPER)))
{
// If ttMove is quiet, update move sorting heuristics on TT hit (~2 Elo)
if (ttMove)
if (ttMove && ttValue >= beta)
{
if (ttValue >= beta)
{
// Bonus for a quiet ttMove that fails high (~2 Elo)
if (!ttCapture)
update_quiet_stats(pos, ss, *this, ttMove, stat_bonus(depth));

// Extra penalty for early quiet moves of
// the previous ply (~0 Elo on STC, ~2 Elo on LTC).
if (prevSq != SQ_NONE && (ss - 1)->moveCount <= 2 && !priorCapture)
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
-stat_malus(depth + 1));
}
// Bonus for a quiet ttMove that fails high (~2 Elo)
if (!ttCapture)
update_quiet_stats(pos, ss, *this, ttMove, stat_bonus(depth));

// Extra penalty for early quiet moves of
// the previous ply (~0 Elo on STC, ~2 Elo on LTC).
if (prevSq != SQ_NONE && (ss - 1)->moveCount <= 2 && !priorCapture)
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
-stat_malus(depth + 1));
}

// Partial workaround for the graph history interaction problem
Expand Down

0 comments on commit f77eddf

Please sign in to comment.