From ed013362e3e906c8c9c9c6da67c17d3073785159 Mon Sep 17 00:00:00 2001 From: SzilBalazs Date: Tue, 15 Aug 2023 11:41:55 +0200 Subject: [PATCH] Add move overhead uci option Bench: 2134743 --- src/chess/constants.h | 1 - src/main.cpp | 1 + src/search/time_manager.h | 3 +++ src/uci/uci.h | 6 ++++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/chess/constants.h b/src/chess/constants.h index 1049195..9b92610 100644 --- a/src/chess/constants.h +++ b/src/chess/constants.h @@ -38,7 +38,6 @@ using Ply = int8_t; constexpr int64_t INF_TIME = 1'000'000'000'000'000; constexpr int64_t INF_NODES = 1'000'000'000'000'000; -constexpr int64_t MOVE_OVERHEAD = 30; constexpr Score UNKNOWN_SCORE = 300000; constexpr Score INF_SCORE = 200000; constexpr Score MATE_VALUE = 100000; diff --git a/src/main.cpp b/src/main.cpp index eeeddc4..39e7677 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,6 +34,7 @@ namespace chess { namespace search { Depth lmr_reductions[200][MAX_PLY + 1]; + int64_t TimeManager::MOVE_OVERHEAD = 30; } void init_all() { diff --git a/src/search/time_manager.h b/src/search/time_manager.h index cc59c6c..badb92a 100644 --- a/src/search/time_manager.h +++ b/src/search/time_manager.h @@ -22,6 +22,9 @@ namespace search { class TimeManager { public: + + static int64_t MOVE_OVERHEAD; + /** * Initializes time management with the given limits. * diff --git a/src/uci/uci.h b/src/uci/uci.h index f8daca0..57a309a 100644 --- a/src/uci/uci.h +++ b/src/uci/uci.h @@ -173,6 +173,12 @@ namespace uci { }, 1, 128); + options.emplace_back( + "Move_Overhead", "30", "spin", [&]() { + search::TimeManager::MOVE_OVERHEAD = get_option("Move_Overhead"); + }, + 0, 1000); + options.emplace_back( "UCI_ShowWDL", "false", "check", [&]() { search::report::set_show_wdl(get_option("UCI_ShowWDL"));