mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 11:36:51 +08:00
Merge remote-tracking branch 'remotes/nodchip/master' into trainer
This commit is contained in:
14
src/tt.cpp
14
src/tt.cpp
@@ -28,13 +28,16 @@
|
||||
|
||||
TranspositionTable TT; // Our global transposition table
|
||||
|
||||
bool TranspositionTable::enable_transposition_table = true;
|
||||
|
||||
/// TTEntry::save() populates the TTEntry with a new node's data, possibly
|
||||
/// overwriting an old position. Update is not atomic and can be racy.
|
||||
|
||||
void TTEntry::save(Key k, Value v, bool pv, Bound b, Depth d, Move m, Value ev) {
|
||||
if (Options["Training"])
|
||||
return;
|
||||
|
||||
if (!TranspositionTable::enable_transposition_table) {
|
||||
return;
|
||||
}
|
||||
// Preserve any existing move for the same position
|
||||
if (m || (uint16_t)k != key16)
|
||||
move16 = (uint16_t)m;
|
||||
@@ -117,8 +120,11 @@ void TranspositionTable::clear() {
|
||||
/// TTEntry t2 if its replace value is greater than that of t2.
|
||||
|
||||
TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
|
||||
if (Options["Training"])
|
||||
return found = false, first_entry(0);
|
||||
|
||||
if (!enable_transposition_table) {
|
||||
found = false;
|
||||
return first_entry(0);
|
||||
}
|
||||
|
||||
TTEntry* const tte = first_entry(key);
|
||||
const uint16_t key16 = (uint16_t)key; // Use the low 16 bits as key inside the cluster
|
||||
|
||||
Reference in New Issue
Block a user