From b7eafdbd2907db67a02a719c43e27af4d925f892 Mon Sep 17 00:00:00 2001 From: rektdie Date: Tue, 20 May 2025 05:05:38 +0200 Subject: [PATCH] added seldepth | bench 4800210 --- source/search.cpp | 9 +++++++++ source/search.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/source/search.cpp b/source/search.cpp index 4ea6893..37f05ff 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -148,6 +148,9 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear return 0; } } + + if (ply > ctx.seldepth) + ctx.seldepth = ply; int bestScore = NNUE::net.Evaluate(board); ctx.ss[ply].eval = bestScore; @@ -223,6 +226,10 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC } } + if (ply > ctx.seldepth) + ctx.seldepth = ply; + + ctx.pvLine.SetLength(ply); if (ply && (IsDraw(board, ctx))) return 0; @@ -464,6 +471,7 @@ static SearchResults ID(Board &board, SearchParams params, SearchContext& ctx) { if constexpr (mode == normal || mode == nodesMode) { std::cout << "info "; std::cout << "depth " << depth; + std::cout << " seldepth " << ctx.seldepth; std::cout << " time " << elapsed; std::cout << " score cp " << UTILS::ConvertToWhiteRelative(board, safeResults.score); std::cout << " nodes " << ctx.nodes << " nps " << int(ctx.nodes/ctx.sw.GetElapsedSec()); @@ -493,6 +501,7 @@ static SearchResults ID(Board &board, SearchParams params, SearchContext& ctx) { template SearchResults SearchPosition(Board &board, SearchParams params, SearchContext& ctx) { ctx.searchStopped = false; + ctx.seldepth = 0; if constexpr (mode != bench) { ctx.nodes = 0; diff --git a/source/search.h b/source/search.h index 1740b33..d56ca14 100644 --- a/source/search.h +++ b/source/search.h @@ -95,6 +95,8 @@ public: U64 nodes = 0; U64 nodesToGo = 0; int timeToSearch = 0; + + int seldepth = 0; bool doingNullMove = false; bool searchStopped = false;