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`.
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.