From bd5f5ac602e70f72f656a944cb1f7e23d3c41401 Mon Sep 17 00:00:00 2001 From: rektdie Date: Fri, 11 Apr 2025 02:16:49 +0200 Subject: [PATCH] removed benchStarted bool --- source/benchmark.cpp | 2 -- source/search.cpp | 11 ++++++----- source/search.h | 2 -- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/source/benchmark.cpp b/source/benchmark.cpp index 78c9511..b0bffcf 100644 --- a/source/benchmark.cpp +++ b/source/benchmark.cpp @@ -65,7 +65,6 @@ void RunBenchmark() { Board board; int depth = BENCH_DEPTH; int ply = 0; - benchStarted = true; searchStopped = false; positionIndex = 0; @@ -86,7 +85,6 @@ void RunBenchmark() { std::cout << ctx.nodes << " nodes " << int(ctx.nodes/sw.GetElapsedSec()) << " nps" << std::endl; TT.Clear(); - benchStarted = false; std::memset(killerMoves, 0, sizeof(killerMoves)); history.Clear(); positionIndex = 0; diff --git a/source/search.cpp b/source/search.cpp index af4ac17..e651747 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -12,7 +12,6 @@ namespace SEARCH { U64 nodes = 0; U64 nodesToGo = 0; -bool benchStarted = false; static inline int timeToSearch = 0; static inline bool doingNullMove = false; @@ -143,10 +142,12 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int template static SearchResults Quiescence(Board board, int alpha, int beta, int ply, SearchContext& ctx) { if constexpr (mode != nodesMode) { - if (!benchStarted && ctx.nodes % 1024 == 0) { - if (sw.GetElapsedMS() >= timeToSearch) { - StopSearch(); - return 0; + if constexpr (mode != bench) { + if (ctx.nodes % 1024 == 0) { + if (sw.GetElapsedMS() >= timeToSearch) { + StopSearch(); + return 0; + } } } } else { diff --git a/source/search.h b/source/search.h index fb206be..3446fb8 100644 --- a/source/search.h +++ b/source/search.h @@ -19,8 +19,6 @@ constexpr int MAX_DEPTH = 64; constexpr int MAX_PLY = 128; constexpr int MAX_HISTORY = 16384; -extern bool benchStarted; - constexpr int inf = 100000; inline bool searchStopped = false;