interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / docs / OMEGA_HOST_TESTS.md

572 lines · 32830 bytes Raw Blame History Rendered
1# Portable host checks and target-only commands
2
3`make test` is the host suite. It does not need a CUDA toolkit, NVIDIA
4userspace tools or a GPU device node. Carried seeded-Omega mutation gates,
5including `test-codegen-f64`, require the pinned compiler and bridge checkouts;
6set their environment as described in [the f64 host runbook](CODEGEN_F64.md).
7Builds and simulations run in the required device-free `bwrap` namespace;
8they must not open `/dev/nvidia*` or `/dev/aien-gpu`.
9
10## Integration long-run receipts (2026-11-06)
11
12These are host differentials, not chip qualification. All three ran inside
13`bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10`.
14
15| Path | Source | Observed result | Local receipt |
16| --- | --- | --- | --- |
17| QMMA | `62640e93b39ca6a6a33a1795d5463db1297eb81f` | rc 0; structure exhaustive NITER bit-basis PASS (94 values, zero refused); NITER-dependence and output mutants caught; `CODEGEN QMMA DIFF PASS (714275 cases)` | `/tmp/integ/codegen-a-qmma-bwrap.log` |
18| TGEMM exhaustive | `62640e93b39ca6a6a33a1795d5463db1297eb81f` | rc 0; mutant caught; `CODEGEN TGEMM EXHAUSTIVE DIFF PASS (17276981 accepted cases)` | `/tmp/integ/codegen-a-tgemm-exhaustive-bwrap.log` |
19| MoE | #284 `262275e` | record negative control caught; `CODEGEN MOE DIFF PASS (1732053 programs, 10681 refusals)` | `/tmp/integ/moe-final-diff-262275e-b.log` |
20
21QMMA and TGEMM commands were `OUT_DIR=build/integ-long-62640` followed by the
22wrapper above and respectively `make -j3 test-codegen-qmma-diff` and
23`make -j3 test-codegen-tgemm-exhaustive`. MoE is Main's recorded differential
24receipt. These results do not substitute for the integrated full host suite.
25
26On x86-64, when you did not set `CC`, `make` uses gcc. GNU make's built-in
27`CC=cc` is left alone on AArch64, so a GB10 `make` still invokes `cc`.
28`make CC=clang test` still uses the compiler you named. Engine simulator
29recipes that name `gcc` directly keep that compiler.
30
31The default `CUDAPP_MEM_RESERVE_MIB` is 4096. It is not changed. On the x86-64
32VM in `evidence/HOST-X86-20261030`, `make CC=gcc -j4 test` exits 2 at that
33default and passes only with `CUDAPP_MEM_RESERVE_MIB=0`. The failing check
34refuses a 741.9 MiB serving upload because 4.6 GiB is free and the runtime
35keeps 4.0 GiB free. A host that cannot keep 4096 MiB free fails the same way.
36GitHub Actions runs `CUDAPP_MEM_RESERVE_MIB=0 make CC=gcc -j4 test` and
37`make CC=gcc gpu-engine-freestanding` on `ubuntu-24.04`
38(`.github/workflows/host-x86.yml`). The AArch64 `host-tests` job is unchanged.
39GB10 stays NOT_RUN.
40
41On x86-64, `make test` does not count checks that execute the seeded AArch64
42binding or the pinned `omc`. Those targets still exist. Invoking one directly
43exits 2 and names the requirement. `make test-omega-target-only` prints one
44line per name in `CUDAPP_TARGET_ONLY_TESTS` and exits 0; that exit is the
45report, not a pass of the named checks. On AArch64 those checks stay inside
46`make test`. The list includes `test-qmma-probe-rest-mutants`,
47`test-core-residue-mutants`, `test-c5-policy`, `test-dagsim-jstr-om`,
48`test-disasm-words`, `test-graph-table-perm`, `test-graph-headscale`,
49`test-numeric-om-mutants`, `test-numeric-rest-om-mutants`, `test-nvrm-alloc`,
50`test-platform-linux-fake-device`, `test-prefill-host-rest`, `test-codegen-fixture-rest`,
51`test-gpu-attn-any-mutants`, `test-codegen-pfhost-admit-mutants`, `test-codegen-tc-mutants`,
52`test-codegen-tc-host-mutants`, `test-gpu-conv2d-mutants`, `test-core-mutants`,
53`test-gpu-dnn-activations-mutants`, `test-dnn-half-mutants`, `test-gpu-dnn-rows-mutants` and
54`test-engine-fixture-rest`.
55
56`test-gpu-imadhi-rc` and `test-dagsim` stay in `make test` on x86-64. They are
57host programs and do not open a device. On the VM in
58`evidence/HOST-X86-20261030`, after main `b4f0480` was merged,
59`CUDAPP_MEM_RESERVE_MIB=0 make CC=gcc -j4 test` exited 0 and ended
60`CUDA++ HOST TESTS PASS (57 targets)`. Inside that run `test-gpu-imadhi-rc`
61printed PASS for `bw_warp_sim.h`, `bw_warp_sim_tc.h`, `bw_warp_sim_k.h` and
62`bw_warp_sim_pa.h`. `test-dagsim` printed `dagsim_unit: 171 checks, 0 failed`.
63The same `make CC=gcc test-gpu-imadhi-rc` command by itself also exited 0.
64GB10 stays NOT RUN.
65
66Three targets in that suite are the fresh-checkout contract:
67
68```sh
69make test-omega-slice-runner # missing compiler, missing slice, wrong pin
70make test-omega-arch-guard # x86-64 production refusal
71make test-omega-barrier-contract # dsb sy stays on AArch64; x86-64 keeps a real fence
72make test-omega-binding-portable # revision and epoch vectors
73make test-omega-target-only # names the checks this host does not run
74```
75
76## Binary64 codegen
77
78`test-codegen-f64` is registered in `CARRIED_HOST_TESTS` by
79`mk/codegen-f64.mk`. It runs independent C/seeded byte differentials,
80IEEE binary64 edge vectors, register-pair pressure/refusal, the append-only
81replay bound, a simulated DFMA/DSETP probe and six compiled seeded mutants.
82The `codegen_f64_probe --chip` mode is never a host-suite dependency and is
83NOT_RUN without a current exclusive window. See [the encoding facts and
84chip runbook](CODEGEN_F64.md).
85
86## Ternary row-major simulation
87
88The ternary `test-gpu-tern-sched` target also runs an independent row-major
89warp-simulator regression. Its packed weights and expected row values do not
90use the API packer or Omega's algebra oracle.
91
92When reusing the pinned Omega `tests/gpu_tern_test.c` battery, pre-include
93CUDA++'s `tests/bw_warp_sim_k.h` in the test translation unit. Quoted includes
94otherwise select the simulator beside the external test, which at Omega
95`e5b32567` ignores scalar `LDG.E` immediate offsets. That stale simulator fails
96row-major cases even with the unchanged C builder. Do not alter the generator,
97packing, or expected values to accommodate it. The integration
98`test-codegen-tern-sim` target already uses a current-simulator adapter.
99
100## Memory ordering
101
102`nvrm/cpu_barrier.h` is the publication barrier.
103
104- On AArch64 the instruction is `dsb sy`. That is the GB10 host barrier. The
105 production backend is not rebuilt with a no-op, an empty `asm`, or a dropped
106 fence.
107- On x86-64 the instruction is a sequentially consistent fence. The object
108 contains that fence. It is how the portable host suite compiles the same
109 sources.
110- `OMEGA_BLACKWELL_HOST_SIMULATOR` is a compile definition for the fake-driver
111 engine tests (`test-gpu-engine-sim` and `test-gpu-engine-backend-mutants`).
112 It lets those tests call the backend on a non-AArch64 host. It does not
113 enable a real device. The production library is built without it. On x86-64
114 that library's Blackwell open and the direct matmul and vector entries return
115 `ENOTSUP` and the text `requires AArch64 Linux`, and they do not call the
116 driver.
117
118`make test-omega-arch-guard` runs that refusal on x86-64. On AArch64 the same
119target prints `NOT_RUN` and does not build the binary, because a cross
120compile is not an x86-64 runtime result and the production path must not be
121asked to open a device from this check. `CROSS_COMPILE_ONLY=1` records the
122same `NOT_RUN` after a cross compile.
123
124`make test-omega-barrier-contract` rejects a raw `dsb sy` outside
125`#if defined(__aarch64__)`, checks the header split, and disassembles a tiny
126caller. A one-line unguarded fixture must fail. If `aarch64-linux-gnu-gcc` is
127absent on an x86-64 host, the AArch64 object row prints `NOT_RUN`. The source
128contract still runs.
129
130## Seeded binding on a non-AArch64 host
131
132`om/units.sh` emits every seeded unit as checked portable C through the pinned
133omega-bridge (`om/omega-bridge.lock`): `src/cudapp_om_<unit>.c` for the hosted
134units and `src/cudapp_freest_<unit>.c` for the import-free scalar units. They
135are generated and not edited. Every host compiles the same files, so x86-64
136runs `bw_enc_sm121.om`, `cubin_elf.om` and the native units through the same C
137that AArch64 links. `make test-om-encoder`, `make test-om-cubin`,
138`make test-codegen-freestanding` and `make test-gpu-native-runtime` run on
139x86-64.
140
141`make test-omega-binding-portable` checks the revision and epoch vectors
142against the generated `src/cudapp_freest_revision.c` and
143`src/cudapp_freest_epoch.c` on every host.
144
145The pinned compiler omc is an AArch64 binary. These commands execute it, so on
146x86-64 they exit 2 unless `OMEGA_OMC` is given explicitly and executes there
147(`.github/workflows/ampere-x86.yml` registers the pinned QEMU provenance oracle
148for that job). They run for real on AArch64 when their other tools are
149present:
150
151```sh
152make test-om-spec-encoder
153make test-portable-receipts
154make test-model-capacity
155make test-prof
156```
157
158`make test-codegen-freestanding` on x86-64 still runs the freestanding C
159encoder checks. The hosted `.om` comparison prints `NOT_RUN` and is not
160performed. `CUDAPP_ENCODER=diff` on x86-64 is an error: that mode executes the
161seeded binding.
162
163`make test-gpu-session-mutants` on x86-64 still runs the nine session-shell
164mutants. Its seven Omega-unit mutants regenerate `.om` through `om/units.sh`,
165so they print `NOT_RUN` there unless `OMEGA_OMC` is given and executes on that
166host. The final line counts only the mutants that ran. The same split applies
167to `test-chip-enum-om` (differential, controls and fixture scan run; seven
168`.om` mutants print `NOT_RUN`), `test-codegen-base-om` (the C comparison runs;
169`om/units.sh --check` prints `NOT_RUN`), `test-regalloc-om` (same split) and
170`test-codegen-rest` (differential and coverage run; the Omega mutants print
171`NOT_RUN`). `CUDAPP_OMC_STEP` (Makefile) gives the same split to one recipe
172line: `test-cm-route`, `test-dagsim`, `test-nvrm-policy`, `test-nvrm-struct`,
173`test-codegen-f64`, `test-platform-linux-rest` and `test-gpu-resident` run
174their C and host checks and print `<target>: <what> NOT_RUN` for the step that
175executes the pinned `omc`.
176
177## Omega slice gate
178
179The eight slices stay in `omega/slices/`: `doorbell.osc`, `sequencer.osc`,
180`nvrm.osc`, `va.osc`, `open_plan.osc`, `kmod.osc`, `mesa.osc`, `launch.osc`.
181A missing name fails before any compiler is required.
182
183The compiler checkout is explicit. There is no default directory.
184
185```sh
186OMEGA_OSC_COMPILER_DIR=/path/to/omega-osc-cubin tests/omega/run.sh 120
187# or: tests/omega/run.sh 120 /path/to/omega-osc-cubin
188# or: make test-omega-slices OMEGA_OSC_COMPILER_DIR=/path/to/omega-osc-cubin
189```
190
191`make test-omega-slices` is not part of `make test`. A fresh checkout has no
192sibling compiler, so the portable suite only runs the refusal checks.
193
194The harness must be a clean Git checkout of source commit
195`1accb93164ce68a2ac2e2c680acf54782f260d62` (the pin recorded on
196`roadmap/15-reproducible-host`). The runner then uses
197`build/compiler/test_osc_compiler` and builds that target when the binary is
198absent. Failures:
199
200| Condition | Exit | Diagnostic |
201|---|---|---|
202| `OMEGA_OSC_COMPILER_DIR` unset and no directory argument | 2 | `compiler harness not configured` plus the required commit |
203| Directory is not a Git checkout | 2 | `harness directory is not a Git checkout` |
204| `HEAD` is a different commit | 2 | `wrong harness source` with expected and found revisions |
205| Tracked or untracked changes | 2 | `harness checkout is modified` |
206| A named slice file is absent | 1 | `missing required slice` and the path |
207| Binary still absent after the build | 2 | `compiler binary still missing` |
208
209The 2026-10-22 receipt on that branch recorded an AArch64 binary SHA-256 of
210`a007283780347dd4a4b024844dc0c81fc09e0926f27f83e50c07d42508886f23` and a
211passing eight-slice run. This tree does not re-measure that binary. A run
212prints the source commit and the binary SHA-256 of whatever it actually
213executed.
214
215## What is portable, and what is not
216
217Portable, included in `make test`:
218
219```sh
220make
221make test
222make test-omega-slice-runner
223make test-omega-arch-guard
224make test-omega-barrier-contract
225make test-omega-binding-portable
226build/hello_gpu --sim
227make doctor
228```
229
230`make doctor` reads `/proc`, `/sys` and `/dev`. It does not open a GPU. On a
231machine that is not a DGX Spark it reports the missing pieces. That report is
232the result.
233
234Target-only, not a silent pass inside `make test`:
235
236```sh
237make test-omega-slices # needs the pinned OSC compiler above
238make test-om-encoder # AArch64; seeded encoder binding
239make test-om-cubin # AArch64; seeded cubin packer
240make test-gpu-native-runtime # AArch64; seeded native units
241make test-om-spec-encoder # pinned omc; samples read by Omega's own sm121dis
242make test-om-spec-encoder-nvdisasm-oracle # same, read by NVIDIA nvdisasm (oracle)
243make test-om-disasm-mutants # pinned omc and bridge; four .om decoder mutants, each caught by the .om vs C differential
244make test-sm121dis # pinned omc and nvdisasm; oracle agreement and .om vs C corpus
245make test-sm121dis-opmove # pinned omc and nvdisasm; BlackwellIR ops 64..79 encoded, read by ours and the oracle
246make test-portable-receipts # pinned omc
247make test-model-capacity # pinned omc
248make test-prof # pinned omc; profiler host and simulator tiers, chip stays NOT_RUN
249make test-expert-coder # pinned omc; ERC1 expert-weight coder on generated matrices, every negative control (not in make test)
250make test-expert-coder-mutants # pinned omc; each ERC1 check broken once, the suite must fail each time (not in make test)
251make test-expert-coder-real # pinned omc and the Qwen3.8-Flash-Next checkpoint; real expert matrices (not in make test)
252make hello-gpu # GB10, opens the NVIDIA device nodes
253./build/gpu_<name>_test --out receipt.json
254```
255
256`make test-gpu-engine-gb10-compile` only compiles the Phase B chip source. It
257does not run it. `make test-gpu-scan` runs the existing frozen-order reduction
258host checks and both warp-simulator scheduling orders. Its numeric substrate
259defaults to the seeded units in `om/numeric/`; retained native C/assembly is
260an opt-in differential oracle. `make test-gpu-gemm` is the separate GEMM host
261and simulator target. Neither simulator target opens a GPU.
262`make test-gpu-scan-mutants` needs `OMEGA_MV` and `OMEGA_BRIDGE_DIR` and is
263outside `make test`.
264
265### Numeric remainder migration
266
267`make test-numeric-rest-om-diff` compares bulk reference/CPU realization, FTZ,
268parity and seed traces, patch encoding/checking, launch admission, IEEE
269predicates and the general reduction hierarchy against the retained C oracle.
270Non-NaN floats compare by bits; NaNs compare by class. The reducer preserves
271the declared warp tree at every level, including padding and final MEAN
272division. Sequential summation is deliberately not that contract.
273The production numeric archive objects also force `-ffp-contract=off`, including
274when a caller supplies `CFLAGS`; see the
275[archive build/control receipt](../evidence/numeric-rest-20261106/archive-fp-contract.md).
276
277`make test-numeric-rest-om-mutants` regenerates disposable copies, requires a
278passing control, kills six changed Omega algorithms and rejects omission of
279each of the five strong remainder units at link time. The earlier scalar
280`test-numeric-om-diff` and `test-numeric-om-mutants` remain unchanged contracts.
281Set `OMEGA_OMC` and `OMEGA_BRIDGE` to the pins checked by `om/units.sh`.
282
283The independent native implementations compile only with
284`CUDAPP_MIGRATION_PENDING_C_NUMERIC_REST` (oracle-only) or
285`CUDAPP_MIGRATION_PENDING_C_NUMERIC_REST_DIFF` (both implementations, distinct
286symbols). The default has no weak-symbol fallback. C adapters transport
287bits/addresses, allocate reduction buffers and render diagnostics; the `.om`
288units decide the computation and admission.
289
290On the shared Spark, run every command above under:
291`bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10`.
292Build with at most `-j3`. These checks are host/simulator evidence only; the
293chip runbook and limitations are in
294[`numeric-rest-20261106`](../evidence/numeric-rest-20261106/README.md).
295
296An AArch64 host build of this tree keeps `dsb sy` in `nvrm_cpu_barrier`. A
297GB10 run of the device path is a separate receipt. A host or simulator pass
298does not qualify it.
299
300## QMMA builder migration
301
302`make test-codegen-qmma-diff` is host-only and part of `make test`. The default
303QMMA probe, peak and F2E4 probe builders execute `om/codegen/cg_qmma.om`
304through checked portable Omega IR replay. `cg_qmma_patch.om` owns placeholder
305validation and rewriting. `CUDAPP_MIGRATION_PENDING_C_CODEGEN_QMMA=1` selects
306the old C oracle; it defaults to zero.
307
308The differential is **exhaustive over structure, bit-basis over niter**.
309For every supported peak chain count, issue stall and thread count it tests
310the unique union of `{1,7,UINT32_MAX}` and
311`{2^k,2^k-1,2^k+1 | k=0..31}`. Zero is a matched refusal.
312It also checks both probe variants at every supported wait count and F2E4.
313Each accepted case compares encoded bytes, patched bytes, patch counts and
314packed cubins between C and Omega. For each structural configuration, both
315implementations' patched bytes must differ from their niter=7 baseline only
316in the same MOVI word-1 immediate field, whose decoded value must equal niter.
317The field is located from the baseline IR, not a hard-coded instruction index.
318A parity-dependent stall mutant must fail this confinement check independently
319of C/Omega equality; a separate corrupted-control-word mutant must fail byte equality.
320Unsupported configurations, null outputs, corrupt placeholders and short
321buffers are also compared with C.
322
323Source-level scalar dependence: `src/omega_blackwell_codegen_qmma.c:110-122`
324rejects zero and copies `iters` only into `movi(e,cnt,iters)`.
325On the peak path, `om/codegen/cg_qmma.om:416-419` copies the scalar into spec
326slot 1, `:98-101` rejects zero, and `:294-297` copies it into the single MOVI
327immediate. No other peak emission depends on that scalar. The executable
328confinement checks strengthen this source argument; they do not claim literal
329enumeration of every uint32 iteration count.
330
331Domain query:
332`WolframLanguageEvaluator: v=Union[Join[{1,7,2^32-1},Flatten[Table[{2^k,2^k-1,2^k+1},{k,0,31}]]]]; {Length[v],Count[v,_?(#>0&)],Length[v]*16*15*32}`
333→ `{94,93,721920}` (including the refused-zero probes).
334The strengthened matrix/confinement target is **NOT_RUN** to completion:
335its focused run was cancelled at the operator's wrap-up directive. The initial
336receipt below predates this strengthening and must not be cited as its PASS.
337Initial pre-confinement receipt:
338The focused command exited zero and printed
339`CODEGEN QMMA DIFF PASS (7748 cases)` on 2026-11-06, after printing
340`CODEGEN QMMA MUTANT CAUGHT`. This is host parity, not chip qualification.
341`make test-codegen-qmma-host` also exited zero on 2026-11-06 UTC:
342the patch oracle-bit self-test and model checks passed, ending
343`GPU_QMMA_PROBE: PASS`.
344
345Constants were transcribed from the existing C oracle and checked with
346`WolframLanguageEvaluator: AssociationMap[FromDigits[#,16]&,{"51303832","46453433","38383838","fc000","358","380","388","ffff","7209","723e","07800000","048070ff","723c","727a","41800","2c00","ffffff00","ffff0000"}]`
347→ respectively
348`1362114610,1178940467,943208504,1032192,856,896,904,65535,29193,29246,125829120,75526399,29244,29306,268288,11264,4294967040,4294901760`.
349
350Chip tier is **NOT_RUN**. In a separately authorized exclusive GB10 window,
351build `taskset -c 10-14 nice -n 10 make -j3 build/gpu_qmma_probe_test`,
352then run `./build/gpu_qmma_probe_test --host-only` and
353`./build/gpu_qmma_probe_test` using that window's required device authorization
354and receipt capture procedure. The default command exercises arithmetic,
355the dropped-C negative control, and the peak sweep. Do not run it outside
356that window.
357
358## Tiled BF16 training GEMM builder migration
359
360The default `omega_blackwell_codegen_tgemm_prog` executes the first-party
361`cg_tgemm.om` builder and `cg_tgemm_spec.om` admission/query unit through
362checked portable IR replay. `cg_tgemm_emit.om` shares the QMMA allocator,
363record packer and scoreboard-control primitives. The old C oracle remains
364behind `CUDAPP_MIGRATION_PENDING_C_CODEGEN_TGEMM=1`, default zero.
365Native portable view lengths count elements, not bytes.
366
367`make test-codegen-tgemm-diff` checks every structural shape and supported
368mutant along the full independent K and N axes, compares all public query
369results and refusals, and compares complete IR plus allocator state.
370Each structural baseline also compares encoded bytes and packed cubins.
371Equal complete IR and allocator state feed the same deterministic encoder;
372this is stronger than comparing only encoded bytes.
373The independent-axes command is not an exhaustive Cartesian-product receipt.
374`make test-codegen-tgemm-exhaustive` visits the complete supported bounded
375K/N/RT/warps/AQN/mutant product, including C refusals.
376Both modes require detection of an independently corrupted Omega control word.
377`make test-codegen-tgemm-sim` runs the carried budget checks and warp simulator
378with its arithmetic reference and mutant controls; it opens no GPU.
379
380Host receipt (2026-11-06 UTC, pinned `omc` e5b32567 and Bridge bc11b30b):
381`taskset -c 10-14 nice -n 10 make -j3 test-codegen-tgemm-diff`
382returned zero with `CODEGEN TGEMM MUTANT CAUGHT` and
383`CODEGEN TGEMM AXES DIFF PASS (55295 accepted cases)`.
384The printed first-instruction control-word mismatch belongs to the deliberate
385mutant, not a positive-case failure. The carried reference command
386`taskset -c 10-14 nice -n 10 make -j3 test-codegen-qmma-host test-codegen-tgemm-sim`
387also exited zero on 2026-11-06 UTC. QMMA ended `GPU_QMMA_PROBE: PASS`;
388TGEMM budget checks ended `GPU_TGEMM: PASS`; TGEMM simulation ended
389`GPU_TGEMM: PASS`, with both fragment orders matching the arithmetic reference
390and mutants 1–4 caught. Full-product and chip verdicts remain separate.
391
392Constant transcription query:
393`WolframLanguageEvaluator: {AssociationMap[FromDigits[#,16]&,{"21","25","26","d8","100","10000","ffff0000","fffffffe"}],2^32,2^17,2^23}`
394→ `{<|"21"->33,"25"->37,"26"->38,"d8"->216,"100"->256,"10000"->65536,"ffff0000"->4294901760,"fffffffe"->4294967294|>,4294967296,131072,8388608}`.
395
396Chip tier is **NOT_RUN**. In a separately authorized exclusive GB10 window,
397build `taskset -c 10-14 nice -n 10 make -j3 build/gpu_tgemm_test`,
398run `./build/gpu_tgemm_test --host-only` and
399`./build/gpu_tgemm_test --sim`, then capture
400`./build/gpu_tgemm_test --chip` under the current device authorization and
401receipt procedure. Only the last command opens the device. Its carried chip
402path checks both uncached and cached buffers, output poisoning, repeat
403identity, arithmetic reference and mutant 4. Host parity is not chip qualification.
404
405## Seeded attention IR builders
406
407The decode and tensor-prefill attention builders use
408`om/codegen/cg_attn*.om` and `om/codegen/cg_pattn*.om` by default. Omega owns
409configuration loops, RMSNorm/RoPE instruction selection, scoreboard scheduling,
410branch fixups, and loop metadata. The C adapter only validates the public spec
411and invokes `omega_gpu_om_ir_replay`; the public headers are unchanged.
412
413The original builders remain differential oracles behind
414`CUDAPP_MIGRATION_PENDING_C_CODEGEN_ATTN` and
415`CUDAPP_MIGRATION_PENDING_C_CODEGEN_PATTN` (both off by default).
416`make test-codegen-attn`, carried by `make test`, builds those oracles separately
417and enumerates every accepted spec: decode depth 1 through 4 and mutant 0 through
4184; prefill warps 4 or 8 and mutant 0 through 4, with FUSED/APPEND/ATTEND and
419mirror permitted only for APPEND. These spec guards define a finite complete
420accepted space; invalid-boundary and null cases are checked separately.
421
422The differential checks the full IR, register allocation, and padded encoded
423bytes. Every accepted spec also runs a one-record negative control and an
424Omega scheduling mutant (`kind=1`, changing the first load's stall).
425Production adapters always use `kind=0`. Runtime launch parameters, including
426sequence length and pointer addresses, do not change the generated program.
427
428Regenerate and check the committed bridge output with the pins in
429`om/units.sh`:
430
431```sh
432OMEGA_OMC=/path/to/omega-mv/seed/out/omc \
433OMEGA_BRIDGE=/path/to/omega-bridge sh om/units.sh
434OMEGA_OMC=/path/to/omega-mv/seed/out/omc \
435OMEGA_BRIDGE=/path/to/omega-bridge sh om/units.sh --check
436make test-codegen-attn
437build/gpu_decode_attn_test --host-only
438build/gpu_decode_attn_test --sim
439build/gpu_prefill_attn_test --host-only
440build/gpu_prefill_attn_test --sim
441```
442
443The compiler pin is omega-mv `e5b32567`, as checked by `om/units.sh`. These are
444host/simulator checks, not chip qualification. A separately authorized GB10
445window is required before running either test binary without `--host-only` or
446`--sim`. During that window, follow the current hardware authorization and
447service-safety procedure, then run `build/gpu_decode_attn_test --out decode.json`
448and `build/gpu_prefill_attn_test --out prefill.json`. Both default modes open the
449GPU; neither is run by the migration tests. Preserve the receipts separately
450from the host evidence and perform the window's required closeout checks.
451
452## Prefill host-work builders in Omega
453
454Router logits and MoE weighted combine default to `om/codegen/cg_pfhost*.om`.
455`CUDAPP_MIGRATION_PENDING_C_CODEGEN_PFHOST=1` selects the retained C builder
456oracle; it is off by default. Public APIs and spec layouts are unchanged.
457The Omega phases construct the records, virtual-register shapes, schedule,
458loop boundaries and branch displacements. C only replays the generic tape.
459
460```sh
461make test-codegen-pfhost
462make build/gpu_pfhost_test
463build/gpu_pfhost_test --sim
464```
465
466The differential enumerates every `k`, `e`, `t`, `h`, `top_k` and mutant
467selector accepted by the C spec validators. It compares return values, every
468IR field, solved register allocation and encoded bytes, including configurations
469whose builders refuse. A flipped instruction is the comparator's negative
470control. Separate router-address and combine-address Omega source mutants
471are regenerated with the pinned compiler and converter, linked in isolation,
472and must fail the same differential. Generation requires `OMEGA_OMC` and
473`OMEGA_BRIDGE` as documented above; it does not install a fallback compiler.
474Without an executable pinned compiler on non-AArch64 hosts, source mutation
475checks are `NOT_RUN`; the exhaustive checked-C differential still runs.
476The existing simulator checks both warp scheduling orders and the numerical
477mutants against the host references.
478
479Chip qualification is separate and needs a current exclusive GPU window.
480Only after obtaining that authorization, build `build/gpu_pfhost_test` and
481run its `--chip` mode using the current machine's window procedure. Never
482interpret the host differential or simulator as a hardware receipt.
483
484## FP8 MoE builder migration
485
486`make test-codegen-moe-diff test-codegen-moe-sim` is host-only and carried by
487`make test`. The default MoE step/deep and row-pipelined builders execute
488`om/codegen/cg_moe*.om` using the existing checked Omega IR replay.
489`cg_moe_sched.om` owns the optional physical-register stall pass. The public
490headers are unchanged. `CUDAPP_MIGRATION_PENDING_C_CODEGEN_MOE=1` and
491`CUDAPP_MIGRATION_PENDING_C_CODEGEN_MOE2=1` select independent handwritten C
492oracles; both default to zero.
493
494The differential exhausts the structural domain accepted by the C guards,
495including every supported mutation selector, and compares exact return codes,
496IR/allocation state, SASS and packed cubin bytes in memory. Variant 2 ignores
497the four free uint32 depth/scheduling/coalescing/weight-first fields: every bit
498and all-ones are checked independently for every accepted structural tuple,
499not the entire uint32 Cartesian product. Boundary and bit-basis invalid
500inputs must retain the C rejection code. A corrupted record must be caught.
501
502The differential covers the plain entry points only (the domain the frozen C guards accept). The ragged-K entry points
503(`omega_blackwell_codegen_fp8_gemv_ragged_prog`, any k that is a multiple of 128 and not of `32 * lane_bytes`) have no C oracle:
504they are checked by the simulator, the double-precision oracle and their own source mutants (see the Flash-Next section below),
505and by a direct comparison of base and head output on every spec the plain entry points accept.
506
507`python3 om/codegen/moe_mutants.py` (with `OMEGA_OMC` and `OMEGA_BRIDGE` set)
508requires each altered Omega source to compile and then fail the ordinary
509differential. `tests/codegen_moe_sim_test.c` uses `bw_warp_sim_k.h` against an
510independent all-one e4m3 reference, both builders and fragment/warp orders,
511with a scale-drop negative control. Neither host path opens a device or
512models scoreboard timing. The exact structural domain, compiler pin,
513arithmetic provenance and separately authorized chip runbook are in
514`evidence/codegen-moe-20261106/REPORT.md`. Chip qualification is **NOT_RUN**.
515Launch these host checks inside the device-free namespace:
516`bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 <command>`.
517This also isolates the mutation runner's child builds and test processes.
518## API-rest seeded runtime views
519
520The API-rest migration uses omega-bridge `79e8c36` runtime views and the seeded
521compiler SHA-256 `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`.
522The handwritten algorithms live in `om/apirest/`; generated checked C is a
523bridge artifact, not a second handwritten implementation. Canonical MoE
524fragment packing and row compaction come from `om/codegen/cg_pack_len.om`,
525`cg_pack_h.om` and `cg_mrow.om`. Their byte/element extents are distinct:
526packing accepts source bytes and destination ushort elements; compaction
527accepts source/destination f32 elements. Runtime views refuse read/edit overlap.
528Four tern segments require four endpoint and scale elements, even though the
529launch contains only three interior boundaries.
530
531Run each command through this isolation prefix on the shared Spark:
532
533```sh
534bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 sh tests/api_rest_run.sh
535bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 python3 tests/api_rest_mutants.py
536bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 env OMEGA_ROOT=/path/to/pinned/omega-mv sh tests/api_rest_families.sh
537```
538
539The mutant runner also requires `OMEGA_OMC`, `OMEGA_SEED` and `OMEGA_BRIDGE`
540as used by `om/units.sh`. The family runner builds at most three jobs, links
541the standalone tgemm test and the external tern algebra oracle, and runs only
542host/simulator modes. It preincludes the current CUDApp simulator for the
543external tern test: allowing that test's quoted include to select its stale
544external simulator gives false row-major failures. None of these receipts
545qualifies the GPU.
546
547`tests/api_rest_diff.c` and `tests/api_rest_partitions.h` contain independent
548source-loop oracles, checked-view refusal cases and deliberately corrupted
549controls. `tests/api_rest_bench.c` records three host samples for matched
550packing, compaction, descriptors, FP8 rows, permutation/gather, tern packing,
551slot transitions and prefill copy/ratios. The FP8 Omega reference uses
552separate f64 accumulator/magnitude passes; its measured cost is reported, not
553hidden by replacing it with the original C reference. Benchmark medians and
554ratios must be evaluated by Wolfram, with the query retained in the receipt.
555
556## MoE shapes of Qwen3.8-Flash-Next (host only, chip NOT_RUN)
557
558Hidden 2560, 512 routed experts, 10 picks plus the shared expert (11 contributions), expert intermediate 640, E4M3 bytes with BF16
559`weight_scale_inv` in 128 x 128 blocks. Receipts: `evidence/FLASH-NEXT-MOE-SHAPES-20261118/`. Every command runs through the device-free
560wrapper of `evidence/codegen-moe-20261106/REPORT.md`; none opens a device.
561
562- `make test-codegen-moe-ragged test-fp8-ragged-api test-codegen-dec-group-sim` (all in `make test`): the ragged-K FP8 GEMV
563 (`omega_blackwell_codegen_fp8_gemv_ragged_prog`, k a multiple of 128 and not of 32 * lane_bytes, for example the expert down_proj k = 640)
564 on the warp simulator against the double-precision oracle, its negative controls, the API selection and the seeded host-policy op 25
565 against its frozen C oracle, and the GROUP kernel at S = 9 and S = 11 with 512 experts.
566- `make test-moe-wide` (`NOT_RUN`, exit 2, without the pinned toolchain; not part of the portable suite) and `make test-moe-wide-mutants`: the
567 `_wide` planning, serializer, GROUP-request, window and admission units (`om/moe/*_wide.om`).
568- `make test-codegen-moe-ragged-mutants`: source mutants of the ragged builder and policy, each killed by wrong results.
569- `make test-flash-expert-real` (needs the checkpoint and `python3`; `NOT_RUN` without them): one routed expert of one layer read from disk
570 and compared with an independent Python float64 computation.
571
572A host simulator result is not a chip result. The simulator runs at most 8 warps per CTA; the launch uses 32.