capthist lmr | bench 4306521

This commit is contained in:
rektdie committed 2025-12-15 03:44:32 +01:00
1 parent 75022da950
commit f4bf94eb98
1 file changed
+15 -6
+15 -6
View File
@@ -174,24 +174,33 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int
if (corrplexity)
reduction -= lmrCorrplexity;
if (move.IsQuiet()) {
// History LMR
// History LMR
int historyReduction = 0;
if (move.IsQuiet()) {
bool sourceThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveFrom());
bool targetThreatened = board.IsSquareThreatened(board.sideToMove, move.MoveTo());
int historyReduction = ctx->history[board.sideToMove][move.MoveFrom()][move.MoveTo()][sourceThreatened][targetThreatened];
historyReduction = ctx->history[board.sideToMove][move.MoveFrom()][move.MoveTo()][sourceThreatened][targetThreatened];
if (ply > 0) {
historyReduction += ctx->conthist.GetNPly(board, move, ctx, ply, 1);
if (ply > 1)
historyReduction += ctx->conthist.GetNPly(board, move, ctx, ply, 2);
}
} else if (move.IsCapture()) {
int attackerType = board.GetPieceType(move.MoveFrom());
int targetType = board.GetPieceType(move.MoveTo());
historyReduction = historyReduction / lmrHistoryDivisor;
reduction -= historyReduction * 1024;
if (move.GetFlags() == epCapture) {
targetType = Pawn;
}
historyReduction = ctx->capthist[board.sideToMove][attackerType][targetType][move.MoveTo()];
}
historyReduction = historyReduction / lmrHistoryDivisor;
reduction -= historyReduction * 1024;
}
reduction /= 1024;