Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/issues/b5e93f157d755671 # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers # [OM-GPU-TRACE P0] Native .om device markers and bounded ranges on the existing CUDA++ path Closed · #82 · open 2026-10-25 23:16 UTC · closed 2026-10-26 01:01 UTC (reason completed) Imported from GitHub aien-dev/CUDApp#82, by drakestapleton drakestapleton wrote on 2026-10-25 23:16 UTC ## Goal and authority User-requested, 2026-10-25: implement our own NVTXD-like device-side markers and begin/end ranges, written in seeded Omega `.om`, inside CUDA++ (canonical repository `aien-dev/CUDApp`). This is an independent native facility, not NVIDIA NVTXD ABI/Nsight compatibility, and not an external profiler recommendation. First slice: one bounded, existing native vector kernel; one selected lane per CTA or explicit fixed producer slots. General source-language instrumentation, nesting/push-pop, SM attribution and whole-model tracing are later qualified extensions, not implicit MVP claims. ## Audited source, not a greenfield runtime Audit snapshot: CUDApp `a520cd30e54c3b0ddd553ee3ccb3f5e673345cd6` , Omega `55f9b0af47de70a3d06357985cf99ae3e45c016f` . Resolve heads/owners again before editing. - native/blackwell/vector.om : `gbword`, `gbquad`, `gbvec` emit raw words for fixed uint32 vector add. This is not a generic GPU frontend. - launch.om : `gbopen/gbbuild/gblaunch`; context.om : `nvsend/nvwait`; existing completion and visibility protocol; native test readback uses `mapget`. - Committed GB10 receipt binds candidate `2e2421694f6110bd84885ae0b2d3caf249809d34`; current native vector/launch/context blobs match it. Bounded vector correctness is recorded; tracing/performance/full-model qualification is NOT_RUN. - Omega's historical resident-seat generator already emits S2R register `0x52` and stores low-32-bit timer stamps. Consult as migration evidence, do not add a C kernel. - Command-list stamps are launch-boundary PTIMER reports, not inner-kernel ranges. Independent launch stamps can precede completion; never relabel host submit/wait as device execution. ## Ownership and dependency order Reuse #5 canonical runtime/integration, #17 measurement/reporting, #22 emitted-byte/control validation, #35 lowering and #52/#53 learning/evaluator ownership. No invented personal assignment; reconcile the live ledger and one-writer ownership first. Omega #638 / #632 own compiler-device integration. - Freeze a narrow trace/clock/buffer/symbol contract with the linked Omega consumer. - Add failing native host fixtures and emitted-byte negative controls. - Extend the existing `.om` emitter/launcher and decoder, no parallel encoder/runtime. - Independent host/source review, then a separately authorized GB10 window. - Only after that, measured consumer integration and optional broader language lowering. ## MVP acceptance - Versioned event layout: run/generation, kernel/code identity, numeric site ID, mark/begin/end kind, producer sequence, logical CTA/thread/warp identity where actually available, timestamp bits/clock domain, bounded payload and explicit loss status. Keep strings/source symbols in an offline manifest; no raw pointers, prompts or tensor content by default. - Checked, separately owned trace allocation and per-producer capacity. Prove extent arithmetic and stores stay within it. Deterministic producer sampling/filtering is recorded. Overflow drops diagnostics with saturating loss accounting; no wrap overwrite, spin for space, task veto or output-buffer corruption. Decode incomplete/unmatched ranges as incomplete. - Default off at generation/compile time: unchanged kernel instruction bytes, no trace allocation/argument/stores and no trace-induced completion work when disabled. Enabled mode preserves math, output canaries and resource/lifetime invariants. - Qualify timer instruction encoding and scheduling on sm_121. Historical low32 is not a 64-bit API. A short-capture MVP must declare wrap/maximum-duration rules and refuse ambiguous intervals; a later 64-bit implementation needs coherent-read/rollover tests. Clock units/resolution, cross-SM comparison and CPU-clock correlation are UNKNOWN until established for the actual chip. `clock64` cycles are not automatically nanoseconds. NVIDIA PTX special-register contract is semantic reference, not a PTX product dependency or proof of our SASS encoding. - Preserve instruction data/predicate/register/control dependencies and ordinary completion/cache visibility. Do not insert barriers merely to make ranges look orderly; label asynchronous issue versus actual completion. A selected lane is not automatically representative of every lane. - Reuse the existing host readback only after qualified completion/visibility. Timeouts/cancellation keep allocation lifetimes safe and trace status partial/failed; never recycle storage while work may still write. - Host controls: zero/exact/full capacity, extent overflow, dropped-counter saturation, stale generation, truncated/wrong-version records, unmatched events, timer rollover, disabled byte identity, malformed timer/store/control-field mutants. Use native `.om` project-owned tests; external independent oracles remain outside the delivered closure. - Scheduled GB10 controls on exact final artifacts: known marked work, ordering/range checks within declared clock scope, math/tail-canary parity, forced overflow, bad timestamp/store/control mutants, repeated runs. Separate host/simulator/chip results. - Paired tracing off/on measurements report raw samples, extra instructions/registers/memory, perturbation and loss rate; no promised overhead percentage. Include setup/readback/export costs separately. No model-speed claim from vector timing. ## Scope and completion rules All new first-party implementation/tests/automation are handwritten seeded `.om`. Existing C is migration/reference evidence, not a new production path; do not weaken the C freeze or add CUDA toolkit, PTX, libcuda, NVTX/Nsight, Python or third-party tracing dependencies. Retain OS/driver/firmware limitations honestly. This issue authorizes bounded implementation preparation, not GPU use, driver changes, live-model disruption, deployment or merge. Coordinate authorized hardware windows separately. Preserve immutable receipts and failures. Record source/seed/compiler/binary/code/QMD/launch/config hashes, commands/exits, independent review and explicit PASS/FAIL/NOT_RUN. Do not close from host-only checks or a PR merge. ## Linked consumer Omega #778 owns source manifests and offline decoding/query integration. Freeze their shared contract before either side implements it. No GPU run is authorized by either issue. drakestapleton wrote on 2026-10-25 23:18 UTC Claiming the initial bounded native Omega slice. I am working from CUDApp main `a520cd30e54c3b0ddd553ee3ccb3f5e673345cd6`, preserving the qualified vector emitter and launcher. First I will freeze the record and selection contract, add .om host tests and refusal/overflow controls, then implement only mechanisms supported by existing opcode evidence. This environment is x86_64 with no admitted GB10 window. Native AArch64 execution and GPU correctness/performance will remain NOT_RUN unless actually established. No live shared-GPU experiments. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:17 UTC Recovered GitHub comment. Original comment `6405501550` Scope claim before editing (agent lane: device-side emitter only). Taking: the native `.om` device-side emitter and its offline checks, plus a separately admitted GB10 qualification if and only if the hardware owner grants an exclusive window through the project's admission process. - `native/blackwell/trace-emit.om` — new file. Emits the trace-side instruction words for the first slice: one selected producer (thread 0 of one CTA), one recording lane, `mark`/`begin`/`end` records drawn from the v1 wire contract, bounded capacity with a saturating dropped counter, and a disabled mode that returns the input kernel words unchanged. - `tests/device-trace/emitter-disabled.om`, `emitter-golden.om`, `emitter-bounds.om` — new files. Disabled byte identity, per-instruction goldens produced by the repository's existing C encoder as an independent oracle (run outside the delivered closure), capacity/overflow arithmetic, clock wrap rules. - `evidence/device-trace/emitter-host-20261026/` — new exact-run directory: source/compiler/golden hashes, commands, exits, raw word dumps. Not taking, and not touching: PR #83's `docs/device-trace/CONTRACT.md`, `native/blackwell/trace.om`, `tests/device-trace/{contract,disabled,golden}-test.om` or `golden.hex`; Omega #778's offline reader; `vector.om`, `launch.om`, `context.om`; any C kernel, NVTXD dependency, CUDA toolkit/PTX/libcuda path or replacement compiler. Interface: I implement against PR #83's CONTRACT.md v1 as written (64-byte header, 64-byte records, kinds 1/2/3, clock domain 1 = raw device globaltimer low32 with units UNKNOWN, capacity 0..64, extent 64+64*capacity, saturating drop count). If the device side cannot meet a field exactly, I will comment on #83 with the specific disagreement before writing a divergent format rather than forking it silently. Clock: `S2R 0x52` low 32 bits only. No 64-bit claim, no nanosecond claim. The emitter defines wrap rules and refuses to interpret an interval that could have wrapped; durations stay unqualified until chips are measured. Enabled launch path stays unavailable until the instruction, control-flow and buffer-bounds checks pass. GPU testing is NOT_RUN until a separately authorized GB10 window; this claim authorizes no hardware use, no driver change, no model disruption. Coordination: if the ledger shows an existing owner for any path above, that owner wins and I will comment instead of editing. Sign in to comment