mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Restore deterministic search state
Introduce helper function Search::reset() which clears all kind of search memory, in order to restore a deterministic search state. Generalize TT.clear() into Search::reset() for the following use cases: - bench: needed to guarantee deterministic bench (ie. if you call bench from interactive command line twice in a row you get the same value). - Clear Hash: restore clean search state, which is the purpose of this button. - ucinewgame: ditto. No functional change. Resolves #346
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <ostream>
|
||||
|
||||
#include "misc.h"
|
||||
#include "search.h"
|
||||
#include "thread.h"
|
||||
#include "tt.h"
|
||||
#include "uci.h"
|
||||
@@ -34,7 +35,7 @@ UCI::OptionsMap Options; // Global object
|
||||
namespace UCI {
|
||||
|
||||
/// 'On change' actions, triggered by an option's value change
|
||||
void on_clear_hash(const Option&) { TT.clear(); }
|
||||
void on_clear_hash(const Option&) { Search::reset(); }
|
||||
void on_hash_size(const Option& o) { TT.resize(o); }
|
||||
void on_logger(const Option& o) { start_logger(o); }
|
||||
void on_threads(const Option&) { Threads.read_uci_options(); }
|
||||
|
||||
Reference in New Issue
Block a user