Fixed-size, thread-safe Transposition Table for expectimax search.
Stored in flat primitive arrays to ensure zero-GC pressure on hot search paths.
Concurrency contract — racy-reader safe, not general-purpose thread-safe: the classic lockless scheme (Hyatt). A checksum over ALL entry fields is written alongside each entry; a reader that observes a mixed or torn snapshot fails the checksum and reports a miss, so concurrent readers can lose entries but never observe a corrupt one (residual false-accept probability ~2⁻⁶⁴). There is no memory-ordering guarantee, so readers may also see stale — but internally consistent — entries. Single writer recommended until the parallel-search stage (#61) revisits publication with JVM fences.
Lifetime contract: entries encode only (position, evaluator) — for a FIXED evaluator an EXACT value never goes stale, across moves or games; that is why entries carry no generation field. The table is therefore bound to one evaluator: it is owned by the search instance that created it and must never be shared between models. Call clear when reusing an instance across games only if you want fresh telemetry or replacement pressure — not for correctness.
Value parameters
- capacityPowerOfTwo
-
table capacity, must be a power of two (default 2^18 = 262,144 entries)
Attributes
- Companion
- object
- Source
- TranspositionTable.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any