executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
mctxUse Mctx for JAX-native Monte Carlo tree search, MuZero/Gumbel MuZero policies, stochastic MuZero search, and search-tree inspection.
Independent GitHub snapshot · Automated classification · Original documentation governs
Mctx is a compact JAX library for batched Monte Carlo tree search. Use this skill when the task asks you to plan with a learned model, improve a policy with search, or inspect the resulting search tree.
pip install mctx.python scripts/check_install.py.python scripts/policy_improvement_demo.py --num_runs=1.references/api-reference.md when you need exact function signatures or
tensor-shape contracts.references/workflows.md when you need an end-to-end recipe.references/troubleshooting.md when search output, shapes, or optional
dependencies are failing.Use search(...) when you already have:
This is the lowest-level entry point and is best when you need to customize the search loop.
Use muzero_policy(...) when you want the standard MuZero policy improvement
loop with Dirichlet root noise, PUCT-style action selection, and visit-count
based action weights.
Use gumbel_muzero_policy(...) when you want the Gumbel MuZero variant and
its default Q-value completion strategy. This is the best default when the task
mentions policy improvement by planning with Gumbel.
Use stochastic_muzero_policy(...) when the environment alternates between
decision nodes and chance nodes. Provide separate decision and chance recurrent
functions; the wrapper handles the internal state structure.
qtransform_by_parent_and_siblings for the default MuZero-style value
normalization.qtransform_completed_by_mix_value for the default Gumbel MuZero path.qtransform_by_min_max when you already know a bounded Q-value range._src internals.After search, prefer the public summary APIs over raw tree fields unless you are troubleshooting.
PolicyOutput.action is the chosen action.PolicyOutput.action_weights are the training targets for the policy head.PolicyOutput.search_tree holds the final Tree.Tree.summary() exposes root visit counts, visit probabilities, value, and
Q-values.Tree.qvalues(node_index) is the best way to inspect a node.1 = invalid, 0 = valid.prior_logits and invalid_actions have the same trailing action
dimension.recurrent_fn outputs aligned with the batch size of the root.max_depth only when you intentionally want to cap traversal depth.scripts/check_install.py verifies the installed package, imports the public
API, and reports the active JAX backend.scripts/policy_improvement_demo.py is a tiny bandit-style smoke demo that
shows how planning can improve a policy.This skill does not bundle tree visualization. If you need Graphviz-style tree rendering later, treat it as a separate dependency problem instead of assuming it is available in a minimal install.
references/api-reference.md before wiring a custom model or action
mask.references/workflows.md before writing a new MuZero or Gumbel MuZero
driver.references/troubleshooting.md when output is flat, invalid-action
handling looks wrong, or JAX is on the wrong backend.references/repo-provenance.md when you need to check whether this
skill is stale against the source checkout that produced it.