using-determinism-and-replay
Installation
SKILL.md
Determinism and replay
Design or repair reproducible execution against a named equivalence predicate. Logical equivalence, numeric tolerance and bit-exact identity are different obligations.
Work from the affected contract
- Specify which executions must agree, over what state, environment and tolerance. Name the observation points and the cost the requirement justifies.
- Trace randomness and nondeterministic inputs. Give independent components stable RNG ownership and record seeds, generator states, external inputs and relevant toolchain/environment identity.
- Enumerate snapshot closure, restore order and state excluded from replay. Capture or substitute clocks, network/storage effects and scheduler-dependent observations.
- Separate read-only replay from counterfactual branches and live side effects. Add compare points and locate the first divergent step rather than diffing only final outputs.
- Run repeated/restore/branch tests under the declared predicate. Test perturbations in component order or concurrency when those lie inside the promised environment.
Scope and completion
For a local reproduction, seeds and RNG isolation may suffice. Add snapshots or full replay machinery only for the required investigation/rollback operations. Report determinism class, captured/excluded state, measured costs and actual checks; do not promise cross-device bit equality from a seed alone.
Use the user’s existing intent and authorization. Ask only for missing information that materially changes the result; use additional reviewers when they address a concrete uncertainty. Treat unavailable checks as gaps rather than successful verification.