mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 15:37:47 +00:00
Added EnableTranspositionTable UCI option to enable/disable transposition table.
This commit is contained in:
+11
@@ -28,6 +28,10 @@
|
|||||||
|
|
||||||
TranspositionTable TT; // Our global transposition table
|
TranspositionTable TT; // Our global transposition table
|
||||||
|
|
||||||
|
#ifdef EVAL_LEARN
|
||||||
|
bool TranspositionTable::enable_transposition_table = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
/// TTEntry::save() populates the TTEntry with a new node's data, possibly
|
/// TTEntry::save() populates the TTEntry with a new node's data, possibly
|
||||||
/// overwriting an old position. Update is not atomic and can be racy.
|
/// overwriting an old position. Update is not atomic and can be racy.
|
||||||
|
|
||||||
@@ -116,6 +120,13 @@ void TranspositionTable::clear() {
|
|||||||
|
|
||||||
TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
|
TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
|
||||||
|
|
||||||
|
#ifdef EVAL_LEARN
|
||||||
|
if (!enable_transposition_table) {
|
||||||
|
found = false;
|
||||||
|
return first_entry(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TTEntry* const tte = first_entry(key);
|
TTEntry* const tte = first_entry(key);
|
||||||
const uint16_t key16 = (uint16_t)key; // Use the low 16 bits as key inside the cluster
|
const uint16_t key16 = (uint16_t)key; // Use the low 16 bits as key inside the cluster
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,10 @@ public:
|
|||||||
return &table[mul_hi64(key, clusterCount)].entry[0];
|
return &table[mul_hi64(key, clusterCount)].entry[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef EVAL_LEARN
|
||||||
|
static bool enable_transposition_table;
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct TTEntry;
|
friend struct TTEntry;
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -44,7 +44,10 @@ void on_use_NNUE(const Option& ) { Eval::init_NNUE(); }
|
|||||||
void on_eval_file(const Option& ) { Eval::init_NNUE(); }
|
void on_eval_file(const Option& ) { Eval::init_NNUE(); }
|
||||||
#ifdef EVAL_LEARN
|
#ifdef EVAL_LEARN
|
||||||
void on_prune_at_shallow_depth_on_pv_node(const Option& o) {
|
void on_prune_at_shallow_depth_on_pv_node(const Option& o) {
|
||||||
Search::prune_at_shallow_depth_on_pv_node = o;
|
Search::prune_at_shallow_depth_on_pv_node = o;
|
||||||
|
}
|
||||||
|
void on_enable_transposition_table(const Option& o) {
|
||||||
|
TranspositionTable::enable_transposition_table = o;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -102,6 +105,8 @@ void init(OptionsMap& o) {
|
|||||||
o["EvalSaveDir"] << Option("evalsave");
|
o["EvalSaveDir"] << Option("evalsave");
|
||||||
// Prune at shallow depth on PV nodes. Setting this value to true gains elo in shallow search.
|
// Prune at shallow depth on PV nodes. Setting this value to true gains elo in shallow search.
|
||||||
o["PruneAtShallowDepthOnPvNode"] << Option(false, on_prune_at_shallow_depth_on_pv_node);
|
o["PruneAtShallowDepthOnPvNode"] << Option(false, on_prune_at_shallow_depth_on_pv_node);
|
||||||
|
// Enable transposition table.
|
||||||
|
o["EnableTranspositionTable"] << Option(true, on_enable_transposition_table);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user