Skip to main content

GpuTraceEventCompact

Struct GpuTraceEventCompact 

Source
#[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: u64

Wall-clock timestamp, nanoseconds since the synthetic epoch.

§entity_and_error: u32

Bit-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: u32

Observed latency in microseconds. Carried as the full u32 from TraceEvent so any clamp behaviour upstream is preserved byte-for-byte.

Implementations§

Source§

impl GpuTraceEventCompact

Source

pub const SIZE: usize = 16

Fixed byte width of one compact event. Mirrored on the GPU side as cuda/layout.cuh::GpuTraceEventCompact.

Source

pub const ERROR_BIT: u32

Bit-31 flag in entity_and_error indicating TraceEvent::error_code != 0.

Source

pub const ENTITY_MASK: u32 = 0x7FFF_FFFF

Bit-mask for the entity_id field within entity_and_error.

Source

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.

Source

pub const fn entity_id(&self) -> u32

Recover the entity id stored in the low 31 bits of entity_and_error.

Source

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

Source§

fn clone(&self) -> GpuTraceEventCompact

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GpuTraceEventCompact

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GpuTraceEventCompact

Source§

fn default() -> GpuTraceEventCompact

Returns the “default value” for a type. Read more
Source§

impl Hash for GpuTraceEventCompact

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for GpuTraceEventCompact

Source§

fn eq(&self, other: &GpuTraceEventCompact) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for GpuTraceEventCompact

Source§

impl Eq for GpuTraceEventCompact

Source§

impl StructuralPartialEq for GpuTraceEventCompact

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.