removed benchStarted bool

This commit is contained in:
rektdie committed 2025-04-11 02:16:49 +02:00
1 parent eff4f50ee8
commit bd5f5ac602
3 files changed
+3 -6

No files matched your search

-2
View File
@@ -65,7 +65,6 @@ void RunBenchmark() {
Board board; Board board;
int depth = BENCH_DEPTH; int depth = BENCH_DEPTH;
int ply = 0; int ply = 0;
benchStarted = true;
searchStopped = false; searchStopped = false;
positionIndex = 0; positionIndex = 0;
@@ -86,7 +85,6 @@ void RunBenchmark() {
std::cout << ctx.nodes << " nodes " << int(ctx.nodes/sw.GetElapsedSec()) << " nps" << std::endl; std::cout << ctx.nodes << " nodes " << int(ctx.nodes/sw.GetElapsedSec()) << " nps" << std::endl;
TT.Clear(); TT.Clear();
benchStarted = false;
std::memset(killerMoves, 0, sizeof(killerMoves)); std::memset(killerMoves, 0, sizeof(killerMoves));
history.Clear(); history.Clear();
positionIndex = 0; positionIndex = 0;
+3 -2
View File
@@ -12,7 +12,6 @@ namespace SEARCH {
U64 nodes = 0; U64 nodes = 0;
U64 nodesToGo = 0; U64 nodesToGo = 0;
bool benchStarted = false;
static inline int timeToSearch = 0; static inline int timeToSearch = 0;
static inline bool doingNullMove = false; static inline bool doingNullMove = false;
@@ -143,12 +142,14 @@ static int GetReductions(Board &board, Move &move, int depth, int moveSeen, int
template <searchMode mode> template <searchMode mode>
static SearchResults Quiescence(Board board, int alpha, int beta, int ply, SearchContext& ctx) { static SearchResults Quiescence(Board board, int alpha, int beta, int ply, SearchContext& ctx) {
if constexpr (mode != nodesMode) { if constexpr (mode != nodesMode) {
if (!benchStarted && ctx.nodes % 1024 == 0) { if constexpr (mode != bench) {
if (ctx.nodes % 1024 == 0) {
if (sw.GetElapsedMS() >= timeToSearch) { if (sw.GetElapsedMS() >= timeToSearch) {
StopSearch(); StopSearch();
return 0; return 0;
} }
} }
}
} else { } else {
if (ctx.nodes > nodesToGo) { if (ctx.nodes > nodesToGo) {
StopSearch(); StopSearch();
-2
View File
@@ -19,8 +19,6 @@ constexpr int MAX_DEPTH = 64;
constexpr int MAX_PLY = 128; constexpr int MAX_PLY = 128;
constexpr int MAX_HISTORY = 16384; constexpr int MAX_HISTORY = 16384;
extern bool benchStarted;
constexpr int inf = 100000; constexpr int inf = 100000;
inline bool searchStopped = false; inline bool searchStopped = false;