Separate lmr #118

Merged
rektdie merged 3 commits from separate-lmr into main 2025-10-08 23:13:54 +02:00
3 changed files with 18 additions and 10 deletions

No files matched your search

+12 -7
View File
@@ -12,12 +12,17 @@
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 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);
}
}
}
}
@@ -163,7 +168,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;
+2 -1
View File
@@ -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<int, 6> SEEPieceValues = {
+4 -2
View File
@@ -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, 1.1, 0.5, 1.5) \
X_DOUBLE(lmrDivisorQuiet, 2.33, 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) \