Skip to content
Deterministic simulation / workflow study / integration proposed

Find a rare failure.
Keep the execution.

Let a simulator explore difficult execution orders. When an invariant fails, keep a recorded machine so a developer or an AI agent can return to the states that explain it.

From a failing seed to a regression →

Inspired by celld

celld's engineering article describes a simulator that runs production event handlers while controlling scheduling, time and object-storage responses. Repeating the same code, settings and seed reproduces a run. Invariant checks expose failures along the way.

That gives us a compelling use case for time travel debugging: preserve a failing execution, then navigate its history to investigate causality. This is our proposed application of wasm-vm, not a celld integration or endorsement.

A small race, a lost alarm

The article reports an alarm race with this critical order:

  1. Delete a 10:00 alarm; leave its wake-entry cleanup pending.
  2. Set a 10:05 alarm that reuses the old wake entry.
  3. Run the delayed cleanup; it deletes the entry the new alarm needs.
  4. The invariant fails: an acknowledged alarm has no usable wake entry.

celld's fix gives each new alarm setting its own entry. Its regression checks the invariant during execution, so a temporary violation cannot hide behind a correct final state. Read the original investigation and fix ↗

Turn reproduction into inspection

A repeatable failure gives the investigator a stable target. A recorded machine would add a way to compare the moments around that failure without repeatedly driving the entire scenario by hand.

Find the first broken state

Associate each invariant check with a recording position. Move between the last passing check and the first failing check, then inspect the intervening guest instructions and state.

Follow the cause backwards

Inspect earlier positions to find when a value changed and which pending operation produced it. Connect the simulator's action IDs to application logs and guest traces. Source-level watchpoints and reverse-continue would need debugger integration; a timeline alone does not provide them.

Give a critic the same run

An AI agent can propose an explanation with exact positions and evidence. A separate reviewer can inspect those positions and challenge the explanation against the recorded state.

From seed to regression

  1. Explore. Run a compatible simulation harness with varied seeds and explicit invariants. Keep its code revision, configuration and failing seed.
  2. Record the failure. Reproduce the selected case inside a pinned wasm-vm guest, recording the external inputs required to replay it. Match the failing invariant and action sequence to the discovered case before treating it as the same bug.
  3. Anchor the checks. Emit the simulator action ID and invariant result at known recording positions. Preserve enough checkpoints to reach the relevant interval efficiently.
  4. Inspect. Restore an earlier checkpoint and replay recorded inputs to the selected position. Compare application state, guest memory, storage changes and the action log. Keep replay disconnected from live services.
  5. Test the repair. Build the changed program and run the same scenario in a new recording. Preserve or explicitly script the relevant action order: changing code can change the choices a seed produces. A patched binary needs its own execution; the old recording remains evidence of the original bug.
  6. Keep the regression. Commit the deterministic test and its invariant assertions. Retain the original and repaired evidence with their code and artifact identities, subject to an explicit storage and privacy policy.

Control every input that matters

The simulator owns the search: its scheduling choices, fault model and invariants determine what it can discover. The recorded VM would preserve an individual execution for investigation. Running a program in an emulator does not automatically explore distributed failures or make uncontrolled host inputs deterministic.

Simulation identity

Pin code, settings, seed, random-number generator and test data. Keep action IDs and check results. A seed alone cannot identify a run across arbitrary changes to the program or harness.

Machine and I/O identity

Pin the guest image and emulator build. Capture or deterministically model clock and entropy reads, scheduler decisions and storage/network outcomes at the boundary that owns them. Multi-node simulations need a recorded or simulated boundary for every participating node and service.

Replay evidence

Check state digests at known positions and validate coverage of the disputed behavior. Bound recording size and recovery time. Redact or restrict access to recordings that contain credentials, request bodies or database contents.

Current status

Existing foundation

wasm-vm runs RISC-V Linux in the browser and has a local timeline for completed software recordings and admitted exact GPU histories. Those are bounded recording paths; they do not establish that this simulation workload runs.

Proposed integration

A compatible simulation guest, action-to-recording markers and invariant inspection. celld says its simulator is still private. We have not run celld or that simulator inside wasm-vm, and this page presents no measured integration results. celld's simulator status ↗

The next proof

Record a real failing simulation, replay its action sequence and guest-state digests offline, locate the first invariant violation, then independently verify the repair in a separate recording. Measure the workload's recording and seek costs before promising interactive debugging at scale.

How wasm-vm uses evidence → · More case studies → · Try the browser VM →