Small WebAssembly programs (Rust, Go, or anything else that targets
wasm32-wasip1) that you can record with the CodeTracer wasm recorder
and replay in the CodeTracer time-travel debugger.
The fixtures under recorder-golden/ double as the
golden inputs for cmd/wazero/recorder_golden_test.go, so they stay
small and stable — perfect starting points for exploring how the
recorder maps WASM execution back to source-level steps, calls, locals,
and panics.
-
cton yourPATH— the CodeTracer CLI (see the maincodetracerrepo). All commands below usect; the recorder binary is invoked transparently byct. -
The wasm recorder built —
just buildfrom the repo root, or anynix buildinvocation that produces a recording-capable wazero binary (see the top-level README). -
For rebuilding the Rust sources in
recorder-golden/from scratch: arustcwith thewasm32-wasip1target installed. Compile with full DWARF debug info preserved, otherwise the recorder has nothing to map PC offsets back to:rustc -g -C debuginfo=2 -C opt-level=0 \ --edition 2021 \ --target wasm32-wasip1 \ -o column_aware.wasm column_aware.rsrecorder-golden/build.shautomates this for every fixture; install the target viarustup target add wasm32-wasip1first.
Produce a .ct trace bundle, then open it in the GUI as a separate
step:
# 1. Record. The output is a `<basename>.ct` bundle in the working dir.
ct record examples/recorder-golden/column_aware.wasm
# 2. Replay. Pass the trace bundle with -t; ct replay launches the GUI.
ct replay -t ./column_aware.ctUse this flow when you want to keep the recorded trace around for later analysis, share it with someone else, or feed it to headless tooling before opening it visually.
ct run examples/recorder-golden/column_aware.wasmct run records the program and opens the resulting trace in the
CodeTracer GUI in a single command — handy for the inner-loop
"tweak the program, look at the trace" cycle.
recorder-golden/column_aware.rs
is a deliberately tiny fixture that highlights column-aware
step-over — the recorder's ability to distinguish individual
statements that share a single source line.
The interesting line is line 17:
let a: i32 = 1; let b: i32 = 2; let c: i32 = 3;Three let bindings live on one line, each starting at a distinct
1-based column. The recorder must emit a separate step event for each
statement, with a strictly increasing column value (the acceptance
criterion behind FU-Column-Aware-Nav-Wasm — see
codetracer-specs/Planned-Features/Column-Aware-Navigation-Other-Languages.plan.md).
Try it end-to-end:
ct run examples/recorder-golden/column_aware.wasmIn the CodeTracer GUI, step into three_on_one_line and step-over
from the start of line 17. Instead of jumping straight to line 18, the
debugger stops three times on line 17 — once at each let binding —
before advancing. Local-variable values appear in the locals panel as
each binding is assigned. That column granularity is what
"column-aware step-over" buys you.
The other fixtures explore complementary surface area:
| Fixture | What it exercises |
|---|---|
control_flow.rs |
if/else, for, nested while — step ordering and loop iteration |
nested_calls.rs |
3-deep call chain plus recursion — call_entry / call_exit pairing |
collections.rs |
Vec, HashMap, structs, tuples — Sequence / Struct / Tuple value records |
panic_path.rs |
Explicit panic! — recorder emits an Error-kind event on trap |
Record any of them the same way as column_aware.wasm.
The remaining subdirectories are the upstream wazero examples, preserved here for embedding/runtime usage and unrelated to the recorder:
allocation— pass strings in and out of WebAssemblybasic— mix host-defined and WebAssembly-defined functionscli— wire wazero into a command-line toolconcurrent-instantiation— multiple Wasm instances per goroutineimport-go— call a Go-defined function from WebAssemblymultiple-results— return more than one resultmultiple-runtimes— share compilation caches