io-chess
UCI chess engine
Loading...
Searching...
No Matches
TTEntry Struct Reference

16-byte Transposition Table entry for search results. More...

#include <TT.h>

Public Member Functions

bool probe (uint64_t key, uint64_t &out_data) const
 Probes the entry to safely retrieve data if the key matches.
void save (uint64_t key, int16_t score, int16_t sEval, uint8_t depth, Bound bound, uint16_t move, uint8_t age)
 Atomically stores search data into the entry.

Static Public Member Functions

static uint16_t getMove (uint64_t d)
static int16_t getScore (uint64_t d)
static int16_t getStaticEval (uint64_t d)
static uint8_t getDepth (uint64_t d)
static Bound getBound (uint64_t d)
static uint8_t getAge (uint64_t d)

Public Attributes

uint64_t data
 Packed search data.
uint64_t signature
 Checksum signature (Key ^ Data).

Detailed Description

16-byte Transposition Table entry for search results.

Uses a lockless XOR signature approach to detect data tearing during concurrent reads and writes. Layout: [Move:16][Score:16][StaticEval:16][Depth:8][Bound:3][Age:5] = 64 bits.

Member Function Documentation

◆ getAge()

uint8_t TTEntry::getAge ( uint64_t d)
inlinestatic
Here is the caller graph for this function:

◆ getBound()

Bound TTEntry::getBound ( uint64_t d)
inlinestatic
Here is the caller graph for this function:

◆ getDepth()

uint8_t TTEntry::getDepth ( uint64_t d)
inlinestatic
Here is the caller graph for this function:

◆ getMove()

uint16_t TTEntry::getMove ( uint64_t d)
inlinestatic
Here is the caller graph for this function:

◆ getScore()

int16_t TTEntry::getScore ( uint64_t d)
inlinestatic
Here is the caller graph for this function:

◆ getStaticEval()

int16_t TTEntry::getStaticEval ( uint64_t d)
inlinestatic
Here is the caller graph for this function:

◆ probe()

bool TTEntry::probe ( uint64_t key,
uint64_t & out_data ) const
inline

Probes the entry to safely retrieve data if the key matches.

Parameters
keyThe 64-bit Zobrist key of the position.
out_dataOutput parameter for the packed data if successful.
Returns
True if the entry belongs to the key and is not torn.
Here is the caller graph for this function:

◆ save()

void TTEntry::save ( uint64_t key,
int16_t score,
int16_t sEval,
uint8_t depth,
Bound bound,
uint16_t move,
uint8_t age )
inline

Atomically stores search data into the entry.

Parameters
key64-bit Zobrist key.
scoreMinimax score.
sEvalStatic evaluation score.
depthRemaining search depth.
boundScore bound type.
moveBest move found.
ageSearch generation age.
Here is the caller graph for this function:

Member Data Documentation

◆ data

uint64_t TTEntry::data

Packed search data.

◆ signature

uint64_t TTEntry::signature

Checksum signature (Key ^ Data).


The documentation for this struct was generated from the following file:
  • engine/src/search/TT.h