Skip to main content

Module beam_search

Module beam_search 

Source
Expand description

Parametrizable beam search for Quantik.

Descends level-by-level from a root state, keeping only the top beam_width non-terminal candidates per depth (breadth pruning) while always discovering and recording every true terminal state encountered, regardless of the beam width. Port of the Python quantik_core.beam_search module (schedules, multiplicity accounting, ranked root moves, wall-clock budget) — without the shared CompactGameTree: this engine is standalone, and nodes_inserted counts the terminal leaves recorded plus the survivors kept per level, the closest observable analogue of the Python tree-insertion counter.

Structs§

BeamLeaf
A single collected leaf: a principal variation and its value.
BeamSearchConfig
Configuration for the beam search algorithm.
BeamSearchEngine
Level-by-level beam search over the Quantik game tree.
BeamSearchResult
Result of a beam search run.
BeamStats
Search statistics.
RankedRootMove
Aggregated beam-sampled statistics for one first move from the root.

Constants§

UNIQUE_CANONICAL_STATES_PER_DEPTH
Unique canonical states per depth (see GAME_TREE_ANALYSIS.md in the Python repository). Useful for building an exhaustive-prefix beam_schedule that keeps every legal line up to some depth before switching to guided sampling.

Type Aliases§

Evaluator
Evaluates a position from player 0’s perspective; values are clamped to [-1, 1] by the engine.