Revert "Lmr rework"

This commit is contained in:
rektdie authored and GitHub committed 2025-10-26 13:40:31 +01:00
1 parent 8f7f8533e3
commit d97fae635a
1 file changed
+18 -19
+18 -19
View File
@@ -157,37 +157,36 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int
int reduction = 0;
// Late Move Reduction
if (depth >= 2 && moveSeen >= 2 + (2 * isPV)) {
if (depth >= 2 && moveSeen >= 2 + (2 * isPV) && !move.IsCapture()) {
reduction = lmrTable[move.IsQuiet()][depth][moveSeen] * 1024;
if (cutnode)
reduction += lmrCutnode;
reduction += lmrCutnode;
if constexpr (isPV)
reduction -= lmrIsPV;
reduction -= lmrIsPV;
if (!improving)
reduction += lmrImproving;
if (move.IsQuiet()) {
bool sourceThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveFrom());
bool targetThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveTo());
// History LMR
int historyReduction = ctx->history[board.sideToMove][move.MoveFrom()][move.MoveTo()][sourceThreatened][targetThreatened];
if (ply > 0) {
historyReduction += ctx->conthist.GetOnePly(board, move, ctx, ply);
if (ply > 1)
historyReduction += ctx->conthist.GetTwoPly(board, move, ctx, ply);
}
bool sourceThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveFrom());
bool targetThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveTo());
historyReduction = historyReduction / lmrHistoryDivisor;
// History LMR
int historyReduction = ctx->history[board.sideToMove][move.MoveFrom()][move.MoveTo()][sourceThreatened][targetThreatened];
if (ply > 0) {
historyReduction += ctx->conthist.GetNPly(board, move, ctx, ply, 1);
reduction -= historyReduction * 1024;
if (ply > 1)
historyReduction += ctx->conthist.GetNPly(board, move, ctx, ply, 2);
}
}
reduction /= 1024;
reduction /= 1024;
historyReduction = historyReduction / lmrHistoryDivisor;
reduction -= historyReduction;
}
return std::clamp(reduction, -1, depth - 1);
}