tt aging | bench 1743358

This commit is contained in:
rektdie committed 2026-02-26 02:21:48 +01:00
1 parent 855e5c2377
commit 5ca125e336
3 files changed
+40 -4

No files matched your search

+12
View File
@@ -26,6 +26,7 @@ public:
Move bestMove = Move();
uint8_t depth = 0;
uint8_t nodeType = 0;
uint8_t age = 0;
bool ttpv = false;
TTEntry() {}
@@ -55,6 +56,13 @@ constexpr int16_t invalidEntry = 11111;
class TTable {
private:
std::vector<TTBucket> table;
uint8_t age = 0;
int GetReplacementValue(const TTEntry& entry) const {
const int ageDelta = uint8_t(age - entry.age);
return entry.depth - ageDelta * 4 + entry.ttpv * 2;
}
public:
TTable() : table(defaultHash) {};
@@ -72,6 +80,10 @@ public:
__builtin_prefetch(&table[hashKey % table.size()]);
}
void IncreaseAge() {
age++;
}
TTEntry GetEntry(U64 &hashKey) {
TTBucket *current = &table[hashKey % table.size()];
if (current->depthPreferred.hashKey == hashKey) {