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
| 1 | # C1 checked kernels |
| 2 | |
| 3 | The source of record for the kernel language, checker2 and language-to-IR |
| 4 | lowering is omega-mv at `omega-mv.lock` in this directory: |
| 5 | `37920c935ce2c2d6b4629a50ac474c0c933f4728` (omega-mv branch `ham/integ-280-c1`: |
| 6 | the unsigned conversions at BlackwellIR 65/66 so published op 64 stays ATOMG MIN, |
| 7 | evidence/INTEG-280-20261110/numbering.txt), on `bb552199e8970bbdcb42c79acc8a36f9c1189e23` |
| 8 | of [draft #1044](https://github.com/aien-dev/omega-mv/pull/1044), not a merged |
| 9 | compiler release. CUDApp owns sm_121 instruction encoding and cubin packaging. |
| 10 | No frontend source is copied into CUDApp. |
| 11 | |
| 12 | ## Host acceptance |
| 13 | |
| 14 | Set `OMEGA_C1_SOURCE` to a clean checkout of the exact pin, with its pinned |
| 15 | `seed/out/omc` artifact present. Then run: |
| 16 | |
| 17 | ``` |
| 18 | bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make -j3 test-c1 |
| 19 | bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make -j3 test |
| 20 | ``` |
| 21 | |
| 22 | The device-free namespace is mandatory for host, simulator, differential and |
| 23 | mutant checks. A missing-device failure is a host-path defect, not permission |
| 24 | to rerun outside it. During the parallel integration wave, only the Integrator |
| 25 | runs the full `make test` command after all writers finish. |
| 26 | |
| 27 | `test-c1` remains standalone while its omega-mv source is a pending draft; |
| 28 | it joins `HOST_TESTS` only once that draft merges. Missing or changed source |
| 29 | or a mismatched compiler SHA-256 is NOT_RUN (the source-check script exits 3, |
| 30 | and Make reports failure), never PASS. No fallback checkout or compiler is used. |
| 31 | |
| 32 | `test-c1-predicate` independently checks guarded unsigned conversions, MOV and |
| 33 | SHFL with inactive, active, inverted and mixed lane predicates. Predicated-off |
| 34 | lanes retain canaries; an inactive SHFL walks past structural checks, while |
| 35 | an active SHFL after a lane exits is still refused. This catches the former |
| 36 | scalar dispatch bug that used the fragment mask instead of the predicate mask. |
| 37 | |
| 38 | The pipeline is: |
| 39 | |
| 40 | 1. Omegese source kernels, including vector add, shared-memory tiled GEMM and |
| 41 | decode attention, emit canonical OSC IR. |
| 42 | 2. checker2 verifies types, ownership, memory phases and races. Named negative |
| 43 | fixtures must be refused. The seeded Omega checker is compared to the C |
| 44 | migration oracle on the same bytes. |
| 45 | 3. `seed/oscgpu/*.om` lowers the checked unit to Blackwell IR. All dumps, |
| 46 | refusals, metadata and machine bytes are compared with the C migration |
| 47 | oracle, including deliberately broken lowering variants. |
| 48 | 4. CUDApp's default `om/encoder/bw_enc_sm121.om` encodes those instructions. |
| 49 | Conversion opcodes 65/66 follow main's ATOMG MIN opcode 64; training opcodes 60..63 retain |
| 50 | their existing meanings. Ordinary guard predicates are encoded fail-closed. |
| 51 | 5. CUDApp's default `om/cubin/cubin_elf.om` packs sm_121 ELF cubins. The test |
| 52 | parses the section table and checks exact `.text` roundtrip; changing a text |
| 53 | byte must be caught. |
| 54 | 6. The existing SIMT simulator runs the matched Blackwell IR against the host |
| 55 | references under both fragment schedules. It models divergence, shared |
| 56 | memory, barriers and shuffles. It is an IR simulator, **not** an independent |
| 57 | machine-byte decoder or a GPU driver. Byte equality and ELF roundtrip bind |
| 58 | its input to the generated cubin, but do not establish hardware correctness. |
| 59 | |
| 60 | Buffer bounds remain checked at runtime: invalid indices trap with status code |
| 61 | 3 and poison propagation, and cannot perform later stores. They are not a |
| 62 | claim that checker2 statically proves every dynamic buffer index in bounds. |
| 63 | A literal index beyond a fixed shared-array length is statically refused as |
| 64 | `C2-GPU-BOUNDS`. The dynamic bounds tests separately exercise refused execution; |
| 65 | neither tier is a claim of a complete static bounds proof. |
| 66 | |
| 67 | Host build dependencies are the pinned compiler artifact, C compiler and the |
| 68 | omega-bridge-generated bindings already committed in each repository. C glue |
| 69 | in `sim.c` only adapts the test ABI and checks ELF output; the language lowering, |
| 70 | encoder and cubin writer are Omega. Existing C lowering/checker implementations |
| 71 | are retained as explicit migration/differential oracles, not represented as |
| 72 | removed dependencies. |
| 73 | |
| 74 | ## Chip runbook — NOT_RUN |
| 75 | |
| 76 | No command in `test-c1` builds a device launcher or opens `/dev/nvidia*`. |
| 77 | A fresh Drake-authorized exclusive GPU window is required for all steps below. |
| 78 | Historical omega-mv receipts do not qualify the draft pin. |
| 79 | The current device-free policy does not authorize the unwrapped chip command: |
| 80 | later authorization must explicitly permit the required GPU device exposure. |
| 81 | |
| 82 | After authorization and the current hardware runbook's preflight, repeat the |
| 83 | host command above and preserve its output and the exact source/compiler/image |
| 84 | hashes. In the pinned language checkout, use the generated CUDApp machine bytes: |
| 85 | |
| 86 | ``` |
| 87 | taskset -c 10-14 nice -n 10 make -C "$OMEGA_C1_SOURCE" -j3 \ |
| 88 | test-osc-gpu-chip OSC_GPU_OM_DIR="$PWD/build/c1/om/om" |
| 89 | ``` |
| 90 | |
| 91 | That launcher is the existing migration path in omega-mv. It checks the generated |
| 92 | machine bytes against the CUDApp corpus before launch. It does not test cubin |
| 93 | loading; that requires CUDApp's module-loader hardware acceptance as a separate |
| 94 | receipt. Collect the vector add/GEMM/attention reference verdicts, status-word |
| 95 | bounds refusals, and a red run for each lowering mutant. Do not weaken the gate |
| 96 | or use a historical receipt if the new path is refused. |
| 97 | |
| 98 | The live-35B replacement gate is also **NOT_RUN**. In a separately authorized |
| 99 | serving window, the operator must identify the actual serving process/model, |
| 100 | freeze a prompt corpus plus deterministic generation settings and golden token |
| 101 | IDs, and select one matching live kernel shape. Capture baseline tokens before |
| 102 | changing the kernel dispatch. Replace only that dispatch with the checked |
| 103 | kernel, capture token IDs under identical settings, require exact ID equality, |
| 104 | and restore the original dispatch on any refusal or mismatch. Record model, |
| 105 | weights/tokenizer hashes, dispatch identity, source/image hashes, settings, |
| 106 | baseline and replacement token streams, and rollback result. No live model or |
| 107 | service is modified by this PR, and simulator equality is not that receipt. |