Merge pull request #126 from rektdie/corrplexity-lmr

added corrplexity to lmr | bench 4317404
This commit was merged in pull request #126.
This commit is contained in:
rektdie authored and GitHub committed 2025-10-30 06:48:58 +01:00
commit d37ba0cdaa
2 files changed
+10 -3

No files matched your search

+9 -3
View File
@@ -153,7 +153,7 @@ bool IsDraw(Board &board, SearchContext* ctx) {
}
template <bool isPV>
static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int ply, bool cutnode, bool improving, SearchContext* ctx) {
static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int ply, bool cutnode, bool improving, bool corrplexity, SearchContext* ctx) {
int reduction = 0;
// Late Move Reduction
@@ -169,6 +169,9 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int
if (!improving)
reduction += lmrImproving;
if (corrplexity)
reduction -= lmrCorrplexity;
if (move.IsQuiet()) {
// History LMR
@@ -427,9 +430,12 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
if (depth <= 0) return Quiescence<mode>(board, alpha, beta, ply, ctx);
const int staticEval = AdjustEval(board, ctx, NNUE::net.Evaluate(board));
int rawEval = NNUE::net.Evaluate(board);
const int staticEval = AdjustEval(board, ctx, rawEval);
ctx->ss[ply].eval = staticEval;
bool corrplexity = std::abs(rawEval - staticEval) > 70;
const bool improving = [&]
{
if (board.InCheck())
@@ -643,7 +649,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
if (ply && depth <= 10 && !SEE(board, currMove, SEEThreshold))
continue;
int reductions = GetReductions<isPV>(board, currMove, depth, moveSeen, ply, cutnode, improving, ctx);
int reductions = GetReductions<isPV>(board, currMove, depth, moveSeen, ply, cutnode, improving, corrplexity, ctx);
int newDepth = depth + copy.InCheck() - 1 + extension;
+1
View File
@@ -14,6 +14,7 @@
X_INT(lmrIsPV, 1024, 512, 2048) \
X_INT(lmrHistoryDivisor, 8192, 6000, 10000) \
X_INT(lmrImproving, 1024, 6000, 10000) \
X_INT(lmrCorrplexity, 1024, 6000, 10000) \
X_INT(rfpBase, 25, 50, 200) \
X_INT(rfpMargin, 100, 50, 200) \
X_INT(fpMargin, 100, 50, 200) \