From 04b118796345f2e8e3b2888695f651b04bd46c03 Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 1 Apr 2026 20:16:55 +0200 Subject: [PATCH 1/8] factorized some heuristics | bench 1398874 --- source/search.cpp | 19 ++++++++++++++++--- source/tunables.h | 13 ++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 56a67bb..bf82172 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -452,7 +452,13 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC if (!board.InCheck() && !ctx->excluded) { if (ply) { // Reverse Futility Pruning - int margin = rfpBase + rfpMargin * (depth - improving); + + int margin = ( + rfpBase + + depth * rfpMargin + - improving * rfpImprovingMargin + ) / 128; + if (!ttpv && ttAdjustedEval - margin >= beta && depth < 7) { return !IsDecisive(ttAdjustedEval) && !IsDecisive(beta) ? ((ttAdjustedEval + beta) / 2) @@ -470,7 +476,12 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC Board copy = board; copy.MakeMove(Move()); - const int reduction = 4 + improving + depth / 3 + entry.bestMove.IsCapture(); + const int reduction = ( + nmpBaseReduction + + improving * nmpImprovingReduction + + depth * nmpDepthReduction + + entry.bestMove.IsCapture() * nmpCaptureReduction + ) / 192; ctx->TT->PrefetchEntry(copy.hashKey); @@ -598,7 +609,9 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 2); } - int margin = fpMargin * (lmrDepth + improving) + historyScore / 32; + int margin = + (lmrDepth * fpMargin + improving * fpImprovingMargin) / 128 + + (historyScore * fpHistoryMargin) / 128; if (!isPV && ply && currMove.IsQuiet() && lmrDepth <= 7 && staticEval + margin < alpha && notMated && !board.GivesDirectCheck(currMove)) { diff --git a/source/tunables.h b/source/tunables.h index 905c842..bcffed4 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -23,15 +23,22 @@ X_INT(lmrTTPVFailLow, 1024, 6000, 10000) \ X_INT(lmrDeeperBase, 30, 6000, 10000) \ X_INT(lmrDeeperScalar, 4, 6000, 10000) \ - X_INT(rfpBase, 25, 50, 200) \ - X_INT(rfpMargin, 100, 50, 200) \ - X_INT(fpMargin, 100, 50, 200) \ + X_INT(rfpBase, 3200, 1600, 6400) \ + X_INT(rfpMargin, 12800, 6400, 25600) \ + X_INT(rfpImprovingMargin, 12800, 0, 25600) \ + X_INT(fpMargin, 12800, 6400, 25600) \ + X_INT(fpImprovingMargin, 12800, 0, 25600) \ + X_INT(fpHistoryMargin, 4, -64, 64) \ X_INT(razoringScalar, 200, 50, 200) \ X_INT(doubleExtMargin, 30, 10, 60) \ X_INT(seeQuietThreshold, -80, -150, -20) \ X_INT(seeNoisyThreshold, -30, -80, 20) \ X_INT(aspInitialDelta, 30, 20, 80) \ X_INT(nmpBetaMargin, 30, 20, 80) \ + X_INT(nmpBaseReduction, 768, 384, 1152) \ + X_INT(nmpImprovingReduction, 192, 0, 384) \ + X_INT(nmpDepthReduction, 64, 32, 128) \ + X_INT(nmpCaptureReduction, 192, 0, 384) \ X_INT(seePawnValue, 100, 80, 120) \ X_INT(seeKnightValue, 300, 250, 350) \ X_INT(seeBishopValue, 350, 300, 400) \ From f9160084a7f7b43a0c61b2869da03882659033da Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 1 Apr 2026 20:31:36 +0200 Subject: [PATCH 2/8] set tunable min/max values | bench 1398874 --- source/tunables.h | 58 +++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/source/tunables.h b/source/tunables.h index bcffed4..6677997 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -2,7 +2,7 @@ #include #include -//#define TUNING +#define TUNING #define AUTO_STEP(min_val, max_val) ((max_val - min_val) / 20.0) #define AUTO_R_END_INT(min_val, max_val) \ @@ -10,45 +10,45 @@ #define AUTO_R_END_FLOAT 0.002 #define TUNABLE_LIST \ - 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_DOUBLE(lmrBaseQuiet, 1.1, 0.6, 1.6) \ + X_DOUBLE(lmrDivisorQuiet, 2.33, 1.6, 3.6) \ + X_DOUBLE(lmrBaseNoisy, 0.41, 0.1, 1.1) \ + X_DOUBLE(lmrDivisorNoisy, 3.20, 2.0, 4.5) \ X_INT(lmrCutnode, 2048, 1024, 3072) \ - X_INT(lmrIsPV, 1024, 512, 2048) \ - X_INT(lmrTTPV, 1024, 512, 2048) \ - X_INT(lmrHistoryDivisor, 8192, 6000, 10000) \ - X_INT(lmrImproving, 1024, 6000, 10000) \ - X_INT(lmrCorrplexity, 1024, 6000, 10000) \ - X_INT(lmrTTPVFailLow, 1024, 6000, 10000) \ - X_INT(lmrDeeperBase, 30, 6000, 10000) \ - X_INT(lmrDeeperScalar, 4, 6000, 10000) \ + X_INT(lmrIsPV, 1024, 256, 2048) \ + X_INT(lmrTTPV, 1024, 256, 2048) \ + X_INT(lmrHistoryDivisor, 8192, 4096, 16384) \ + X_INT(lmrImproving, 1024, 256, 2048) \ + X_INT(lmrCorrplexity, 1024, 256, 2048) \ + X_INT(lmrTTPVFailLow, 1024, 256, 2048) \ + X_INT(lmrDeeperBase, 30, 0, 96) \ + X_INT(lmrDeeperScalar, 4, 0, 16) \ X_INT(rfpBase, 3200, 1600, 6400) \ X_INT(rfpMargin, 12800, 6400, 25600) \ X_INT(rfpImprovingMargin, 12800, 0, 25600) \ X_INT(fpMargin, 12800, 6400, 25600) \ X_INT(fpImprovingMargin, 12800, 0, 25600) \ X_INT(fpHistoryMargin, 4, -64, 64) \ - X_INT(razoringScalar, 200, 50, 200) \ - X_INT(doubleExtMargin, 30, 10, 60) \ - X_INT(seeQuietThreshold, -80, -150, -20) \ - X_INT(seeNoisyThreshold, -30, -80, 20) \ - X_INT(aspInitialDelta, 30, 20, 80) \ - X_INT(nmpBetaMargin, 30, 20, 80) \ + X_INT(razoringScalar, 200, 80, 320) \ + X_INT(doubleExtMargin, 30, 8, 64) \ + X_INT(seeQuietThreshold, -80, -160, 0) \ + X_INT(seeNoisyThreshold, -30, -120, 40) \ + X_INT(aspInitialDelta, 30, 8, 96) \ + X_INT(nmpBetaMargin, 30, 8, 96) \ X_INT(nmpBaseReduction, 768, 384, 1152) \ X_INT(nmpImprovingReduction, 192, 0, 384) \ X_INT(nmpDepthReduction, 64, 32, 128) \ X_INT(nmpCaptureReduction, 192, 0, 384) \ - X_INT(seePawnValue, 100, 80, 120) \ - X_INT(seeKnightValue, 300, 250, 350) \ - X_INT(seeBishopValue, 350, 300, 400) \ - X_INT(seeRookValue, 500, 400, 600) \ - X_INT(seeQueenValue, 900, 750, 1100) \ - X_INT(seeQsThreshold, 0, -50, 50) \ - X_INT(seeOrderingThreshold, -100, -120, -80) \ - X_INT(ldseMargin, 25, -120, -80) \ - X_INT(historyBonusMultiplier, 300, 270, 330) \ - X_INT(historyBonusSub, 250, 230, 280) + X_INT(seePawnValue, 100, 80, 140) \ + X_INT(seeKnightValue, 300, 240, 420) \ + X_INT(seeBishopValue, 350, 250, 450) \ + X_INT(seeRookValue, 500, 400, 700) \ + X_INT(seeQueenValue, 900, 700, 1300) \ + X_INT(seeQsThreshold, 0, -120, 120) \ + X_INT(seeOrderingThreshold, -100, -200, 0) \ + X_INT(ldseMargin, 25, 0, 96) \ + X_INT(historyBonusMultiplier, 300, 200, 500) \ + X_INT(historyBonusSub, 250, 128, 384) #ifdef TUNING #define X_DOUBLE(name, default_val, min_val, max_val) \ From d4ed1a3f409e0b1cf299c686bd65b18e826fc95a Mon Sep 17 00:00:00 2001 From: rektdie Date: Thu, 2 Apr 2026 00:05:48 +0200 Subject: [PATCH 3/8] reverted to previous nmp, rfp, fp tunables | bench 1398874 --- source/search.cpp | 19 +++---------------- source/tunables.h | 13 +++---------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index bf82172..56a67bb 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -452,13 +452,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC if (!board.InCheck() && !ctx->excluded) { if (ply) { // Reverse Futility Pruning - - int margin = ( - rfpBase - + depth * rfpMargin - - improving * rfpImprovingMargin - ) / 128; - + int margin = rfpBase + rfpMargin * (depth - improving); if (!ttpv && ttAdjustedEval - margin >= beta && depth < 7) { return !IsDecisive(ttAdjustedEval) && !IsDecisive(beta) ? ((ttAdjustedEval + beta) / 2) @@ -476,12 +470,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC Board copy = board; copy.MakeMove(Move()); - const int reduction = ( - nmpBaseReduction - + improving * nmpImprovingReduction - + depth * nmpDepthReduction - + entry.bestMove.IsCapture() * nmpCaptureReduction - ) / 192; + const int reduction = 4 + improving + depth / 3 + entry.bestMove.IsCapture(); ctx->TT->PrefetchEntry(copy.hashKey); @@ -609,9 +598,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 2); } - int margin = - (lmrDepth * fpMargin + improving * fpImprovingMargin) / 128 - + (historyScore * fpHistoryMargin) / 128; + int margin = fpMargin * (lmrDepth + improving) + historyScore / 32; if (!isPV && ply && currMove.IsQuiet() && lmrDepth <= 7 && staticEval + margin < alpha && notMated && !board.GivesDirectCheck(currMove)) { diff --git a/source/tunables.h b/source/tunables.h index 6677997..6796134 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -23,22 +23,15 @@ X_INT(lmrTTPVFailLow, 1024, 256, 2048) \ X_INT(lmrDeeperBase, 30, 0, 96) \ X_INT(lmrDeeperScalar, 4, 0, 16) \ - X_INT(rfpBase, 3200, 1600, 6400) \ - X_INT(rfpMargin, 12800, 6400, 25600) \ - X_INT(rfpImprovingMargin, 12800, 0, 25600) \ - X_INT(fpMargin, 12800, 6400, 25600) \ - X_INT(fpImprovingMargin, 12800, 0, 25600) \ - X_INT(fpHistoryMargin, 4, -64, 64) \ + X_INT(rfpBase, 25, 50, 200) \ + X_INT(rfpMargin, 100, 50, 200) \ + X_INT(fpMargin, 100, 50, 200) \ X_INT(razoringScalar, 200, 80, 320) \ X_INT(doubleExtMargin, 30, 8, 64) \ X_INT(seeQuietThreshold, -80, -160, 0) \ X_INT(seeNoisyThreshold, -30, -120, 40) \ X_INT(aspInitialDelta, 30, 8, 96) \ X_INT(nmpBetaMargin, 30, 8, 96) \ - X_INT(nmpBaseReduction, 768, 384, 1152) \ - X_INT(nmpImprovingReduction, 192, 0, 384) \ - X_INT(nmpDepthReduction, 64, 32, 128) \ - X_INT(nmpCaptureReduction, 192, 0, 384) \ X_INT(seePawnValue, 100, 80, 140) \ X_INT(seeKnightValue, 300, 240, 420) \ X_INT(seeBishopValue, 350, 250, 450) \ From 34018414df23f37e4c786babe4c7ac8b05b68807 Mon Sep 17 00:00:00 2001 From: rektdie Date: Thu, 2 Apr 2026 00:29:11 +0200 Subject: [PATCH 4/8] more tunables | bench 1398874 --- source/search.cpp | 28 +++++++++++++++++----------- source/tunables.h | 16 ++++++++++++++-- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index 56a67bb..d8bece7 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -435,7 +435,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC ttAdjustedEval = entry.score; } - bool corrplexity = std::abs(rawEval - staticEval) > 70; + bool corrplexity = std::abs(rawEval - staticEval) > corrplexityThreshold; const bool improving = [&] { @@ -498,7 +498,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC } // Probcut - const int probcutBeta = beta + 200; + const int probcutBeta = beta + probcutBetaMargin; const int probcutDepth = std::max(depth - 3, 1); if (depth >= 7 && std::abs(beta) < MATE_SCORE - MAX_DEPTH @@ -728,12 +728,18 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC // Fail high (beta cutoff) if (score >= beta) { - int bonus = historyBonusMultiplier * (depth + (!board.InCheck() && staticEval <= alpha)) - historyBonusSub; + const int bonusDepth = depth + (!board.InCheck() && staticEval <= alpha); + int historyBonus = historyBonusMultiplier * bonusDepth - historyBonusSub; + int historyMalus = historyMalusMultiplier * bonusDepth - historyMalusSub; + int contHistoryBonus = contHistoryBonusMultiplier * bonusDepth - contHistoryBonusSub; + int contHistoryMalus = contHistoryMalusMultiplier * bonusDepth - contHistoryMalusSub; + int captHistoryBonus = captHistoryBonusMultiplier * bonusDepth - captHistoryBonusSub; + int captHistoryMalus = captHistoryMalusMultiplier * bonusDepth - captHistoryMalusSub; if (!currMove.IsCapture()) { ctx->killerMoves[ply] = currMove; - ctx->history.Update(board.sideToMove, currMove, sourceThreatened, targetThreatened, bonus); + ctx->history.Update(board.sideToMove, currMove, sourceThreatened, targetThreatened, historyBonus); if (ply > 0) { int prevType = ctx->ss[ply-1].pieceType; @@ -742,14 +748,14 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC int to = ctx->ss[ply].moveTo; bool otherColor = ctx->ss[ply-1].side; - ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, bonus); + ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, contHistoryBonus); // Malus for (int moveIndex = 0; moveIndex < seenQuietsCount - 1; moveIndex++) { int pieceType = board.GetPieceType(seenQuiets[moveIndex].MoveFrom()); int to = seenQuiets[moveIndex].MoveTo(); - ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, -bonus); + ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, -contHistoryMalus); } if (ply > 1) { @@ -757,14 +763,14 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC prevTo = ctx->ss[ply-2].moveTo; otherColor = ctx->ss[ply-2].side; - ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, bonus); + ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, contHistoryBonus); // Malus for (int moveIndex = 0; moveIndex < seenQuietsCount - 1; moveIndex++) { int pieceType = board.GetPieceType(seenQuiets[moveIndex].MoveFrom()); int to = seenQuiets[moveIndex].MoveTo(); - ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, -bonus); + ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, -contHistoryMalus); } } @@ -776,7 +782,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC sourceThreatened = board.IsSquareThreatened(board.sideToMove, seenQuiets[moveIndex].MoveFrom()); targetThreatened = board.IsSquareThreatened(board.sideToMove, seenQuiets[moveIndex].MoveTo()); - ctx->history.Update(board.sideToMove, seenQuiets[moveIndex], sourceThreatened, targetThreatened, -bonus); + ctx->history.Update(board.sideToMove, seenQuiets[moveIndex], sourceThreatened, targetThreatened, -historyMalus); } } else { int movingPiece = board.GetPieceType(currMove.MoveFrom()); @@ -786,7 +792,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC capturedPiece = Pawn; } - ctx->capthist.Update(board.sideToMove, movingPiece, capturedPiece, currMove.MoveTo(), bonus); + ctx->capthist.Update(board.sideToMove, movingPiece, capturedPiece, currMove.MoveTo(), captHistoryBonus); } // Capthist malus @@ -803,7 +809,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC } ctx->capthist.Update(board.sideToMove, movingPiece, capturedPiece, - seenCaptures[moveIndex].MoveTo(), -bonus); + seenCaptures[moveIndex].MoveTo(), -captHistoryMalus); } if (!ctx->excluded) diff --git a/source/tunables.h b/source/tunables.h index 6796134..6314b36 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -23,9 +23,11 @@ X_INT(lmrTTPVFailLow, 1024, 256, 2048) \ X_INT(lmrDeeperBase, 30, 0, 96) \ X_INT(lmrDeeperScalar, 4, 0, 16) \ + X_INT(corrplexityThreshold, 70, 32, 128) \ X_INT(rfpBase, 25, 50, 200) \ X_INT(rfpMargin, 100, 50, 200) \ X_INT(fpMargin, 100, 50, 200) \ + X_INT(probcutBetaMargin, 200, 100, 300) \ X_INT(razoringScalar, 200, 80, 320) \ X_INT(doubleExtMargin, 30, 8, 64) \ X_INT(seeQuietThreshold, -80, -160, 0) \ @@ -40,8 +42,18 @@ X_INT(seeQsThreshold, 0, -120, 120) \ X_INT(seeOrderingThreshold, -100, -200, 0) \ X_INT(ldseMargin, 25, 0, 96) \ - X_INT(historyBonusMultiplier, 300, 200, 500) \ - X_INT(historyBonusSub, 250, 128, 384) + X_INT(historyBonusMultiplier, 300, 270, 330) \ + X_INT(historyBonusSub, 250, 230, 280) \ + X_INT(historyMalusMultiplier, 300, 270, 330) \ + X_INT(historyMalusSub, 250, 230, 280) \ + X_INT(contHistoryBonusMultiplier, 300, 270, 330) \ + X_INT(contHistoryBonusSub, 250, 230, 280) \ + X_INT(contHistoryMalusMultiplier, 300, 270, 330) \ + X_INT(contHistoryMalusSub, 250, 230, 280) \ + X_INT(captHistoryBonusMultiplier, 300, 270, 330) \ + X_INT(captHistoryBonusSub, 250, 230, 280) \ + X_INT(captHistoryMalusMultiplier, 300, 270, 330) \ + X_INT(captHistoryMalusSub, 250, 230, 280) #ifdef TUNING #define X_DOUBLE(name, default_val, min_val, max_val) \ From de6b96bbf82a9559505edcaef47c3812d2febe5c Mon Sep 17 00:00:00 2001 From: rektdie Date: Thu, 2 Apr 2026 00:37:18 +0200 Subject: [PATCH 5/8] removed poisonous parameters | bench 1398874 --- source/search.cpp | 4 ++-- source/tunables.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source/search.cpp b/source/search.cpp index d8bece7..e379094 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -435,7 +435,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC ttAdjustedEval = entry.score; } - bool corrplexity = std::abs(rawEval - staticEval) > corrplexityThreshold; + bool corrplexity = std::abs(rawEval - staticEval) > 70; const bool improving = [&] { @@ -685,7 +685,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC score = -PVS(copy, reduced, -alpha - 1, -alpha, ply + 1, ctx, true).score; if (score > alpha && reduced < newDepth) { - const bool goDeeper = score > results.score + lmrDeeperBase + lmrDeeperScalar * newDepth; + const bool goDeeper = score > results.score + lmrDeeperBase + 4 * newDepth; const bool goShallower = score < results.score + newDepth; newDepth += goDeeper - goShallower; diff --git a/source/tunables.h b/source/tunables.h index 6314b36..d18ea94 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -22,8 +22,6 @@ X_INT(lmrCorrplexity, 1024, 256, 2048) \ X_INT(lmrTTPVFailLow, 1024, 256, 2048) \ X_INT(lmrDeeperBase, 30, 0, 96) \ - X_INT(lmrDeeperScalar, 4, 0, 16) \ - X_INT(corrplexityThreshold, 70, 32, 128) \ X_INT(rfpBase, 25, 50, 200) \ X_INT(rfpMargin, 100, 50, 200) \ X_INT(fpMargin, 100, 50, 200) \ From caac437db71be42e41e28fd8c6f8493fafd37056 Mon Sep 17 00:00:00 2001 From: rektdie Date: Thu, 2 Apr 2026 00:44:40 +0200 Subject: [PATCH 6/8] fixed rfp min max | bench 1398874 --- source/tunables.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/source/tunables.h b/source/tunables.h index d18ea94..c617a36 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -22,7 +22,7 @@ X_INT(lmrCorrplexity, 1024, 256, 2048) \ X_INT(lmrTTPVFailLow, 1024, 256, 2048) \ X_INT(lmrDeeperBase, 30, 0, 96) \ - X_INT(rfpBase, 25, 50, 200) \ + X_INT(rfpBase, 25, 0, 100) \ X_INT(rfpMargin, 100, 50, 200) \ X_INT(fpMargin, 100, 50, 200) \ X_INT(probcutBetaMargin, 200, 100, 300) \ @@ -40,18 +40,18 @@ X_INT(seeQsThreshold, 0, -120, 120) \ X_INT(seeOrderingThreshold, -100, -200, 0) \ X_INT(ldseMargin, 25, 0, 96) \ - X_INT(historyBonusMultiplier, 300, 270, 330) \ - X_INT(historyBonusSub, 250, 230, 280) \ - X_INT(historyMalusMultiplier, 300, 270, 330) \ - X_INT(historyMalusSub, 250, 230, 280) \ - X_INT(contHistoryBonusMultiplier, 300, 270, 330) \ - X_INT(contHistoryBonusSub, 250, 230, 280) \ - X_INT(contHistoryMalusMultiplier, 300, 270, 330) \ - X_INT(contHistoryMalusSub, 250, 230, 280) \ - X_INT(captHistoryBonusMultiplier, 300, 270, 330) \ - X_INT(captHistoryBonusSub, 250, 230, 280) \ - X_INT(captHistoryMalusMultiplier, 300, 270, 330) \ - X_INT(captHistoryMalusSub, 250, 230, 280) + X_INT(historyBonusMultiplier, 300, 280, 320) \ + X_INT(historyBonusSub, 250, 235, 265) \ + X_INT(historyMalusMultiplier, 300, 280, 320) \ + X_INT(historyMalusSub, 250, 235, 265) \ + X_INT(contHistoryBonusMultiplier, 300, 280, 320) \ + X_INT(contHistoryBonusSub, 250, 235, 265) \ + X_INT(contHistoryMalusMultiplier, 300, 280, 320) \ + X_INT(contHistoryMalusSub, 250, 235, 265) \ + X_INT(captHistoryBonusMultiplier, 300, 280, 320) \ + X_INT(captHistoryBonusSub, 250, 235, 265) \ + X_INT(captHistoryMalusMultiplier, 300, 280, 320) \ + X_INT(captHistoryMalusSub, 250, 235, 265) #ifdef TUNING #define X_DOUBLE(name, default_val, min_val, max_val) \ From c4886db1fe35735715ef1228f8364b0fcf3572fa Mon Sep 17 00:00:00 2001 From: rektdie Date: Fri, 3 Apr 2026 19:34:52 +0200 Subject: [PATCH 7/8] 8k iters 5k games | bench 1181803 --- Scripts/spsa_output.txt | 42 +++++++++++++++++++++++ source/tunables.h | 76 ++++++++++++++++++++--------------------- 2 files changed, 80 insertions(+), 38 deletions(-) diff --git a/Scripts/spsa_output.txt b/Scripts/spsa_output.txt index e69de29..5f90346 100644 --- a/Scripts/spsa_output.txt +++ b/Scripts/spsa_output.txt @@ -0,0 +1,42 @@ +lmrBaseQuiet, 1.1029723689888005 +lmrDivisorQuiet, 2.3063513397139945 +lmrBaseNoisy, 0.451805556082857 +lmrDivisorNoisy, 3.1355330830404338 +lmrCutnode, 2005 +lmrIsPV, 982 +lmrTTPV, 936 +lmrHistoryDivisor, 8377 +lmrImproving, 1131 +lmrCorrplexity, 830 +lmrTTPVFailLow, 913 +lmrDeeperBase, 46 +rfpBase, 21 +rfpMargin, 97 +fpMargin, 86 +probcutBetaMargin, 190 +razoringScalar, 195 +doubleExtMargin, 32 +seeQuietThreshold, -81 +seeNoisyThreshold, -32 +aspInitialDelta, 26 +nmpBetaMargin, 25 +seePawnValue, 98 +seeKnightValue, 301 +seeBishopValue, 346 +seeRookValue, 507 +seeQueenValue, 924 +seeQsThreshold, -13 +seeOrderingThreshold, -102 +ldseMargin, 26 +historyBonusMultiplier, 306 +historyBonusSub, 252 +historyMalusMultiplier, 301 +historyMalusSub, 250 +contHistoryBonusMultiplier, 300 +contHistoryBonusSub, 252 +contHistoryMalusMultiplier, 300 +contHistoryMalusSub, 249 +captHistoryBonusMultiplier, 302 +captHistoryBonusSub, 249 +captHistoryMalusMultiplier, 300 +captHistoryMalusSub, 249 diff --git a/source/tunables.h b/source/tunables.h index c617a36..0bfba91 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -10,48 +10,48 @@ #define AUTO_R_END_FLOAT 0.002 #define TUNABLE_LIST \ - X_DOUBLE(lmrBaseQuiet, 1.1, 0.6, 1.6) \ - X_DOUBLE(lmrDivisorQuiet, 2.33, 1.6, 3.6) \ - X_DOUBLE(lmrBaseNoisy, 0.41, 0.1, 1.1) \ - X_DOUBLE(lmrDivisorNoisy, 3.20, 2.0, 4.5) \ - X_INT(lmrCutnode, 2048, 1024, 3072) \ - X_INT(lmrIsPV, 1024, 256, 2048) \ - X_INT(lmrTTPV, 1024, 256, 2048) \ - X_INT(lmrHistoryDivisor, 8192, 4096, 16384) \ - X_INT(lmrImproving, 1024, 256, 2048) \ - X_INT(lmrCorrplexity, 1024, 256, 2048) \ - X_INT(lmrTTPVFailLow, 1024, 256, 2048) \ - X_INT(lmrDeeperBase, 30, 0, 96) \ - X_INT(rfpBase, 25, 0, 100) \ - X_INT(rfpMargin, 100, 50, 200) \ - X_INT(fpMargin, 100, 50, 200) \ - X_INT(probcutBetaMargin, 200, 100, 300) \ - X_INT(razoringScalar, 200, 80, 320) \ - X_INT(doubleExtMargin, 30, 8, 64) \ - X_INT(seeQuietThreshold, -80, -160, 0) \ - X_INT(seeNoisyThreshold, -30, -120, 40) \ - X_INT(aspInitialDelta, 30, 8, 96) \ - X_INT(nmpBetaMargin, 30, 8, 96) \ - X_INT(seePawnValue, 100, 80, 140) \ - X_INT(seeKnightValue, 300, 240, 420) \ - X_INT(seeBishopValue, 350, 250, 450) \ - X_INT(seeRookValue, 500, 400, 700) \ - X_INT(seeQueenValue, 900, 700, 1300) \ - X_INT(seeQsThreshold, 0, -120, 120) \ - X_INT(seeOrderingThreshold, -100, -200, 0) \ - X_INT(ldseMargin, 25, 0, 96) \ - X_INT(historyBonusMultiplier, 300, 280, 320) \ - X_INT(historyBonusSub, 250, 235, 265) \ - X_INT(historyMalusMultiplier, 300, 280, 320) \ + X_DOUBLE(lmrBaseQuiet, 1.1029723689888005, 0.6, 1.6) \ + X_DOUBLE(lmrDivisorQuiet, 2.3063513397139945, 1.6, 3.6) \ + X_DOUBLE(lmrBaseNoisy, 0.451805556082857, 0.1, 1.1) \ + X_DOUBLE(lmrDivisorNoisy, 3.1355330830404338, 2.0, 4.5) \ + X_INT(lmrCutnode, 2005, 1024, 3072) \ + X_INT(lmrIsPV, 982, 256, 2048) \ + X_INT(lmrTTPV, 936, 256, 2048) \ + X_INT(lmrHistoryDivisor, 8377, 4096, 16384) \ + X_INT(lmrImproving, 1131, 256, 2048) \ + X_INT(lmrCorrplexity, 830, 256, 2048) \ + X_INT(lmrTTPVFailLow, 913, 256, 2048) \ + X_INT(lmrDeeperBase, 46, 0, 96) \ + X_INT(rfpBase, 21, 0, 100) \ + X_INT(rfpMargin, 97, 50, 200) \ + X_INT(fpMargin, 86, 50, 200) \ + X_INT(probcutBetaMargin, 190, 100, 300) \ + X_INT(razoringScalar, 195, 80, 320) \ + X_INT(doubleExtMargin, 32, 8, 64) \ + X_INT(seeQuietThreshold, -81, -160, 0) \ + X_INT(seeNoisyThreshold, -32, -120, 40) \ + X_INT(aspInitialDelta, 26, 8, 96) \ + X_INT(nmpBetaMargin, 25, 8, 96) \ + X_INT(seePawnValue, 98, 80, 140) \ + X_INT(seeKnightValue, 301, 240, 420) \ + X_INT(seeBishopValue, 346, 250, 450) \ + X_INT(seeRookValue, 507, 400, 700) \ + X_INT(seeQueenValue, 924, 700, 1300) \ + X_INT(seeQsThreshold, -13, -120, 120) \ + X_INT(seeOrderingThreshold, -102, -200, 0) \ + X_INT(ldseMargin, 26, 0, 96) \ + X_INT(historyBonusMultiplier, 306, 280, 320) \ + X_INT(historyBonusSub, 252, 235, 265) \ + X_INT(historyMalusMultiplier, 301, 280, 320) \ X_INT(historyMalusSub, 250, 235, 265) \ X_INT(contHistoryBonusMultiplier, 300, 280, 320) \ - X_INT(contHistoryBonusSub, 250, 235, 265) \ + X_INT(contHistoryBonusSub, 252, 235, 265) \ X_INT(contHistoryMalusMultiplier, 300, 280, 320) \ - X_INT(contHistoryMalusSub, 250, 235, 265) \ - X_INT(captHistoryBonusMultiplier, 300, 280, 320) \ - X_INT(captHistoryBonusSub, 250, 235, 265) \ + X_INT(contHistoryMalusSub, 249, 235, 265) \ + X_INT(captHistoryBonusMultiplier, 302, 280, 320) \ + X_INT(captHistoryBonusSub, 249, 235, 265) \ X_INT(captHistoryMalusMultiplier, 300, 280, 320) \ - X_INT(captHistoryMalusSub, 250, 235, 265) + X_INT(captHistoryMalusSub, 249, 235, 265) #ifdef TUNING #define X_DOUBLE(name, default_val, min_val, max_val) \ From d1bcec29ce2385d72913e04fd8a1b88784980f36 Mon Sep 17 00:00:00 2001 From: rektdie Date: Sat, 4 Apr 2026 00:12:28 +0200 Subject: [PATCH 8/8] disabled tuning | bench 1181803 --- source/tunables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tunables.h b/source/tunables.h index 0bfba91..c9e917c 100644 --- a/source/tunables.h +++ b/source/tunables.h @@ -2,7 +2,7 @@ #include #include -#define TUNING +//#define TUNING #define AUTO_STEP(min_val, max_val) ((max_val - min_val) / 20.0) #define AUTO_R_END_INT(min_val, max_val) \