]> git.sesse.net Git - stockfish/commitdiff
Remove TranspositionTable::overwrites variable
authorJoona Kiiski <joona.kiiski@gmail.com>
Sun, 11 Jul 2010 17:22:30 +0000 (20:22 +0300)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 11 Jul 2010 21:25:02 +0000 (22:25 +0100)
Doesn't provide useful information and
can cause slowdown with many Threads.

No functional change

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp
src/tt.cpp
src/tt.h

index 367368b738e0493a8ae0ac635ed693421ce77f5c..e38f4021d135a424da33225739ac28f775139e46 100644 (file)
@@ -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?
index 00ecfb635c187780cf4c8c475ee3df660532fb1a..5c5e10c16b720115ca4b20fabb9c97dbd21ffd99 100644 (file)
@@ -23,7 +23,6 @@
 ////
 
 #include <cassert>
-#include <cmath>
 #include <cstring>
 
 #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))));
-}
index 6833c67db0b36a2395a859a5033f79b64943e30c..bd6aae99b9e2918a4b008e28af9abc2f17e75f4e 100644 (file)
--- 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;