mirror of
https://github.com/sockspls/badfish
synced 2025-05-02 09:39:36 +00:00
Sync with master
bench: 7374604
This commit is contained in:
commit
60c121f3b1
3 changed files with 24 additions and 2 deletions
|
@ -1441,8 +1441,12 @@ string UCI::pv(const Position& pos, Depth depth, Value alpha, Value beta) {
|
||||||
ss << (v >= beta ? " lowerbound" : v <= alpha ? " upperbound" : "");
|
ss << (v >= beta ? " lowerbound" : v <= alpha ? " upperbound" : "");
|
||||||
|
|
||||||
ss << " nodes " << pos.nodes_searched()
|
ss << " nodes " << pos.nodes_searched()
|
||||||
<< " nps " << pos.nodes_searched() * 1000 / elapsed
|
<< " nps " << pos.nodes_searched() * 1000 / elapsed;
|
||||||
<< " tbhits " << TB::Hits
|
|
||||||
|
if (elapsed > 1000) // Earlier makes little sense
|
||||||
|
ss << " hashfull " << TT.hashfull();
|
||||||
|
|
||||||
|
ss << " tbhits " << TB::Hits
|
||||||
<< " time " << elapsed
|
<< " time " << elapsed
|
||||||
<< " pv";
|
<< " pv";
|
||||||
|
|
||||||
|
|
17
src/tt.cpp
17
src/tt.cpp
|
@ -94,3 +94,20 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
|
||||||
|
|
||||||
return found = false, replace;
|
return found = false, replace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Returns an approximation of the hashtable occupation during a search. The
|
||||||
|
/// hash is x permill full, as per UCI protocol.
|
||||||
|
|
||||||
|
int TranspositionTable::hashfull() const
|
||||||
|
{
|
||||||
|
int cnt = 0;
|
||||||
|
for (int i = 0; i < 1000 / ClusterSize; i++)
|
||||||
|
{
|
||||||
|
const TTEntry* tte = &table[i].entry[0];
|
||||||
|
for (int j = 0; j < ClusterSize; j++)
|
||||||
|
if ((tte[j].genBound8 & 0xFC) == generation8)
|
||||||
|
cnt++;
|
||||||
|
}
|
||||||
|
return cnt;
|
||||||
|
}
|
||||||
|
|
1
src/tt.h
1
src/tt.h
|
@ -88,6 +88,7 @@ public:
|
||||||
void new_search() { generation8 += 4; } // Lower 2 bits are used by Bound
|
void new_search() { generation8 += 4; } // Lower 2 bits are used by Bound
|
||||||
uint8_t generation() const { return generation8; }
|
uint8_t generation() const { return generation8; }
|
||||||
TTEntry* probe(const Key key, bool& found) const;
|
TTEntry* probe(const Key key, bool& found) const;
|
||||||
|
int hashfull() const;
|
||||||
void resize(size_t mbSize);
|
void resize(size_t mbSize);
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue