aien-architecture-mv
Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.
Brought by drakestapleton
aien-architecture-mv / docs / adr / 0046-omega-ng-one-seeded-compiler-cpu-gpu.md
| 1 | # ADR 0046: Omega NG: one seeded compiler for CPU and GPU (Omega and CUDA++ unified) |
| 2 | |
| 3 | **Status:** Accepted, Drake's directive 2026-11-07 ~07:35Z to 07:46Z (relayed by Manager(Aien)); recorded by |
| 4 | omp-queen-ng, queen of Hive NG. This text follows the later of the two relayed instructions, |
| 5 | `~/handoffs/hive-ng/DIRECTIVE-20261107-consult.md` (about 08:00Z), which replaced the supersession asked for in |
| 6 | `DIRECTIVE-20261107-adr.md` (about 07:46Z) with consumption by pin and no ownership move. |
| 7 | **Supersedes:** nothing. It works inside [ADR 0042](0042-omega-cudapp-bridge-ownership.md), |
| 8 | [ADR 0043](0043-gpu-stack-portable-top-thin-backend.md) and [ADR 0044](0044-one-cubin-writer-per-nvidia-target-family.md): |
| 9 | no ownership moves. Every code generator NG uses for a native GPU ISA (NVIDIA today), including the lowering of ΩIR |
| 10 | kernels to BlackwellIR, is CUDApp-owned and consumed by omega-mv at a pinned commit. |
| 11 | **Related:** ADR 0024 (Omega is the destination language), ADR 0042 Decision 4 (dependency by pin), ADR 0043 |
| 12 | Decision 0 (proof gate) and its ownership seam (new `.om` GPU code generators land in CUDApp). |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | ## Context |
| 17 | |
| 18 | Drake's words on 2026-11-07, verbatim: |
| 19 | |
| 20 | - "I want everything written in pure seeded omega. If the compiler is too slow to outrun the other languages, |
| 21 | then you need to create the next generation of Omega Compiler." |
| 22 | - "Don't let what I've told you in the past restrict your creativity for the future. Evolve Omega and CUDA++ |
| 23 | into something greater, something more uniform, semantic, and universal across everything. It can compute |
| 24 | with no matter what it is. Evolve this compiler into the ultimate thing." / "use all of my repos to evolve |
| 25 | this thing into something beautiful" / "Absolutely no restrictions. Do it however you think is best to do it. |
| 26 | Make no mistakes." |
| 27 | - "You can run the GPU. Just use your Omega language to do it." |
| 28 | - "CUDA++. Do it yourself. … Just make this fucker fly." |
| 29 | - "everything comes from the original handwritten kernel of the Omega language, which was hand-seeded, |
| 30 | assembled, and compiled over and over again by my own agents. Whatever we build has to use that language to |
| 31 | make it as fast as possible. Do whatever you need to do to make that happen. You can mutate the language, use |
| 32 | the language in some other way, or take good things from other people's languages and implement them in our |
| 33 | own languages. Figure it out please." |
| 34 | |
| 35 | Ground truth (omega-mv main `943d955531b9d4d9f70deb41756c0b46441dd5e0`, CUDApp main |
| 36 | `b774723f537cec16a359fe082b8100317a5b5490`, checked 2026-11-07): |
| 37 | |
| 38 | - omega-mv's seeded compiler `seed/omc/omc.om` emits AArch64 directly with no IR on the native path, a fixed |
| 39 | 16-register pool without spilling (error 12) and save-all calls. Its IR mode writes scalar-only OSC IR v1. |
| 40 | - CUDApp already holds seeded Omega GPU pieces: the sm_121 encoder `om/encoder/bw_enc_sm121.om`, the cubin packer |
| 41 | `om/cubin/cubin_elf.om` and the allocator component `om/components/bw_alloc.om`. Its kernel builder |
| 42 | (`src/omega_blackwell_codegen.c`) and runtime are C. |
| 43 | - CUDApp's README (line 465 at `b774723f`) applies ADR 0042 this way: "The existing Omegese → IR → sm_121 lowering, |
| 44 | its checker and host words stay in omega-mv." The seeded port of that lowering (`seed/oscgpu/gpulow.om`, |
| 45 | `gpuemit.om`) is on omega-mv draft #1044, which waits for a YubiKey re-sign of the checker. |
| 46 | |
| 47 | Manager(Aien) relayed two architecture reviews (2026-11-07). The directive lists the reuse of CUDApp's seeded pieces |
| 48 | through sha-pinned source under the reviewers' disagreements, attributing the view that it respects ADR 0042 with no |
| 49 | ownership move to one reviewer (consult-claude). Manager directed that this ADR say exactly that CUDApp keeps the |
| 50 | pieces and NG consumes them by pin. This ADR applies that direction; it is a decision, not a joint finding. |
| 51 | |
| 52 | ## Decision |
| 53 | |
| 54 | 1. **ΩIR is the single semantic IR** for every Omega NG target: one typed SSA IR with block parameters, explicit check |
| 55 | ops carrying exact trap codes, one ordering token through every check and effect, memory, floats, vectors and a |
| 56 | kernel form shared by CPU and GPU. Its binary encoding is a new version of the OSC wire family |
| 57 | (`spec/one-layer-format.md`) with one written specification and an independent validator. |
| 58 | 2. **omega-mv `seed/ng/**` holds Omega NG's compiler**: the front end, ΩIR (spec, reader, writer, validator), the |
| 59 | optimizer, and the AArch64 back end. All of it is seeded Omega built by the seed chain: `seed/out/omc` compiles |
| 60 | NG, then NG compiles itself to a fixpoint before it is proposed as a compiler pin. SPIR-V and WebAssembly come |
| 61 | from the existing omega-mv emitters retargeted to ΩIR; they are existing omega-mv code and stay there (ADR 0042 |
| 62 | Decision 7; ADR 0043 section 9). x86-64 and EFI stay with omc. |
| 63 | 3. **CUDApp owns every code generator NG uses for a native GPU ISA (NVIDIA today)** (ADR 0042 Decision 2; ADR 0043 |
| 64 | seam: "any new `.om` code generator, including the `.om` successor of the sm_121 lowering", in CUDApp |
| 65 | `backend/gb10/`; ADR 0044). That covers the lowering of ΩIR kernels to BlackwellIR, the GPU register allocator |
| 66 | `om/components/bw_alloc.om`, the encoder `om/encoder/bw_enc_sm121.om` and the cubin writer |
| 67 | `om/cubin/cubin_elf.om`, and, with them, the driver client and the runtime (ADR 0042 Decision 2). The |
| 68 | ΩIR-to-BlackwellIR lowering is written for CUDApp `backend/gb10/` and lands through CUDApp's own |
| 69 | review queue (a pull request or Radicle patch under the desk's protocol) and owners. It reads ΩIR as specified by |
| 70 | omega-mv at a pin (CUDApp consumes omega-mv at a |
| 71 | pin, ADR 0042 Decision 4). Code under ADR 0043 keeps that ADR's Decision 0 gate: until P0's head-to-head is |
| 72 | published and C2 to C5 are QUALIFIED on the GB10, the lowering stays a host-only experiment that touches no |
| 73 | shared file, and nothing merges into CUDApp under it. |
| 74 | 4. **Consumption by pin, defined.** `seed/ng/cudapp.lock` in omega-mv holds, on its first non-comment line, one |
| 75 | CUDApp commit, then one line per consumed file: its sha256 and its path in CUDApp. The NG build (`ngbuild`) must |
| 76 | check out that commit as the sibling `../CUDApp`, hash each listed file and refuse to build when any sha256 |
| 77 | differs or a file is missing; the NG GPU gate (`seed/ng/gpu/gate.cases`) must run CUDApp's units at that pin and |
| 78 | fail on any encoding difference. The lock moves only by an omega-mv change (a pull request or Radicle patch) from |
| 79 | the NG GPU lane, after the new CUDApp commit is merged on CUDApp's main and the gate passes at it, with the |
| 80 | reviewer checking the hashes against that commit. If a consumed file must change shape (signature, table layout, |
| 81 | name), the change is made in CUDApp first through its review queue; omega-mv then moves the lock. omega-mv never |
| 82 | edits or copies a consumed file. While a needed CUDApp change |
| 83 | is not yet merged (an open pull request, an open Radicle patch, or a committed change waiting as a READY bundle for |
| 84 | its patch), the lock may name that change's head as a provisional pin, marked so in the lock's comment with the |
| 85 | pull request, patch or READY bundle it belongs to. A READY bundle named this way must contain the pinned commit and |
| 86 | pass `git bundle verify`, so a reviewer can rebuild the pinned files and check their sha256 rows from a fresh |
| 87 | clone. A provisional pin is for building and review only: an omega-mv change carrying one does not merge until the |
| 88 | CUDApp change has merged and the lock names the merged commit with the gate passing at it. |
| 89 | 5. **No C is re-ported.** NG does not translate CUDApp's C kernel builder; GPU code generation for NG starts from |
| 90 | ΩIR and the seeded CUDApp pieces above. |
| 91 | 6. **omega-bridge keeps compatibility**, unchanged (ADR 0042 Decision 3). |
| 92 | 7. **Existing code stays.** omc and its back ends keep working and remain the compiler pin until NG is qualified and |
| 93 | proposed as the next pin; nothing is deleted before its NG successor is merged and its consumers have migrated. |
| 94 | |
| 95 | ## Consequences |
| 96 | |
| 97 | - New compiler work lands in omega-mv `seed/ng/**` through the normal desk: a finished change (a pull request or |
| 98 | Radicle patch under the desk's protocol, built from a READY bundle) with evidence, its gates and an independent |
| 99 | signed review on the exact head. |
| 100 | - New NG GPU code generation lands in CUDApp under ADR 0043, including its Decision 0 gate. omega-mv gains a CUDApp |
| 101 | pin file for NG's GPU path; CUDApp gains a consumer and no new owner. |
| 102 | - GPU tiers stay NOT_RUN until an authorized `spark-window` run produces a receipt. This ADR records a decision. It is |
| 103 | not evidence that anything has been implemented or qualified. |
| 104 | |
| 105 | ## Source |
| 106 | |
| 107 | - Drake's directive, 2026-11-07, quoted above as relayed in `~/handoffs/hive-ng/BRIEF.md`, |
| 108 | `~/handoffs/hive-ng/DIRECTIVE-20261107-adr.md` and `~/handoffs/hive-ng/DIRECTIVE-20261107-consult.md` (operator |
| 109 | handoff files). |
| 110 | - Hive NG scout reports `ng-omc.md` and `ng-gpu.md` (2026-11-07); CUDApp README.md:465 at `b774723f`. |