Skip to main content

Configuration Options

Every configurable method in GameState and MCTS, in one place.

Conventions: "Required" means no default -- you must implement it. All other methods have defaults you can override. Types shown are return types.


GameState methods

MethodTypeDefaultPurposeTutorial
current_player()Self::PlayerrequiredIdentifies whose turn it is2
available_moves()Self::MoveListrequiredLegal moves from this state; empty = terminal2
make_move(mov)()requiredApply a move, mutating state in place2
max_children(visits)usizeusize::MAXMax children to expand at this visit count; override for progressive wideningProgressive widening
terminal_value()Option<ProvenValue>NoneClassify terminal state for MCTS-Solver (current player's perspective)4
terminal_score()Option<i32>NoneExact minimax score of terminal state for Score-Bounded MCTS4
chance_outcomes()Option<Vec<(Move, f64)>>NoneChance event outcomes with probabilities (must sum to 1.0)5

MCTS associated types

TypeBoundsPurposeTutorial
StateGameState + Send + Sync + 'staticThe game state type2
EvalEvaluator<Self> + Send + 'staticState and move evaluator2
TreePolicyTreePolicy<Self> + Send + 'staticChild selection policy2
NodeDataDefault + Sync + Send + 'staticCustom per-node data (accessible via SearchHandle)7
TranspositionTableTranspositionTable<Self> + Send + 'staticTransposition table (use () for none)7
ExtraThreadData'staticCustom per-thread data (accessible via SearchHandle)7

MCTS methods

Search control

MethodTypeDefaultPurposeTutorial
virtual_loss()i640Bias subtracted during descent, added back during backprop; discourages thread collisionParallel MCTS
fpu_value()f64f64::INFINITYFirst Play Urgency: value for unvisited children; INFINITY = try all first; finite = let prior guide6
visits_before_expansion()u641Visits to a leaf before creating a tree node7
node_limit()usizeusize::MAXMaximum tree nodes; search halts when reached7
max_playout_length()usize1_000_000Safety cap: panics if a single playout exceeds this depth7
max_playout_depth()usizeusize::MAXQuality knob: forces leaf evaluation when exceeded7

Selection and output

MethodTypeDefaultPurposeTutorial
select_child_after_search(children)&MoveInfo<Self>Most-visited (solver/bounds-aware)Post-search child selection; override for custom behavior7
selection_temperature()f640.0Temperature for best_move(); 0 = argmax, 1 = proportional to visits6

Solver and bounds

MethodTypeDefaultPurposeTutorial
solver_enabled()boolfalseEnable MCTS-Solver: propagate proven win/loss/draw values4
score_bounded_enabled()boolfalseEnable Score-Bounded MCTS: track [lower, upper] minimax bounds4

Stochastic games

MethodTypeDefaultPurposeTutorial
closed_loop_chance()boolfalseGive each chance outcome its own tree node (larger tree, better per-outcome stats)5

Determinism and noise

MethodTypeDefaultPurposeTutorial
rng_seed()Option<u64>NoneSeed for deterministic search; each thread gets seed + thread_id7
dirichlet_noise()Option<(f64, f64)>None(epsilon, alpha) for root exploration noise: (1-eps)*prior + eps*Dir(alpha)6

Callbacks

MethodTypeDefaultPurposeTutorial
on_backpropagation(evaln, handle)()no-opCalled for each node on the playout path during backpropagation7
cycle_behaviour()CycleBehaviour<Self>PanicWhenCycleDetected (with TT) / Ignore (without TT)Strategy for graph cycles from transposition tables7

Interaction matrix

Some options interact with or require others.

OptionRequiresInteracts with
solver_enabled()GameState::terminal_value() or terminal_score()select_child_after_search() prefers proven wins
score_bounded_enabled()GameState::terminal_score() or terminal_value()Converged bounds set proven values when solver is also active
closed_loop_chance()GameState::chance_outcomes()Increases tree size; interacts with node_limit()
dirichlet_noise()TreePolicy::apply_dirichlet_noise() (non-trivial impl)Only effective with AlphaGoPolicy or custom policy with f64 priors
fpu_value() (finite)NothingBest combined with AlphaGoPolicy and neural network priors
virtual_loss()NothingOnly meaningful with parallel search (playout_n_parallel, etc.)
selection_temperature()NothingOnly affects best_move(); principal_variation() always uses argmax
rng_seed()NothingSeeds policy thread data via TreePolicy::seed_thread_data()
max_children()Moves returned in priority orderWorks with TreePolicy::compare_move_evaluations() for ordering

treant-gumbel configuration

The treant-gumbel crate uses GumbelConfig instead of the MCTS trait. See Gumbel Search tutorial and Traits Reference.

FieldTypeDefaultPurpose
m_actionsusize16Actions to consider after Gumbel-Top-k sampling; higher = broader search
c_puctf641.25PUCT exploration constant for below-root tree traversal
max_depthusize200Maximum depth per simulation before forcing leaf evaluation
value_scalef6450.0Scale factor mapping Q-values to logit scale; controls Q vs prior balance in the improved policy
seedu6442RNG seed for reproducible Gumbel noise sampling

Tuning guidance:

  • m_actions: set to the typical number of legal moves or smaller. For games with 200+ moves, 16-32 is typical. For games with fewer than 10 moves, use the move count.
  • value_scale: higher values make the improved policy sharper (more exploitation). Lower values let the prior dominate. The paper uses 50.0 with Q-values in [-1, 1].
  • c_puct: same role as in AlphaGoPolicy. Typical range: 1.0-2.5.