interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / docs / device-trace / CONTRACT.md

135 lines · 7045 bytes Raw Blame History Source

Device trace wire contract v1, host reference only

Status and ownership

PROPOSED wire contract for CUDApp #82 and Omega #778. The handwritten native/blackwell/trace.om is a bounded host reference and codec, not a GPU producer. It does not emit SASS, allocate a device buffer or read a device clock. The semantic fixtures and compiler source have run through an external reference interpreter. Native ELF execution and all device behavior are NOT_RUN. See REPRODUCE.md for pins, commands and limitations. The existing vector.om, launch.om and context.om are unchanged.

This first slice uses one fixed producer, lane 0 of one selected warp in one selected CTA. The existing VECTOR_1D launch has 64 threads per CTA, at most 1,048,576 logical threads. CTA is 0..16383 and warp is 0..1. It is not an all-thread view. The source contains no atomics, spin loops or barriers.

Bytes and identities

All integers are unsigned little-endian. Header and record are each 64 bytes. Capacity is 0..64. The exact transport extent is 64 + 64*capacity, at most4160 bytes. This is a chosen bound, not a hardware limit. No implicit alignment, padding, pointers, strings, tensor data or prompt text are serialized.

Header offsets:

ByteWidthField
04Magic bytes OMGT (1413958991)
44Version 1
84Exact transport extent
124Capacity
164Written prefix length
204Dropped selected valid events, saturating at 4294967295
244Status: 0 recording, 1 complete, 2 partial, 3 failed
284Clock domain 1: raw device globaltimer low32, units UNKNOWN
328Nonzero generation ID
408Nonzero kernel ID
484Selected CTA
524Selected warp
564Nonzero manifest ID
604Loss saturation flag: 0 exact, 1 further loss was clipped

Each retained record, at64 + 64*sequence:

ByteWidthField
04Nonzero numeric site ID
44Kind: 1 mark, 2 begin, 3 end
84Retained producer sequence, starting 0
124Raw low32 stamp
168Generation ID
248Kernel ID
324CTA
364Warp
404Lane, always 0 in v1
444Explicit numeric payload, default 0
4816Reserved zero

All unused slots are zero. An exported capture carries the exact configured extent, not only the written prefix. The final partial record is never valid.

IDs are lookup keys, not hashes or proof. The offline manifest must bind them without collision within the run to full source, compiler, generated-code, launch-descriptor and configuration digests, plus site location/name/kind. A consumer must possess that exact manifest and expected generation/kernel before calling gtvalidate. After structural validation, the #778 consumer must resolve every nonzero site ID and reject unknown sites or site/kind mismatches. The codec does not perform that lookup. It checks matching numeric generation/kernel/manifest keys, not the external manifest's truth.

Native host reference API

Concatenate the module and a unit with fn main. Its globals are private to one host process and one capture, not reentrant or thread-safe. This is an explicit reference for a future GPU producer, not host timestamps disguised as GPU execution.

The producer retains a prefix. When full, it changes only loss accounting. It never wraps onto existing records, waits for space or vetoes application work. A zero-capacity capture is valid and loses every selected valid event.

Clock and ordering, deliberately not interpreted

Clock 1 names the intended source, not a qualified opcode. Test stamps are synthetic. The historical S2R special-register value 0x52 is only migration reference. The new timer encoding, scheduling and selected-lane stores still need independent word/control checks and an admitted sm_121 hardware receipt.

There is no conversion to nanoseconds, cycles, wall time or CPU time here. There is no 64-bit timer, cross-SM comparison, cross-kernel ordering or claim that issuing asynchronous work means it completed. A begin near 2^32 followed by a small end is preserved exactly, not silently converted to a duration. A low32 delta alone cannot distinguish multiple wraps. A later consumer must have independently established capture-duration bounds in the same clock before interpreting any interval, otherwise timing is unavailable.

Sequence gives order only for this single producer. Nested ranges are out of scope. A structurally valid unmatched end, missing end, partial capture or loss remains incomplete; gtvalidate is not a range-completeness validator. Omega #778 owns symbol resolution, pairing and presentation.

Next device slice, still required

Keep tracing absent from default unit composition. Default generated kernel bytes, allocations, arguments and completion work must remain identical. Before adding an enabled branch, prove the timer/store/control encodings, register/predicate liveness and resource counts against the existing emitter. Then add separately owned trace storage, initialization and readback only following the already qualified completion/cache path. Do not insert a new barrier merely to make a plot appear orderly. GB10 correctness, overflow, canaries, mutants, repeated runs and paired off/on perturbation remain open.