okay, actually disable it | bench 1181803

This commit is contained in:
rektdie committed 2026-04-04 12:44:42 +02:00
1 parent 0f849c1b7f
commit 00f0d06381
1 file changed
+20 -20
+20 -20
View File
@@ -274,12 +274,12 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear
if (ShouldStop<mode>(ctx)) return 0; if (ShouldStop<mode>(ctx)) return 0;
if (ply + 1 >= MAX_DEPTH) if (ply + 1 >= MAX_DEPTH)
return NNUE::net.Evaluate(board); return NNUE::net.Evaluate(board, mode == datagen);
if (ply > ctx->seldepth) if (ply > ctx->seldepth)
ctx->seldepth = ply; ctx->seldepth = ply;
int bestScore = AdjustEval(board, ctx, NNUE::net.Evaluate(board)); int bestScore = AdjustEval(board, ctx, NNUE::net.Evaluate(board, mode == datagen));
ctx->ss[ply].eval = bestScore; ctx->ss[ply].eval = bestScore;
TTEntry entry; TTEntry entry;
@@ -390,7 +390,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
if (ShouldStop<mode>(ctx)) return 0; if (ShouldStop<mode>(ctx)) return 0;
if (ply + 1 >= MAX_DEPTH) if (ply + 1 >= MAX_DEPTH)
return NNUE::net.Evaluate(board); return NNUE::net.Evaluate(board, mode == datagen);
if (ply > ctx->seldepth) if (ply > ctx->seldepth)
ctx->seldepth = ply; ctx->seldepth = ply;
@@ -421,13 +421,13 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
if (depth <= 0) return Quiescence<isPV, mode>(board, alpha, beta, ply, ctx); if (depth <= 0) return Quiescence<isPV, mode>(board, alpha, beta, ply, ctx);
int rawEval = NNUE::net.Evaluate(board); int rawEval = NNUE::net.Evaluate(board, mode == datagen);
const int staticEval = AdjustEval(board, ctx, rawEval); const int staticEval = AdjustEval(board, ctx, rawEval);
ctx->ss[ply].eval = staticEval; ctx->ss[ply].eval = staticEval;
int ttAdjustedEval = staticEval; int ttAdjustedEval = staticEval;
if (!ctx->excluded && !board.InCheck() && ttHit && if (!ctx->excluded && !board.InCheck() && ttHit &&
((entry.nodeType == PV) || ((entry.nodeType == PV) ||
(entry.nodeType == AllNode && entry.score <= staticEval) || (entry.nodeType == AllNode && entry.score <= staticEval) ||
(entry.nodeType == CutNode && entry.score >= staticEval))) { (entry.nodeType == CutNode && entry.score >= staticEval))) {
@@ -547,7 +547,7 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
MovePicker<All> mp(board, ctx, ply, entry.bestMove); MovePicker<All> mp(board, ctx, ply, entry.bestMove);
int score = -inf; int score = -inf;
int nodeType = AllNode; int nodeType = AllNode;
@@ -590,14 +590,14 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
// If our static eval is far below alpha, there is only a small chance // If our static eval is far below alpha, there is only a small chance
// that a quiet move will help us so we skip them // that a quiet move will help us so we skip them
int historyScore = ctx->history[board.sideToMove][currMove.MoveFrom()][currMove.MoveTo()][sourceThreatened][targetThreatened]; int historyScore = ctx->history[board.sideToMove][currMove.MoveFrom()][currMove.MoveTo()][sourceThreatened][targetThreatened];
if (ply > 0) { if (ply > 0) {
historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 1); historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 1);
if (ply > 1) if (ply > 1)
historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 2); historyScore += ctx->conthist.GetNPly(board, currMove, ctx, ply, 2);
} }
int margin = fpMargin * (lmrDepth + improving) + historyScore / 32; int margin = fpMargin * (lmrDepth + improving) + historyScore / 32;
if (!isPV && ply && currMove.IsQuiet() if (!isPV && ply && currMove.IsQuiet()
@@ -867,10 +867,10 @@ public:
}; };
static double ScaleTime(SearchContext *ctx, Move &move) { static double ScaleTime(SearchContext *ctx, Move &move) {
double notBmNodesFraction = double notBmNodesFraction =
ctx->nodesTable[move % 4096] / double(ctx->nodes); ctx->nodesTable[move % 4096] / double(ctx->nodes);
double nodeScalingFactor = (1.5f - notBmNodesFraction) * 1.35f; double nodeScalingFactor = (1.5f - notBmNodesFraction) * 1.35f;
return nodeScalingFactor; return nodeScalingFactor;
} }
@@ -1040,11 +1040,11 @@ void PrintSearchInfo(Board& board, SearchContext* ctx, SearchResults& results, i
} else { } else {
std::cout << termcolor::color<251>; std::cout << termcolor::color<251>;
} }
std::stringstream depthStr; std::stringstream depthStr;
depthStr << depth << '/' << ctx->seldepth; depthStr << depth << '/' << ctx->seldepth;
std::cout << std::setw(6) << std::left << depthStr.str(); std::cout << std::setw(6) << std::left << depthStr.str();
std::stringstream timeStr; std::stringstream timeStr;
if (elapsed >= 1000) { if (elapsed >= 1000) {
timeStr << std::fixed << std::setprecision(1) << (elapsed / 1000.0) << "s"; timeStr << std::fixed << std::setprecision(1) << (elapsed / 1000.0) << "s";
@@ -1052,7 +1052,7 @@ void PrintSearchInfo(Board& board, SearchContext* ctx, SearchResults& results, i
timeStr << elapsed << "ms"; timeStr << elapsed << "ms";
} }
std::cout << std::setw(10) << std::right << timeStr.str(); std::cout << std::setw(10) << std::right << timeStr.str();
std::stringstream scoreStr; std::stringstream scoreStr;
bool isMate = false; bool isMate = false;
int mateIn = 0; int mateIn = 0;
@@ -1067,7 +1067,7 @@ void PrintSearchInfo(Board& board, SearchContext* ctx, SearchResults& results, i
scoreStr << "+M" << mateIn; scoreStr << "+M" << mateIn;
} }
} else { } else {
scoreStr << std::showpos << std::fixed << std::setprecision(2) scoreStr << std::showpos << std::fixed << std::setprecision(2)
<< (normalizedScore / 100.0) << std::noshowpos; << (normalizedScore / 100.0) << std::noshowpos;
} }
@@ -1084,7 +1084,7 @@ void PrintSearchInfo(Board& board, SearchContext* ctx, SearchResults& results, i
std::cout << termcolor::red; std::cout << termcolor::red;
} }
} }
std::cout << std::setw(9) << std::right << scoreStr.str(); std::cout << std::setw(9) << std::right << scoreStr.str();
std::cout << termcolor::reset; std::cout << termcolor::reset;
if (depth % 2 == 0) { if (depth % 2 == 0) {
@@ -1103,7 +1103,7 @@ void PrintSearchInfo(Board& board, SearchContext* ctx, SearchResults& results, i
std::stringstream hashfullStr; std::stringstream hashfullStr;
hashfullStr << "TT: " << (ctx->TT->GetUsedPercentage() + 5) / 10 << '%'; hashfullStr << "TT: " << (ctx->TT->GetUsedPercentage() + 5) / 10 << '%';
std::cout << std::setw(10) << std::right << hashfullStr.str(); std::cout << std::setw(10) << std::right << hashfullStr.str();
std::stringstream nodesStr; std::stringstream nodesStr;
if (ctx->nodes >= 1000000) { if (ctx->nodes >= 1000000) {
nodesStr << std::fixed << std::setprecision(1) << (ctx->nodes / 1000000.0) << "M"; nodesStr << std::fixed << std::setprecision(1) << (ctx->nodes / 1000000.0) << "M";
@@ -1113,7 +1113,7 @@ void PrintSearchInfo(Board& board, SearchContext* ctx, SearchResults& results, i
nodesStr << ctx->nodes; nodesStr << ctx->nodes;
} }
std::cout << std::setw(11) << std::right << nodesStr.str(); std::cout << std::setw(11) << std::right << nodesStr.str();
int nps = int(ctx->nodes/ctx->sw.GetElapsedSec()); int nps = int(ctx->nodes/ctx->sw.GetElapsedSec());
std::stringstream npsStr; std::stringstream npsStr;
if (nps >= 1000000) { if (nps >= 1000000) {
@@ -1124,10 +1124,10 @@ void PrintSearchInfo(Board& board, SearchContext* ctx, SearchResults& results, i
npsStr << nps << "/s"; npsStr << nps << "/s";
} }
std::cout << std::setw(12) << std::right << npsStr.str(); std::cout << std::setw(12) << std::right << npsStr.str();
std::cout << " "; std::cout << " ";
ctx->pvLine.Print(0, depth % 2 == 0); ctx->pvLine.Print(0, depth % 2 == 0);
std::cout << termcolor::reset << std::endl; std::cout << termcolor::reset << std::endl;
} }
} }