con un clic
simtest-debug
// Debug deterministic Sui simtest failures with structured experiments, logging-only changes, and NOTEBOOK.md observations.
// Debug deterministic Sui simtest failures with structured experiments, logging-only changes, and NOTEBOOK.md observations.
Cherry-pick a commit from main to a Sui release branch, create the release PR, and report the PR URL.
Run Sui dual execution replay between base and tip commits, recover failed steps, build, and commit replay instrumentation.
Safely modify or verify Sui protocol config changes, including version bumps, release-branch checks, guards, and snapshots.
Prepare, validate, and send or update a pull request with full due diligence
| name | simtest-debug |
| description | Debug deterministic Sui simtest failures with structured experiments, logging-only changes, and NOTEBOOK.md observations. |
Debugs a simtest failure using logging and the scientific method.
/debug-simtest <repro command or test>
Example: /debug-simtest MSIM_TEST_SEED=1768248386016 RUST_LOG=sui=debug,info cargo simtest --test address_balance_tests test_deposit_and_withdraw
Example: `/debug-simtest test_deposit_and_withdraw
$ARGUMENTS should contain either:
This skill logs its progress to a file called NOTEBOOK.md in the repo root. The file should look like
# iteration 1
- OBSERVATIONS
- <observation 1>
- <observation 2>
- ...
- HYPOTHESIS: <description of hypothesis>
- EXPERIMENT: <description of experiment>
- RESULTS: <did the experiment confirm or refute the hypothesis?>
# iteration 2
<more observations, hypothesis, etc>
While executing the skill, never make functional changes to the code. Only add logging statements as described below. The goal is to find the root cause, not fix the issue. If at any point the reproduction command stops failing, or fails in a different way, this indicates that functional changes have been made. The test is deterministic and cannot be affected by emitting logs, doing expensive computations, etc.
Log files should be named consistently using the experiment number: experiment_N.log (e.g., experiment_1.log, experiment_2.log, etc.).
After each experiment:
CLAUDE: experiment N loggingCLAUDE: experiment N observationsThis keeps the debugging history clean and allows easy navigation between experiments. Do not include log files in any commits.
Execute the following steps:
If a full command was provided, this command is the repro.
If only a test name was provided, find a repro as follows:
./scripts/simtest/seed-search.py --test <test_target_name> <test_name> --exact. This program will search for a seed that fails.MSIM_TEST_SEED=<seed> cargo simtest --test <test_target> -E 'test(=<test_name>)'Run the repro command. If RUST_LOG=... is missing, add RUST_LOG=sui=debug,info. if --no-capture is missing, add it.
Redirect the test output to a file named experiment_N.log where N is the iteration number. Do not run the test in the background or use a timeout. It may run for a long time, but it will finish.
Use grep and other tools to examine the output log (which will be very large). Summarize your observations to NOTEBOOK.md.
Based on the observations, form a hypothesis. Check if the hypothesis has not been ruled out by prior experiments. record it to NOTEBOOK.md.
An "experiment" consists of adding logging statments to the code which can confirm or refute the hypothesis. All logging statements should be of the form info!("CLAUDE: ...") so that you can grep for them easily.
Summarize the experiment to NOTEBOOK.md
After adding logs to the code (N is the iteration number):
debug: experiment N logging (do not include log files)experiment_N.logdebug: experiment N observationsif a hypothesis has been confirmed, determine if it is the root cause. If so, the debugging is complete. Summarize the results to the user.
Otherwise, if the hypothesis is refuted, or if it is not a root cause, return to step 4, and form a new hypothesis consistent with previous hypotheses. Repeat all steps until we find the root cause.
When creating a PR for the fix:
git rebase to remove them.experiment_N.log files.