mirror of
https://github.com/sockspls/badfish
synced 2025-05-03 01:59:36 +00:00
Raise max Hash to 1TB
And use size_t where appropriate, as suggested on FishCooking. No functional change.
This commit is contained in:
parent
6b354305e1
commit
24ba204931
3 changed files with 5 additions and 7 deletions
|
@ -30,11 +30,9 @@ TranspositionTable TT; // Our global transposition table
|
||||||
/// measured in megabytes. Transposition table consists of a power of 2 number
|
/// measured in megabytes. Transposition table consists of a power of 2 number
|
||||||
/// of clusters and each cluster consists of TTClusterSize number of TTEntry.
|
/// of clusters and each cluster consists of TTClusterSize number of TTEntry.
|
||||||
|
|
||||||
void TranspositionTable::resize(uint64_t mbSize) {
|
void TranspositionTable::resize(size_t mbSize) {
|
||||||
|
|
||||||
assert(msb((mbSize * 1024 * 1024) / sizeof(TTCluster)) < 32);
|
size_t newClusterCount = size_t(1) << msb((mbSize * 1024 * 1024) / sizeof(TTCluster));
|
||||||
|
|
||||||
uint32_t newClusterCount = 1 << msb((mbSize * 1024 * 1024) / sizeof(TTCluster));
|
|
||||||
|
|
||||||
if (newClusterCount == clusterCount)
|
if (newClusterCount == clusterCount)
|
||||||
return;
|
return;
|
||||||
|
|
4
src/tt.h
4
src/tt.h
|
@ -89,12 +89,12 @@ public:
|
||||||
|
|
||||||
const TTEntry* probe(const Key key) const;
|
const TTEntry* probe(const Key key) const;
|
||||||
TTEntry* first_entry(const Key key) const;
|
TTEntry* first_entry(const Key key) const;
|
||||||
void resize(uint64_t mbSize);
|
void resize(size_t mbSize);
|
||||||
void clear();
|
void clear();
|
||||||
void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV);
|
void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t clusterCount;
|
size_t clusterCount;
|
||||||
TTCluster* table;
|
TTCluster* table;
|
||||||
void* mem;
|
void* mem;
|
||||||
uint8_t generation; // Size must be not bigger than TTEntry::genBound8
|
uint8_t generation; // Size must be not bigger than TTEntry::genBound8
|
||||||
|
|
|
@ -60,7 +60,7 @@ void init(OptionsMap& o) {
|
||||||
o["Contempt Factor"] << Option(0, -50, 50);
|
o["Contempt Factor"] << Option(0, -50, 50);
|
||||||
o["Min Split Depth"] << Option(0, 0, 12, on_threads);
|
o["Min Split Depth"] << Option(0, 0, 12, on_threads);
|
||||||
o["Threads"] << Option(1, 1, MAX_THREADS, on_threads);
|
o["Threads"] << Option(1, 1, MAX_THREADS, on_threads);
|
||||||
o["Hash"] << Option(32, 1, 16384, on_hash_size);
|
o["Hash"] << Option(32, 1, 1024 * 1024, on_hash_size);
|
||||||
o["Clear Hash"] << Option(on_clear_hash);
|
o["Clear Hash"] << Option(on_clear_hash);
|
||||||
o["Ponder"] << Option(true);
|
o["Ponder"] << Option(true);
|
||||||
o["MultiPV"] << Option(1, 1, 500);
|
o["MultiPV"] << Option(1, 1, 500);
|
||||||
|
|
Loading…
Add table
Reference in a new issue