Skip to content

Record + Replay

A SimDrive recording is a directory:

~/.simdrive/recordings/<name>/
├── recording.yaml # canonical replay spec
├── recording.summary.json # one-line status, drift events, timings
└── screenshots/ # one PNG per step

recording.yaml is human-readable and deterministic. simdrive replay <name> re-executes it without calling any AI model — free in CI.

Every recording carries a requires: block that pins the preconditions for replay:

recording:
name: ENG-1247-repro
requires:
target: simulator # or "device"
app:
bundle_id: com.acme.familybag
device:
device_name: iPhone 17
os_major: 26
os_version: "26.3"
udid: <only present on device>
FieldMismatch behavior
requires.targethalt (replay_state_contract_failed)
requires.app.bundle_idhalt
requires.device.udidhalt (device target only)
requires.device.os_majorhalt
requires.device.os_version (minor diff)warn only, replay proceeds
requires.device.device_namewarn only

State contracts solve the “23 blind taps at SSIM 0.014” failure mode: a replay that’s run against the wrong device or wrong app refuses to fire any actions, instead of degrading silently.

Before each step, SimDrive captures a live screenshot and compares it to the recorded pre-state via SSIM (structural similarity).

ThresholdBehavior
SSIM ≥ 0.85 (simulator) / 0.80 (device)Step dispatches
SSIM below thresholdreplay_drift_detected — replay halts
Marks count drops to < 50% of recordedmarks_count_drift — halts

Drift is a feature, not a bug. A UI regression should halt the replay so you see it on the PR.

  • The --drift halt | warn | force flag and when to use each
  • Per-step tolerance overrides for known-flappy screens
  • Recording schema versioning and migrate_recording
  • Cross-target replay (record on sim, replay on device) — what works, what doesn’t