Merge pull request #25 from rektdie/lmr_fix

Lmr fix bench 345289
This commit was merged in pull request #25.
This commit is contained in:
rektdie authored and GitHub committed 2025-03-19 23:08:03 +01:00
commit 06a5c6fd40
1 file changed
+4 -4
+4 -4
View File
@@ -96,15 +96,15 @@ static bool IsThreefold(Board &board) {
return false;
}
static int GetReductions(Board &board, int depth, int moveSeen, int ply) {
static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int ply) {
int reduction = 0;
// Late Move Reduction
if (depth >= 3 && moveSeen >= 5 + 2 * (ply == 0) && !board.InCheck(board.sideToMove)) {
if (depth >= 3 && moveSeen >= 3 && !move.IsCapture()) {
double base = 0.77;
double divisor = 2.36;
reduction = std::round(base + std::log(depth) * std::log(moveSeen) / divisor);
reduction = std::floor(base + std::log(depth) * std::log(moveSeen) / divisor);
}
return reduction;
@@ -233,7 +233,7 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
Board copy = board;
copy.MakeMove(currMove);
int reductions = GetReductions(board, depth, i, ply);
int reductions = GetReductions(board, currMove, depth, i, ply);
// First move (suspected PV node)
if (!i) {