Skip to main content

Module reference

Module reference 

Source
Expand description

Exact game-theoretic references for benchmark positions.

Port of benchmarks/reference.py: a position’s reference is the game value for the side to move plus the complete set of optimal moves, produced by full-depth minimax and stored only when every child was solved with no cutoff.

Functions§

augment_with_references
Fill reference fields in place; the opening phase is skipped (its positions are too expensive to solve and never contribute to exact move-agreement figures).
augment_with_references_with_book
Like augment_with_references, but reads through (and writes back into) book when given — see solve_position_with_book.
move_key
Stable string identifier for a move: player:shape:position.
parse_move_key
Parse a move key into (player, shape, position).
solve_position
Return an exact reference for bb, or None on budget cutoff.
solve_position_with_book
Like solve_position, but first probes book (when given) for a stored solved reference at bb’s canonical key, short-circuiting the minimax solve on a hit. On a fresh solve, the result is written back through book (best-effort — a write failure is silently ignored, the solve itself already succeeded and is returned regardless).