Join conditions for move sorting heuristics

closes https://github.com/official-stockfish/Stockfish/pull/5078

No functional change.
This commit is contained in:
Gahtan Nahdi
2024-02-27 19:27:40 +07:00
committed by Joost VandeVondele
parent 0c22d5bb1a
commit f77eddfa2f
+9 -12
View File
@@ -607,20 +607,17 @@ Value Search::Worker::search(
&& (tte->bound() & (ttValue >= beta ? BOUND_LOWER : BOUND_UPPER))) && (tte->bound() & (ttValue >= beta ? BOUND_LOWER : BOUND_UPPER)))
{ {
// If ttMove is quiet, update move sorting heuristics on TT hit (~2 Elo) // 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)
// Bonus for a quiet ttMove that fails high (~2 Elo) update_quiet_stats(pos, ss, *this, ttMove, stat_bonus(depth));
if (!ttCapture)
update_quiet_stats(pos, ss, *this, ttMove, stat_bonus(depth));
// Extra penalty for early quiet moves of // Extra penalty for early quiet moves of
// the previous ply (~0 Elo on STC, ~2 Elo on LTC). // the previous ply (~0 Elo on STC, ~2 Elo on LTC).
if (prevSq != SQ_NONE && (ss - 1)->moveCount <= 2 && !priorCapture) if (prevSq != SQ_NONE && (ss - 1)->moveCount <= 2 && !priorCapture)
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq, update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
-stat_malus(depth + 1)); -stat_malus(depth + 1));
}
} }
// Partial workaround for the graph history interaction problem // Partial workaround for the graph history interaction problem