Skip to main content

Module event

Module event 

Source
Expand description

The canonical trace-event record.

TraceEvent is the input atom of the DSFB-GPU-Debug pipeline. Each record represents one observable point in the debug catalog — a span emitted by a tracing system, a latency sample, an error stamp. The shape is intentionally narrow: we keep only the fields the downstream pipeline actually reads, so the canonical byte form is small and the hash chain stays cheap to compute.

Layout decisions:

  • #[repr(C)] so the struct can cross the FFI boundary into CUDA without per-field marshaling. The CUDA-side mirror in cuda/layout.cuh (introduced in Section H) lays the fields out identically.
  • Field order is part of the in-crate canonical trace contract. Changing this order would change the catalog hash and therefore the case-file hash, so the order is not to be reshuffled.
  • Widths chosen for the bounded v0 demo: latency_us: u32 covers up to ~71 minutes of latency (way beyond the contract clamp of 32 767 ms), entity_id and route_id are u32 to leave room without paying for u64, and the 16-bit status/error/kind/flags fields keep the total record size small.

Stability: this type is deserialized from the canonical JSON fixture and re-serialized into the case file’s input_catalog_hash. The serialization order is fixed by serialize::write_event (canonical key ordering); modifying field names or order requires bumping the contract version.

Structs§

GpuTraceEventCompact
R.11c — compact GPU-ingest projection of TraceEvent. Carries only the four fields the window_feature_kernel_structured kernel actually reads (ts_ns, entity_id, latency_us, and the error_code != 0 flag), packed into 16 bytes. Throughput dispatches H2D this projection instead of the 48-byte audit- grade TraceEvent, cutting PCIe payload ~3× at full scale (192 MB → 64 MB at K=128 256×4096).
TraceEvent
A single observable trace point.