The problem
A run of many seeds reports a red seed. The invariant broke at one event, but the cause is earlier: a message that was lost, a server that was down, a rule in the code that is wrong. A log of a run on a real cluster does not come back, so you guess.
The technique
The seed is the whole run. Run that seed alone and you get the same run, event for event, as many times as you need. Then read the events backwards: from the broken invariant to the event that fed it, and from there to the decision that was wrong. Each step is an event of the run, not a guess.
The live run
Seed 37 of the register with the planted bug: a read takes the first reply in place of a quorum. The report names the seed and the first violation. Replay the seed in your browser: the print is the same. Then step back from the failed read, one event per click.
The code
To replay one seed, pin it and run one iteration. The site's engine does this for each run, and replays a timeline of an exploration from its recipe:
let builder = match config.recipe.as_deref().map(parse_recipe).transpose()? {
Some(recipe) => builder.replay_timeline(config.seed, recipe),
None => builder.set_iterations(1).set_debug_seeds(vec![config.seed]),
};In a test, raise the log level to ERROR or DEBUG for the replay, then read the events from the first violation backwards.
To find a red seed of your own, hunt for one in the playground.