From 73be819426a9bf434d4c5fae1f807da565e3697d Mon Sep 17 00:00:00 2001 From: Tord Romstad Date: Tue, 29 Sep 2009 13:40:00 +0200 Subject: [PATCH] Temporarily removed the unfinished UCI_Elo code in preparation for the release of the public Stockfish 1.5. --- src/search.cpp | 55 ++--------------------------------------------- src/ucioption.cpp | 2 -- 2 files changed, 2 insertions(+), 55 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 7d8f8e87..4ba85b48 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -193,16 +193,6 @@ namespace { /// Variables initialized by UCI options - // Adjustable playing strength - int Slowdown = 0; - const int SlowdownArray[32] = { - 19, 41, 70, 110, 160, 230, 320, 430, 570, 756, 1000, 1300, 1690, 2197, - 2834, 3600, 4573, 5809, 7700, 9863, 12633, 16181, 20726, 26584, 34005, - 43557, 55792, 71463, 91536, 117247, 150180, 192363 - }; - int Strength; - const int MaxStrength = 25; - // Minimum number of full depth (i.e. non-reduced) moves at PV and non-PV nodes int LMRPVMoves, LMRNonPVMoves; // heavy SMP read access for the latter @@ -302,7 +292,6 @@ namespace { bool ok_to_history(const Position& pos, Move m); void update_history(const Position& pos, Move m, Depth depth, Move movesSearched[], int moveCount); void update_killers(Move m, SearchStack& ss); - void slowdown(const Position& pos); bool fail_high_ply_1(); int current_search_time(); @@ -423,10 +412,8 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, read_weights(pos.side_to_move()); - // Set the number of active threads. If UCI_LimitStrength is enabled, never - // use more than one thread. - int newActiveThreads = - get_option_value_bool("UCI_LimitStrength")? 1 : get_option_value_int("Threads"); + // Set the number of active threads. + int newActiveThreads = get_option_value_int("Threads"); if (newActiveThreads != ActiveThreads) { ActiveThreads = newActiveThreads; @@ -439,19 +426,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, for (int i = 1; i < ActiveThreads; i++) assert(thread_is_available(i, 0)); - // Set playing strength - if (get_option_value_bool("UCI_LimitStrength")) - { - Strength = (get_option_value_int("UCI_Elo") - 2100) / 25; - Slowdown = - (Strength == MaxStrength)? 0 : SlowdownArray[Max(0, 31-Strength)]; - } - else - { - Strength = MaxStrength; - Slowdown = 0; - } - // Set thinking time int myTime = time[side_to_move]; int myIncrement = increment[side_to_move]; @@ -496,13 +470,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, NodesBetweenPolls = Min(MaxNodes, 30000); InfiniteSearch = true; // HACK } - else if (Slowdown) { - if (Slowdown > 50000) NodesBetweenPolls = 30; - else if (Slowdown > 10000) NodesBetweenPolls = 100; - else if (Slowdown > 1000) NodesBetweenPolls = 500; - else if (Slowdown > 100) NodesBetweenPolls = 3000; - else NodesBetweenPolls = 15000; - } else NodesBetweenPolls = 30000; @@ -2107,9 +2074,6 @@ namespace { assert(ply >= 0 && ply < PLY_MAX); assert(threadID >= 0 && threadID < ActiveThreads); - if (Slowdown && Iteration >= 3) - slowdown(pos); - Threads[threadID].nodes++; if (threadID == 0) @@ -2447,21 +2411,6 @@ namespace { } - // slowdown() simply wastes CPU cycles doing nothing useful. It's used - // in strength handicap mode. - - void slowdown(const Position &pos) { - int i, n; - n = Slowdown; - for (i = 0; i < n; i++) { - Square s = Square(i&63); - if (count_1s(pos.attackers_to(s)) > 63) - std::cout << "This can't happen, but I put this string here anyway, in order to " - "prevent the compiler from optimizing away the useless computation." << std::endl; - } - } - - // fail_high_ply_1() checks if some thread is currently resolving a fail // high at ply 1 at the node below the first root node. This information // is used for time managment. diff --git a/src/ucioption.cpp b/src/ucioption.cpp index c1b35137..1b866554 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -131,8 +131,6 @@ namespace { o["UCI_ShowCurrLine"] = Option(false); o["UCI_Chess960"] = Option(false); o["UCI_AnalyseMode"] = Option(false); - o["UCI_LimitStrength"] = Option(false); - o["UCI_Elo"] = Option(2900, 2100, 2900); // Any option should know its name so to be easily printed for (Options::iterator it = o.begin(); it != o.end(); ++it) -- 2.39.2