Part
Transposition table
You might say: transposition cache, memo table
A hash-keyed cache of results for game states or rules queries reached during search. It lets search reuse a prior result instead of simulating or scoring the same state again.
- What it does
- Trades memory for time by avoiding repeated search work and by supplying stored bounds or moves to guide later search.
- Ask
- Does each key include every rule-relevant fact, and can this entry be reused safely at the current search depth and bound?
- Typical
- A bounded table sized for available memory, with entries carrying a key, search depth, score or bound, best move and age.
- Trouble
- A stale entry is returned after the relevant rules or search context changed, a collision returns another state's result, or the table is too small and repeated states are expanded again.
What to look for
- A hash key, depth and score beside a search node
- Cache-hit and collision counters in a search profile
- A repeated state marked as reused instead of expanded again
Connections
- See also: Forward model
- See also: AI budget
Sources
- Chess Programming Wiki, Transposition Table, How it works
When the search encounters a transposition, it is beneficial to 'remember' what was determined the last time the position was examined, rather than redoing the entire search again.
- Chess Programming Wiki, Transposition Table, Hash functions
Hash functions convert chess positions into an almost unique, scalar signature, allowing fast index calculation as well as space-saving verification of stored positions.
- Aske Plaat, Jonathan Schaeffer, Wim Pijls and Arie de Bruin, Best-First Fixed-Depth Minimax Algorithms, Section 3.1, p. 13
A transposition table is a hash table in which searched nodes (barring collisions, the search tree) are stored. The tree-search algorithm is modified to look in this table before it searches a node and, if it finds the node, uses the value instead of searching.
- Chess Programming Wiki, Transposition Table, Aging
Aging is used to likely replace those entries by new ones, even if their draft and flags would otherwise protect them.
Use it on your project
teardown-apply: hold "Transposition table" (transposition-table) from the teardown at https://teardownatlas.com/game-ai/ against my project
Paste it into a coding agent that has the teardown skills.
An AI agent wrote this map with the teardown skill. It can contain errors: check the sources before you rely on a part. About and legal