diff --git a/src/search.c b/src/search.c index 251cc4d2..4cba415e 100644 --- a/src/search.c +++ b/src/search.c @@ -39,6 +39,7 @@ SearchLimits Limits = { .multiPV = 1 }; atomic_bool ABORT_SIGNAL; atomic_bool SEARCH_STOPPED = true; +atomic_bool Minimal = false; static int Reductions[2][32][32]; @@ -687,6 +688,7 @@ static void AspirationWindow(Thread *thread, Stack *ss) { // Give an update when failing high/low in longer searches if ( mainThread && Limits.multiPV == 1 + && !Minimal && (score <= alpha || score >= beta) && TimeSince(Limits.start) > 3000) PrintThinking(thread, alpha, beta); @@ -739,8 +741,9 @@ static void *IterativeDeepening(void *voidThread) { // Only the main thread concerns itself with the rest if (!mainThread) continue; - // Print thinking info - PrintThinking(thread, -INFINITE, INFINITE); + // Print search info + if (!Minimal) + PrintThinking(thread, -INFINITE, INFINITE); // Stop searching after finding a short enough mate if (MATE - abs(thread->rootMoves[0].score) <= 2 * abs(Limits.mate)) break; @@ -763,6 +766,14 @@ static void *IterativeDeepening(void *voidThread) { history(i).key = 0; } + // Print final search info in minimal mode + if (mainThread && Minimal) { + // Fix the depth when the search is stopped due to reaching the depth limit + if (thread->depth > Limits.depth) + thread->depth--; + PrintThinking(thread, -INFINITE, INFINITE); + } + return NULL; } diff --git a/src/search.h b/src/search.h index 0d912194..a0fd89b6 100644 --- a/src/search.h +++ b/src/search.h @@ -37,6 +37,7 @@ typedef struct { extern SearchLimits Limits; extern atomic_bool ABORT_SIGNAL; extern atomic_bool SEARCH_STOPPED; +extern atomic_bool Minimal; void *SearchPosition(void *pos); diff --git a/src/uci.c b/src/uci.c index 07772e4f..8651d09e 100644 --- a/src/uci.c +++ b/src/uci.c @@ -115,6 +115,7 @@ static void SetOption(char *str) { else if (OptionNameIs("Threads" )) InitThreads(IntValue); else if (OptionNameIs("SyzygyPath" )) tb_init(optionValue); else if (OptionNameIs("MultiPV" )) Limits.multiPV = IntValue; + else if (OptionNameIs("Minimal" )) Minimal = BooleanValue; else if (OptionNameIs("NoobBookLimit")) NoobLimit = IntValue; else if (OptionNameIs("NoobBookMode" )) NoobBookSetMode(optionValue); else if (OptionNameIs("NoobBook" )) NoobBook = BooleanValue; @@ -133,6 +134,7 @@ static void Info() { printf("option name Threads type spin default %d min %d max %d\n", 1, 1, 2048); printf("option name SyzygyPath type string default \n"); printf("option name MultiPV type spin default 1 min 1 max %d\n", MULTI_PV_MAX); + printf("option name Minimal type check default false\n"); printf("option name UCI_Chess960 type check default false\n"); printf("option name NoobBook type check default false\n"); printf("option name NoobBookMode type string default \n");