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/patches/8b8cf6c6cb5164dd # 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 ## docs: record the two cubin writers and their owner (Refs #108) merged `8b8cf6c6cb5164dd` #190 · opened 2026-10-30 11:20 UTC · closed 2026-10-30 11:44 UTC · merged 2026-10-30 11:44 UTC Imported from GitHub aien-dev/CUDApp#190, by drakestapleton Base `d79519e0ecbb734781bdfe652de6524f45f6cfc2` · Head `ab8911cbad9a7b39fc4f8cfa5f3ac35bf4e89cc4` Merged on GitHub as `78fea51d6f8859ec8cc5e5561295fd5583b92c19`; reachable from main `21d8de285f713adf09e0d6ba6db2b37139d0674e` (observed 2026-11-18T16:38:27Z) drakestapleton wrote on 2026-10-30 11:20 UTC ## Purpose and scope Refs #108. Documentation only. No writer was moved, merged, or rewritten. ARCH-0042 (accepted 2026-10-30) keeps the existing copies and sends new cubin-writer work to CUDApp. The original "one writer, delete `src/omega_cubin.c`" list was withdrawn by the 2026-10-27 scope comment on #108. #106 and #107 are not touched. `docs/CUBIN_WRITERS.md` records both writers from the files that were read: - CUDApp `src/omega_cubin.c` and `om/cubin/cubin_elf.om` (one sm_121, ABI 8 writer, two bodies). - omega-mv `seed/sm80/cubin.om` at `76639738` on closed draft omega-mv#864 (branch `ck/cubin-om`). That path 404s on omega-mv's default branch. README, AGENTS.md, `docs/ARCHITECTURE.md`, and `docs/REVIEWING.md` no longer call that second writer a proposal or an open hold. `om/moe/README.md` no longer calls ARCH-0042 PROPOSED. `evidence/` was not edited. ## Evidence on the exact commit Head: `ab8911cbad9a7b39fc4f8cfa5f3ac35bf4e89cc4`. CUDApp sources cited in the note were read at parent `d79519e0ecbb734781bdfe652de6524f45f6cfc2`. omega-mv `cubin.om` blob `b659fafe847a99e6ff3e6b3c7bc9b0840d7a783a` (14129 bytes, 786 lines). Linux. No GPU device was opened. - `make test` (host-only): NOT RUN. No buildable file changed. - `make test-native-artifact` (host-only): NOT RUN. Same reason. - `make zero-cuda-gate` (ELF audit and negative control): NOT RUN. Same reason. - `build/hello_gpu --sim` (simulator only): NOT RUN. Same reason. - `make doctor` (diagnostic): NOT RUN. Same reason. - GB10 hardware tests: NOT RUN. This VM has no GB10 and no authorized window. Device claims in `omega_cubin.c` and in omega-mv#864 are hardware-unverified in `docs/CUBIN_WRITERS.md`. ## Correctness, compatibility and provenance - Negative controls and affected contracts are documented. `cubin.om` exit 6 (register coverage) and CUDApp's exit 6 (shared size) are different codes. No new runtime check was added. - API/ABI and Omega consumer effects: none. Public headers were not changed. The stale program-header comment in `src/omega_cubin.h` is recorded and left alone. - No bytes, note bodies, or instruction masks were copied from `cubin.om`. The comparison cites lines only. - No secrets, private paths, or vendor binaries. - Existing receipts were not edited. `evidence/CUDAPP-OM-ENCODER/README.md` still says HOLD; the note says so. ## Known limitations Consolidation is still Drake's decision, on #108. Whether sm_121 ABI 8 needs `.note.nv.tkinfo`, and which register count belongs in the cubin attributes, are open and were not loaded on a device. Wolfram was not mounted; the only numeric identity used is the existing 2026-10-27 receipt that maps `0x380` to 896. `cubin.om`'s `e_flags` formula was not evaluated against `0x6007902`.
Open in Web Open in Cursor
drakestapleton reviewed (COMMENTED) on 2026-10-30 11:30 UTC Classification: blocked (CI pending: host-tests still running on `ab8911c`); otherwise ready-to-merge. - Docs only, mergeable with `main`. All other checks green. - Verified: ADR 0042 on aien-architecture-mv main reads "Accepted … 2026-10-30; merged as #342", matching the README / AGENTS.md / ARCHITECTURE.md / REVIEWING.md / om/moe/README.md edits. - All `cubin.om` line citations resolve at pinned commit `76639738` (omega-mv#864, closed unmerged; the citations use the SHA, not the branch). - Spot-checked CUDApp citations match: `src/omega_cubin.c:71-73, 86-96, 128, 162, 170, 257-258, 263-264, 300, 306, 366-375`; `src/omega_cubin.h:31-33, 49, 55-63`. - Device claims are correctly marked hardware-unverified, including the unreceipted "confirmed on-device: error 200" at `src/omega_cubin.c:71-73`. - Optional follow-up: the stale program-header comment at `src/omega_cubin.h:31-33`. — Grokbot ### Apply it ``` git checkout -b patch-8b8cf6c6cb5164dd d79519e0ecbb734781bdfe652de6524f45f6cfc2 curl -fsSL https://interplane.io/drakestapleton/CUDApp/patches/8b8cf6c6cb5164dd.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/CUDApp 190 ab8911cbad9a7b39fc4f8cfa5f3ac35bf4e89cc4 ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"CUDApp","number":190,"url":"https://github.com/aien-dev/CUDApp/pull/190","export_sha256":"0aafd51b77ff5776d6baaf9b88b48c8b36a6e27c8d829ae8ded561b71712b17a","imported_utc":"2026-11-18T16:38:27Z"} ``` ### Changes ``` diff --git a/AGENTS.md b/AGENTS.md index 129ee023..244f0dc7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,7 +13,7 @@ Shared rules: read https://www.aienos.com/agents/RULES.md first. This file adds - `tests/`: host tests and the chip tests (`tests/gpu_*_test.c`). `mk/*.mk`: build fragments included by the `Makefile`. - `evidence/`: dated receipts. They record what ran on a named commit; never edit or regenerate an existing receipt. New receipts go in a new folder. - `build/` is generated (`make`, `OUT_DIR`) and ignored by git. -- Omega is meant to build these sources at a pinned commit (`cudapp.lock` in Omega). That pin does not exist yet: Omega main still builds its own diverged copy and takes `nvrm` from physics-mv (#106, #107). Changes to public headers or the runtime API will affect Omega once it does. Ownership rule: ARCH-0042, PROPOSED in aien-architecture-mv#342 (Omega owns computation, CUDA++ owns GPU execution, Omega Bridge owns compatibility). +- Omega is meant to build these sources at a pinned commit (`cudapp.lock` in Omega). That pin does not exist yet: Omega main still builds its own diverged copy and takes `nvrm` from physics-mv (#106, #107). Changes to public headers or the runtime API will affect Omega once it does. Ownership rule: ARCH-0042, Accepted 2026-10-30 in aien-architecture-mv#342 (Omega owns computation, CUDA++ owns GPU execution, Omega Bridge owns compatibility). The cubin writer is this repository's: `docs/CUBIN_WRITERS.md` (#108). New cubin-writer work stays here. Do not import omega-mv `seed/sm80/cubin.om`. ## Installation @@ -88,4 +88,5 @@ make hello-gpu # runs make doctor, then examples/he - `ROADMAP.md`: every NVIDIA piece on the Spark, its replacement and receipt. - `docs/DRIVER.md`, `docs/HOW_I_DID_IT.md`, `docs/runtime/API.md`, `docs/runtime/PORTABILITY.md`. - `docs/AUDIT.md`, `docs/LICENSING_TRANSITION.md`, `THIRD_PARTY.md`: provenance and licences. +- `docs/CUBIN_WRITERS.md`: the two cubin writers, who owns new work, and what was not run (#108). - Aienux, the Aien kernel, which holds Aien's GB10 driver research harness (L332, aienux#441; not a product, NVIDIA's open kernel module stays and GB10 support goes upstream to Nova and nouveau): https://github.com/aien-dev/aienux diff --git a/README.md b/README.md index f83c321a..66d02f6c 100644 --- a/README.md +++ b/README.md @@ -446,7 +446,7 @@ gates were NOT_RUN for this repair. ## How it fits with Omega and Omega Bridge -Ownership rule ([ARCH-0042](https://github.com/aien-dev/aien-architecture-mv/pull/342), PROPOSED): Omega owns computation, CUDA++ owns GPU execution, Omega Bridge owns compatibility. +Ownership rule ([ARCH-0042](https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0042-omega-cudapp-bridge-ownership.md), Accepted 2026-10-30): Omega owns computation, CUDA++ owns GPU execution, Omega Bridge owns compatibility. - **CUDA++ (this repository)** owns GPU execution: the sm_121 encoder and GPU code generators, the cubin writer and artifact exporter, artifact admission, the disassembler, the driver client (`nvrm/`), submission, sessions and the GPU runtime. - **[Omega](https://github.com/aien-dev/omega-mv)** owns Aien's seeded `.om` language, its compiler and the compiler pin, semantics, and the declared contract of what a kernel computes. The existing Omegese → IR → sm_121 lowering, its checker and host words stay in omega-mv. omega-mv#885 (draft) adds a seeded `.om` port of that lowering. It stops at BlackwellIR, so register allocation and sm_121 encoding are still the C builder. CUDA++ is the GPU execution component Omega consumes. @@ -454,7 +454,7 @@ Ownership rule ([ARCH-0042](https://github.com/aien-dev/aien-architecture-mv/pul The currently shipped CUDApp implementation still contains first-party C; the planned, test-gated replacement with native `.om` is tracked in [#79](https://github.com/aien-dev/CUDApp/issues/79). The code was split out of Omega on 2026-10-21 with its full history; `docs/AUDIT.md` records how, and what was checked before it was published. -Not yet true: Omega does not consume CUDA++ at a pin today. Omega main has no `cudapp.lock`; it still builds its own diverged copy of the GPU code ([#106](https://github.com/aien-dev/CUDApp/issues/106)) and takes the driver client from physics-mv ([#107](https://github.com/aien-dev/CUDApp/issues/107)). The disassembler is in Omega ([#10](https://github.com/aien-dev/CUDApp/issues/10)) and a second, `.om` cubin writer is proposed there ([#108](https://github.com/aien-dev/CUDApp/issues/108)). The `.om` work here takes its compiler through Omega Bridge's bootstrap rather than an Omega pin ([omega-mv#870](https://github.com/aien-dev/omega-mv/issues/870)). +Not yet true: Omega does not consume CUDA++ at a pin today. Omega main has no `cudapp.lock`; it still builds its own diverged copy of the GPU code ([#106](https://github.com/aien-dev/CUDApp/issues/106)) and takes the driver client from physics-mv ([#107](https://github.com/aien-dev/CUDApp/issues/107)). The disassembler is in Omega ([#10](https://github.com/aien-dev/CUDApp/issues/10)). The cubin writer lives here (`src/omega_cubin.c`, and `om/cubin/cubin_elf.om` on the hosted build). A second writer, omega-mv `seed/sm80/cubin.om`, is not on omega-mv main: it is the closed, unmerged branch of [omega-mv#864](https://github.com/aien-dev/omega-mv/pull/864). Ownership, the differences, and what was not run are in [docs/CUBIN_WRITERS.md](docs/CUBIN_WRITERS.md) ([#108](https://github.com/aien-dev/CUDApp/issues/108)). The `.om` work here takes its compiler through Omega Bridge's bootstrap rather than an Omega pin ([omega-mv#870](https://github.com/aien-dev/omega-mv/issues/870)). ## Names diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 788f16e5..450b0e61 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -87,7 +87,7 @@ Linux today), `queue_submit(words)` (replaced by `ob_dispatch` + `ob_submit`). Code-object formats accepted by `ob_code_load`: `SM121_RAW`, `AMDGPU_HSACO`, `SPIRV_VK`, `SPIRV_CL` (OpenCL-environment SPIR-V: Kernel capability, Physical64 addressing, for OpenCL runtimes), -`MSL_SOURCE`, `AARCH64`. `CUBIN` is reserved and unused while omega-mv #864 is on HOLD. +`MSL_SOURCE`, `AARCH64`. `CUBIN` is reserved and unused. omega-mv #864 (`seed/sm80/cubin.om`) was closed unmerged; see `docs/CUBIN_WRITERS.md`. ### 3a. First pieces that exist (IMPLEMENTED; host EXERCISED; hardware NOT_RUN off the GB10) @@ -140,7 +140,7 @@ faster. - Encodings come from Mesa NAK (MIT) plus chip tests (`THIRD_PARTY.md` §2). `docs/HOW_I_DID_IT.md` line 36 records a preference for nvcc output where it and NAK disagree; every encoder field gets a NAK citation or a chip test before the GB10 encoder is declared the backend. -- Nothing derived from omega-mv #864 (`cubin.om`) enters a backend while #864 is on HOLD. +- Nothing derived from omega-mv #864 (`seed/sm80/cubin.om`) enters a backend. That pull request was closed unmerged on 2026-10-27. See `docs/CUBIN_WRITERS.md`. - AMD encodings come from AMD's published ISA reference guides; LLVM (`llvm-mc`, `llvm-readelf`) is a verification oracle only. The terms of the ISA guides are an open item for the IP-lawyer review. `backend/amd/vadd-gfx1151.s` is such an oracle fixture: it exists to test the loader, is labelled diff --git a/docs/CUBIN_WRITERS.md b/docs/CUBIN_WRITERS.md new file mode 100644 index 00000000..531e07bd --- /dev/null +++ b/docs/CUBIN_WRITERS.md @@ -0,0 +1,92 @@ +# Cubin writers (CUDApp #108) + +Source comparison, 2026-10-30. No device was opened. No cubin was packed. Nothing here was run on GB10 or any other GPU. Device results quoted from comments or from omega-mv#864 are marked hardware-unverified. + +This note records the duplication and the owner. It does not move, merge, or rewrite either writer. ARCH-0042 decision 7 (Drake, 2026-10-27, accepted 2026-10-30) keeps existing copies where they are. Consolidating them waits for a decision by Drake, recorded on [#108](https://github.com/aien-dev/CUDApp/issues/108). New work on the cubin container writer goes to this repository, or to a new aien-dev repository that pins this one. It does not go into the omega-mv copy. + +[#106](https://github.com/aien-dev/CUDApp/issues/106) and [#107](https://github.com/aien-dev/CUDApp/issues/107) are other copies (GPU C sources, driver client). They are not resolved here. + +## Owner + +[ARCH-0042](https://github.com/aien-dev/aien-architecture-mv/blob/main/docs/adr/0042-omega-cudapp-bridge-ownership.md) is Accepted (Main, delegated by Drake, 2026-10-30, merged as aien-architecture-mv#342). The consequences table names one owner for the cubin writer: CUDApp. Omega owns computation. Omega Bridge owns compatibility and does not write cubins. + +The container writer is the ELF a loader would read: sections, `.nv.info` attributes, the register count, the ABI version. That is GPU execution, so it is this repository's. + +## What was read + +CUDApp files below were read from main `d79519e0ecbb734781bdfe652de6524f45f6cfc2` before this note. + +omega-mv `seed/sm80/cubin.om` is not on omega-mv's default branch. `gh api repos/aien-dev/omega-mv/contents/seed/sm80/cubin.om` returned 404. The same path on `ck/cubin-om` returned blob `b659fafe847a99e6ff3e6b3c7bc9b0840d7a783a`, 14129 bytes, 786 lines (`wc -l` after a base64 decode). That blob is commit `76639738acdd67030ae1ceb22ef957d264d836ef`. [omega-mv#864](https://github.com/aien-dev/omega-mv/pull/864) is a closed draft: `mergedAt` is null, `closedAt` is 2026-10-27T11:48:36Z, head is that commit. The close comment says the branch is kept and that the file is not to be merged, labelled, or built on. The reason given there is a licence question about earlier extracts, with no counsel answer on the PR. This note cites the file. It copies no section payload, note body, or instruction mask out of it. + +The issue's 2026-10-26 table says the omega-mv writer targets sm_80, sm_86 and sm_89 and is a draft with a hardware retest pending. The file at `76639738` accepts more targets, and the pull request is closed rather than open. Those are the two states. The issue body was not edited to match the later file. + +`evidence/CUDAPP-OM-ENCODER/README.md` still says #864 is on HOLD. That receipt is left as it was written. The public pull request was closed later the same day. + +## The CUDApp writer is one writer with two bodies + +Both bodies target sm_121 only and ABI version 8. + +| Body | Path | When it is compiled | +|---|---|---| +| C | `src/omega_cubin.c` `c_cubin_pack`, called as `omega_cubin_pack` | Freestanding (`OMEGA_GPU_NO_POSIX`) or `CUDAPP_MIGRATION_PENDING_C_CUBIN` (`src/omega_cubin.c:41-42`, `386-395`) | +| `.om` | `om/cubin/cubin_elf.om` `cubin_elf`, called through `omega_cubin_elf` | The hosted build (`src/omega_cubin.c:6-9`, `510-518`; `mk/om-cubin.mk:1-4`) | + +`om/cubin/cubin_elf.om:1-3` says it replaces the body of `omega_cubin_pack`. `evidence/CUDAPP-OM-ENCODER/README.md` says that unit is a translation of `src/omega_cubin.c` only, and that omega-mv#864 was not read for it. `make test-om-cubin` (`mk/om-cubin.mk:36-47`) packs each call both ways and fails if the code, bytes, or message differ. That target was not re-run for this note. The receipt's host counts stay in the receipt. + +Constants the two bodies share, from `src/omega_cubin.h:46-52`: ABI version 8, `e_flags` `0x6007902`, SM 121, parameter base `0x380`, at most 32 parameters, names of at most 64 bytes. `om/cubin/cubin_elf.om:24` spells the parameter base as decimal 896. `evidence/CUDAPP-OM-CUBIN/wolfram-constants.txt` (Wolfram, 2026-10-27) maps the hex literal `0x380` to 896. No new numeric conversion was done for this note. Wolfram is not mounted in this session. + +## The other writer + +`seed/sm80/cubin.om` at `76639738` is a program, not a library function. `main` (`cubin.om:772-785`) reads arguments, the instruction bytes on stdin, checks registers, and writes a cubin to stdout. Its note (`cubin.om:17-23`) accepts SM 80, 86, 87, 89, 90, 100, 103, or 120. The check is `cubin.om:165-178`. SM 121 is not in that list. ABI 7 and ABI 8 are accepted (`cubin.om:180-182`). ABI 7 with SM >= 100 is refused (`cubin.om:183-185`). + +The file's own note (`cubin.om:5-6`) says the layout was read from the author's nvcc 13.0 probes and from CUDApp `src/omega_cubin.c`. That is the file's claim about its sources. It is not a claim this session re-checked against those probes. + +## Differences checked + +Each row is a difference read off the files. Absence from this table is not a claim that the bytes match. + +| | CUDApp (`omega_cubin.c` / `cubin_elf.om`) | omega-mv `cubin.om` at `76639738` | +|---|---|---| +| Targets | SM 121 only (`omega_cubin.h:48`, note word at `omega_cubin.c:237`) | 80, 86, 87, 89, 90, 100, 103, 120, else exit 2 (`cubin.om:165-178`). 121 is refused | +| ABI | Version 8 only (`omega_cubin.h:46`, `omega_cubin.c:335`). OS/ABI byte `0x41` (`omega_cubin.c:334`) | 7 or 8 (`cubin.om:689-701`). ABI 8 writes decimal 65 at byte 7 and 8 at byte 8. ABI 7 writes decimal 51 and 7. Whether 65 is the same byte as `0x41` was not re-evaluated | +| `e_flags` | The constant `0x6007902` (`omega_cubin.h:47`, stored at `omega_cubin.c:342`) | Computed from SM (`cubin.om:694-697`). `args` rejects SM 121 before `ehdr` runs, so this file never stores an sm_121 flags word. The formula was not evaluated against `0x6007902` | +| Register count stored | The caller's `gpr_count`, unchanged, in `.nv.info` attribute `0x2f` (`omega_cubin.c:222`) and attribute `0x1b` (`omega_cubin.c:254`). `cubin_elf.om:310` and `:367` store the same field | Input REGS is checked, then `VREG` is replaced with REGS+2 (`cubin.om:317`) and that sum is what `ginfo` stores (`cubin.om:386`). Attribute 27 (decimal) is the constant 255 on both the pre-sm_90 path (`cubin.om:539`) and the sm_90+ path (`cubin.om:545`), not `VREG` | +| Register refusal | `gpr_count > 255` (`omega_cubin.c:170`, `cubin_elf.om:164`). 0 is accepted. The text is not scanned | REGS outside 1..253 is exit 2 (`cubin.om:189`). `regchk` (`cubin.om:295-316`) exits 6 when REGS is below a register number taken from byte 2 of an instruction, with the exceptions named in the notes at `cubin.om:36-39` and `:291-294`. Then it adds 2 | +| Exit numbers | 0 ok, 1 bad argument, 2 text, 3 parameters, 4 constant bank, 5 GPR above 255, 6 shared size not a multiple of 4, 7 allocation (`omega_cubin.h:55-63`) | 0 written, 1 usage, 2 bad number, 3 bad name or signature, 4 bad input, 5 write failed, 6 register coverage (`cubin.om:35-37`). Exit 6 does not mean the same thing | +| `.note.nv.tkinfo` | Not in the section list (`omega_cubin.c:263-264`). `cubin_elf.om` writes `.note.nv.cuinfo` (`:375-385`) and has no tkinfo writer | Appended only for ABI 8 (`cubin.om:218-221`). Writer at `cubin.om:429` | +| `.nv.callgraph` | Not in the section list | Section writer `cgraph` at `cubin.om:394` | +| Other sections | Always: `.shstrtab`, `.strtab`, `.symtab`, `.text.`, `.nv.constant0.`, `.nv.info`, `.nv.compat`, `.nv.info.`, `.nv.shared.reserved.0`, `.note.nv.cuinfo` (`omega_cubin.c:263-264`) | Name table at `cubin.om:41`. `.nv.compat` and `.nv.shared.reserved.0` are added from sm_90 (`cubin.om:208-212`). Order is not the CUDApp order | +| `.text` `sh_info` | 2 (`omega_cubin.c:300`, `cubin_elf.om:422`) | 3 from sm_90, otherwise a word that includes `VREG` shifted (`cubin.om:640-644`) | +| `.note.nv.cuinfo` link | `sh_link` 0, `sh_info` 2, flags literal `0x1000040` (`omega_cubin.c:306`) | `sh_link` is `VTK`: 0 on ABI 7, and the tkinfo section index on ABI 8 (`cubin.om:217-221`, `:638`). `sh_info` is 0 below sm_90 and 10 from sm_90 (`cubin.om:634-637`). Flags literal 16777216 below sm_90 and 16777280 from sm_90 (`cubin.om:630-632`). The 2026-10-27 Wolfram receipt maps `0x1000040` to 16777280. The 16777216 literal was not given a hex spelling in that receipt | +| EXIT offsets | `EIATTR_EXIT_INSTR_OFFSETS` is omitted (`omega_cubin.c:257-258`, `omega_cubin.h:34-36`) | Input with no EXIT is exit 4 (`cubin.om:503-505`). Offsets are written (`cubin.om:506-513`) | +| Parameter base | `0x380` for the only target (`omega_cubin.h:49`) | Decimal 352 below sm_90, 528 from sm_90 and below sm_100, 896 from sm_100 (`cubin.om:196-202`). 896 is the receipt's reading of `0x380`. cubin.om never selects it for sm_121, because sm_121 is refused | +| Parameters | Caller supplies offset, size 1, 2, 4, or 8, and a pointer bit. At most 32 (`omega_cubin.h:51`, `omega_cubin.c:186`). Records are written in caller order (`omega_cubin.c:123`) | Signature letters `p` (8) and `u` (4) only, 1 to 16 (`cubin.om:32`, `:252-266`). `kparams` writes them last to first (`cubin.om:488`). The KPARAM type bytes (`cubin.om:475-480`) were not byte-compared with CUDApp's type words `0x0021f500` and `0x0011f000` (`omega_cubin.c:128`) | +| Name | 1 to 64 bytes, first character a letter or `_` (`omega_cubin.c:86-96`) | 1 to 32 bytes (`cubin.om:31`, buffer at `:49`). A leading digit is accepted (`cubin.om:233`) | +| Text | Nonzero multiple of 16, at most `1 << 24` bytes (`omega_cubin.c:162`) | Multiple of 16, below 65536 bytes (`cubin.om:33`, buffer at `:47`). The same note requires one EXIT (`cubin.om:34`) | +| Shared | Caller `shared_reserved`, multiple of 4, section always present (`omega_cubin.c:174`, `:305`) | From sm_100 the reservation literal is 64, otherwise 0 (`cubin.om:205-215`). The section exists from sm_90 | +| Program headers | Five headers are written (`omega_cubin.c:366-375`, `cubin_elf.om:467-479`) | Written (`cubin.om:746-758`). Count is 4 below sm_90 and 5 from sm_90 (`cubin.om:206-211`) | + +`tools/artifact_export.c` passes `kern.gpr_count` into the cubin (`:102`, `:136`, `:175`). That field is the allocator peak (`src/omega_blackwell_codegen.c:1405`). The same tool sets `device-load=NOT_RUN` (`tools/artifact_export.c:183`). `omega_native_artifact.c:300-301` forwards that same `gpr_count` and a shared size of 64. Neither call adds 2. + +## A register reserve that is not the cubin writer + +`omega_bw_gpr_declared` (`src/omega_blackwell_codegen.c:2712`) returns `((peak + 2u + 7u) / 8u) * 8u`. The comment at `src/omega_blackwell_codegen.h:293-298` says this is the count to declare in the QMD: peak + 2, rounded up to a multiple of 8. Launchers call it. The cubin packer does not. The header cites chip runs from 2026-10-13 and says the exact minimum is UNKNOWN and the rule is INFERRED. Those runs were not repeated here: hardware-unverified. + +That helper is one launch declaration. It is not the rule `cubin.om` implements. `cubin.om` adds 2 to the count it stores in `.nv.info` and does not round to 8 (`cubin.om:317`). The two `+ 2` operations are different code, on different outputs. + +`src/omega_blackwell_submit.c:265` puts a third expression into a QMD config: `(kernel->gpr_count > 16) ? ((kernel->gpr_count + 15) & ~15U) : 32`. That value is not passed to `omega_cubin_pack`. This note did not classify every other launch site. + +## Hardware-unverified + +- `src/omega_cubin.c:71-73` says a cubin without program headers is rejected by `cuModuleLoadData` with error 200, and that this was confirmed on device. No receipt under `evidence/` mentions that sentence. `src/omega_cubin.h:31-33` still says `e_phoff` and `e_phnum` are 0 and that whether the loader needs program headers is what a NOT_RUN probe must decide. The C body and `cubin_elf.om` both write the headers. The header comment, the `.c` comment, and the code disagree. This note does not edit those sources. +- omega-mv#864's body and `cubin.om:30` describe `CUDA_ERROR_ILLEGAL_INSTRUCTION` (715) when the recorded count did not cover the registers the code wrote, and the PR body describes `CUDA_ERROR_INVALID_IMAGE` (200) for an ABI 8 image without `.note.nv.tkinfo`, plus later PASS lines on named GPUs through NVIDIA `libcuda`. None of that was run here. None of it names sm_121: `cubin.om` does not accept 121. Hardware-unverified, and not a GB10 result. +- `tools/artifact_export.c:183` already marks device load and device exec of the exported cubin NOT_RUN. That line was not changed, and no load was attempted. + +## Open questions + +1. Whether the two writers are ever consolidated is Drake's decision, on #108. This note does not choose a date or a design for that. +2. omega-mv#864's close comment says a later cubin writer is not a port of `cubin.om`. ARCH-0042 puts new cubin-writer work in CUDApp. Nobody has decided that a second, clean writer for the sm_80 family will be written. +3. The CUDApp cubin stores the integer it is given. The QMD helper stores peak + 2 rounded up to 8. The artifact exporter stores the codegen peak. Which of those belongs in `.nv.info` attribute `0x1b` and attribute `0x2f` for sm_121 is not decided, and was not loaded on a device here. +4. Whether an sm_121 ABI 8 image needs `.note.nv.tkinfo` is open. The CUDApp writer does not emit that section. No sm_121 load of either writer was run here. +5. `src/omega_cubin.h:31-33` describes a writer that omits program headers. `src/omega_cubin.c:340-375` writes them. Correcting the header is a change to a compiled file and was left for a separate change. +6. KPARAM payload bytes, `.nv.compat` words, and the tkinfo note layout were not byte-compared. The table is only the rows that were read. diff --git a/docs/REVIEWING.md b/docs/REVIEWING.md index 4247a94f..3a1a4d31 100644 --- a/docs/REVIEWING.md +++ b/docs/REVIEWING.md @@ -35,7 +35,7 @@ a human reviewer** in the owning group, in addition to section 1. The groups are disagree (`docs/HOW_I_DID_IT.md`, steps 1-2); those fields keep that record until each gets a NAK citation or a chip test. `nvdisasm` may be used only as a read-only checker of words we produced. -- **No HOLD material.** Nothing derived from omega-mv #864 (`cubin.om`) while it is on HOLD. +- **No material from omega-mv #864.** Nothing derived from `seed/sm80/cubin.om` (branch `ck/cubin-om` at `76639738`, closed unmerged 2026-10-27) enters this repository. See `docs/CUBIN_WRITERS.md`. - **Negative control.** A deliberately broken kernel or input is refused or detected by the change's own test. - **Cache and coherence.** Anything the CPU polls for a GPU write is GPU-uncached; flush and invalidate diff --git a/om/moe/README.md b/om/moe/README.md index 02976dda..0e90b0a0 100644 --- a/om/moe/README.md +++ b/om/moe/README.md @@ -40,4 +40,4 @@ Saved model config only: `$HOME/models/qwen3.6-35b-a3b-fp8-95a723d0/config.json` ## Remaining full acceptance -IMPLEMENTED / HOST_EXERCISED is not QUALIFIED, MERGED or DEPLOYED. No GPU/model launch, server/driver/firmware change, deployment or merge occurred. Remaining acceptance is unchanged: reviewed graph consumer integration and trusted-record authority; independent repaired-encoder/machine-code verification; reserved chip numerical and refusal controls; B=1 decode, supported request batching and prefill; paired whole-model quality and latency against cached-scratch incumbent. #18 fusion is separate and #137's previous kernel gain is not counted again. ADR0042 remains PROPOSED. Host fixtures do not satisfy physical or whole-model gates. +IMPLEMENTED / HOST_EXERCISED is not QUALIFIED, MERGED or DEPLOYED. No GPU/model launch, server/driver/firmware change, deployment or merge occurred. Remaining acceptance is unchanged: reviewed graph consumer integration and trusted-record authority; independent repaired-encoder/machine-code verification; reserved chip numerical and refusal controls; B=1 decode, supported request batching and prefill; paired whole-model quality and latency against cached-scratch incumbent. #18 fusion is separate and #137's previous kernel gain is not counted again. ADR 0042 is Accepted (aien-architecture-mv main, 2026-10-30). Host fixtures do not satisfy physical or whole-model gates. ```