From 00e86078a550631e3d045d882ab27f827d3f2378 Mon Sep 17 00:00:00 2001 From: Joona Kiiski Date: Sun, 11 Jul 2010 20:22:30 +0300 Subject: [PATCH] Remove TranspositionTable::overwrites variable Doesn't provide useful information and can cause slowdown with many Threads. No functional change Signed-off-by: Marco Costalba --- src/search.cpp | 5 ++--- src/tt.cpp | 17 +---------------- src/tt.h | 7 ------- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 367368b7..e38f4021 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -738,8 +738,7 @@ namespace { // Print final search statistics cout << "info nodes " << TM.nodes_searched() << " nps " << nps() - << " time " << current_search_time() - << " hashfull " << TT.full() << endl; + << " time " << current_search_time() << endl; // Print the best move and the ponder move to the standard output if (pv[0] == MOVE_NONE) @@ -2154,7 +2153,7 @@ namespace { dbg_print_hit_rate(); cout << "info nodes " << TM.nodes_searched() << " nps " << nps() - << " time " << t << " hashfull " << TT.full() << endl; + << " time " << t << endl; } // Should we stop the search? diff --git a/src/tt.cpp b/src/tt.cpp index 00ecfb63..5c5e10c1 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -23,7 +23,6 @@ //// #include -#include #include #include "movegen.h" @@ -38,7 +37,7 @@ TranspositionTable TT; TranspositionTable::TranspositionTable() { - size = overwrites = 0; + size = 0; entries = 0; generation = 0; } @@ -127,7 +126,6 @@ void TranspositionTable::store(const Key posKey, Value v, ValueType t, Depth d, replace = tte; } replace->save(posKey32, v, t, d, m, generation, statV, kingD); - overwrites++; } @@ -154,9 +152,7 @@ TTEntry* TranspositionTable::retrieve(const Key posKey) const { /// entries from the current search. void TranspositionTable::new_search() { - generation++; - overwrites = 0; } @@ -212,14 +208,3 @@ void TranspositionTable::extract_pv(const Position& pos, Move bestMove, Move pv[ } pv[ply] = MOVE_NONE; } - - -/// TranspositionTable::full() returns the permill of all transposition table -/// entries which have received at least one overwrite during the current search. -/// It is used to display the "info hashfull ..." information in UCI. - -int TranspositionTable::full() const { - - double N = double(size) * ClusterSize; - return int(1000 * (1 - exp(overwrites * log(1.0 - 1.0/N)))); -} diff --git a/src/tt.h b/src/tt.h index 6833c67d..bd6aae99 100644 --- a/src/tt.h +++ b/src/tt.h @@ -113,16 +113,9 @@ public: void new_search(); void insert_pv(const Position& pos, Move pv[]); void extract_pv(const Position& pos, Move bestMove, Move pv[], const int PLY_MAX); - int full() const; TTEntry* first_entry(const Key posKey) const; private: - // Be sure 'overwrites' is at least one cache line away - // from read only variables. - unsigned char pad_before[64 - sizeof(unsigned)]; - unsigned overwrites; // heavy SMP read/write access here - unsigned char pad_after[64]; - size_t size; TTCluster* entries; uint8_t generation; -- 2.39.2