Skip to content

Commit

Permalink
Simplify post-lmr conthist bonus
Browse files Browse the repository at this point in the history
  • Loading branch information
xu-shawn authored and PikaCat-OuO committed Jan 6, 2025
1 parent 28efdfb commit 771c82e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,11 @@ Value Search::Worker::search(

// Decrease reduction if position is or has been on the PV (~7 Elo)
if (ss->ttPv)
r -= 1182 + (ttData.value > alpha) * 1182 + (ttData.depth >= depth) * 1182;
r -= 1024 + (ttData.value > alpha) * 1024 + (ttData.depth >= depth) * 1024;

// Decrease reduction for PvNodes (~0 Elo on STC, ~2 Elo on LTC)
if (PvNode)
r -= 1182;
r -= 1024;

// These reduction adjustments have no proven non-linear scaling

Expand Down Expand Up @@ -1109,7 +1109,7 @@ Value Search::Worker::search(
// To prevent problems when the max value is less than the min value,
// std::clamp has been replaced by a more robust implementation.
Depth d = std::max(
1, std::min(newDepth - r / 1182, newDepth + !allNode + (PvNode && !bestMove)));
1, std::min(newDepth - r / 1024, newDepth + !allNode + (PvNode && !bestMove)));

value = -search<NonPV>(pos, ss + 1, -(alpha + 1), -alpha, d, true);

Expand All @@ -1127,8 +1127,8 @@ Value Search::Worker::search(
value = -search<NonPV>(pos, ss + 1, -(alpha + 1), -alpha, newDepth, !cutNode);

// Post LMR continuation history updates (~1 Elo)
int bonus = (value >= beta) * stat_bonus(newDepth);
update_continuation_histories(ss, movedPiece, move.to_sq(), bonus * 1427 / 1024);
int bonus = (value >= beta) * 2048;
update_continuation_histories(ss, movedPiece, move.to_sq(), bonus);
}
}

Expand Down

0 comments on commit 771c82e

Please sign in to comment.