#[repr(C)]pub struct GpuTraceEventCompact {
pub ts_ns: u64,
pub entity_and_error: u32,
pub latency_us: u32,
}Expand description
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).
Audit invariance: the 48-byte TraceEvent byte form, the
Audit-mode FFI, and every D16 audit-chain golden hash are
untouched. The projection is opt-in to the D64 throughput path.
Provenance: the projection is a deterministic function of
TraceEvent[]. An auditor can re-pack the events via
GpuTraceEventCompact::from_trace_event and verify the recorded
compact_event_projection_hash (the SHA-256 over the packed
byte stream) matches. The hash is surfaced through the dispatch
diagnostic so a verifier can confirm the compact bytes weren’t
silently substituted between catalog ingest and the kernel.
Byte layout (16 bytes, 8-byte aligned, repr(C)):
offset field type
0 ts_ns u64
8 entity_and_error u32 (low 31 bits = entity_id,
high bit = error_code != 0)
12 latency_us u32
entity_id is bounded to 31 bits (max 2^31 − 1). All fixtures
the v0 plan supports cap n_entities at < 2^15.
Fields§
§ts_ns: u64Wall-clock timestamp, nanoseconds since the synthetic epoch.
entity_and_error: u32Bit-packed (entity_id, error_flag). Low 31 bits carry
entity_id; bit 31 is 1 iff the original event’s
error_code was non-zero.
latency_us: u32Observed latency in microseconds. Carried as the full
u32 from TraceEvent so any clamp behaviour upstream
is preserved byte-for-byte.
Implementations§
Source§impl GpuTraceEventCompact
impl GpuTraceEventCompact
Sourcepub const SIZE: usize = 16
pub const SIZE: usize = 16
Fixed byte width of one compact event. Mirrored on the GPU
side as cuda/layout.cuh::GpuTraceEventCompact.
Sourcepub const ERROR_BIT: u32
pub const ERROR_BIT: u32
Bit-31 flag in entity_and_error indicating
TraceEvent::error_code != 0.
Sourcepub const ENTITY_MASK: u32 = 0x7FFF_FFFF
pub const ENTITY_MASK: u32 = 0x7FFF_FFFF
Bit-mask for the entity_id field within
entity_and_error.
Sourcepub const fn from_trace_event(ev: &TraceEvent) -> Self
pub const fn from_trace_event(ev: &TraceEvent) -> Self
Pack a single TraceEvent into the compact projection. The
resulting bytes are a deterministic function of the input;
two events that compare equal under
PartialEq<TraceEvent> produce identical compact bytes.
Sourcepub const fn entity_id(&self) -> u32
pub const fn entity_id(&self) -> u32
Recover the entity id stored in the low 31 bits of
entity_and_error.
Sourcepub const fn error_nonzero(&self) -> bool
pub const fn error_nonzero(&self) -> bool
true iff the original TraceEvent::error_code was
non-zero. Stored as bit 31 of entity_and_error so the
compact projection holds in 16 bytes.
Trait Implementations§
Source§impl Clone for GpuTraceEventCompact
impl Clone for GpuTraceEventCompact
Source§fn clone(&self) -> GpuTraceEventCompact
fn clone(&self) -> GpuTraceEventCompact
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GpuTraceEventCompact
impl Debug for GpuTraceEventCompact
Source§impl Default for GpuTraceEventCompact
impl Default for GpuTraceEventCompact
Source§fn default() -> GpuTraceEventCompact
fn default() -> GpuTraceEventCompact
Source§impl Hash for GpuTraceEventCompact
impl Hash for GpuTraceEventCompact
Source§impl PartialEq for GpuTraceEventCompact
impl PartialEq for GpuTraceEventCompact
Source§fn eq(&self, other: &GpuTraceEventCompact) -> bool
fn eq(&self, other: &GpuTraceEventCompact) -> bool
self and other values to be equal, and is used by ==.