Skip to main content

Module trace

Module trace 

Source
Expand description

Runtime trace hook for cross-runtime parity comparison.

When two emulator backends claim to execute the same fixture, the runtime emits a structured event stream so an external comparator can detect the first divergence. This module defines only the hook: the event/snapshot data types and the TraceSink trait the dispatcher emits to. The concrete sink — which persists events, snapshots, and framebuffer dumps — lives outside this crate and is installed via Runner::set_trace_sink.

Recording is opt-in (no sink installed = no cost) and the runtime is agnostic to how a sink stores what it receives.

Structs§

SnapshotEntry
Metadata for one captured framebuffer snapshot; the raw pixels are stored separately by the sink and referenced by pixels_file.
TraceEvent
One structured runtime event, tagged with the counters needed to align it against the other backend’s stream.

Enums§

TraceSource
Which backend produced a trace artifact, so a comparator can tell the two event streams apart at merge time.

Traits§

TraceSink
Destination for runtime trace output. The dispatcher emits events and screen snapshots to whichever sink the host installs; the sink decides how (and whether) to persist them. Errors are surfaced as String and wrapped by the runtime as crate::error::Error::Trace.