From 1e62f6adef8616023bede5048572c1e21ab2b4d8 Mon Sep 17 00:00:00 2001 From: rektdie Date: Tue, 7 Oct 2025 19:52:11 +0200 Subject: [PATCH 1/3] separated quiets from noisies | bench 3663120 --- source/search.cpp | 20 +++++++++++++------- source/search.h | 3 ++- source/tunables.h | 6 ++++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 95511d1..0a2091e 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -12,12 +12,18 @@ namespace SEARCH { void InitLMRTable() { - for (int depth = 0; depth <= MAX_DEPTH; depth++) { - for (int move = 0; move < MAX_MOVES; move++) { - if (depth == 0 || move == 0) { - lmrTable[depth][move] = 0; - } else { - lmrTable[depth][move] = std::floor(lmrBase + std::log(depth) * std::log(move) / lmrDivisor); + for (int i = 0; i < 2; i++) { + const bool base = i ? lmrBaseQuiet : lmrBaseNoisy; + const bool divisor = i ? lmrDivisorQuiet : lmrDivisorNoisy; + + for (int depth = 0; depth <= MAX_DEPTH; depth++) { + for (int move = 0; move < MAX_MOVES; move++) { + if (depth == 0 || move == 0) { + lmrTable[i][depth][move] = 0; + } else { + + lmrTable[i][depth][move] = std::floor(base + std::log(depth) * std::log(move) / divisor); + } } } } @@ -163,7 +169,7 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int // Late Move Reduction if (depth >= 2 && moveSeen >= 2 + (2 * isPV) && !move.IsCapture()) { - reduction = lmrTable[depth][moveSeen] * 1024; + reduction = lmrTable[move.IsQuiet()][depth][moveSeen] * 1024; if (cutnode) reduction += lmrCutnode; diff --git a/source/search.h b/source/search.h index 3b339b7..98ac16d 100644 --- a/source/search.h +++ b/source/search.h @@ -34,7 +34,8 @@ constexpr int CORRHIST_MAX = 16384; constexpr int32_t ScoreNone = -255000; constexpr int inf = 100000; -inline int lmrTable[MAX_DEPTH+1][MAX_MOVES]; +// first index: [0] noisy, [1] quiet +inline int lmrTable[2][MAX_DEPTH+1][MAX_MOVES]; #ifdef TUNING inline std::array SEEPieceValues = { diff --git a/source/tunables.h b/source/tunables.h index 293d9cd..3540860 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -6,8 +6,10 @@ #define AUTO_STEP(min_val, max_val) ((max_val - min_val) / 20.0) #define TUNABLE_LIST \ - X_DOUBLE(lmrBase, 0.77, 0.5, 1.5) \ - X_DOUBLE(lmrDivisor, 2.36, 1.5, 3.5) \ + X_DOUBLE(lmrBaseQuiet, 0.98, 0.5, 1.5) \ + X_DOUBLE(lmrDivisorQuiet, 2.33, 1.5, 3.5) \ + X_DOUBLE(lmrBaseNoisy, 0.39, 0.5, 1.5) \ + X_DOUBLE(lmrDivisorNoisy, 3.48, 1.5, 3.5) \ X_INT(lmrCutnode, 2048, 1024, 3072) \ X_INT(lmrIsPV, 1024, 512, 2048) \ X_INT(lmrHistoryDivisor, 8192, 6000, 10000) \ -- 2.47.3 From f71e6c20e1b14ee62cf8a39d08c9b362beebeea6 Mon Sep 17 00:00:00 2001 From: rektdie Date: Tue, 7 Oct 2025 20:59:42 +0200 Subject: [PATCH 2/3] bugfix: used wrong variable type | bench 5480424 --- source/search.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 0a2091e..d3c6615 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -13,15 +13,14 @@ namespace SEARCH { void InitLMRTable() { for (int i = 0; i < 2; i++) { - const bool base = i ? lmrBaseQuiet : lmrBaseNoisy; - const bool divisor = i ? lmrDivisorQuiet : lmrDivisorNoisy; + const double base = i ? lmrBaseQuiet : lmrBaseNoisy; + const double divisor = i ? lmrDivisorQuiet : lmrDivisorNoisy; for (int depth = 0; depth <= MAX_DEPTH; depth++) { for (int move = 0; move < MAX_MOVES; move++) { if (depth == 0 || move == 0) { lmrTable[i][depth][move] = 0; } else { - lmrTable[i][depth][move] = std::floor(base + std::log(depth) * std::log(move) / divisor); } } -- 2.47.3 From a8ac4c7feb8fb0c74430eb1fe28c9111fca29515 Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 8 Oct 2025 11:40:20 +0200 Subject: [PATCH 3/3] diff values | bench 5478784 --- source/tunables.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/tunables.h b/source/tunables.h index 3540860..08a10ad 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -6,10 +6,10 @@ #define AUTO_STEP(min_val, max_val) ((max_val - min_val) / 20.0) #define TUNABLE_LIST \ - X_DOUBLE(lmrBaseQuiet, 0.98, 0.5, 1.5) \ + X_DOUBLE(lmrBaseQuiet, 1.1, 0.5, 1.5) \ X_DOUBLE(lmrDivisorQuiet, 2.33, 1.5, 3.5) \ - X_DOUBLE(lmrBaseNoisy, 0.39, 0.5, 1.5) \ - X_DOUBLE(lmrDivisorNoisy, 3.48, 1.5, 3.5) \ + X_DOUBLE(lmrBaseNoisy, 0.41, 0.5, 1.5) \ + X_DOUBLE(lmrDivisorNoisy, 3.20, 1.5, 3.5) \ X_INT(lmrCutnode, 2048, 1024, 3072) \ X_INT(lmrIsPV, 1024, 512, 2048) \ X_INT(lmrHistoryDivisor, 8192, 6000, 10000) \ -- 2.47.3