interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

GitHub aien-dev/omega-mv#926 (code only)

closed derived 5333315b3c80076a #926

Imported from GitHub aien-dev/omega-mv#926 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base 6999fa9e6dae4847c155ef4eacaece74f491d3ca · Head 9ab1e7bb15037a2d1fd69eb9f2d4004882bcf3ae

Fetch it

A git bundle of the pull request's head, 73830 bytes.

curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/5333315b3c80076a.bundle -o 5333315b3c80076a.bundle
git fetch 5333315b3c80076a.bundle refs/pull/926/head

Raw bundle · 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/omega-mv
926
9ab1e7bb15037a2d1fd69eb9f2d4004882bcf3ae
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":926,"url":"https://github.com/aien-dev/omega-mv/pull/926","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:39:23Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index 06f512f0c..048b11ed8 100644
--- a/.crumb
+++ b/.crumb
@@ -42,68 +42,68 @@
       "children": [
         {
           "digest": "9f19f11674ca5dfc3c9c3ae35fe6106557aee9583210da13d257e1b9d88e052c",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "calibration",
           "purpose": "Directory calibration. Purpose not yet described by a human."
         },
         {
           "digest": "ab620fb23433db5887c549b5484a1268399f08d4fcfdb285d7d178ac58b89dd9",
-          "last_commit": "c095c17df",
+          "last_commit": "1fe5976d",
           "name": "docs",
           "purpose": "Directory docs. Purpose not yet described by a human."
         },
         {
           "digest": "536f7b8db9a92a1f586bad4379d47544a30d1b8e83c2d799c18e66cf8660c9ae",
-          "last_commit": "30bb116cc",
+          "last_commit": "30bb116c",
           "name": "doctrine",
           "purpose": "Directory doctrine. Purpose not yet described by a human."
         },
         {
-          "digest": "8f0e5cb325040247440527f6b54b65cf72c47ff5adca75b4f32a1ddf2b2d6ade",
-          "last_commit": "1f320caad",
+          "digest": "5fb34d7988eea79177ebfa6b8245c1131a63e09789572b5633278936d11295ae",
+          "last_commit": "174f647a",
           "name": "mk",
           "purpose": "Directory mk. Purpose not yet described by a human."
         },
         {
           "digest": "62b92244c52fa8af6f511012dee2967e98dff162cc1d8bf45d0b2f15cb0adc5f",
-          "last_commit": "450bbefd4",
+          "last_commit": "450bbefd",
           "name": "research",
           "purpose": "Directory research. Purpose not yet described by a human."
         },
         {
           "digest": "055cfcb74d741695ca12b8dbefe0fab71a234291b3ca136984f736a6213accef",
-          "last_commit": "107f93545",
+          "last_commit": "107f9354",
           "name": "spec",
           "purpose": "Directory spec. Purpose not yet described by a human."
         },
         {
-          "digest": "36bd5a00a116cad009672752dcac449a48515f0ef74e759d1710492967158315",
-          "last_commit": "c815809d9",
+          "digest": "356bac6620b52492f1e1c8464ce092e11845d12ff857857cf32ad4009228d2c9",
+          "last_commit": "9a6340d6",
           "name": "src",
           "purpose": "Directory src. Purpose not yet described by a human."
         },
         {
-          "digest": "4f54ac0e02337bf2bd58142881e60cb25241457eb40b659235360a4eadebfb82",
-          "last_commit": "56dfcbd9b",
+          "digest": "f8324a406c96486b9fc156b0cbd9fab2ad57bdcf33eda1614d97ec9585fb70a0",
+          "last_commit": "174f647a",
           "name": "tests",
           "purpose": "Directory tests. Purpose not yet described by a human."
         },
         {
-          "digest": "4e83dea21da137c30076c2dc0ca4f3a488f576f30a94e334558ad5ea523f3a6b",
-          "last_commit": "a50c3bd41",
+          "digest": "1a49f30057f97de35b3a9ea43e4d964ec9a2211294b12ffe8ed08abe80c2ba1e",
+          "last_commit": "174f647a",
           "name": "tools",
           "purpose": "Directory tools. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:555a98b414f4a51bac364cecefcbc8c46f02f72ba8aee8b6cf38da55bea9ded6",
-      "compiled_at": "2026-10-28T09:49:40Z",
+      "children_root": "sha256:2a37feb3c2d21093e100e1abdf6d589e9dacb686a6646456a7697167ca02bc89",
+      "compiled_at": "2026-10-28T21:12:07Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:23619aae22042fc9c7f3ec9938f0da3692964c3bebe8d4fbe006875201a46ba8",
+      "digest": "sha256:569bbc21c454681a78e7f9d898c0eb559018e9b3460e84549166e0e4162e4c14",
       "evidence_files": 12477,
       "evidence_root": "sha256:9d96c8c22e5c574c4768d1eadd333b9750f73cd27be276a0f190c876960008a1",
-      "files": 17564,
-      "generated_at_commit": "56dfcbd9b284a88618983e3eac7512630ad70b3e",
-      "source_tree": "sha256:20bbed51f47dd0d11180520f489e436b54f970840ca38d290c1780073e50592f"
+      "files": 17448,
+      "generated_at_commit": "174f647a6694c61212ab90aa9e204ea2d3a69952",
+      "source_tree": "sha256:8b64baaf984c009aadef35dcb6e5d788e77140939049e061f11eb3c331aaa94e"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/AGENTS.md b/AGENTS.md
index 4df279aac..9fcf7a648 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -31,11 +31,13 @@ Some gates expect sibling checkouts next to this one: `../physics` (physics-mv)
 
 ## Configuration
 
-- `physics.lock`, `aienos.lock`, `argus.lock`: commits of the sibling sources the full build and some gates pin. `crumb.lock`: the aien-architecture commit the crumb tool is built from. `om/omega-bridge.lock`: the omega-bridge commit whose `src/native.om` generates `src/omega_om_units.inc`.
+- `physics.lock`, `aienos.lock`, `argus.lock`: commits of the sibling sources the full build and some gates pin. `crumb.lock`: the aien-architecture commit the crumb tool is built from. `om/omega-bridge.lock`: the bridge for the retained CPU SHA-256/BLAKE3 binding generated by `om/units.sh`.
 - `PHYSICS_DIR=/nonexistent PHYSICS_LOCK_CHECK=0` on `make` builds the host suites without a physics checkout.
 - `OUT_DIR`: per-step build directory; `tests/gates/run.sh` sets it to `build/step-<name>`.
 - `.aien/always` lists the gates every commit must pass (`CRUMB-VERIFY`, `OMEGA-EVIDENCE-IMMUTABLE`, `OMEGA-ZERO-DISK-SECRETS`); `.aien/verify.pub` is the Spark judge's public key.
 - `AIEN_OMEGA_FP8_GROUPED_WAVE=1` and `AIEN_OMEGA_FP8_GROUPED_CTAS=n` change the GB10 FP8 grouped expert launch (off by default; see `README.md`).
+- `cudapp.lock`: canonical native GPU source. Set `CUDAPP_DIR` to a checkout at that exact HEAD, `OMEGA_OMC` to the seeded compiler SHA-256 `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`, and `OMEGA_BRIDGE` to `0c4cb9ff980af278890b231b994eaede4dc7621c`. `check-cudapp` stages and authenticates committed sources, generated units and archive on every native entry, without a lock-check bypass. Canonical headers precede Physics headers; the canonical archive follows retained Omega CPU objects.
+- Do not restore duplicate GPU sources or rewrite historical receipts. The 123-path retirement ledger is `tests/cudapp_retirement_sources.json`. Unique Omega gate/resident adapters remain local. Host-only fixtures and source provenance are not GPU or full-model qualification; production native candidate admission remains refused until independently accepted exact-artifact qualification.
 
 ## Usage
 
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 5dc4ef563..fb79d4573 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -5,6 +5,7 @@ Every model below did real work. A model is listed only for work it did. The orc
 
 | Model | What it did |
 |---|---|
+| Codex (GPT-6.1 Sol) | Canonical CUDApp source staging and native caller integration, graph/session lifecycle binding, preserved full-union GPU source retirement, and independent host refusal controls; GPU and full-model qualification not claimed |
 | Codex (GPT-6.1 Sol) | Corrected qty prefix-query types and capacity-only diagnostic repairability, with exact-record regression controls (#911) |
 | Codex | Inference-cost driver compiler-failure status repair, host-only refusal regression probes and independent review; native Omega execution NOT_RUN |
 | Codex (GPT-6 Astra) | Bounded native peer credentials, multi-descriptor polling, single-iovec sendmsg, socket-option allowlist and host fixtures (#788) |
diff --git a/Makefile b/Makefile
index 4e068c1de..ff1235461 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@ CC ?= gcc
 .DEFAULT_GOAL := all
 PHYSICS_DIR ?= ../physics
 OUT_DIR ?= build
+include mk/cudapp-consumer.mk
 -include mk/*.mk
 PHYSICS_LOCK_CHECK ?= 1
 
@@ -11,67 +12,17 @@ CFLAGS ?= -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc \
 	-I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/kernel-open/common/inc \
 	-I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm \
 	-I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include
+override CFLAGS := -Isrc $(CUDAPP_HEADER_FLAGS) $(filter-out -Isrc,$(CFLAGS))
 
+# Omega owns its CPU substrate and evidence adapters. Native GPU implementation
+# and bundled driver objects come only from the pinned canonical CUDApp archive.
 SRCS = src/omega_om_units.c src/omega_canonical.c src/omega_validate.c src/omega_core.c src/omega_codec.c \
 	src/aarch64_encoder.c src/aarch64_decoder.c src/omega_realize.c src/omega_exec.c \
 	src/omega_self_host.c src/omega_verify.c src/omega_program.c src/omega_synthesis.c \
 	src/omega_library.c src/omega_discovery.c src/omega_machine.c src/omega_realize_synth.c \
 	src/omega_matvec.c src/omega_accelerator.c src/omega_accelerator_world.c \
-	src/omega_vector.c src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \
-	src/omega_blackwell_realize.c src/omega_blackwell_submit.c src/omega_blackwell_engine.c src/omega_gpu_engine.c src/omega_blackwell_gates.c src/omega_blackwell_matmul.c src/omega_blackwell_codegen.c src/omega_gpu_session.c src/omega_gpu_platform.c src/omega_gpu_platform_linux.c src/omega_gpu_fmt.c src/omega_gpu_matmul_api.c src/omega_gpu_elementwise_api.c src/omega_gpu_attention_api.c src/omega_gpu_serving.c src/omega_world_gates.c src/omega_gpu_wait.c \
-	src/omega_evidence.c \
-	$(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c \
-	tools/omegatool.c
-# OWN-30B cut 2 (2026-10-13): column windows over a resident bf16 tensor for the MoE path. New file,
-# adds exports only (8B decode-speed lane collision rule: no existing GPU source moves).
-SRCS += src/omega_gpu_moe_api.c
-
-# OWN-30B Cut 6 / Cut 5 (2026-10-13): FP8 e4m3 GEMV kernel family, new files only (omega_gpu_fp8_api.h)
-SRCS += src/omega_blackwell_codegen_moe.c src/omega_gpu_fp8_pack.c src/omega_gpu_fp8_api.c
-# OWN-30B W-L2c (2026-10-14): FP8 GEMV variant 2, row-pipelined (omega_blackwell_codegen_moe2.h), selectable, variant 1 untouched
-SRCS += src/omega_blackwell_codegen_moe2.c
-# OWN-30B cut 8 (2026-10-13): one-launch decode attention (omega_gpu_decode_attn_api.h), new files only
-SRCS += src/omega_blackwell_codegen_attn.c src/omega_gpu_decode_attn_api.c
-# Qwen3.8-27B (omega-mv#544, 2026-10-18): decode attention head_dim 256, new files only
-SRCS += src/omega_blackwell_codegen_attn256.c src/omega_gpu_decode_attn256_api.c
-# Qwen3.8-27B (omega-mv#545, 2026-10-18): prefill attention head_dim 256 on the decode cache, new files only
-SRCS += src/omega_blackwell_codegen_pattn256.c src/omega_gpu_prefill_attn256_api.c
-# OWN-30B (2026-10-13): libm-free host math (omega_gpu_hostmath.h) so libomega_gpu.a links without -lm
-SRCS += src/omega_gpu_hostmath.c
-# OWN-30B cut 8 item 2 (2026-10-13): one-launch MoE router (omega_gpu_router_api.h), new files only
-SRCS += src/omega_blackwell_codegen_router.c src/omega_gpu_router_api.c
-# Qwen3.8-27B Gated DeltaNet decode step (omega#542, 2026-10-18): one launch per layer (omega_gpu_gdn_api.h), new files only
-SRCS += src/omega_blackwell_codegen_gdn.c src/omega_gpu_gdn_api.c
-# OWN-30B W-L2 (2026-10-13): decode launch collapse, new files only: command list (N launches, one submit) + glue kernels
-SRCS += src/omega_gpu_cmdlist.c src/omega_blackwell_codegen_dec.c
-# C3 (docs/OMEGA.md): reductions and prefix sums of any length, bit-exact against the frozen-order host reference.
-SRCS += src/omega_gpu_scan.c src/omega_gpu_scan_ref.c
-# C3: matrix multiply of any shape, BF16 and FP8, both layouts, on the tensor cores (pack kernels + one multiply kernel).
-SRCS += src/omega_gpu_gemm.c
-SRCS += src/omega_gpu_mem_cached.c
-SRCS += src/omega_gpu_decode_graph.c
-# sc #642 (2026-10-18): one Qwen3.8-27B decode token as one command list (GDN + hd256 attention layers, dense MLP)
-SRCS += src/omega_gpu_q38_graph.c
-SRCS += src/omega_gpu_q36_graph.c
-# C6 (L386): Omega's own sm_121 disassembler; the listing checks in tests/ call it instead of nvdisasm
-SRCS += src/omega_sm121_disasm.c
-# OWN-30B (2026-10-13): bf16 streaming GEMV for the lm_head (omega_gpu_bf16_gemv_api.h), new files only
-SRCS += src/omega_blackwell_codegen_bf16.c src/omega_gpu_bf16_gemv_api.c
-# OWN-30B prefill (2026-10-13): FP8 grouped GEMM, each expert streamed once per pass (omega_gpu_fp8gemm_api.h), new files only
-SRCS += src/omega_blackwell_codegen_gemm.c src/omega_gpu_fp8gemm_api.c
-# OWN-30B T3 (2026-10-13): tensor-core prefill kernels (omega_blackwell_codegen_tc.h), new files only
-SRCS += src/omega_blackwell_codegen_tc.c
-SRCS += src/omega_gpu_tcgemm_api.c
-# OWN-30B L1 attention (2026-10-13): tensor-core causal prefill attention (omega_gpu_prefill_attn_api.h), new files only
-SRCS += src/omega_blackwell_codegen_pattn.c src/omega_gpu_prefill_attn_api.c
-# OWN-30B T3b (2026-10-13): device-resident prefill (omega_gpu_prefill.h), new files only
-SRCS += src/omega_blackwell_codegen_pf.c src/omega_gpu_prefill.c src/omega_blackwell_codegen_tc2.c src/omega_gpu_pfgemm.c
-# OWN-30B L1 GEMM (W-L1G, 2026-10-14): native FP8 QMMA, new files only
-SRCS += src/omega_blackwell_codegen_qmma.c src/omega_blackwell_codegen_qg.c
-# OWN-30B W-L1G-D (2026-10-14): router logits + MoE combine for the whole-prompt prefill, new files only
-SRCS += src/omega_blackwell_codegen_pfhost.c src/omega_gpu_pfhost.c
-# Ternary engine T0 (2026-10-15): KT1, the W2A8 ternary GEMV (omega_gpu_tern_api.h), new files only
-SRCS += src/omega_blackwell_codegen_tern.c src/omega_gpu_tern_api.c
+	src/omega_vector.c src/omega_blackwell_gates.c src/omega_world_gates.c \
+	src/omega_evidence.c tools/omegatool.c
 OBJS = $(patsubst %.c,$(OUT_DIR)/%.o,$(notdir $(SRCS)))
 DEPS = $(OBJS:.o=.d)
 -include $(DEPS)
@@ -116,12 +67,6 @@ $(OUT_DIR):
 $(OUT_DIR)/%.o: src/%.c | $(OUT_DIR)
 	$(CC) $(CFLAGS) -c $< -o $@
 
-$(OUT_DIR)/m16_native.o: $(PHYSICS_DIR)/m16/m16_native.c | $(OUT_DIR)
-	$(CC) $(CFLAGS) -c $< -o $@
-
-$(OUT_DIR)/nvrm.o: $(PHYSICS_DIR)/nvrm/nvrm.c | $(OUT_DIR)
-	$(CC) $(CFLAGS) -c $< -o $@
-
 $(OUT_DIR)/crumbline/%.o: src/crumbline/%.c | $(OUT_DIR)
 	mkdir -p $(OUT_DIR)/crumbline
 	$(CC) $(CFLAGS) -c $< -o $@
@@ -141,8 +86,8 @@ $(LEARNER): $(LEARNER_OBJS)
 $(OUT_DIR)/omegatool.o: tools/omegatool.c | $(OUT_DIR)
 	$(CC) $(CFLAGS) -c $< -o $@
 
-$(TARGET): $(OBJS) | check-physics-lock
-	$(CC) $(CFLAGS) -o $@.tmp.$$$$ $(OBJS) && mv -f $@.tmp.$$$$ $@
+$(TARGET): $(OBJS) $(CUDAPP_LIB) | check-physics-lock check-cudapp
+	$(CC) $(CFLAGS) -o $@.tmp.$$$$ $(OBJS) $(CUDAPP_LIB) && mv -f $@.tmp.$$$$ $@
 
 test: $(TARGET)
 	./$(TARGET) --run-gates
@@ -251,9 +196,9 @@ NUMERIC_CPU_SRCS = tests/test_omega_numeric.c src/omega_numeric.c src/omega_nume
                    $(NUMERIC_BW_SRCS)
 NUMERIC_CPU_HDRS = src/omega_numeric.h src/omega_numeric_provenance.h src/omega_numeric_divsqrt_gb10.h tests/numeric_oracle.h \
                    $(NUMERIC_BW_HDRS)
-build/test_omega_numeric_cpu: $(NUMERIC_CPU_SRCS) $(NUMERIC_CPU_HDRS)
+build/test_omega_numeric_cpu: $(NUMERIC_CPU_SRCS) $(NUMERIC_CPU_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc -DOMEGA_NUMERIC_CPU_ONLY -o $@ $(NUMERIC_CPU_SRCS)
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc $(CUDAPP_HEADER_FLAGS) -DOMEGA_NUMERIC_CPU_ONLY -o $@ $(NUMERIC_CPU_SRCS) $(CUDAPP_LIB) -lpthread
 # test-numeric-cpu exit status: 0 means no host test failed and the only SKIPs
 # are the five declared chip-only IDs (CHIP_ONLY_IDS in the test; the last line
 # prints "Gate 5 Verdict: PASS_EXCEPT_DECLARED_CHIP_ONLY"). Nonzero means a real
@@ -291,9 +236,9 @@ test-numeric-e1-exhaustive: build/test_omega_numeric_cpu
 REDUCE_CPU_SRCS = tests/test_omega_reduce.c src/omega_numeric_reduce.c src/omega_numeric_reduce_gb10.c \
                   src/omega_numeric.c src/omega_numeric_provenance.c src/omega_numeric_divsqrt_gb10.c \
                   $(NUMERIC_BW_SRCS)
-build/test_omega_reduce_cpu: $(REDUCE_CPU_SRCS) src/omega_numeric_reduce.h $(NUMERIC_CPU_HDRS)
+build/test_omega_reduce_cpu: $(REDUCE_CPU_SRCS) src/omega_numeric_reduce.h $(NUMERIC_CPU_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc -DOMEGA_NUMERIC_CPU_ONLY -o $@ $(REDUCE_CPU_SRCS)
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc $(CUDAPP_HEADER_FLAGS) -DOMEGA_NUMERIC_CPU_ONLY -o $@ $(REDUCE_CPU_SRCS) $(CUDAPP_LIB) -lpthread
 test-numeric-reduce-cpu: build/test_omega_reduce_cpu
 	./build/test_omega_reduce_cpu
 
@@ -676,16 +621,13 @@ test-cortex: $(RX_CX_TEST) $(RX_CXJ_TEST)
 RX_R12_SILICON_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c \
 	src/runtime/rx_coherent.c src/runtime/rx_native_bind.c \
 	src/runtime/rx_resident_gpu.c src/omega_om_units.c src/omega_evidence.c \
-	src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c \
-	src/omega_blackwell_qmd.c src/omega_blackwell_matmul.c \
-	$(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c \
 	tests/runtime/rx_r12_silicon.c
 RX_R12_SILICON = $(OUT_DIR)/rx_r12_silicon_test
 
 $(RX_R12_SILICON): $(RX_R12_SILICON_SRCS) src/runtime/rx_world.h \
 	src/runtime/rx_resident_gpu.h src/runtime/rx_caproot.h src/runtime/aienos_cap.h \
-	src/omega_blackwell_codegen.h $(AIENOS_CAP_LIB) | $(OUT_DIR)
-	$(CC) $(CFLAGS) -pthread -o $@ $(RX_R12_SILICON_SRCS) $(AIENOS_CAP_LIB) -ldl -lm
+	$(CUDAPP_SOURCE)/src/omega_blackwell_codegen.h $(AIENOS_CAP_LIB) $(CUDAPP_LIB) | check-cudapp $(OUT_DIR)
+	$(CC) $(CFLAGS) -pthread -o $@ $(RX_R12_SILICON_SRCS) $(AIENOS_CAP_LIB) $(CUDAPP_LIB) -ldl -lm
 
 test-r12-silicon: $(RX_R12_SILICON)
 	./$(RX_R12_SILICON)
@@ -745,9 +687,7 @@ RX_R13_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c \
 # RX_ERR_AUTHORITY (sovereign-core abi-qualify, 2026-10-12).
 -include $(RXC_LIB_OBJS:.o=.d)
 RX_R13_TEST_SRCS = $(RX_R13_SRCS) $(RX_FABRIC_TEST_SRCS)
-RX_R13_SILICON_EXTRA = src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \
-	src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c src/omega_blackwell_matmul.c \
-	$(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c
+RX_R13_SILICON_EXTRA = src/runtime/rx_resident_gpu.c
 # Production program (rules after the ARGUS block below: they link ARGUS).
 RX_R13_HOST = $(OUT_DIR)/rx_r13_living_host
 RX_R13_SILICON = $(OUT_DIR)/rx_r13_living_silicon
@@ -762,9 +702,9 @@ $(RX_R13_TEST_HOST): $(RX_R13_TEST_SRCS) src/runtime/rx_living.h $(RX_COMPOSE_LI
 # Lane 17: the Fabric phase runs in the silicon test build too; its Fabric part
 # is CPU-only loopback. The composition phase stays host-only.
 $(RX_R13_TEST_SILICON): $(RX_R13_TEST_SRCS) $(RX_R13_SILICON_EXTRA) src/runtime/rx_living.h \
-	$(RX_COMPOSE_LIVING_CHECKS) $(RX_R13_TEST_CHECKS) $(AIENOS_CAP_LIB) | $(OUT_DIR)
+	$(RX_COMPOSE_LIVING_CHECKS) $(RX_R13_TEST_CHECKS) $(AIENOS_CAP_LIB) $(CUDAPP_LIB) | check-cudapp $(OUT_DIR)
 	$(CC) $(CFLAGS) $(AIEN_TEST_FLAGS) -DR13_SILICON -pthread -o $@ $(RX_R13_TEST_SRCS) \
-		$(RX_R13_SILICON_EXTRA) $(AIENOS_CAP_LIB) -ldl -lm
+		$(RX_R13_SILICON_EXTRA) $(AIENOS_CAP_LIB) $(CUDAPP_LIB) -ldl -lm
 
 test-r13-host: $(RX_R13_HOST)
 	./$(RX_R13_HOST)
@@ -815,15 +755,9 @@ $(RX_R14_HOST): $(RX_R14_SRCS) src/runtime/rx_living.h $(RX_COMPOSE_LIVING_CHECK
 	$(CC) $(CFLAGS) -pthread -o $@ $(RX_R14_SRCS) $(AIENOS_CAP_LIB) -lm
 
 $(RX_R14_SILICON): $(RX_R14_SRCS) src/runtime/rx_resident_gpu.c \
-	src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c \
-	src/omega_blackwell_qmd.c src/omega_blackwell_matmul.c \
-	$(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c \
-	$(AIENOS_CAP_LIB) | $(OUT_DIR)
+	$(AIENOS_CAP_LIB) $(CUDAPP_LIB) | check-cudapp $(OUT_DIR)
 	$(CC) $(CFLAGS) -DR14_SILICON -pthread -o $@ $(RX_R14_SRCS) \
-		src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \
-		src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \
-		src/omega_blackwell_matmul.c $(PHYSICS_DIR)/m16/m16_native.c \
-		$(PHYSICS_DIR)/nvrm/nvrm.c $(AIENOS_CAP_LIB) -ldl -lm
+		src/runtime/rx_resident_gpu.c $(AIENOS_CAP_LIB) $(CUDAPP_LIB) -ldl -lm
 
 test-r14-host: $(RX_R14_HOST)
 	./$(RX_R14_HOST)
@@ -851,9 +785,7 @@ RX_R15_RIG_SRCS = $(filter-out tests/runtime/rx_r13_living.c src/runtime/rx_oper
 	src/runtime/rx_seq_reference.c tests/runtime/rx_r15_rig.c
 RX_R15_RIG_HDRS = src/runtime/rx_living.h src/runtime/rx_seq_reference.h \
 	src/runtime/rx_world.h tests/runtime/rx_r15_rig.h
-RX_R15_GPU_SRCS = src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \
-	src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \
-	src/omega_blackwell_matmul.c $(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c
+RX_R15_GPU_SRCS = src/runtime/rx_resident_gpu.c
 RX_R15_PARITY_HOST = $(OUT_DIR)/rx_r15_parity_host
 RX_R15_PARITY_SILICON = $(OUT_DIR)/rx_r15_parity_silicon
 
@@ -863,9 +795,9 @@ $(RX_R15_PARITY_HOST): $(RX_R15_RIG_SRCS) tests/runtime/rx_r15_parity.c $(RX_R15
 		$(AIENOS_CAP_LIB) -lm
 
 $(RX_R15_PARITY_SILICON): $(RX_R15_RIG_SRCS) tests/runtime/rx_r15_parity.c $(RX_R15_RIG_HDRS) \
-	$(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) | $(OUT_DIR)
+	$(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) $(CUDAPP_LIB) | check-cudapp $(OUT_DIR)
 	$(CC) $(CFLAGS) -DR15_SILICON -pthread -o $@ $(RX_R15_RIG_SRCS) \
-		tests/runtime/rx_r15_parity.c $(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) -ldl -lm
+		tests/runtime/rx_r15_parity.c $(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) $(CUDAPP_LIB) -ldl -lm
 
 test-r15-parity-host: $(RX_R15_PARITY_HOST)
 	./$(RX_R15_PARITY_HOST)
@@ -887,9 +819,9 @@ R15_GPU_LOAD_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/
 	tests/runtime/r15_gpu_load.c
 
 $(R15_GPU_LOAD): $(R15_GPU_LOAD_SRCS) $(RX_R15_GPU_SRCS) src/runtime/rx_world.h \
-	$(AIENOS_CAP_LIB) | $(OUT_DIR)
+	$(AIENOS_CAP_LIB) $(CUDAPP_LIB) | check-cudapp $(OUT_DIR)
 	$(CC) $(CFLAGS) -pthread -o $@ $(R15_GPU_LOAD_SRCS) $(RX_R15_GPU_SRCS) \
-		$(AIENOS_CAP_LIB) -ldl -lm
+		$(AIENOS_CAP_LIB) $(CUDAPP_LIB) -ldl -lm
 
 r15-gpu-load: $(R15_GPU_LOAD)
 
@@ -916,14 +848,14 @@ $(RX_R15_PERF_HOST_ND): $(RX_R15_PERF_SRCS) $(RX_R15_PERF_HDRS) $(AIENOS_CAP_LIB
 		$(AIENOS_CAP_LIB) -ldl -lm
 
 $(RX_R15_PERF_SILICON): $(RX_R15_PERF_SRCS) $(RX_R15_PERF_HDRS) $(RX_R15_GPU_SRCS) \
-	$(AIENOS_CAP_LIB) | $(OUT_DIR)
+	$(AIENOS_CAP_LIB) $(CUDAPP_LIB) | check-cudapp $(OUT_DIR)
 	$(CC) $(CFLAGS) -DR15_SILICON -pthread -o $@ $(RX_R15_PERF_SRCS) $(RX_R15_GPU_SRCS) \
-		$(AIENOS_CAP_LIB) -ldl -lm
+		$(AIENOS_CAP_LIB) $(CUDAPP_LIB) -ldl -lm
 
 $(RX_R15_PERF_SILICON_ND): $(RX_R15_PERF_SRCS) $(RX_R15_PERF_HDRS) $(RX_R15_GPU_SRCS) \
-	$(AIENOS_CAP_LIB) | $(OUT_DIR)
+	$(AIENOS_CAP_LIB) $(CUDAPP_LIB) | check-cudapp $(OUT_DIR)
 	$(CC) $(CFLAGS) -DR15_SILICON -DRX_MEASURE_NO_CAUSAL_DIGEST -pthread -o $@ \
-		$(RX_R15_PERF_SRCS) $(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) -ldl -lm
+		$(RX_R15_PERF_SRCS) $(RX_R15_GPU_SRCS) $(AIENOS_CAP_LIB) $(CUDAPP_LIB) -ldl -lm
 
 $(R15_REDUCE): tools/r15_reduce.c src/omega_om_units.c src/sha256.h | $(OUT_DIR)
 	$(CC) $(CFLAGS) -o $@ tools/r15_reduce.c src/omega_om_units.c -lm
@@ -1004,10 +936,7 @@ test-r16-authpath: $(RX_R13_HOST) $(RX_R14_HOST)
 test-r16-authpath-silicon: $(RX_R13_SILICON) $(RX_R14_SILICON)
 	sh tools/r16_authpath.sh silicon $(RX_R13_SILICON) $(RX_R14_SILICON) \
 		$(OUT_DIR)/r16/authpath/silicon-$(R16_STAMP) $(RX_R13_SRCS) $(RX_PROD_ARGUS_SRCS) \
-		src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \
-		src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \
-		src/omega_blackwell_matmul.c $(PHYSICS_DIR)/m16/m16_native.c \
-		$(PHYSICS_DIR)/nvrm/nvrm.c $(AIENOS_CAP_LIB)
+		src/runtime/rx_resident_gpu.c $(AIENOS_CAP_LIB) $(CUDAPP_LIB)
 
 # R16-G3 checks 1-3 only (sources, link map, shared libraries, embedded names)
 # on the current living-system build, for CI runners. Nothing is executed, so
@@ -1022,10 +951,7 @@ test-r16-authpath-linkmap: $(RX_R13_HOST) $(RX_R14_HOST)
 test-r16-authpath-linkmap-silicon: $(RX_R13_SILICON) $(RX_R14_SILICON)
 	R16_G3_STATIC_ONLY=1 sh tools/r16_authpath.sh silicon $(RX_R13_SILICON) $(RX_R14_SILICON) \
 		$(OUT_DIR)/r16/authpath/linkmap-silicon-$(R16_STAMP) $(RX_R13_SRCS) $(RX_PROD_ARGUS_SRCS) \
-		src/runtime/rx_resident_gpu.c src/omega_blackwell_codegen.c \
-		src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \
-		src/omega_blackwell_matmul.c $(PHYSICS_DIR)/m16/m16_native.c \
-		$(PHYSICS_DIR)/nvrm/nvrm.c $(AIENOS_CAP_LIB)
+		src/runtime/rx_resident_gpu.c $(AIENOS_CAP_LIB) $(CUDAPP_LIB)
 
 # R16-G4: legacy paths cannot bypass authority. The R13 body (R15 rig, RES-4,
 # host seat) is started; a legacy context tries six acts and each must be
@@ -1415,10 +1341,10 @@ test-regulate: $(RX_REGULATE_TEST)
 	./$(RX_REGULATE_TEST)
 
 $(RX_R13_SILICON): $(RX_R13_SRCS) $(RX_R13_SILICON_EXTRA) src/runtime/rx_living.h src/runtime/rx_argus.h \
-	$(RX_COMPOSE_LIVING_CHECKS) $(ARGUS_STAMP) $(AIENOS_CAP_LIB) | $(OUT_DIR)
+	$(RX_COMPOSE_LIVING_CHECKS) $(ARGUS_STAMP) $(AIENOS_CAP_LIB) $(CUDAPP_LIB) | check-cudapp $(OUT_DIR)
 	$(RX_PROD_REFUSE_TEST)
 	$(CC) $(CFLAGS) $(RX_PROD_ARGUS_FLAGS) -DR13_SILICON -pthread -o $@ $(RX_R13_SRCS) \
-		$(RX_PROD_ARGUS_SRCS) $(RX_R13_SILICON_EXTRA) $(AIENOS_CAP_LIB) -ldl -lm
+		$(RX_PROD_ARGUS_SRCS) $(RX_R13_SILICON_EXTRA) $(AIENOS_CAP_LIB) $(CUDAPP_LIB) -ldl -lm
 
 # Production hygiene (link map + strings + ARGUS present; host run of the
 # ARGUS probe where the binary can run) and the negative build test: compiling
@@ -1862,15 +1788,12 @@ print-c4-requal-bin:
 # tests/runtime/rx_compose_gpu_skill.h. A chip run: take the quiet flag and
 # use tools/composition_gate.sh --gpu (clean tree, content-addressed receipt).
 RX_COMPOSE_GATE_GPU = $(OUT_DIR)/rx_composition_gate_gpu
-RX_COMPOSE_GPU_SRCS = src/omega_blackwell_submit.c src/omega_blackwell_engine.c src/omega_gpu_engine.c src/omega_blackwell_matmul.c \
-	src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \
-	src/omega_blackwell_realize.c src/omega_vector.c src/omega_validate.c src/omega_gpu_wait.c \
-	$(PHYSICS_DIR)/m16/m16_native.c $(PHYSICS_DIR)/nvrm/nvrm.c
+RX_COMPOSE_GPU_SRCS = src/omega_vector.c src/omega_validate.c
 
 $(RX_COMPOSE_GATE_GPU): $(RX_COMPOSE_DEPS) $(RX_COMPOSE_GPU_SRCS) tests/runtime/rx_composition_gate.c \
-	tests/runtime/rx_compose_gpu_skill.h | check-physics-lock $(OUT_DIR)
+	tests/runtime/rx_compose_gpu_skill.h $(CUDAPP_LIB) | check-physics-lock check-cudapp $(OUT_DIR)
 	$(CC) $(CFLAGS) -DRXC_GATE_GPU -Itests/runtime -pthread -o $@ $(RX_COMPOSE_SRCS) \
-		$(RX_COMPOSE_GPU_SRCS) tests/runtime/rx_composition_gate.c $(RX_COMPOSE_LINK) -ldl
+		$(RX_COMPOSE_GPU_SRCS) tests/runtime/rx_composition_gate.c $(RX_COMPOSE_LINK) $(CUDAPP_LIB) -ldl
 
 test-composition-gate-gpu: $(RX_COMPOSE_GATE_GPU)
 	./$(RX_COMPOSE_GATE_GPU) "$$(git rev-parse HEAD)" $(OUT_DIR)/composition_gate_gpu_receipt.json
@@ -1888,12 +1811,11 @@ print-composition-gate-gpu-bin:
 # tools/run_divsqrt_gate.sh only (quiet flag, detached, receipt).
 DIVSQRT_SRCS = tests/test_omega_divsqrt_gb10.c src/omega_numeric_divsqrt_gb10.c src/omega_numeric.c \
                src/omega_numeric_provenance.c $(NUMERIC_BW_SRCS)
-DIVSQRT_HDRS = src/omega_numeric_divsqrt_gb10.h src/omega_numeric.h src/omega_blackwell_encoder.h \
-               src/omega_blackwell_qmd.h src/sha256.h
+DIVSQRT_HDRS = src/omega_numeric_divsqrt_gb10.h src/omega_numeric.h $(NUMERIC_BW_HDRS)
 .PHONY: test-divsqrt-host test-divsqrt-nvdisasm test-divsqrt-sweep
-build/test_omega_divsqrt_gb10_cpu: $(DIVSQRT_SRCS) $(DIVSQRT_HDRS)
+build/test_omega_divsqrt_gb10_cpu: $(DIVSQRT_SRCS) $(DIVSQRT_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc -DOMEGA_NUMERIC_CPU_ONLY -pthread -o $@ $(DIVSQRT_SRCS)
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc $(CUDAPP_HEADER_FLAGS) -DOMEGA_NUMERIC_CPU_ONLY -pthread -o $@ $(DIVSQRT_SRCS) $(CUDAPP_LIB)
 test-divsqrt-host: build/test_omega_divsqrt_gb10_cpu
 	./build/test_omega_divsqrt_gb10_cpu
 test-divsqrt-nvdisasm:
@@ -1910,9 +1832,9 @@ TRANSC_GB10_SRCS = tests/test_omega_numeric_transc_gb10.c src/omega_numeric_divs
                    src/omega_numeric_transc.c src/omega_numeric.c src/omega_numeric_provenance.c \
                    $(NUMERIC_BW_SRCS)
 .PHONY: test-numeric-transc-gb10-host
-build/test_omega_numeric_transc_gb10_cpu: $(TRANSC_GB10_SRCS) $(DIVSQRT_HDRS) src/omega_numeric_transc.h
+build/test_omega_numeric_transc_gb10_cpu: $(TRANSC_GB10_SRCS) $(DIVSQRT_HDRS) src/omega_numeric_transc.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -fno-fast-math -Isrc -DOMEGA_NUMERIC_CPU_ONLY -pthread -o $@ $(TRANSC_GB10_SRCS)
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -fno-fast-math -Isrc $(CUDAPP_HEADER_FLAGS) -DOMEGA_NUMERIC_CPU_ONLY -pthread -o $@ $(TRANSC_GB10_SRCS) $(CUDAPP_LIB)
 test-numeric-transc-gb10-host: build/test_omega_numeric_transc_gb10_cpu
 	./build/test_omega_numeric_transc_gb10_cpu
 
@@ -1931,14 +1853,12 @@ test-unwritten-trap-host: build/test_omega_unwritten_trap
 # docs/numeric/E1_LDST_GB10.md). test-ldst-host needs no device; test-ldst-nvdisasm
 # decodes every table kernel offline; the chip run is tools/run_numeric_ldst_chip.sh.
 LDST_SRCS = tests/test_omega_ldst_gb10.c src/omega_numeric_ldst_gb10.c src/omega_numeric_divsqrt_gb10.c src/omega_numeric.c \
-            src/omega_numeric_provenance.c src/omega_blackwell_encoder.c src/omega_blackwell_codegen.c \
-            src/omega_blackwell_matmul.c src/omega_blackwell_qmd.c src/omega_om_units.c
-LDST_HDRS = src/omega_numeric_ldst_gb10.h src/omega_numeric_divsqrt_gb10.h src/omega_numeric.h src/omega_blackwell_encoder.h \
-            src/omega_blackwell_qmd.h src/sha256.h
+            src/omega_numeric_provenance.c $(NUMERIC_BW_SRCS)
+LDST_HDRS = src/omega_numeric_ldst_gb10.h src/omega_numeric_divsqrt_gb10.h src/omega_numeric.h $(NUMERIC_BW_HDRS)
 .PHONY: test-ldst-host test-ldst-nvdisasm
-build/test_omega_ldst_gb10_cpu: $(LDST_SRCS) $(LDST_HDRS)
+build/test_omega_ldst_gb10_cpu: $(LDST_SRCS) $(LDST_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc -DOMEGA_NUMERIC_CPU_ONLY -pthread -o $@ $(LDST_SRCS)
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -Isrc $(CUDAPP_HEADER_FLAGS) -DOMEGA_NUMERIC_CPU_ONLY -pthread -o $@ $(LDST_SRCS) $(CUDAPP_LIB)
 test-ldst-host: build/test_omega_ldst_gb10_cpu
 	./build/test_omega_ldst_gb10_cpu
 test-ldst-nvdisasm:
@@ -2396,9 +2316,9 @@ test-vc-bridge: tests/test_omega_vc_bridge.c src/omega_vc_bridge.c src/omega_vc_
 	@echo "test-vc-bridge: PASS (bridge verifies and recomputes the id, bridge records refused in build, ASan/UBSan clean, 4 mutants killed)"
 
 # FB-1 cut 1: native (no CUDA) matmul entry point for the inference stack.
-# libomega_gpu.a = everything the tool links except its main; the Rust FFI crate
-# (cut 2) links it. test-gpu-matmul-api runs the host-only refusals; the chip
-# sweep is `./build/gpu_matmul_api_test --out receipt.json` through the heavy queue.
+# libomega_gpu.a is the Omega CPU/evidence adapter companion, not a
+# second GPU implementation. Consumers link it FIRST and the pinned canonical
+# CUDApp archive LAST. Host-only API refusals do not qualify the chip path.
 .PHONY: libomega_gpu test-gpu-matmul-api
 # The two gate-runner objects (omegatool's M17/M18/M19 and World gates) are NOT part of the
 # library: nothing in the library or in the Rust FFI crate calls them (checked with nm), and
@@ -2406,22 +2326,25 @@ test-vc-bridge: tests/test_omega_vc_bridge.c src/omega_vc_bridge.c src/omega_vc_
 # archive digest depend on where physics was checked out. Without them libomega_gpu.a is
 # byte-identical for any PHYSICS_DIR and any omega checkout directory.
 GPU_API_OBJS = $(filter-out $(OUT_DIR)/omegatool.o $(OUT_DIR)/omega_blackwell_gates.o $(OUT_DIR)/omega_world_gates.o,$(OBJS))
+GPU_LINK_LIBS = $(OUT_DIR)/libomega_gpu.a $(CUDAPP_LIB)
 GPU_API_TEST = $(OUT_DIR)/gpu_matmul_api_test
 GPU_R4_RECEIPT = $(OUT_DIR)/gpu_matmul_r4_receipt
-$(OUT_DIR)/libomega_gpu.a: $(GPU_API_OBJS) | check-physics-lock
-	ar rcs $@ $(GPU_API_OBJS)
-libomega_gpu: $(OUT_DIR)/libomega_gpu.a
+$(OUT_DIR)/libomega_gpu.a: $(GPU_API_OBJS) | check-physics-lock check-cudapp
+	ar rcs $@.tmp.$$$$ $(GPU_API_OBJS) && mv -f $@.tmp.$$$$ $@
+libomega_gpu: $(GPU_LINK_LIBS)
 # omega-mv#471: the archive must link without -lm (omegatool, the Rust FFI crate and AIENOS link it bare). Fails if any symbol
 # the archive leaves undefined is one libm exports (the export list is read from this toolchain's libm.so.6).
 .PHONY: test-gpu-libm-free
-test-gpu-libm-free: $(OUT_DIR)/libomega_gpu.a
+test-gpu-libm-free: $(GPU_LINK_LIBS)
 	@export LC_ALL=C; libm="$$($(CC) -print-file-name=libm.so.6)"; test -f "$$libm" || { echo "libm-free: no libm.so.6 from $(CC)"; exit 1; }; \
-	nm -D --defined-only "$$libm" | awk '{print $$3}' | sed 's/@.*//' | sort -u > $(OUT_DIR)/libm.syms; \
-	nm -u $(OUT_DIR)/libomega_gpu.a | awk '{print $$2}' | sort -u | comm -12 - $(OUT_DIR)/libm.syms > $(OUT_DIR)/libm-refs.txt; \
-	n=$$(wc -l < $(OUT_DIR)/libm-refs.txt); echo "libm-free: $$n libm symbols referenced by libomega_gpu.a ($$(wc -l < $(OUT_DIR)/libm.syms) libm exports checked)"; \
-	if [ "$$n" -ne 0 ]; then sed 's/^/  /' $(OUT_DIR)/libm-refs.txt; echo "FAIL: libomega_gpu.a is not libm-free"; exit 1; fi; echo "PASS: libomega_gpu.a is libm-free"
-$(GPU_API_TEST): tests/gpu_matmul_api_test.c src/omega_gpu_matmul_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -o $@ tests/gpu_matmul_api_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+	nm -D --defined-only "$$libm" > $(OUT_DIR)/libm-exports.raw || exit $$?; \
+	awk '{print $$3}' $(OUT_DIR)/libm-exports.raw | sed 's/@.*//' | sort -u > $(OUT_DIR)/libm.syms; \
+	nm -u $(GPU_LINK_LIBS) > $(OUT_DIR)/gpu-undefined.raw || exit $$?; \
+	awk '{print $$2}' $(OUT_DIR)/gpu-undefined.raw | sort -u | comm -12 - $(OUT_DIR)/libm.syms > $(OUT_DIR)/libm-refs.txt; \
+	n=$$(wc -l < $(OUT_DIR)/libm-refs.txt); echo "libm-free: $$n libm symbols referenced by the adapter plus canonical GPU archives ($$(wc -l < $(OUT_DIR)/libm.syms) libm exports checked)"; \
+	if [ "$$n" -ne 0 ]; then sed 's/^/  /' $(OUT_DIR)/libm-refs.txt; echo "FAIL: adapter plus canonical GPU archives are not libm-free"; exit 1; fi; echo "PASS: adapter plus canonical GPU archives are libm-free"
+$(GPU_API_TEST): tests/gpu_matmul_api_test.c $(CUDAPP_SOURCE)/src/omega_gpu_matmul_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -o $@ tests/gpu_matmul_api_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-matmul-api: $(GPU_API_TEST) $(GPU_R4_RECEIPT)
 	./$(GPU_API_TEST) --host-only
 	./$(GPU_R4_RECEIPT) --host-only
@@ -2429,8 +2352,8 @@ test-gpu-matmul-api: $(GPU_API_TEST) $(GPU_R4_RECEIPT)
 # omega #473 R4: the sealed CTA-budget receipt (full-output comparison at the training shapes,
 # every budget, repeats, I42 stale-output check, negative controls). Host-only self-test above; the
 # chip receipt is `quietlock run -- ./build/gpu_matmul_r4_receipt --out receipt.json`.
-$(GPU_R4_RECEIPT): tests/gpu_matmul_r4_receipt.c src/omega_gpu_matmul_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -o $@ tests/gpu_matmul_r4_receipt.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_R4_RECEIPT): tests/gpu_matmul_r4_receipt.c $(CUDAPP_SOURCE)/src/omega_gpu_matmul_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -o $@ tests/gpu_matmul_r4_receipt.c $(GPU_LINK_LIBS) -lpthread -lm
 
 # FB-1 cut 4: native rmsnorm / rope / swiglu (+ EX2 and shared-exchange probes).
 # test-gpu-elementwise is host-only (refusals, codegen, word fixtures, nvdisasm
@@ -2438,8 +2361,8 @@ $(GPU_R4_RECEIPT): tests/gpu_matmul_r4_receipt.c src/omega_gpu_matmul_api.h $(OU
 # through the heavy queue. -ffp-contract=off keeps the f32 oracle free of FMA.
 .PHONY: test-gpu-elementwise
 GPU_EW_TEST = $(OUT_DIR)/gpu_elementwise_test
-$(GPU_EW_TEST): tests/gpu_elementwise_test.c src/omega_gpu_elementwise_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_elementwise_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_EW_TEST): tests/gpu_elementwise_test.c $(CUDAPP_SOURCE)/src/omega_gpu_elementwise_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_elementwise_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-elementwise: $(GPU_EW_TEST)
 	./$(GPU_EW_TEST) --host-only
 
@@ -2447,8 +2370,8 @@ test-gpu-elementwise: $(GPU_EW_TEST)
 # into instruction word 3. Host only; the golden-word checks compare words 0..2, so this is the check for word 3.
 .PHONY: test-bw-encode-control
 BW_ENCODE_CONTROL_TEST = $(OUT_DIR)/bw_encode_control_test
-$(BW_ENCODE_CONTROL_TEST): tests/bw_encode_control_test.c src/omega_blackwell_codegen.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -o $@ tests/bw_encode_control_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(BW_ENCODE_CONTROL_TEST): tests/bw_encode_control_test.c $(CUDAPP_SOURCE)/src/omega_blackwell_codegen.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -o $@ tests/bw_encode_control_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-bw-encode-control: $(BW_ENCODE_CONTROL_TEST)
 	./$(BW_ENCODE_CONTROL_TEST)
 
@@ -2458,8 +2381,8 @@ test-bw-encode-control: $(BW_ENCODE_CONTROL_TEST)
 # controls); the chip gate is tools/run_gpu_reconv_chip.sh.
 .PHONY: test-gpu-reconv
 GPU_RECONV_TEST = $(OUT_DIR)/gpu_reconv_test
-$(GPU_RECONV_TEST): tests/gpu_reconv_test.c tests/bw_warp_sim.h src/omega_gpu_elementwise_api.h src/omega_bw_reconv.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -Itests -o $@ tests/gpu_reconv_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_RECONV_TEST): tests/gpu_reconv_test.c tests/bw_warp_sim.h $(CUDAPP_SOURCE)/src/omega_gpu_elementwise_api.h $(CUDAPP_SOURCE)/src/omega_bw_reconv.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -Itests -o $@ tests/gpu_reconv_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-reconv: $(GPU_RECONV_TEST)
 	./$(GPU_RECONV_TEST) --host-only
 
@@ -2472,8 +2395,8 @@ test-gpu-reconv: $(GPU_RECONV_TEST)
 # (tools/run_gpu_attention_chip.sh). -ffp-contract=off keeps the oracle free of FMA.
 .PHONY: test-gpu-attention
 GPU_ATTN_TEST = $(OUT_DIR)/gpu_attention_test
-$(GPU_ATTN_TEST): tests/gpu_attention_test.c tests/bw_warp_sim.h src/omega_gpu_attention_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_attention_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_ATTN_TEST): tests/gpu_attention_test.c tests/bw_warp_sim.h $(CUDAPP_SOURCE)/src/omega_gpu_attention_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_attention_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-attention: $(GPU_ATTN_TEST)
 	./$(GPU_ATTN_TEST) --host-only
 	./$(GPU_ATTN_TEST) --sim
@@ -2483,15 +2406,15 @@ test-gpu-attention: $(GPU_ATTN_TEST)
 	./$(GPU_ATTN_TEST) --hd 128 --divergent --sim
 
 # FB-1 cut 4b: fresh-process device-open probe (flake investigation, tools/probe_gpu_open.sh)
-$(OUT_DIR)/gpu_session_probe: tests/gpu_session_probe.c src/omega_gpu_session.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -o $@ tests/gpu_session_probe.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(OUT_DIR)/gpu_session_probe: tests/gpu_session_probe.c $(CUDAPP_SOURCE)/src/omega_gpu_session.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -o $@ tests/gpu_session_probe.c $(GPU_LINK_LIBS) -lpthread -lm
 
 # OWN-30B cut 2: window matmul gate (tests/gpu_moe_window_test.c). test-gpu-moe-window runs the host-only
 # refusals and the packed-window byte rule; the chip gate is `./build/gpu_moe_window_test --out r.json`
 # under /tmp/aien-gb10.lock (equivalence to the whole-tensor columns, mutants, window timing).
 GPU_MOE_TEST = $(OUT_DIR)/gpu_moe_window_test
-$(GPU_MOE_TEST): tests/gpu_moe_window_test.c src/omega_gpu_moe_api.h src/omega_gpu_matmul_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -o $@ tests/gpu_moe_window_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_MOE_TEST): tests/gpu_moe_window_test.c $(CUDAPP_SOURCE)/src/omega_gpu_moe_api.h $(CUDAPP_SOURCE)/src/omega_gpu_matmul_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -o $@ tests/gpu_moe_window_test.c $(GPU_LINK_LIBS) -lpthread -lm
 .PHONY: test-gpu-moe-window
 test-gpu-moe-window: $(GPU_MOE_TEST)
 	./$(GPU_MOE_TEST) --host-only
@@ -2502,8 +2425,8 @@ test-gpu-moe-window: $(GPU_MOE_TEST)
 # -ffp-contract=off keeps the double oracle free of FMA.
 .PHONY: test-gpu-fp8
 GPU_FP8_TEST = $(OUT_DIR)/gpu_fp8_api_test
-$(GPU_FP8_TEST): tests/gpu_fp8_api_test.c tests/bw_warp_sim.h src/omega_gpu_fp8_api.h src/omega_blackwell_codegen_moe.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_fp8_api_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_FP8_TEST): tests/gpu_fp8_api_test.c tests/bw_warp_sim.h $(CUDAPP_SOURCE)/src/omega_gpu_fp8_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_moe.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_fp8_api_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-fp8: $(GPU_FP8_TEST)
 	./$(GPU_FP8_TEST) --host-only
 	AIEN_OMEGA_FP8_COAL=0 ./$(GPU_FP8_TEST) --coal-default
@@ -2513,15 +2436,15 @@ test-gpu-fp8: $(GPU_FP8_TEST)
 # omega #457 (2026-10-15): host rewrite of a GPU-cached buffer must be visible to the next launch. Chip only; the gate
 # is tools/run_gpu_l2_stale_chip.sh.
 GPU_L2_STALE_TEST = $(OUT_DIR)/gpu_l2_stale_test
-$(GPU_L2_STALE_TEST): tests/gpu_l2_stale_test.c src/omega_gpu_fp8_api.h src/omega_gpu_session.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_l2_stale_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_L2_STALE_TEST): tests/gpu_l2_stale_test.c $(CUDAPP_SOURCE)/src/omega_gpu_fp8_api.h $(CUDAPP_SOURCE)/src/omega_gpu_session.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_l2_stale_test.c $(GPU_LINK_LIBS) -lpthread -lm
 
 # OWN-30B cut 8 (2026-10-13): one-launch decode attention (omega_gpu_decode_attn_api.h). test-gpu-decode-attn is
 # host-only + simulator; the chip gate is tools/run_gpu_decode_attn_chip.sh.
 .PHONY: test-gpu-decode-attn
 GPU_DATTN_TEST = $(OUT_DIR)/gpu_decode_attn_test
-$(GPU_DATTN_TEST): tests/gpu_decode_attn_test.c tests/bw_warp_sim_k.h src/omega_gpu_decode_attn_api.h src/omega_blackwell_codegen_attn.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_decode_attn_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_DATTN_TEST): tests/gpu_decode_attn_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_decode_attn_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_attn.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_decode_attn_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-decode-attn: $(GPU_DATTN_TEST)
 	$(GPU_DATTN_TEST) --host-only
 	$(GPU_DATTN_TEST) --sim
@@ -2531,8 +2454,8 @@ test-gpu-decode-attn: $(GPU_DATTN_TEST)
 # tools/run_gpu_decode_attn256_chip.sh.
 .PHONY: test-gpu-decode-attn256
 GPU_DATTN256_TEST = $(OUT_DIR)/gpu_decode_attn256_test
-$(GPU_DATTN256_TEST): tests/gpu_decode_attn256_test.c tests/bw_warp_sim_k.h src/omega_gpu_decode_attn256_api.h src/omega_blackwell_codegen_attn256.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_decode_attn256_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_DATTN256_TEST): tests/gpu_decode_attn256_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_decode_attn256_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_attn256.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_decode_attn256_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-decode-attn256: $(GPU_DATTN256_TEST)
 	$(GPU_DATTN256_TEST) --host-only
 	$(GPU_DATTN256_TEST) --sim
@@ -2541,8 +2464,8 @@ test-gpu-decode-attn256: $(GPU_DATTN256_TEST)
 # (oracle, budgets) plus the warp simulator; the chip gate is tools/run_gpu_router_chip.sh under the GB10 lock.
 .PHONY: test-gpu-router
 GPU_ROUTER_TEST = $(OUT_DIR)/gpu_router_test
-$(GPU_ROUTER_TEST): tests/gpu_router_test.c tests/bw_warp_sim_k.h src/omega_gpu_router_api.h src/omega_blackwell_codegen_router.h src/omega_gpu_fp8_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_router_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_ROUTER_TEST): tests/gpu_router_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_router_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_router.h $(CUDAPP_SOURCE)/src/omega_gpu_fp8_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_router_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-router: $(GPU_ROUTER_TEST)
 	./$(GPU_ROUTER_TEST) --host-only
 	./$(GPU_ROUTER_TEST) --sim
@@ -2551,15 +2474,15 @@ test-gpu-router: $(GPU_ROUTER_TEST)
 # test-gpu-gdn is host-only plus the warp simulator over the whole grid; the chip run is ./build/gpu_gdn_test under the GB10 lock.
 .PHONY: test-gpu-gdn
 GPU_GDN_TEST = $(OUT_DIR)/gpu_gdn_test
-$(GPU_GDN_TEST): tests/gpu_gdn_test.c tests/bw_warp_sim_k.h src/omega_gpu_gdn_api.h src/omega_blackwell_codegen_gdn.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gdn_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_GDN_TEST): tests/gpu_gdn_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_gdn_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_gdn.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gdn_test.c $(GPU_LINK_LIBS) -lpthread -lm
 # L369: the multi-token GDN decode == T decode steps bit for bit (--sim: simulator; default: the chip, under the GB10 lock)
 GPU_GDN_MULTI_TEST = $(OUT_DIR)/gpu_gdn_multi_test
-$(GPU_GDN_MULTI_TEST): tests/gpu_gdn_multi_test.c tests/bw_warp_sim_k.h src/omega_gpu_gdn_api.h src/omega_blackwell_codegen_gdn.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gdn_multi_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_GDN_MULTI_TEST): tests/gpu_gdn_multi_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_gdn_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_gdn.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gdn_multi_test.c $(GPU_LINK_LIBS) -lpthread -lm
 GPU_DATTN256_MULTI_TEST = $(OUT_DIR)/gpu_dattn256_multi_test
-$(GPU_DATTN256_MULTI_TEST): tests/gpu_dattn256_multi_test.c src/omega_gpu_decode_attn256_api.h src/omega_blackwell_codegen_attn256.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -Itests -o $@ tests/gpu_dattn256_multi_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_DATTN256_MULTI_TEST): tests/gpu_dattn256_multi_test.c $(CUDAPP_SOURCE)/src/omega_gpu_decode_attn256_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_attn256.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -Itests -o $@ tests/gpu_dattn256_multi_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-gdn: $(GPU_GDN_TEST)
 	./$(GPU_GDN_TEST) --host-only
 	./$(GPU_GDN_TEST) --sim
@@ -2569,8 +2492,8 @@ test-gpu-gdn: $(GPU_GDN_TEST)
 # gate is tools/run_gpu_bf16_gemv_chip.sh under the GB10 lock.
 .PHONY: test-gpu-bf16-gemv
 GPU_BF16_TEST = $(OUT_DIR)/gpu_bf16_gemv_test
-$(GPU_BF16_TEST): tests/gpu_bf16_gemv_test.c tests/bw_warp_sim_k.h src/omega_gpu_bf16_gemv_api.h src/omega_blackwell_codegen_bf16.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_bf16_gemv_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_BF16_TEST): tests/gpu_bf16_gemv_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_bf16_gemv_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_bf16.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_bf16_gemv_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-bf16-gemv: $(GPU_BF16_TEST)
 	$(GPU_BF16_TEST) --host-only
 	$(GPU_BF16_TEST) --sim
@@ -2580,30 +2503,30 @@ test-gpu-bf16-gemv: $(GPU_BF16_TEST)
 # epilogue, mutants 1-3 caught); the chip gate is tools/run_gpu_tern_chip.sh with the quiet flag held.
 .PHONY: test-gpu-tern
 GPU_TERN_TEST = $(OUT_DIR)/gpu_tern_test
-$(GPU_TERN_TEST): tests/gpu_tern_test.c tests/bw_warp_sim_k.h src/omega_gpu_tern_api.h src/omega_blackwell_codegen_tern.h $(OMA_RZ_SRCS) $(OMA_RZ_HDRS) $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off $(OMA_RZ_ARCH) -Itests -o $@ tests/gpu_tern_test.c $(OMA_RZ_SRCS) $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_TERN_TEST): tests/gpu_tern_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_tern_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_tern.h $(OMA_RZ_SRCS) $(OMA_RZ_HDRS) $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off $(OMA_RZ_ARCH) -Itests -o $@ tests/gpu_tern_test.c $(OMA_RZ_SRCS) $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-tern: $(GPU_TERN_TEST)
 	$(GPU_TERN_TEST) --host-only
 	$(GPU_TERN_TEST) --sim
 
 # OWN-30B (2026-10-13): report-only lm_head study, fp8 vs bf16 argmax agreement on the real checkpoint (chip, GB10 lock).
-$(OUT_DIR)/gpu_lmhead_fp8_study: tests/gpu_lmhead_fp8_study.c src/omega_gpu_bf16_gemv_api.h src/omega_gpu_fp8_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -O2 -o $@ tests/gpu_lmhead_fp8_study.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(OUT_DIR)/gpu_lmhead_fp8_study: tests/gpu_lmhead_fp8_study.c $(CUDAPP_SOURCE)/src/omega_gpu_bf16_gemv_api.h $(CUDAPP_SOURCE)/src/omega_gpu_fp8_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -O2 -o $@ tests/gpu_lmhead_fp8_study.c $(GPU_LINK_LIBS) -lpthread -lm
 
 # OWN-30B prefill (2026-10-13): FP8 grouped GEMM (omega_gpu_fp8gemm_api.h). test-gpu-fp8gemm is host-only (emulation,
 # permutation, budgets) plus the warp simulator (512 threads); the chip gate is tools/run_gpu_fp8gemm_chip.sh under the GB10 lock.
 .PHONY: test-gpu-fp8gemm
 GPU_FP8GEMM_TEST = $(OUT_DIR)/gpu_fp8gemm_test
-$(GPU_FP8GEMM_TEST): tests/gpu_fp8gemm_test.c tests/bw_warp_sim_k.h src/omega_gpu_fp8gemm_api.h src/omega_blackwell_codegen_gemm.h src/omega_gpu_fp8_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_fp8gemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_FP8GEMM_TEST): tests/gpu_fp8gemm_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_fp8gemm_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_gemm.h $(CUDAPP_SOURCE)/src/omega_gpu_fp8_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_fp8gemm_test.c $(GPU_LINK_LIBS) -lpthread -lm
 
 # Qwen3.6-35B (sc L306 / L312) host-only simulator checks of the decode glue kernels, and the codegen hash pin
 Q36_DEC_SIM_TEST = $(OUT_DIR)/q36_dec_sim_test
-$(Q36_DEC_SIM_TEST): tests/q36_dec_sim_test.c tests/bw_warp_sim_k.h src/omega_blackwell_codegen_dec.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/q36_dec_sim_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(Q36_DEC_SIM_TEST): tests/q36_dec_sim_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_dec.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/q36_dec_sim_test.c $(GPU_LINK_LIBS) -lpthread -lm
 Q36_CODEGEN_HASH = $(OUT_DIR)/q36_codegen_hash
-$(Q36_CODEGEN_HASH): tests/q36_codegen_hash.c $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -Itests -o $@ tests/q36_codegen_hash.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(Q36_CODEGEN_HASH): tests/q36_codegen_hash.c $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -Itests -o $@ tests/q36_codegen_hash.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-fp8gemm: $(GPU_FP8GEMM_TEST)
 	$(GPU_FP8GEMM_TEST) --host-only
 	$(GPU_FP8GEMM_TEST) --sim
@@ -2611,56 +2534,56 @@ test-gpu-fp8gemm: $(GPU_FP8GEMM_TEST)
 # OWN-30B (2026-10-13): host-only audit that every launcher declares peak + 2 registers (the chip hung at peak + 1).
 .PHONY: test-gpu-gpr-boundary
 GPU_GPR_BOUNDARY_TEST = $(OUT_DIR)/gpu_gpr_boundary_test
-$(GPU_GPR_BOUNDARY_TEST): tests/gpu_gpr_boundary_test.c src/omega_blackwell_codegen.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -o $@ tests/gpu_gpr_boundary_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_GPR_BOUNDARY_TEST): tests/gpu_gpr_boundary_test.c $(CUDAPP_SOURCE)/src/omega_blackwell_codegen.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -o $@ tests/gpu_gpr_boundary_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-gpr-boundary: $(GPU_GPR_BOUNDARY_TEST)
 	$(GPU_GPR_BOUNDARY_TEST)
 
 # OWN-30B T3 (2026-10-13): HMMA arithmetic probe (host model self-checks; chip run under the GB10 lock).
 GPU_TC_PROBE_TEST = $(OUT_DIR)/gpu_tc_probe_test
-$(GPU_TC_PROBE_TEST): tests/gpu_tc_probe_test.c tests/bw_hmma_model.h src/omega_blackwell_codegen_tc.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_tc_probe_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_TC_PROBE_TEST): tests/gpu_tc_probe_test.c tests/bw_hmma_model.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_tc.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_tc_probe_test.c $(GPU_LINK_LIBS) -lpthread -lm
 
 GPU_TCGEMM_TEST = $(OUT_DIR)/gpu_tcgemm_test
-$(GPU_TCGEMM_TEST): tests/gpu_tcgemm_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h src/omega_blackwell_codegen_tc.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_tcgemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_TCGEMM_TEST): tests/gpu_tcgemm_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_tc.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_tcgemm_test.c $(GPU_LINK_LIBS) -lpthread -lm
 
 GPU_TC_PEAK_TEST = $(OUT_DIR)/gpu_tc_peak_test
-$(GPU_TC_PEAK_TEST): tests/gpu_tc_peak_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h src/omega_blackwell_codegen_tc.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_tc_peak_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_TC_PEAK_TEST): tests/gpu_tc_peak_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_tc.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_tc_peak_test.c $(GPU_LINK_LIBS) -lpthread -lm
 
 # OWN-30B L1 attention (2026-10-13): tensor-core causal prefill attention. --host-only and --sim are host proofs;
 # the chip gate is tools/run_gpu_prefill_attn_chip.sh.
 GPU_PATTN_TEST = $(OUT_DIR)/gpu_prefill_attn_test
-$(GPU_PATTN_TEST): tests/gpu_prefill_attn_test.c tests/bw_hmma_model.h tests/bw_warp_sim_pa.h src/omega_gpu_prefill_attn_api.h src/omega_blackwell_codegen_pattn.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=256 -Itests -o $@ tests/gpu_prefill_attn_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_PATTN_TEST): tests/gpu_prefill_attn_test.c tests/bw_hmma_model.h tests/bw_warp_sim_pa.h $(CUDAPP_SOURCE)/src/omega_gpu_prefill_attn_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_pattn.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=256 -Itests -o $@ tests/gpu_prefill_attn_test.c $(GPU_LINK_LIBS) -lpthread -lm
 # Qwen3.8-27B (omega-mv#545, 2026-10-18): head_dim 256 prefill attention on the decode cache. --host-only and --sim
 # are host proofs; the chip run is the default mode (under the GB10 lock).
 GPU_PATTN256_TEST = $(OUT_DIR)/gpu_prefill_attn256_test
-$(GPU_PATTN256_TEST): tests/gpu_prefill_attn256_test.c tests/bw_hmma_model.h tests/bw_warp_sim_pa.h src/omega_gpu_prefill_attn256_api.h src/omega_blackwell_codegen_pattn256.h src/omega_blackwell_codegen_attn256.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=256 -Itests -o $@ tests/gpu_prefill_attn256_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_PATTN256_TEST): tests/gpu_prefill_attn256_test.c tests/bw_hmma_model.h tests/bw_warp_sim_pa.h $(CUDAPP_SOURCE)/src/omega_gpu_prefill_attn256_api.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_pattn256.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_attn256.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=256 -Itests -o $@ tests/gpu_prefill_attn256_test.c $(GPU_LINK_LIBS) -lpthread -lm
 # OWN-30B T3b (2026-10-13): device-resident prefill module tests (host sim first; chip parts under the GB10 lock)
 GPU_PF_MEM_TEST = $(OUT_DIR)/gpu_pf_mem_test
-$(GPU_PF_MEM_TEST): tests/gpu_pf_mem_test.c tests/bw_warp_sim_tc.h src/omega_gpu_prefill.h src/omega_blackwell_codegen_pf.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_pf_mem_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_PF_MEM_TEST): tests/gpu_pf_mem_test.c tests/bw_warp_sim_tc.h $(CUDAPP_SOURCE)/src/omega_gpu_prefill.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_pf.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_pf_mem_test.c $(GPU_LINK_LIBS) -lpthread -lm
 GPU_PFGEMM_TEST = $(OUT_DIR)/gpu_pfgemm_test
-$(GPU_PFGEMM_TEST): tests/gpu_pfgemm_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h src/omega_gpu_prefill.h src/omega_blackwell_codegen_tc2.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_pfgemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_PFGEMM_TEST): tests/gpu_pfgemm_test.c tests/bw_hmma_model.h tests/bw_warp_sim_tc.h $(CUDAPP_SOURCE)/src/omega_gpu_prefill.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_tc2.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=512 -Itests -o $@ tests/gpu_pfgemm_test.c $(GPU_LINK_LIBS) -lpthread -lm
 GPU_QMMA_PROBE_TEST = $(OUT_DIR)/gpu_qmma_probe_test
-$(GPU_QMMA_PROBE_TEST): tests/gpu_qmma_probe_test.c tests/bw_qmma_model.h src/omega_blackwell_codegen_qmma.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_qmma_probe_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_QMMA_PROBE_TEST): tests/gpu_qmma_probe_test.c tests/bw_qmma_model.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_qmma.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_qmma_probe_test.c $(GPU_LINK_LIBS) -lpthread -lm
 GPU_QGEMM_TEST = $(OUT_DIR)/gpu_qgemm_test
-$(GPU_QGEMM_TEST): tests/gpu_qgemm_test.c tests/bw_qmma_model.h tests/bw_warp_sim_tc.h src/omega_gpu_prefill.h src/omega_blackwell_codegen_qg.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=1024 -Itests -o $@ tests/gpu_qgemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_QGEMM_TEST): tests/gpu_qgemm_test.c tests/bw_qmma_model.h tests/bw_warp_sim_tc.h $(CUDAPP_SOURCE)/src/omega_gpu_prefill.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_qg.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=1024 -Itests -o $@ tests/gpu_qgemm_test.c $(GPU_LINK_LIBS) -lpthread -lm
 GPU_PFHOST_TEST = $(OUT_DIR)/gpu_pfhost_test
-$(GPU_PFHOST_TEST): tests/gpu_pfhost_test.c tests/bw_warp_sim_tc.h src/omega_gpu_pfhost.h src/omega_blackwell_codegen_pfhost.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=1024 -Itests -o $@ tests/gpu_pfhost_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_PFHOST_TEST): tests/gpu_pfhost_test.c tests/bw_warp_sim_tc.h $(CUDAPP_SOURCE)/src/omega_gpu_pfhost.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_pfhost.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -DWS_MAX_THREADS=1024 -Itests -o $@ tests/gpu_pfhost_test.c $(GPU_LINK_LIBS) -lpthread -lm
 # OWN-30B W-L2 (2026-10-13): command list (many launches, one submission) + decode glue kernels. test-gpu-cmdlist is
 # host-only + warp simulator; the chip gate is tools/run_gpu_cmdlist_chip.sh under the GB10 lock.
 .PHONY: test-gpu-cmdlist
 GPU_CMDLIST_TEST = $(OUT_DIR)/gpu_cmdlist_test
-$(GPU_CMDLIST_TEST): tests/gpu_cmdlist_test.c tests/bw_warp_sim_k.h src/omega_gpu_cmdlist.h src/omega_blackwell_codegen_dec.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_cmdlist_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_CMDLIST_TEST): tests/gpu_cmdlist_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_gpu_cmdlist.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_dec.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_cmdlist_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-cmdlist: $(GPU_CMDLIST_TEST)
 	./$(GPU_CMDLIST_TEST) --host-only
 	./$(GPU_CMDLIST_TEST) --sim
@@ -2670,8 +2593,8 @@ test-gpu-cmdlist: $(GPU_CMDLIST_TEST)
 # with no flag, under the GB10 lock (timings need an exclusive window).
 .PHONY: test-gpu-streams
 GPU_STREAMS_TEST = $(OUT_DIR)/gpu_streams_test
-$(GPU_STREAMS_TEST): tests/gpu_streams_test.c tests/bw_warp_sim.h src/omega_gpu_cmdlist.h src/omega_bw_em.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_streams_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_STREAMS_TEST): tests/gpu_streams_test.c tests/bw_warp_sim.h $(CUDAPP_SOURCE)/src/omega_gpu_cmdlist.h $(CUDAPP_SOURCE)/src/omega_bw_em.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_streams_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-streams: $(GPU_STREAMS_TEST)
 	./$(GPU_STREAMS_TEST) --sim
 
@@ -2680,8 +2603,8 @@ test-gpu-streams: $(GPU_STREAMS_TEST)
 # the chip tier is "$(GPU_ISOLATION_TEST)" with no flag, under the GB10 lock.
 .PHONY: test-gpu-isolation
 GPU_ISOLATION_TEST = $(OUT_DIR)/gpu_isolation_test
-$(GPU_ISOLATION_TEST): tests/gpu_isolation_test.c tests/bw_warp_sim.h src/omega_gpu_session.h src/omega_bw_em.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_isolation_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_ISOLATION_TEST): tests/gpu_isolation_test.c tests/bw_warp_sim.h $(CUDAPP_SOURCE)/src/omega_gpu_session.h $(CUDAPP_SOURCE)/src/omega_bw_em.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_isolation_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-isolation: $(GPU_ISOLATION_TEST)
 	./$(GPU_ISOLATION_TEST) --host-only
 
@@ -2689,39 +2612,39 @@ test-gpu-isolation: $(GPU_ISOLATION_TEST)
 # host-only; the chip gate is tools/run_gpu_decode_graph_chip.sh under the GB10 lock.
 .PHONY: test-gpu-decode-graph
 GPU_DECODE_GRAPH_TEST = $(OUT_DIR)/gpu_decode_graph_test
-$(GPU_DECODE_GRAPH_TEST): tests/gpu_decode_graph_test.c src/omega_gpu_decode_graph.h src/omega_gpu_cmdlist.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_decode_graph_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_DECODE_GRAPH_TEST): tests/gpu_decode_graph_test.c $(CUDAPP_SOURCE)/src/omega_gpu_decode_graph.h $(CUDAPP_SOURCE)/src/omega_gpu_cmdlist.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_decode_graph_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-decode-graph: $(GPU_DECODE_GRAPH_TEST)
 	./$(GPU_DECODE_GRAPH_TEST) --host-only
 
 # OWN-30B W-L2c (2026-10-14): per-launch fixed cost inside a command list (tests/gpu_launch_cost_test.c, chip only, GB10 lock).
 GPU_LAUNCH_COST_TEST = $(OUT_DIR)/gpu_launch_cost_test
-$(GPU_LAUNCH_COST_TEST): tests/gpu_launch_cost_test.c src/omega_gpu_fp8_api.h src/omega_gpu_cmdlist.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_launch_cost_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_LAUNCH_COST_TEST): tests/gpu_launch_cost_test.c $(CUDAPP_SOURCE)/src/omega_gpu_fp8_api.h $(CUDAPP_SOURCE)/src/omega_gpu_cmdlist.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_launch_cost_test.c $(GPU_LINK_LIBS) -lpthread -lm
 
 # OWN-30B W-L2d (2026-10-14): L2 reuse of FP8 GEMV weights between two launches of one list (tests/gpu_l2_reuse_test.c, chip only, GB10 lock).
 GPU_L2_REUSE_TEST = $(OUT_DIR)/gpu_l2_reuse_test
-$(GPU_L2_REUSE_TEST): tests/gpu_l2_reuse_test.c src/omega_gpu_fp8_api.h src/omega_gpu_cmdlist.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_l2_reuse_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_L2_REUSE_TEST): tests/gpu_l2_reuse_test.c $(CUDAPP_SOURCE)/src/omega_gpu_fp8_api.h $(CUDAPP_SOURCE)/src/omega_gpu_cmdlist.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_l2_reuse_test.c $(GPU_LINK_LIBS) -lpthread -lm
 
 # sc #642 (2026-10-18): Qwen3.8-27B decode graph (one token = one command list), chip test vs the APIs one call at a time
 .PHONY: test-gpu-q38-graph-host
 GPU_Q38_GRAPH_TEST = $(OUT_DIR)/gpu_q38_graph_test
-$(GPU_Q38_GRAPH_TEST): tests/gpu_q38_graph_test.c src/omega_gpu_q38_graph.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_q38_graph_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_Q38_GRAPH_TEST): tests/gpu_q38_graph_test.c $(CUDAPP_SOURCE)/src/omega_gpu_q38_graph.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -o $@ tests/gpu_q38_graph_test.c $(GPU_LINK_LIBS) -lpthread -lm
 test-gpu-q38-graph-host: $(GPU_Q38_GRAPH_TEST)
 	./$(GPU_Q38_GRAPH_TEST) --host-only
 
 # HUM L314 exact two-pass lm_head (XBOUND simulator proofs; the chip run comes with the export)
 GPU_EXACT_HEAD_TEST = $(OUT_DIR)/gpu_exact_head_test
-$(GPU_EXACT_HEAD_TEST): tests/gpu_exact_head_test.c tests/bw_warp_sim_k.h src/omega_blackwell_codegen_dec.h src/omega_gpu_bf16_gemv_api.h src/omega_gpu_fp8_api.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_exact_head_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_EXACT_HEAD_TEST): tests/gpu_exact_head_test.c tests/bw_warp_sim_k.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen_dec.h $(CUDAPP_SOURCE)/src/omega_gpu_bf16_gemv_api.h $(CUDAPP_SOURCE)/src/omega_gpu_fp8_api.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_exact_head_test.c $(GPU_LINK_LIBS) -lpthread -lm
 # C3 (docs/OMEGA.md): sum, max, min and prefix sum of any length 1..2^28, bit-exact against the frozen order.
 # test-gpu-scan: host refusals, codegen, references vs exact sums and vs the E1 reference, then the warp simulator
 # (both orders, mutants caught). The chip tier is "$(GPU_SCAN_TEST)" with no flag, under the GB10 lock.
 GPU_SCAN_TEST = $(OUT_DIR)/gpu_scan_test
-$(GPU_SCAN_TEST): tests/gpu_scan_test.c tests/bw_warp_sim.h src/omega_gpu_scan.h src/omega_numeric_reduce.c src/omega_numeric.c $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_scan_test.c src/omega_numeric_reduce.c src/omega_numeric.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_SCAN_TEST): tests/gpu_scan_test.c tests/bw_warp_sim.h $(CUDAPP_SOURCE)/src/omega_gpu_scan.h src/omega_numeric_reduce.c src/omega_numeric.c $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_scan_test.c src/omega_numeric_reduce.c src/omega_numeric.c $(GPU_LINK_LIBS) -lpthread -lm
 .PHONY: test-gpu-scan
 test-gpu-scan: $(GPU_SCAN_TEST)
 	./$(GPU_SCAN_TEST) --sim
@@ -2730,8 +2653,8 @@ test-gpu-scan: $(GPU_SCAN_TEST)
 # against the chip-measured tensor-core model. test-gpu-gemm: host refusals and codegen, then the warp simulator.
 # The chip tier is "$(GPU_GEMM_TEST)" with no flag (>= 200 shapes up to 8192, speed vs the measured ceiling), under the GB10 lock.
 GPU_GEMM_TEST = $(OUT_DIR)/gpu_gemm_test
-$(GPU_GEMM_TEST): tests/gpu_gemm_test.c tests/bw_warp_sim_tc.h tests/bw_hmma_model.h tests/bw_qmma_model.h src/omega_gpu_gemm.h $(OUT_DIR)/libomega_gpu.a
-	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+$(GPU_GEMM_TEST): tests/gpu_gemm_test.c tests/bw_warp_sim_tc.h tests/bw_hmma_model.h tests/bw_qmma_model.h $(CUDAPP_SOURCE)/src/omega_gpu_gemm.h $(GPU_LINK_LIBS)
+	$(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gemm_test.c $(GPU_LINK_LIBS) -lpthread -lm
 .PHONY: test-gpu-gemm
 test-gpu-gemm: $(GPU_GEMM_TEST)
 	./$(GPU_GEMM_TEST) --sim
diff --git a/README.md b/README.md
index 6cff6147d..6b7e6fc20 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,74 @@ The live status is owned by [aien-architecture](https://github.com/aien-spark/ai
 
 [aienux](https://github.com/aien-dev/aienux) holds Aienux, the kernel of AienOS, which Omega is meant to run on. [physics](https://github.com/aien-spark/physics) provides FORGE machine realization and the GB10 native path (pinned in `physics.lock`). [aien-architecture](https://github.com/aien-spark/aien-architecture) owns status and sequencing. ARGUS-0/1 (a defensive plane) is implemented in aienux (`native/argus`, pinned by `argus.lock`); Omega only carries the opt-in `RX_ARGUS` hooks (`src/runtime/rx_argus.c`) and receipts in `evidence/ARGUS/`. Physics Zero exists here as a host benchmark apparatus and learner (`src/physics0/`, `tests/physics0/`, `mk/physics0-learner.mk`, `docs/physics0/`, receipts in `evidence/physics0/`), with its specifications in the physics repository. DIRAC-0 is a specification in aien-architecture plus an oracle source in `research/dirac-oracle/` that has never been built or run. The Evolution Arena is a plan only.
 
+### Canonical native GPU sources
+
+`cudapp.lock` pins the CUDApp source consumed by this tree. Native GPU implementation, driver closure, generated native GPU units and their public headers come from that revision, not from a second Omega copy. `tools/cudapp-stage.sh` authenticates the checkout, materializes its committed tree, checks native-unit regeneration, builds the canonical archive and publishes an immutable stage under `OUT_DIR/cudapp`. Every native build authenticates that stage again, including a build without `make clean`. A missing or different pin, missing source, changed source or changed archive refuses the build. There is no lock-check bypass.
+
+Set `CUDAPP_DIR` to a checkout whose HEAD is exactly `cudapp.lock`, `OMEGA_OMC` to the seeded compiler with SHA-256 `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f` (Omega `e5b32567a7aff3ce594e3254a622a846a6cd190b`), and `OMEGA_BRIDGE` to omega-bridge `0c4cb9ff980af278890b231b994eaede4dc7621c`. The canonical library is linked after Omega's retained CPU objects. Omega's CPU SHA-256/BLAKE3 binding retains its separately recorded compiler and bridge pins in `om/units.sh` and `om/omega-bridge.lock`; those are not the native GPU binding.
+
+`tests/cudapp_retirement_sources.json` records all 123 removed source/header paths, their exact historical and canonical object identities, and the SHA-256 of the preserved original-source archive. Omega retains its unique Blackwell qualification adapter and resident runtime adapter. Historical receipts and unmerged branches, including #618, are not rewritten or represented as newly qualified. The remaining CPU implementation overlap is explicit: Omega's CPU companion objects precede the canonical archive; native GPU implementation comes only from CUDApp.
+
+Visor and program host callers also link the canonical archive after retained CPU
+objects; they do not require retired local Blackwell object rules. Tensor mutation
+and GB10-host controls authenticate/stage before invoking their standalone runner,
+including parallel builds. `test-numeric-cpu`, `test-program-fp32`,
+`test-program-realize`, `test-program-id`, `test-tensor`, `test-tensor-store` and
+`test-tensor-mutations` exercise host behavior only.
+
+Standalone chip collectors use the same authenticated stage or disposable canonical overlay and retain their existing device-authorization requirements. Their `canonical_source` field embeds the existing `.om` stage-verifier object unchanged; it is source provenance, not qualification authority. M17 reruns refuse an existing receipt or corpus manifest: set `M17_EVIDENCE_DIR` to a fresh evidence directory rather than replacing historical evidence. A build-only check of a chip collector is not a chip run.
+
+This ownership cutover does not activate new native candidates. Existing artifact admission remains authoritative; new candidates have no production qualification record and remain refused. Host fixtures use explicitly synthetic handles. GPU execution, exact-artifact independent hardware qualification and full-model parity/performance are separate authorized gates, not consequences of staging, compilation or host tests.
+
+#### Existing 35B candidate acceptance boundary
+
+The first whole-model target is the existing Q36 35B inference path on Spark,
+not a new operator, adapter or hardware backend. Before an authorized device run,
+freeze one manifest containing the Core source and executable hashes, this Omega
+source, `cudapp.lock`, staged source/archive hashes, all generated-unit identities,
+compiler and bridge pins, model/config/tokenizer/weight/scale content identities,
+exact command/environment, admission records and workload inputs. The capacity
+repair CUDApp #173 and command-lifetime repair #174 are candidate prerequisites;
+pending source is not merged source and historical component receipts are not
+qualification of that manifest.
+This isolated host-integration branch pins local, unmerged CUDApp
+`685f6c38924383667469fa32d1f6495490b94bc9`: combines the prior candidate
+`6ed24d1618e06b6e8f92e307f731a38c0d515a4b` with MMIO instruction repair #172
+at `885e32017eaae6208719eefcfa516ceaa853a846`. The prior candidate combines
+`491da3ce11c74fe66b49d679aafb0334915b7ab4` (#175 on accepted #173
+`ca441c5a92f5a951a67de00aeddae0e077f10216`) and
+`8cd1c912e8c7a68b7adcca75c6f71d1652401a54` (#174 evidence head;
+corrected code `05be6d98211d7fdc043d173da8f661bbb51e0138`).
+This is not canonical main, merged source, device qualification or production admission.
+The original #924 draft pin and all earlier component receipts remain unchanged.
+
+Build the canonical archive through `check-cudapp`, then build the existing Core
+35B consumer against that exact archive without an alternate GPU implementation.
+Retain the link map and verify the consumed archive and generated-unit identities.
+Run host/refusal controls first, including wrong pin, changed source/archive,
+shape/grouped-MoE admission, capacity exhaustion, command disposal and recovery.
+Production resolver `NULL` and record count zero remain unchanged; a build-only
+candidate does not acquire production admission.
+
+Actual inference requires a current authorized GPU reservation and an isolated
+endpoint, never an unapproved replacement or second large model beside the resident
+service. Compare the candidate with the saved qualified incumbent using identical
+model bytes, prompts, decoding settings, context and slot configuration. Record
+correctness and numerical/model-quality results, complete prefill/decode timings,
+peak and steady memory, repeated-run reliability, timeout/refusal and recovery
+behavior, and effects on neighboring processes. Cover one-user and existing
+multi-user workloads, ragged/large-M prefill and grouped experts; bind every actual
+recorded code/launch occurrence before submission. A partial run, a mismatched
+artifact or any unaccepted qualification refuses activation. GPU, full-model,
+memory, speed, recovery and neighboring-process outcomes remain NOT_RUN until
+measured against the frozen candidate; publish new receipts without changing old ones.
+
+This path still depends on Linux and NVIDIA's kernel driver/firmware; the vendored
+driver interface headers are version `580.173.02`. Record the actual running driver
+and firmware versions in the candidate manifest. Removing CUDA userspace imports
+does not establish an independent driver, generic CUDA compatibility or a drop-in
+replacement for arbitrary applications.
+
 ## Standing rules
 
 Language rule: `.om` is the only forward first-party implementation language. Implement and qualify each replacement, switch its actual consumers, then remove the superseded first-party source and obsolete build/runtime dependencies from the active tree. This includes compiler/runtime code, services, tools, automation and project-owned tests; C/Rust/shell remaining today are unfinished migration, not permanent exemptions. Preserve Git history and immutable evidence. External protocol formats, generated machine code, device firmware and independently sourced qualification oracles have separately declared roles; they must not conceal a foreign implementation of Omega. See the [replacement/deletion contract](https://github.com/aien-dev/aien-architecture-mv/issues/300).
diff --git a/cudapp.lock b/cudapp.lock
new file mode 100644
index 000000000..d983de03c
--- /dev/null
+++ b/cudapp.lock
@@ -0,0 +1 @@
+685f6c38924383667469fa32d1f6495490b94bc9
diff --git a/mk/.crumb b/mk/.crumb
index e38efa48f..d4f893173 100644
--- a/mk/.crumb
+++ b/mk/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-28T03:06:12Z",
+      "compiled_at": "2026-10-28T20:28:40Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:8f0e5cb325040247440527f6b54b65cf72c47ff5adca75b4f32a1ddf2b2d6ade",
+      "digest": "sha256:5fb34d7988eea79177ebfa6b8245c1131a63e09789572b5633278936d11295ae",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 75,
-      "generated_at_commit": "79b8c1f9c24195c53ac8dad111d35175a4431506",
-      "source_tree": "sha256:b8302c1e15664dfe98c550a03830f5d4cf75c5451a6c75eed5042e623dea5d10"
+      "files": 76,
+      "generated_at_commit": "cafb7be08e4a92d6dd7347b011a833f524140dee",
+      "source_tree": "sha256:4c099e8fef751278a3ffcc52b1a206de6108dcc8135bf3a6699e72527132e852"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/mk/00-visor-core.mk b/mk/00-visor-core.mk
index d5e243a92..b30a7dcd7 100644
--- a/mk/00-visor-core.mk
+++ b/mk/00-visor-core.mk
@@ -3,7 +3,7 @@
 # from a clean checkout with PHYSICS_DIR=/nonexistent PHYSICS_LOCK_CHECK=0.
 VISOR_CORE = omega_om_units omega_canonical omega_validate omega_core omega_codec aarch64_encoder aarch64_decoder \
 	omega_realize omega_realize_synth omega_machine omega_exec omega_verify omega_program omega_synthesis omega_library \
-	omega_vector omega_blackwell_qmd omega_blackwell_encoder omega_blackwell_realize
+	omega_vector
 VISOR_CORE_OBJS = $(addprefix $(OUT_DIR)/,$(addsuffix .o,$(VISOR_CORE)))
 VISOR_CFLAGS = -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -Isrc/visor -Isrc/language
 VISOR_SRCS = $(wildcard src/visor/*.c)
@@ -26,7 +26,7 @@ $(OUT_DIR)/language/%.o: src/language/%.c | $(OUT_DIR)/language
 $(OUT_DIR)/omega_main.o: tools/omega.c | $(OUT_DIR)
 	$(CC) $(VISOR_CFLAGS) -c $< -o $@
 
-$(OMEGA_BIN): $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(OUT_DIR)/omega_main.o
+$(OMEGA_BIN): $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(OUT_DIR)/omega_main.o $(CUDAPP_LIB) | check-cudapp
 	$(CC) $(VISOR_CFLAGS) -o $@ $^
 
 .PHONY: omega
@@ -34,11 +34,11 @@ omega: $(OMEGA_BIN)
 	cp $(OMEGA_BIN) ./omega
 
 # Generic rule for lane tests: tests/visor/test_X.c -> build/tests-visor/test_X
-$(OUT_DIR)/tests-visor/%: tests/visor/%.c $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) | $(OUT_DIR)/tests-visor
-	$(CC) $(VISOR_CFLAGS) -Itests/visor -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS)
+$(OUT_DIR)/tests-visor/%: tests/visor/%.c $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(CUDAPP_LIB) | $(OUT_DIR)/tests-visor check-cudapp
+	$(CC) $(VISOR_CFLAGS) -Itests/visor -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(CUDAPP_LIB)
 
-$(OUT_DIR)/tests-language/%: tests/language/%.c $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) | $(OUT_DIR)/tests-language
-	$(CC) $(VISOR_CFLAGS) -Itests/language -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS)
+$(OUT_DIR)/tests-language/%: tests/language/%.c $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(CUDAPP_LIB) | $(OUT_DIR)/tests-language check-cudapp
+	$(CC) $(VISOR_CFLAGS) -Itests/language -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(CUDAPP_LIB)
 
 # ---- aggregate Visor gates (lead-owned) --------------------------------------
 # Physics-free lane tests (no PHYSICS_DIR needed):
diff --git a/mk/autodiff.mk b/mk/autodiff.mk
index 1ef131765..9f727d75a 100644
--- a/mk/autodiff.mk
+++ b/mk/autodiff.mk
@@ -14,26 +14,25 @@ ifndef AUTODIFF_MK
 AUTODIFF_MK := 1
 .PHONY: test-autodiff test-autodiff-mutations autodiff-mutants
 AUTODIFF_CFLAGS = -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -ffp-contract=off -Isrc -Isrc/tensor \
-	-Isrc/autodiff -DOMEGA_NUMERIC_CPU_ONLY
+	-Isrc/autodiff -DOMEGA_NUMERIC_CPU_ONLY $(CUDAPP_HEADER_FLAGS)
 AUTODIFF_SRCS = src/autodiff/omega_autodiff.c
 AUTODIFF_TENSOR_SRCS = src/tensor/omega_tensor.c src/tensor/omega_tensor_cpu.c \
 	src/tensor/omega_tensor_reduce_seam.c src/omega_numeric_reduce.c src/omega_numeric_transc.c
-AUTODIFF_DEPS = src/omega_numeric.c src/omega_numeric_provenance.c src/omega_blackwell_encoder.c \
-	src/omega_blackwell_codegen.c src/omega_blackwell_matmul.c src/omega_blackwell_qmd.c src/omega_om_units.c
+AUTODIFF_DEPS = src/omega_numeric.c src/omega_numeric_provenance.c src/omega_om_units.c
 AUTODIFF_HDRS = src/autodiff/omega_autodiff.h src/tensor/omega_tensor.h src/tensor/omega_tensor_reduce_seam.h \
 	src/omega_numeric_reduce.h src/omega_numeric.h src/sha256.h src/omega_numeric_transc.h
 
 $(OUT_DIR)/test_omega_autodiff: tests/test_omega_autodiff.c $(AUTODIFF_SRCS) $(AUTODIFF_TENSOR_SRCS) \
-		$(AUTODIFF_DEPS) $(AUTODIFF_HDRS)
+		$(AUTODIFF_DEPS) $(AUTODIFF_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(OUT_DIR)
 	gcc $(AUTODIFF_CFLAGS) -O2 -o $@ tests/test_omega_autodiff.c $(AUTODIFF_SRCS) $(AUTODIFF_TENSOR_SRCS) \
-		$(AUTODIFF_DEPS)
+		$(AUTODIFF_DEPS) $(CUDAPP_LIB)
 
 $(OUT_DIR)/test_omega_autodiff_asan: tests/test_omega_autodiff.c $(AUTODIFF_SRCS) $(AUTODIFF_TENSOR_SRCS) \
-		$(AUTODIFF_DEPS) $(AUTODIFF_HDRS)
+		$(AUTODIFF_DEPS) $(AUTODIFF_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(OUT_DIR)
 	gcc $(AUTODIFF_CFLAGS) -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all \
-		-o $@ tests/test_omega_autodiff.c $(AUTODIFF_SRCS) $(AUTODIFF_TENSOR_SRCS) $(AUTODIFF_DEPS)
+		-o $@ tests/test_omega_autodiff.c $(AUTODIFF_SRCS) $(AUTODIFF_TENSOR_SRCS) $(AUTODIFF_DEPS) $(CUDAPP_LIB)
 
 test-autodiff: $(OUT_DIR)/test_omega_autodiff $(OUT_DIR)/test_omega_autodiff_asan
 	./$(OUT_DIR)/test_omega_autodiff
diff --git a/mk/cudapp-consumer.mk b/mk/cudapp-consumer.mk
new file mode 100644
index 000000000..3a6e6ee25
--- /dev/null
+++ b/mk/cudapp-consumer.mk
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+# Source identity is checked on every native entry, including stale-output builds.
+ifndef OMEGA_CUDAPP_CONSUMER_MK
+OMEGA_CUDAPP_CONSUMER_MK := 1
+CUDAPP_DIR ?= ../CUDApp
+CUDAPP_STAGE = $(OUT_DIR)/cudapp
+CUDAPP_SOURCE = $(CUDAPP_STAGE)/source
+CUDAPP_LIB = $(CUDAPP_STAGE)/build/libcudapp.a
+CUDAPP_HEADER_FLAGS = -I"$(CUDAPP_SOURCE)/src" -I"$(CUDAPP_SOURCE)/m16" -I"$(CUDAPP_SOURCE)/nvrm" \
+	-I"$(CUDAPP_SOURCE)/third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc" \
+	-I"$(CUDAPP_SOURCE)/third_party/nvidia-open-580.173.02/kernel-open/common/inc" \
+	-I"$(CUDAPP_SOURCE)/third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm" \
+	-I"$(CUDAPP_SOURCE)/third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include" \
+	-DOMEGA_CUDAPP_SOURCE='"$(abspath $(CUDAPP_SOURCE))"'
+.PHONY: check-cudapp test-cudapp-stage-hermetic
+check-cudapp:
+	sh tools/cudapp-stage.sh cudapp.lock "$(CUDAPP_DIR)" "$(CUDAPP_STAGE)"
+
+test-cudapp-stage-hermetic:
+	sh tests/cudapp_stage_hermetic.sh "$(CUDAPP_DIR)"
+
+$(CUDAPP_LIB): cudapp.lock | check-cudapp
+	@test -f "$@"
+
+# Required canonical source/header prerequisites may not exist until staging.
+# A missing member is an error; it is never silently dropped from a read set.
+$(CUDAPP_SOURCE)/%: | check-cudapp
+	@test -f "$@"
+
+$(OUT_DIR)/omegatool.o $(OUT_DIR)/omega_blackwell_gates.o $(OUT_DIR)/omega_world_gates.o \
+$(OUT_DIR)/omega_vector.o $(OUT_DIR)/omega_accelerator.o $(OUT_DIR)/omega_accelerator_world.o \
+$(OUT_DIR)/rx_resident_gpu.o: cudapp.lock $(CUDAPP_SOURCE)/src/cudapp_native.h | check-cudapp
+
+endif
diff --git a/mk/numeric-slices.mk b/mk/numeric-slices.mk
index ff2125f03..7d8ea79db 100644
--- a/mk/numeric-slices.mk
+++ b/mk/numeric-slices.mk
@@ -1,4 +1,3 @@
-# Numeric Blackwell source slice, declared once. The numeric CPU/host test
-# source lists in Makefile end with this run, in this order.
-NUMERIC_BW_SRCS = src/omega_blackwell_encoder.c src/omega_blackwell_codegen.c src/omega_blackwell_matmul.c src/omega_blackwell_qmd.c src/omega_om_units.c
-NUMERIC_BW_HDRS = src/omega_blackwell_qmd.h src/omega_blackwell_codegen.h src/omega_blackwell_encoder.h src/sha256.h
+# Hosted numerics retain Omega CPU/provenance units; GPU code comes from CUDA++.
+NUMERIC_BW_SRCS = src/omega_om_units.c
+NUMERIC_BW_HDRS = $(CUDAPP_SOURCE)/src/omega_blackwell_qmd.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen.h $(CUDAPP_SOURCE)/src/omega_blackwell_encoder.h src/sha256.h
diff --git a/mk/omega-gpu-code-alloc.mk b/mk/omega-gpu-code-alloc.mk
index 3b217c32d..92ede96c1 100644
--- a/mk/omega-gpu-code-alloc.mk
+++ b/mk/omega-gpu-code-alloc.mk
@@ -1,18 +1,34 @@
-# GPU code buffer sizing (src/omega_gpu_code_alloc.h): the 2 KB instruction prefetch tail after every
+# Canonical GPU code buffer sizing: the 2 KB instruction prefetch tail after every
 # kernel (omega#323). Host only: no device, no physics headers. Three parts: the size rule, a NO_TAIL
 # mutant that must fail it, and a source scan that refuses the page-only code sizing idioms the six
 # variable-size upload sites and five fixed-size sites used before.
-CODE_ALLOC_SCAN_SRC := src/*.c src/runtime/*.c
+CODE_ALLOC_SCAN_SRC = $(wildcard $(CUDAPP_SOURCE)/src/*.c src/runtime/*.c)
 CODE_ALLOC_SCAN_RE := code_size \+ 0x[fF]{3}|session_alloc\([^,]*code_size|alloc[a-z_]*\([^,]*, *(0x[0-9a-fA-F]+|OMEGA_DS_MAX_CODE_BYTES), *&[a-z_>.-]*code_mem\)
-.PHONY: test-gpu-code-alloc
-build/test_omega_gpu_code_alloc: tests/test_omega_gpu_code_alloc.c src/omega_gpu_code_alloc.h
+.PHONY: test-gpu-code-alloc test-gpu-code-alloc-scan
+build/test_omega_gpu_code_alloc: tests/test_omega_gpu_code_alloc.c $(CUDAPP_SOURCE)/src/omega_gpu_code_alloc.h | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -o $@ tests/test_omega_gpu_code_alloc.c
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -o $@ tests/test_omega_gpu_code_alloc.c
 test-gpu-code-alloc: build/test_omega_gpu_code_alloc
 	./build/test_omega_gpu_code_alloc
-	@gcc -std=gnu11 -O2 -Wall -Wextra -Werror -DOMEGA_GPU_CODE_ALLOC_MUTANT_NO_TAIL -Isrc -o build/test_omega_gpu_code_alloc_no_tail tests/test_omega_gpu_code_alloc.c
+	@gcc -std=gnu11 -O2 -Wall -Wextra -Werror -DOMEGA_GPU_CODE_ALLOC_MUTANT_NO_TAIL $(CUDAPP_HEADER_FLAGS) -Isrc -o build/test_omega_gpu_code_alloc_no_tail tests/test_omega_gpu_code_alloc.c
 	@if ./build/test_omega_gpu_code_alloc_no_tail >build/test_omega_gpu_code_alloc_no_tail.log 2>&1; then echo "MUTANT SURVIVED: NO_TAIL"; exit 1; fi
 	@echo "NO_TAIL mutant: killed ($$(grep -c '^FAIL:' build/test_omega_gpu_code_alloc_no_tail.log) failing checks)"
-	@if grep -nE '$(CODE_ALLOC_SCAN_RE)' $(CODE_ALLOC_SCAN_SRC); then echo "code buffer sized without the prefetch tail (use omega_gpu_code_alloc_bytes)"; exit 1; fi
-	@echo "source scan: no page-only code sizing"
+	@$(MAKE) --no-print-directory test-gpu-code-alloc-scan
+	@if $(MAKE) --no-print-directory test-gpu-code-alloc-scan CODE_ALLOC_SCAN_SRC=build/code-alloc-missing-input.c >build/code-alloc-missing.log 2>&1; then echo "source scan accepted a missing input"; exit 1; fi
+	@grep -q '^source scan failed (grep exit 2)' build/code-alloc-missing.log
+	@if $(MAKE) --no-print-directory test-gpu-code-alloc-scan CODE_ALLOC_SCAN_SRC= >build/code-alloc-empty.log 2>&1; then echo "source scan accepted an empty readset"; exit 1; fi
+	@grep -q '^source scan has no inputs' build/code-alloc-empty.log
+	@printf '%s\n' 'code_size + 0xfff' >build/code-alloc-forbidden.c
+	@if $(MAKE) --no-print-directory test-gpu-code-alloc-scan CODE_ALLOC_SCAN_SRC=build/code-alloc-forbidden.c >build/code-alloc-forbidden.log 2>&1; then echo "source scan accepted forbidden sizing"; exit 1; fi
+	@grep -q '^code buffer sized without the prefetch tail' build/code-alloc-forbidden.log
 	@echo "OMEGA_GPU_CODE_ALLOC_GATE PASS"
+
+# A canonical stage must exist before expanding the default optional source globs.
+test-gpu-code-alloc-scan: | check-cudapp
+	@test -n "$(strip $(CODE_ALLOC_SCAN_SRC))" || { echo "source scan has no inputs"; exit 2; }
+	@rc=0; grep -nE '$(CODE_ALLOC_SCAN_RE)' $(CODE_ALLOC_SCAN_SRC) || rc=$$?; \
+	case $$rc in \
+	1) echo "source scan: no page-only code sizing" ;; \
+	0) echo "code buffer sized without the prefetch tail (use omega_gpu_code_alloc_bytes)"; exit 1 ;; \
+	*) echo "source scan failed (grep exit $$rc)"; exit 2 ;; \
+	esac
diff --git a/mk/omega-gpu-engine.mk b/mk/omega-gpu-engine.mk
index ac62777ff..b2e9f0fe2 100644
--- a/mk/omega-gpu-engine.mk
+++ b/mk/omega-gpu-engine.mk
@@ -17,32 +17,27 @@
 #   test-gpu-engine-freestanding     the engine contract test and the platform contract test linked against
 #                                    those freestanding objects (host runner, opens no device)
 .PHONY: test-gpu-engine-compile test-gpu-engine test-gpu-engine-mutants test-gpu-engine-backend-compile test-gpu-engine-prod-build test-gpu-engine-sim test-gpu-engine-backend-mutants test-gpu-engine-gb10-compile gpu-engine-freestanding test-gpu-engine-freestanding
-build/test_omega_gpu_engine_compile: tests/test_omega_gpu_engine_compile.c src/omega_gpu_engine.c src/omega_gpu_engine.h
+build/test_omega_gpu_engine_compile: tests/test_omega_gpu_engine_compile.c $(CUDAPP_SOURCE)/src/omega_gpu_engine.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -DOMEGA_NUMERIC_CPU_ONLY -o $@ tests/test_omega_gpu_engine_compile.c src/omega_gpu_engine.c
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -DOMEGA_NUMERIC_CPU_ONLY -o $@ tests/test_omega_gpu_engine_compile.c $(CUDAPP_LIB)
 test-gpu-engine-compile: build/test_omega_gpu_engine_compile
 	./build/test_omega_gpu_engine_compile
 
-build/test_omega_gpu_engine: tests/test_omega_gpu_engine.c src/omega_gpu_engine.c src/omega_gpu_engine.h
+build/test_omega_gpu_engine: tests/test_omega_gpu_engine.c $(CUDAPP_SOURCE)/src/omega_gpu_engine.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -DOMEGA_NUMERIC_CPU_ONLY -o $@ tests/test_omega_gpu_engine.c src/omega_gpu_engine.c
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -DOMEGA_NUMERIC_CPU_ONLY -o $@ tests/test_omega_gpu_engine.c $(CUDAPP_LIB)
 test-gpu-engine: build/test_omega_gpu_engine
 	./build/test_omega_gpu_engine
 
 test-gpu-engine-mutants:
 	sh tools/gpu_engine_mutations.sh
 
-# A3b1: the Blackwell backend includes physics headers (m16_native.h, nvrm.h), so it
-# uses the same physics -I paths as the top-level Makefile CFLAGS (Makefile lines 9-14).
-GPU_ENGINE_PHYS_INC = -I$(PHYSICS_DIR)/m16 -I$(PHYSICS_DIR)/nvrm \
-	-I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc \
-	-I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/kernel-open/common/inc \
-	-I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm \
-	-I$(PHYSICS_DIR)/third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include
+# Syntax-check the canonical backend, using its bundled driver headers.
+GPU_ENGINE_PHYS_INC = $(CUDAPP_HEADER_FLAGS)
 
-build/omega_blackwell_engine_syntax.o: src/omega_blackwell_engine.c src/omega_blackwell_engine.h src/omega_gpu_engine.h
+build/omega_blackwell_engine_syntax.o: $(CUDAPP_SOURCE)/src/omega_blackwell_engine.c $(CUDAPP_SOURCE)/src/omega_blackwell_engine.h $(CUDAPP_SOURCE)/src/omega_gpu_engine.h | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -Isrc $(GPU_ENGINE_PHYS_INC) -c -o $@ src/omega_blackwell_engine.c
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE $(GPU_ENGINE_PHYS_INC) -Isrc -c -o $@ $(CUDAPP_SOURCE)/src/omega_blackwell_engine.c
 test-gpu-engine-backend-compile: build/omega_blackwell_engine_syntax.o
 
 # Links only, opens no device. Uses the real m16_native and nvrm sources at the physics pin.
@@ -52,17 +47,15 @@ test-gpu-engine-prod-build:
 # A3b2: simulated-driver host test. Links the sources of the Makefile RX_COMPOSE_GPU_SRCS list (plus the
 # three core files the vector builder needs) with tests/fake_m16_native.c in place of the physics
 # m16_native.c and nvrm.c. Opens no device.
-GPU_ENGINE_SIM_SRCS = src/omega_blackwell_submit.c src/omega_blackwell_engine.c src/omega_gpu_engine.c \
-	src/omega_blackwell_matmul.c src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c \
-	src/omega_blackwell_qmd.c src/omega_blackwell_realize.c src/omega_vector.c src/omega_validate.c \
+GPU_ENGINE_SIM_SRCS = src/omega_vector.c src/omega_validate.c \
 	src/omega_core.c src/omega_canonical.c src/omega_om_units.c
 
 build/test_omega_blackwell_engine: tests/test_omega_blackwell_engine.c tests/fake_m16_native.c tests/fake_m16_native.h \
-	$(GPU_ENGINE_SIM_SRCS) src/omega_gpu_engine.h src/omega_blackwell_engine.h
+	$(GPU_ENGINE_SIM_SRCS) $(CUDAPP_SOURCE)/src/omega_gpu_engine.h $(CUDAPP_SOURCE)/src/omega_blackwell_engine.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
 	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -pthread -ffunction-sections -fdata-sections \
 		-Isrc -Itests $(GPU_ENGINE_PHYS_INC) -o $@ tests/test_omega_blackwell_engine.c tests/fake_m16_native.c \
-		$(GPU_ENGINE_SIM_SRCS) -Wl,--gc-sections -lm
+		$(GPU_ENGINE_SIM_SRCS) -Wl,--gc-sections -lm $(CUDAPP_LIB)
 test-gpu-engine-sim: build/test_omega_blackwell_engine
 	./build/test_omega_blackwell_engine
 
@@ -71,7 +64,7 @@ test-gpu-engine-backend-mutants:
 	PHYSICS_DIR="$(PHYSICS_DIR)" sh tools/gpu_engine_backend_mutations.sh
 
 # Phase B chip test, compile only here. Never run in Phase A.
-build/test_omega_gpu_engine_gb10.o: tests/test_omega_gpu_engine_gb10.c src/omega_gpu_engine.h src/omega_blackwell_engine.h src/omega_blackwell_submit.h
+build/test_omega_gpu_engine_gb10.o: tests/test_omega_gpu_engine_gb10.c $(CUDAPP_SOURCE)/src/omega_gpu_engine.h $(CUDAPP_SOURCE)/src/omega_blackwell_engine.h $(CUDAPP_SOURCE)/src/omega_blackwell_submit.h | check-cudapp
 	@mkdir -p build
 	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffp-contract=off -fno-fast-math -pthread -Isrc $(GPU_ENGINE_PHYS_INC) -c -o $@ tests/test_omega_gpu_engine_gb10.c
 test-gpu-engine-gb10-compile: build/test_omega_gpu_engine_gb10.o
@@ -79,13 +72,11 @@ test-gpu-engine-gb10-compile: build/test_omega_gpu_engine_gb10.o
 # Measurement (sc#277): driver allocations and frees made by the REAL session + matmul + attention
 # APIs while serving a Qwen3-4B-shaped sequence, against the simulated driver. Host only, no device.
 # Prints MEASURE lines; asserts only bookkeeping. Links no physics C sources, only its headers.
-GPU_SERVE_ALLOC_SRCS = src/omega_gpu_session.c src/omega_gpu_platform.c src/omega_gpu_platform_linux.c src/omega_gpu_fmt.c src/omega_gpu_matmul_api.c src/omega_gpu_attention_api.c src/omega_gpu_serving.c \
-	src/omega_gpu_wait.c src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c src/omega_blackwell_qmd.c \
-	src/omega_blackwell_matmul.c src/omega_om_units.c
-build/gpu_serving_alloc_count_test: tests/gpu_serving_alloc_count_test.c tests/fake_m16_native.c tests/fake_m16_native.h $(GPU_SERVE_ALLOC_SRCS)
+GPU_SERVE_ALLOC_SRCS = src/omega_om_units.c
+build/gpu_serving_alloc_count_test: tests/gpu_serving_alloc_count_test.c tests/fake_m16_native.c tests/fake_m16_native.h $(GPU_SERVE_ALLOC_SRCS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
 	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -pthread -ffp-contract=off -Isrc -Itests $(GPU_ENGINE_PHYS_INC) \
-		-o $@ tests/gpu_serving_alloc_count_test.c tests/fake_m16_native.c $(GPU_SERVE_ALLOC_SRCS) -lm
+		-o $@ tests/gpu_serving_alloc_count_test.c tests/fake_m16_native.c $(GPU_SERVE_ALLOC_SRCS) -lm $(CUDAPP_LIB)
 .PHONY: test-gpu-serving-alloc
 test-gpu-serving-alloc: build/gpu_serving_alloc_count_test
 	./build/gpu_serving_alloc_count_test plain
@@ -112,23 +103,27 @@ test-gpu-serving-alloc: build/gpu_serving_alloc_count_test
 # runtime symbols; it proves nothing about device ownership (NOT_RUN until cut B runs on the Spark).
 GPU_FS_DIR = build/gpu_fs
 GPU_FS_CFLAGS = -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector \
-	-U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc
+	-U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY $(CUDAPP_HEADER_FLAGS) -Isrc
 # P07 cut C (session part): the persistent session, the matmul and attention APIs, the serving reservation and the
 # bounded wait join the link. Their machine comes from an installed OmegaGpuPlatform; the Linux reference
 # (src/omega_gpu_platform_linux.c) is deliberately NOT in this list. Still outside it: the elementwise API, the
 # numeric launchers, the vector executor, the resident runtime (docs/numeric/OMEGA_GPU_NATIVE_BOUNDARY.md).
-GPU_FS_SRCS = src/omega_gpu_engine.c src/omega_gpu_platform.c src/omega_blackwell_encoder.c src/omega_blackwell_codegen.c \
-	src/omega_blackwell_matmul.c src/omega_blackwell_qmd.c src/omega_blackwell_realize.c src/omega_om_units.c \
-	src/omega_gpu_session.c src/omega_gpu_fmt.c src/omega_gpu_matmul_api.c src/omega_gpu_attention_api.c \
-	src/omega_gpu_serving.c src/omega_gpu_wait.c
-GPU_FS_HDRS = src/omega_gpu_engine.h src/omega_gpu_platform.h src/omega_blackwell_codegen.h src/omega_blackwell_matmul.h \
-	src/omega_gpu_session.h src/omega_gpu_fmt.h src/omega_gpu_matmul_api.h src/omega_gpu_attention_api.h \
-	src/omega_gpu_serving.h src/omega_gpu_wait.h
-GPU_FS_OBJS = $(patsubst src/%.c,$(GPU_FS_DIR)/%.o,$(GPU_FS_SRCS))
+GPU_FS_NAMES = omega_gpu_engine omega_gpu_platform omega_blackwell_encoder omega_blackwell_codegen \
+	omega_blackwell_matmul omega_blackwell_qmd omega_blackwell_realize \
+	omega_gpu_session omega_gpu_fmt omega_gpu_matmul_api omega_gpu_attention_api \
+	omega_gpu_serving omega_gpu_wait cudapp_freest_units
+GPU_FS_SRCS = $(addprefix $(CUDAPP_SOURCE)/src/,$(addsuffix .c,$(GPU_FS_NAMES))) src/omega_om_units.c
+GPU_FS_HDRS = $(addprefix $(CUDAPP_SOURCE)/src/,omega_gpu_engine.h omega_gpu_platform.h omega_blackwell_codegen.h omega_blackwell_matmul.h \
+	omega_gpu_session.h omega_gpu_fmt.h omega_gpu_matmul_api.h omega_gpu_attention_api.h omega_gpu_serving.h omega_gpu_wait.h)
+GPU_FS_OBJS = $(addprefix $(GPU_FS_DIR)/,$(addsuffix .o,$(GPU_FS_NAMES))) $(GPU_FS_DIR)/omega_om_units.o
 GPU_FS_LINK = $(GPU_FS_DIR)/omega_gpu_freestanding.o
 GPU_FS_ALLOWED = memcpy|memmove|memset|memcmp|strlen|strcmp
 
-$(GPU_FS_DIR)/%.o: src/%.c $(GPU_FS_HDRS)
+$(GPU_FS_DIR)/%.o: $(CUDAPP_SOURCE)/src/%.c $(GPU_FS_HDRS) | check-cudapp
+	@mkdir -p $(GPU_FS_DIR)
+	gcc $(GPU_FS_CFLAGS) -c -o $@ $<
+
+$(GPU_FS_DIR)/omega_om_units.o: src/omega_om_units.c $(GPU_FS_HDRS) | check-cudapp
 	@mkdir -p $(GPU_FS_DIR)
 	gcc $(GPU_FS_CFLAGS) -c -o $@ $<
 
@@ -139,13 +134,13 @@ $(GPU_FS_LINK): $(GPU_FS_OBJS)
 	@echo "freestanding GPU link ($(words $(GPU_FS_SRCS)) files): only $$(nm -u $@ | awk '{print $$NF}' | grep -Ev '^_GLOBAL_OFFSET_TABLE_$$' | sort -u | tr '\n' ' ')undefined"
 gpu-engine-freestanding: $(GPU_FS_LINK)
 
-build/test_omega_gpu_engine_freestanding: tests/test_omega_gpu_engine.c $(GPU_FS_DIR)/omega_gpu_engine.o src/omega_gpu_engine.h
+build/test_omega_gpu_engine_freestanding: tests/test_omega_gpu_engine.c $(GPU_FS_LINK) $(CUDAPP_SOURCE)/src/omega_gpu_engine.h | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -DOMEGA_NUMERIC_CPU_ONLY -DOMEGA_GPU_NO_POSIX \
-		-o $@ tests/test_omega_gpu_engine.c $(GPU_FS_DIR)/omega_gpu_engine.o
-build/test_omega_gpu_platform: tests/test_omega_gpu_platform.c $(GPU_FS_DIR)/omega_gpu_platform.o src/omega_gpu_platform.h
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -DOMEGA_NUMERIC_CPU_ONLY -DOMEGA_GPU_NO_POSIX \
+		-o $@ tests/test_omega_gpu_engine.c $(GPU_FS_LINK)
+build/test_omega_gpu_platform: tests/test_omega_gpu_platform.c $(GPU_FS_LINK) $(CUDAPP_SOURCE)/src/omega_gpu_platform.h | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -o $@ tests/test_omega_gpu_platform.c $(GPU_FS_DIR)/omega_gpu_platform.o
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -o $@ tests/test_omega_gpu_platform.c $(GPU_FS_LINK)
 test-gpu-engine-freestanding: $(GPU_FS_LINK) build/test_omega_gpu_engine_freestanding build/test_omega_gpu_platform
 	./build/test_omega_gpu_engine_freestanding
 	./build/test_omega_gpu_platform
@@ -158,15 +153,15 @@ test-gpu-engine-freestanding: $(GPU_FS_LINK) build/test_omega_gpu_engine_freesta
 # all 2^32 inputs. The allowlist control links a malloc caller into the freestanding object and requires the
 # nm -u check to refuse it (a check that can never fail proves nothing).
 .PHONY: test-codegen-freestanding test-gpu-fs-allowlist-control
-CODEGEN_FS_TEST_DEPS = tests/test_omega_codegen_freestanding.c src/omega_blackwell_codegen.h src/omega_blackwell_matmul.h
-build/test_codegen_hosted: $(CODEGEN_FS_TEST_DEPS) src/omega_blackwell_codegen.c src/omega_blackwell_matmul.c src/omega_om_units.c
+CODEGEN_FS_TEST_DEPS = tests/test_omega_codegen_freestanding.c $(CUDAPP_SOURCE)/src/omega_blackwell_codegen.h $(CUDAPP_SOURCE)/src/omega_blackwell_matmul.h
+build/test_codegen_hosted: $(CODEGEN_FS_TEST_DEPS) src/omega_om_units.c $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -o $@ tests/test_omega_codegen_freestanding.c \
-		src/omega_blackwell_codegen.c src/omega_blackwell_matmul.c src/omega_om_units.c
-build/test_codegen_freestanding: $(CODEGEN_FS_TEST_DEPS) $(GPU_FS_LINK)
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -o $@ tests/test_omega_codegen_freestanding.c \
+		src/omega_om_units.c $(CUDAPP_LIB)
+build/test_codegen_freestanding: $(CODEGEN_FS_TEST_DEPS) $(GPU_FS_LINK) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -DOMEGA_GPU_NO_POSIX -o $@ tests/test_omega_codegen_freestanding.c \
-		$(GPU_FS_DIR)/omega_blackwell_codegen.o $(GPU_FS_DIR)/omega_blackwell_matmul.o $(GPU_FS_DIR)/omega_om_units.o
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -DOMEGA_GPU_NO_POSIX -o $@ tests/test_omega_codegen_freestanding.c \
+		$(GPU_FS_LINK)
 test-codegen-freestanding: build/test_codegen_hosted build/test_codegen_freestanding test-gpu-fs-allowlist-control
 	./build/test_codegen_hosted --dump > build/codegen_dump_hosted.txt
 	./build/test_codegen_freestanding --dump > build/codegen_dump_freestanding.txt
@@ -192,19 +187,14 @@ test-gpu-fs-allowlist-control: $(GPU_FS_LINK)
 #  - the mutants prove the session test can fail: each one breaks one rule in a copy of the session and the test
 #    must report FAIL for it.
 .PHONY: test-gpu-session-platform test-gpu-session-mutants
-build/test_omega_gpu_session_platform: tests/test_omega_gpu_session_platform.c $(GPU_FS_LINK)
+build/test_omega_gpu_session_platform: tests/test_omega_gpu_session_platform.c $(GPU_FS_LINK) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -DOMEGA_GPU_NO_POSIX -o $@ tests/test_omega_gpu_session_platform.c $(GPU_FS_LINK)
-GPU_LINUX_REF_SRCS = src/omega_gpu_session.c src/omega_gpu_platform.c src/omega_gpu_platform_linux.c src/omega_gpu_fmt.c src/omega_blackwell_qmd.c
-# omega #459: the command list over the reference (near-full ring with the #457 L2 invalidate prefix pending) needs the
-# cached allocation, the command list and the codegen behind its nop kernel.
-GPU_LINUX_REF_CMDLIST_SRCS = src/omega_gpu_mem_cached.c src/omega_gpu_cmdlist.c src/omega_blackwell_codegen.c src/omega_blackwell_encoder.c \
-	src/omega_blackwell_matmul.c src/omega_blackwell_realize.c src/omega_om_units.c
-build/test_omega_gpu_platform_linux: tests/test_omega_gpu_platform_linux.c tests/fake_m16_native.c tests/fake_m16_native.h $(GPU_LINUX_REF_SRCS) $(GPU_FS_HDRS) src/omega_gpu_platform_linux.h \
-		src/omega_gpu_cmdlist.h src/omega_gpu_mem_cached.h $(GPU_LINUX_REF_CMDLIST_SRCS)
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -DOMEGA_GPU_NO_POSIX -o $@ tests/test_omega_gpu_session_platform.c $(GPU_FS_LINK)
+GPU_LINUX_REF_SRCS = src/omega_om_units.c
+build/test_omega_gpu_platform_linux: tests/test_omega_gpu_platform_linux.c tests/fake_m16_native.c tests/fake_m16_native.h $(GPU_LINUX_REF_SRCS) $(GPU_FS_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
 	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -pthread -Isrc -Itests $(GPU_ENGINE_PHYS_INC) \
-		-o $@ tests/test_omega_gpu_platform_linux.c tests/fake_m16_native.c $(GPU_LINUX_REF_SRCS) $(GPU_LINUX_REF_CMDLIST_SRCS) -lm
+		-o $@ tests/test_omega_gpu_platform_linux.c tests/fake_m16_native.c $(GPU_LINUX_REF_SRCS) -lm $(CUDAPP_LIB)
 test-gpu-session-platform: build/test_omega_gpu_session_platform build/test_omega_gpu_platform_linux test-gpu-session-mutants
 	./build/test_omega_gpu_session_platform
 	./build/test_omega_gpu_platform_linux
@@ -214,11 +204,11 @@ test-gpu-session-mutants: $(GPU_FS_LINK)
 	@mkdir -p $(GPU_SESSION_MUT_DIR)
 	@set -e; killed=0; \
 	smut() { name=$$1; script=$$2; \
-	  sed -e "$$script" src/omega_gpu_session.c > $(GPU_SESSION_MUT_DIR)/$$name.c; \
-	  if cmp -s src/omega_gpu_session.c $(GPU_SESSION_MUT_DIR)/$$name.c; then echo "mutant $$name: pattern not found"; exit 1; fi; \
+	  sed -e "$$script" $(CUDAPP_SOURCE)/src/omega_gpu_session.c > $(GPU_SESSION_MUT_DIR)/$$name.c; \
+	  if cmp -s $(CUDAPP_SOURCE)/src/omega_gpu_session.c $(GPU_SESSION_MUT_DIR)/$$name.c; then echo "mutant $$name: pattern not found"; exit 1; fi; \
 	  gcc $(GPU_FS_CFLAGS) -c -o $(GPU_SESSION_MUT_DIR)/$$name.o $(GPU_SESSION_MUT_DIR)/$$name.c; \
 	  objs=$$(echo $(GPU_FS_OBJS) | tr ' ' '\n' | grep -v '/omega_gpu_session.o$$' | tr '\n' ' '); \
-	  gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -DOMEGA_GPU_NO_POSIX -o $(GPU_SESSION_MUT_DIR)/$$name \
+	  gcc -std=gnu11 -O2 -Wall -Wextra -Werror $(CUDAPP_HEADER_FLAGS) -Isrc -DOMEGA_GPU_NO_POSIX -o $(GPU_SESSION_MUT_DIR)/$$name \
 	    tests/test_omega_gpu_session_platform.c $$objs $(GPU_SESSION_MUT_DIR)/$$name.o; \
 	  if ./$(GPU_SESSION_MUT_DIR)/$$name > $(GPU_SESSION_MUT_DIR)/$$name.log 2>&1; then echo "mutant $$name SURVIVED"; exit 1; fi; \
 	  echo "mutant $$name killed: $$(grep -c '^FAIL' $(GPU_SESSION_MUT_DIR)/$$name.log) case(s) failed"; killed=$$((killed+1)); }; \
diff --git a/mk/omega-gpu-wait.mk b/mk/omega-gpu-wait.mk
index 42e5ed25b..8f46eca72 100644
--- a/mk/omega-gpu-wait.mk
+++ b/mk/omega-gpu-wait.mk
@@ -1,15 +1,15 @@
-# Shared GPU completion wait primitive (src/omega_gpu_wait.c): host unit test with
+# Shared canonical GPU completion wait primitive: host unit test with
 # fake memory and a fake clock, plus a naive wall-clock mutant that must be
 # caught. Picked up by `-include mk/*.mk`. Host only: opens no device, needs no
 # physics headers, takes no chip lock.
 .PHONY: test-gpu-wait
-build/test_omega_gpu_wait: tests/test_omega_gpu_wait.c src/omega_gpu_wait.c src/omega_gpu_wait.h
+build/test_omega_gpu_wait: tests/test_omega_gpu_wait.c $(CUDAPP_SOURCE)/src/omega_gpu_wait.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -Isrc -o $@ tests/test_omega_gpu_wait.c src/omega_gpu_wait.c
+	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE $(CUDAPP_HEADER_FLAGS) -Isrc -o $@ tests/test_omega_gpu_wait.c $(CUDAPP_LIB)
 test-gpu-wait: build/test_omega_gpu_wait
 	./build/test_omega_gpu_wait
 
-# Real-code mutants: src/omega_gpu_wait.c carries one-line compile-flag mutants.
+# Real-code mutants: the canonical omega_gpu_wait.c carries compile-flag mutants.
 # Each flagged build of the real primitive must FAIL the suite; the unflagged
 # build must PASS. A mutant that does not compile is an error, not a kill.
 GPU_WAIT_MUTANTS := OMEGA_GPU_WAIT_MUTANT_STALL_NO_RESET OMEGA_GPU_WAIT_MUTANT_PROGRESS_EXTENDS_HARD OMEGA_GPU_WAIT_MUTANT_NO_READ_BARRIER
@@ -18,7 +18,7 @@ test-gpu-wait-mutants: build/test_omega_gpu_wait
 	@./build/test_omega_gpu_wait >/dev/null || { echo "unflagged build FAILED"; exit 1; }
 	@echo "unflagged: PASS"
 	@set -e; for m in $(GPU_WAIT_MUTANTS); do \
-	  gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -D$$m -Isrc -o build/test_omega_gpu_wait_$$m tests/test_omega_gpu_wait.c src/omega_gpu_wait.c; \
+	  gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -D$$m $(CUDAPP_HEADER_FLAGS) -Isrc -o build/test_omega_gpu_wait_$$m tests/test_omega_gpu_wait.c $(CUDAPP_SOURCE)/src/omega_gpu_wait.c; \
 	  if ./build/test_omega_gpu_wait_$$m >build/test_omega_gpu_wait_$$m.log 2>&1; then echo "MUTANT SURVIVED: $$m"; exit 1; fi; \
 	  echo "$$m: killed ($$(grep -c 'FAIL' build/test_omega_gpu_wait_$$m.log) failing checks)"; \
 	done
diff --git a/mk/prime_race_gb10.mk b/mk/prime_race_gb10.mk
index 67634702a..53a8602a5 100644
--- a/mk/prime_race_gb10.mk
+++ b/mk/prime_race_gb10.mk
@@ -1,6 +1,6 @@
-# AIEN Prime Drag Race: native GB10 implementation (bench/prime_race/gb10_native.c) on Omega's
-# own Blackwell codegen + session (libomega_gpu.a, no CUDA). Picked up by `-include mk/*.mk`;
-# not part of `all` or `test`. Needs PHYSICS_DIR at the physics.lock commit (libomega_gpu).
+# AIEN Prime Drag Race: native GB10 implementation (bench/prime_race/gb10_native.c)
+# linked to the pinned canonical CUDA++ archive. No CUDA runtime; chip execution
+# remains separate from the host build and simulation checks.
 #
 # prime-race-gb10            build bench/prime_race/build/gb10_native (+ _mutant, the chip test's
 #                            negative control) and refuse them if nm finds a CUDA symbol
@@ -20,33 +20,33 @@ GB_OPT = -O3 -mcpu=native
 GB_SRC_COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo unknown)$(shell git status --porcelain -- src bench/prime_race mk 2>/dev/null | head -c1 | sed 's/.\+/+dirty/')
 GB_LABEL_STAMP = $(GB_BUILD)/.gb_source_label
 GB_DEFS = -DPR_SOURCE_COMMIT='"$(GB_SRC_COMMIT)"' -DPR_CC='"$(CC)"' \
-	-DPR_CFLAGS='"$(GB_OPT) -I$(GB_DIR) + omega CFLAGS; libomega_gpu.a built with omega CFLAGS"'
+	-DPR_CFLAGS='"$(GB_OPT) -I$(GB_DIR) + omega CFLAGS; pinned canonical libcudapp.a"'
 GB_DEPS = $(GB_DIR)/gb10_native.c $(GB_LABEL_STAMP) $(GB_DIR)/prime_race_impl.c $(GB_DIR)/prime_race_impl.h \
-	src/omega_gpu_elementwise_api.h src/omega_gpu_session.h $(OUT_DIR)/libomega_gpu.a
+	$(CUDAPP_SOURCE)/src/omega_gpu_elementwise_api.h $(CUDAPP_SOURCE)/src/omega_gpu_session.h $(CUDAPP_LIB)
 # Same pattern as tools/chip_run.sh REFUSAL:cuda
 GB_NM_CHECK = if nm -u $@ | grep -Eiq 'cuda|cuInit|cuLaunch|nvrtc|cublas'; then echo "CUDA symbols in $@"; rm -f $@; exit 1; fi
 
-$(GB_BUILD)/gb10_native: $(GB_DEPS)
+$(GB_BUILD)/gb10_native: $(GB_DEPS) | check-cudapp
 	@mkdir -p $(GB_BUILD)
-	$(CC) $(CFLAGS) $(GB_OPT) -I$(GB_DIR) $(GB_DEFS) -o $@ $(GB_DIR)/gb10_native.c $(GB_DIR)/prime_race_impl.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+	$(CC) $(CFLAGS) $(GB_OPT) -I$(GB_DIR) $(GB_DEFS) -o $@ $(GB_DIR)/gb10_native.c $(GB_DIR)/prime_race_impl.c -lpthread -lm $(CUDAPP_LIB)
 	@$(GB_NM_CHECK)
-$(GB_BUILD)/gb10_native_mutant: $(GB_DEPS)
+$(GB_BUILD)/gb10_native_mutant: $(GB_DEPS) | check-cudapp
 	@mkdir -p $(GB_BUILD)
-	$(CC) $(CFLAGS) $(GB_OPT) -I$(GB_DIR) $(GB_DEFS) -DPR_GB10_MUTANT=1 -o $@ $(GB_DIR)/gb10_native.c $(GB_DIR)/prime_race_impl.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+	$(CC) $(CFLAGS) $(GB_OPT) -I$(GB_DIR) $(GB_DEFS) -DPR_GB10_MUTANT=1 -o $@ $(GB_DIR)/gb10_native.c $(GB_DIR)/prime_race_impl.c -lpthread -lm $(CUDAPP_LIB)
 	@$(GB_NM_CHECK)
 prime-race-gb10: $(GB_BUILD)/gb10_native $(GB_BUILD)/gb10_native_mutant
 $(GB_LABEL_STAMP): PRIME_RACE_FORCE
 	@mkdir -p $(GB_BUILD)
 	@echo '$(GB_SRC_COMMIT)' > $@.tmp; cmp -s $@.tmp $@ && rm $@.tmp || mv $@.tmp $@
 
-$(GB_BUILD)/gb10_sieve_host_test: $(GB_DIR)/tests/gb10_sieve_host_test.c $(GB_DIR)/prime_race_impl.h src/omega_blackwell_codegen.h src/omega_gpu_elementwise_api.h tests/bw_warp_sim.h $(OUT_DIR)/libomega_gpu.a
+$(GB_BUILD)/gb10_sieve_host_test: $(GB_DIR)/tests/gb10_sieve_host_test.c $(GB_DIR)/prime_race_impl.h $(CUDAPP_SOURCE)/src/omega_blackwell_codegen.h $(CUDAPP_SOURCE)/src/omega_gpu_elementwise_api.h tests/bw_warp_sim.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(GB_BUILD)
-	$(CC) $(CFLAGS) -I$(GB_DIR) -Itests -o $@ $(GB_DIR)/tests/gb10_sieve_host_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+	$(CC) $(CFLAGS) -I$(GB_DIR) -Itests -o $@ $(GB_DIR)/tests/gb10_sieve_host_test.c -lpthread -lm $(CUDAPP_LIB)
 prime-race-gb10-host-test: $(GB_BUILD)/gb10_sieve_host_test
 	./$(GB_BUILD)/gb10_sieve_host_test
-$(GB_BUILD)/gb10_launch_cost: $(GB_DIR)/tests/gb10_launch_cost.c src/omega_blackwell_codegen.h src/omega_gpu_elementwise_api.h src/omega_gpu_session.h $(OUT_DIR)/libomega_gpu.a
+$(GB_BUILD)/gb10_launch_cost: $(GB_DIR)/tests/gb10_launch_cost.c $(CUDAPP_SOURCE)/src/omega_blackwell_codegen.h $(CUDAPP_SOURCE)/src/omega_gpu_elementwise_api.h $(CUDAPP_SOURCE)/src/omega_gpu_session.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(GB_BUILD)
-	$(CC) $(CFLAGS) $(GB_OPT) -o $@ $(GB_DIR)/tests/gb10_launch_cost.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm
+	$(CC) $(CFLAGS) $(GB_OPT) -o $@ $(GB_DIR)/tests/gb10_launch_cost.c -lpthread -lm $(CUDAPP_LIB)
 	@$(GB_NM_CHECK)
 prime-race-gb10-launch-cost: $(GB_BUILD)/gb10_launch_cost
 endif
diff --git a/mk/program-fp32.mk b/mk/program-fp32.mk
index 41dacb2e1..bc943bcfc 100644
--- a/mk/program-fp32.mk
+++ b/mk/program-fp32.mk
@@ -1,11 +1,10 @@
 # FP32 in the program IR (spec/program-fp32.md, E1 gap row 12). Physics-free, host-only.
 PROGRAM_FP32_TEST = $(OUT_DIR)/tests-realize/test_program_fp32
-PROGRAM_FP32_NUM = src/omega_numeric.c src/omega_numeric_provenance.c src/omega_numeric_divsqrt_gb10.c \
-                   src/omega_blackwell_codegen.c src/omega_blackwell_matmul.c
+PROGRAM_FP32_NUM = src/omega_numeric.c src/omega_numeric_provenance.c
 
-$(PROGRAM_FP32_TEST): tests/realize/test_program_fp32.c src/omega_program_fp32.c src/omega_program_fp32.h $(VISOR_CORE_OBJS) $(PROGRAM_FP32_NUM)
+$(PROGRAM_FP32_TEST): tests/realize/test_program_fp32.c src/omega_program_fp32.c src/omega_program_fp32.h $(VISOR_CORE_OBJS) $(PROGRAM_FP32_NUM) $(CUDAPP_LIB) | check-cudapp
 	mkdir -p $(dir $@)
-	$(CC) $(VISOR_CFLAGS) -ffp-contract=off -DOMEGA_NUMERIC_CPU_ONLY -o $@ tests/realize/test_program_fp32.c src/omega_program_fp32.c $(PROGRAM_FP32_NUM) $(VISOR_CORE_OBJS)
+	$(CC) $(VISOR_CFLAGS) $(CUDAPP_HEADER_FLAGS) -ffp-contract=off -DOMEGA_NUMERIC_CPU_ONLY -o $@ tests/realize/test_program_fp32.c src/omega_program_fp32.c $(PROGRAM_FP32_NUM) $(VISOR_CORE_OBJS) $(CUDAPP_LIB)
 
 .PHONY: test-program-fp32
 test-program-fp32: $(PROGRAM_FP32_TEST)
diff --git a/mk/program-id.mk b/mk/program-id.mk
index 1a28bbf6b..0526d4c5e 100644
--- a/mk/program-id.mk
+++ b/mk/program-id.mk
@@ -6,9 +6,9 @@ PROGRAM_ID_TEST = $(OUT_DIR)/tests-program/test_program_id
 PROGRAM_ID_BRIDGE_OBJS = $(addprefix $(OUT_DIR)/,$(addsuffix .o,omega_program_ir omega_vc_bridge omega_resolve omega_receipt omega_blake3 omega_vcstore))
 
 $(PROGRAM_ID_TEST): tests/program/test_program_id.c $(VISOR_CORE_OBJS) $(OUT_DIR)/omega_discovery.o \
-		$(VISOR_OBJS) $(LANG_OBJS) $(PROGRAM_ID_BRIDGE_OBJS)
+		$(VISOR_OBJS) $(LANG_OBJS) $(PROGRAM_ID_BRIDGE_OBJS) $(CUDAPP_LIB) | check-cudapp
 	mkdir -p $(dir $@)
-	$(CC) $(VISOR_CFLAGS) -o $@ $< $(VISOR_CORE_OBJS) $(OUT_DIR)/omega_discovery.o $(VISOR_OBJS) $(LANG_OBJS) $(PROGRAM_ID_BRIDGE_OBJS)
+	$(CC) $(VISOR_CFLAGS) -o $@ $< $(VISOR_CORE_OBJS) $(OUT_DIR)/omega_discovery.o $(VISOR_OBJS) $(LANG_OBJS) $(PROGRAM_ID_BRIDGE_OBJS) $(CUDAPP_LIB)
 
 .PHONY: test-program-id
 test-program-id: $(PROGRAM_ID_TEST)
diff --git a/mk/program-realize.mk b/mk/program-realize.mk
index 64a5dfeeb..c0e1eacc4 100644
--- a/mk/program-realize.mk
+++ b/mk/program-realize.mk
@@ -2,9 +2,9 @@
 # Visor core object set. Executes generated code natively: run on an AArch64 host.
 PROGRAM_REALIZE_TEST = $(OUT_DIR)/tests-realize/test_program_realize
 
-$(PROGRAM_REALIZE_TEST): tests/realize/test_program_realize.c $(VISOR_CORE_OBJS)
+$(PROGRAM_REALIZE_TEST): tests/realize/test_program_realize.c $(VISOR_CORE_OBJS) $(CUDAPP_LIB) | check-cudapp
 	mkdir -p $(dir $@)
-	$(CC) $(VISOR_CFLAGS) -o $@ $< $(VISOR_CORE_OBJS)
+	$(CC) $(VISOR_CFLAGS) -o $@ $< $(VISOR_CORE_OBJS) $(CUDAPP_LIB)
 
 .PHONY: test-program-realize
 test-program-realize: $(PROGRAM_REALIZE_TEST)
diff --git a/mk/reservoir.mk b/mk/reservoir.mk
index 5063f3dc8..8088f1090 100644
--- a/mk/reservoir.mk
+++ b/mk/reservoir.mk
@@ -24,13 +24,12 @@ ifndef RESERVOIR_MK
 RESERVOIR_MK := 1
 .PHONY: test-reservoir reservoir-purity qualify-reservoir
 RES_CFLAGS = -std=gnu11 -Wall -Wextra -Werror -O2 -Isrc -Isrc/reservoir -Itests/reservoir \
-	-ffp-contract=off -fno-fast-math -fno-math-errno -DOMEGA_NUMERIC_CPU_ONLY
+	-ffp-contract=off -fno-fast-math -fno-math-errno -DOMEGA_NUMERIC_CPU_ONLY $(CUDAPP_HEADER_FLAGS)
 RES_ASAN = -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all -DRES_QUICK
 RES_SRCS = src/reservoir/omega_reservoir.c src/reservoir/omega_reservoir_readout.c
 RES_HDRS = src/reservoir/omega_reservoir.h src/reservoir/omega_reservoir_readout.h src/omega_numeric.h src/sha256.h
-# omega_numeric.c pulls in the provenance and encoder objects at link time.
-RES_DEPS = src/omega_numeric.c src/omega_numeric_provenance.c src/omega_blackwell_encoder.c \
-	src/omega_blackwell_codegen.c src/omega_blackwell_matmul.c src/omega_blackwell_qmd.c src/omega_om_units.c
+# CPU numerics retain provenance and Omega units; GPU definitions are canonical.
+RES_DEPS = src/omega_numeric.c src/omega_numeric_provenance.c src/omega_om_units.c
 RES_TEST_SRCS = tests/reservoir/test_reservoir.c tests/reservoir/res_oracle64.c
 RES_TEST_HDRS = tests/reservoir/res_fixtures.h tests/reservoir/res_oracle64.h
 RES_DIR = $(OUT_DIR)/tests-reservoir
@@ -42,7 +41,7 @@ RES_TOOL_CFLAGS = $(RES_CFLAGS) -Itools/reservoir -pthread
 RES_MAT_SRCS = tools/reservoir/res_mat.c tools/reservoir/res_inflate.c src/omega_om_units.c
 RES_MAT_TEST = tests/reservoir/test_res_mat.c
 
-$(RES_DIR)/%.o: src/reservoir/%.c $(RES_HDRS)
+$(RES_DIR)/%.o: src/reservoir/%.c $(RES_HDRS) | check-cudapp
 	@mkdir -p $(RES_DIR)
 	$(CC) $(RES_CFLAGS) -pedantic -c -o $@ $<
 
@@ -51,20 +50,20 @@ reservoir-purity: $(RES_DIR)/omega_reservoir.o $(RES_DIR)/omega_reservoir_readou
 		echo "reservoir object references an allocator, libm or an I/O or process operation"; exit 1; fi
 	@echo "reservoir-purity: omega_reservoir.o and omega_reservoir_readout.o reference no forbidden symbol"
 
-$(RES_DIR)/test_reservoir: $(RES_TEST_SRCS) $(RES_SRCS) $(RES_DEPS) $(RES_HDRS) $(RES_TEST_HDRS)
+$(RES_DIR)/test_reservoir: $(RES_TEST_SRCS) $(RES_SRCS) $(RES_DEPS) $(RES_HDRS) $(RES_TEST_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(RES_DIR)
-	$(CC) $(RES_CFLAGS) -o $@ $(RES_TEST_SRCS) $(RES_SRCS) $(RES_DEPS) -lm
-$(RES_DIR)/test_reservoir_asan: $(RES_TEST_SRCS) $(RES_SRCS) $(RES_DEPS) $(RES_HDRS) $(RES_TEST_HDRS)
+	$(CC) $(RES_CFLAGS) -o $@ $(RES_TEST_SRCS) $(RES_SRCS) $(RES_DEPS) -lm $(CUDAPP_LIB)
+$(RES_DIR)/test_reservoir_asan: $(RES_TEST_SRCS) $(RES_SRCS) $(RES_DEPS) $(RES_HDRS) $(RES_TEST_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(RES_DIR)
-	$(CC) $(RES_CFLAGS) $(RES_ASAN) -o $@ $(RES_TEST_SRCS) $(RES_SRCS) $(RES_DEPS) -lm
+	$(CC) $(RES_CFLAGS) $(RES_ASAN) -o $@ $(RES_TEST_SRCS) $(RES_SRCS) $(RES_DEPS) -lm $(CUDAPP_LIB)
 
-$(RES_DIR)/res_qualify: $(RES_TOOL_SRCS) $(RES_TOOL_HDRS) $(RES_SRCS) $(RES_DEPS) $(RES_HDRS) $(RES_TEST_HDRS)
+$(RES_DIR)/res_qualify: $(RES_TOOL_SRCS) $(RES_TOOL_HDRS) $(RES_SRCS) $(RES_DEPS) $(RES_HDRS) $(RES_TEST_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(RES_DIR)
-	$(CC) $(RES_TOOL_CFLAGS) -DRES_BUILD_FLAGS='"$(strip $(RES_TOOL_CFLAGS))"' -o $@ $(RES_TOOL_SRCS) $(RES_SRCS) $(RES_DEPS) -lm
-$(RES_DIR)/test_res_mat: $(RES_MAT_TEST) $(RES_MAT_SRCS) $(RES_TOOL_HDRS) $(RES_TEST_HDRS)
+	$(CC) $(RES_TOOL_CFLAGS) -DRES_BUILD_FLAGS='"$(strip $(RES_TOOL_CFLAGS))"' -o $@ $(RES_TOOL_SRCS) $(RES_SRCS) $(RES_DEPS) -lm $(CUDAPP_LIB)
+$(RES_DIR)/test_res_mat: $(RES_MAT_TEST) $(RES_MAT_SRCS) $(RES_TOOL_HDRS) $(RES_TEST_HDRS) | check-cudapp
 	@mkdir -p $(RES_DIR)
 	$(CC) $(RES_TOOL_CFLAGS) -o $@ $(RES_MAT_TEST) $(RES_MAT_SRCS)
-$(RES_DIR)/test_res_mat_asan: $(RES_MAT_TEST) $(RES_MAT_SRCS) $(RES_TOOL_HDRS) $(RES_TEST_HDRS)
+$(RES_DIR)/test_res_mat_asan: $(RES_MAT_TEST) $(RES_MAT_SRCS) $(RES_TOOL_HDRS) $(RES_TEST_HDRS) | check-cudapp
 	@mkdir -p $(RES_DIR)
 	$(CC) $(RES_TOOL_CFLAGS) $(RES_ASAN) -o $@ $(RES_MAT_TEST) $(RES_MAT_SRCS)
 
diff --git a/mk/sm121dis.mk b/mk/sm121dis.mk
index d29fcba32..f7781c32d 100644
--- a/mk/sm121dis.mk
+++ b/mk/sm121dis.mk
@@ -7,12 +7,12 @@ SM121DIS = $(OUT_DIR)/sm121dis
 SM121DIS_RED = $(OUT_DIR)/sm121dis_red
 SM121DIS_K = $(OUT_DIR)/sm121dis-kernels
 
-$(SM121DIS): tools/sm121dis/sm121dis.c src/omega_sm121_disasm.c src/omega_sm121_disasm.h
+$(SM121DIS): tools/sm121dis/sm121dis.c $(CUDAPP_SOURCE)/src/omega_sm121_disasm.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(OUT_DIR)
-	$(CC) -std=gnu11 -Wall -Wextra -Werror -O2 -Isrc -o $@ tools/sm121dis/sm121dis.c src/omega_sm121_disasm.c
-$(SM121DIS_RED): tools/sm121dis/sm121dis.c src/omega_sm121_disasm.c src/omega_sm121_disasm.h
+	$(CC) -std=gnu11 -Wall -Wextra -Werror -O2 $(CUDAPP_HEADER_FLAGS) -Isrc -o $@ tools/sm121dis/sm121dis.c $(CUDAPP_LIB)
+$(SM121DIS_RED): tools/sm121dis/sm121dis.c $(CUDAPP_SOURCE)/src/omega_sm121_disasm.c $(CUDAPP_SOURCE)/src/omega_sm121_disasm.h | check-cudapp
 	@mkdir -p $(OUT_DIR)
-	$(CC) -std=gnu11 -Wall -Wextra -Werror -O2 -DSM121DIS_MUTANT=1 -Isrc -o $@ tools/sm121dis/sm121dis.c src/omega_sm121_disasm.c
+	$(CC) -std=gnu11 -Wall -Wextra -Werror -O2 -DSM121DIS_MUTANT=1 $(CUDAPP_HEADER_FLAGS) -Isrc -o $@ tools/sm121dis/sm121dis.c $(CUDAPP_SOURCE)/src/omega_sm121_disasm.c
 
 sm121dis-corpus-bins: $(addprefix $(OUT_DIR)/,gpu_matmul_api_test gpu_elementwise_test gpu_reconv_test gpu_attention_test \
 	gpu_moe_window_test gpu_fp8_api_test gpu_decode_attn_test gpu_router_test gpu_bf16_gemv_test gpu_tern_test gpu_fp8gemm_test \
@@ -35,9 +35,9 @@ test-sm121dis: $(SM121DIS) $(SM121DIS_RED) sm121dis-corpus-bins test-sm121dis-co
 # The provenance checks (tools/divsqrt_nvdisasm_check.sh, tools/ldst_nvdisasm_check.sh, test-numeric-reduce-nvdisasm)
 # call build/sm121dis by that name, whatever OUT_DIR is.
 ifneq ($(OUT_DIR),build)
-build/sm121dis: tools/sm121dis/sm121dis.c src/omega_sm121_disasm.c src/omega_sm121_disasm.h
+build/sm121dis: tools/sm121dis/sm121dis.c $(CUDAPP_SOURCE)/src/omega_sm121_disasm.h $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p build
-	$(CC) -std=gnu11 -Wall -Wextra -Werror -O2 -Isrc -o $@ tools/sm121dis/sm121dis.c src/omega_sm121_disasm.c
+	$(CC) -std=gnu11 -Wall -Wextra -Werror -O2 $(CUDAPP_HEADER_FLAGS) -Isrc -o $@ tools/sm121dis/sm121dis.c $(CUDAPP_LIB)
 endif
 
 # ZERO-NVDISASM (bar C6, second half: nothing calls nvdisasm). tools/sm121dis/zero_nvdisasm.sh runs every listing and
diff --git a/mk/tensor.mk b/mk/tensor.mk
index d257cc2a3..e66fbaa11 100644
--- a/mk/tensor.mk
+++ b/mk/tensor.mk
@@ -22,11 +22,10 @@ ifndef TENSOR_MK
 TENSOR_MK := 1
 .PHONY: test-tensor test-tensor-no-hooks test-tensor-mutations test-tensor-e1-reduce test-tensor-store
 TENSOR_CFLAGS = -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -ffp-contract=off -Isrc -Isrc/tensor \
-	-DOMEGA_NUMERIC_CPU_ONLY
+	-DOMEGA_NUMERIC_CPU_ONLY $(CUDAPP_HEADER_FLAGS)
 TENSOR_SRCS = src/tensor/omega_tensor.c src/tensor/omega_tensor_cpu.c src/tensor/omega_tensor_reduce_seam.c \
 	src/omega_numeric_reduce.c src/omega_numeric_transc.c
-TENSOR_DEPS = src/omega_numeric.c src/omega_numeric_provenance.c src/omega_blackwell_encoder.c \
-	src/omega_blackwell_codegen.c src/omega_blackwell_matmul.c src/omega_blackwell_qmd.c src/omega_om_units.c
+TENSOR_DEPS = src/omega_numeric.c src/omega_numeric_provenance.c src/omega_om_units.c
 TENSOR_HDRS = src/tensor/omega_tensor.h src/tensor/omega_tensor_reduce_seam.h src/omega_numeric_reduce.h src/omega_numeric.h src/sha256.h src/omega_numeric_transc.h
 # CR-5 tests are #included by tests/test_omega_tensor.c: rebuild when they change.
 TENSOR_HDRS += tests/tensor_reduce_multi_tests.inc
@@ -37,14 +36,14 @@ TENSOR_HOOK_SYMS = omega_tensor_test_set_storage_generation omega_tensor_store_t
 TENSOR_STORE_SRCS = src/tensor/omega_tensor_store.c
 TENSOR_STORE_HDRS = src/tensor/omega_tensor_store.h
 
-$(OUT_DIR)/test_omega_tensor: tests/test_omega_tensor.c $(TENSOR_SRCS) $(TENSOR_DEPS) $(TENSOR_HDRS)
+$(OUT_DIR)/test_omega_tensor: tests/test_omega_tensor.c $(TENSOR_SRCS) $(TENSOR_DEPS) $(TENSOR_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(OUT_DIR)
-	gcc $(TENSOR_CFLAGS) $(TENSOR_TEST_FLAGS) -O2 -o $@ tests/test_omega_tensor.c $(TENSOR_SRCS) $(TENSOR_DEPS)
+	gcc $(TENSOR_CFLAGS) $(TENSOR_TEST_FLAGS) -O2 -o $@ tests/test_omega_tensor.c $(TENSOR_SRCS) $(TENSOR_DEPS) $(CUDAPP_LIB)
 
-$(OUT_DIR)/test_omega_tensor_asan: tests/test_omega_tensor.c $(TENSOR_SRCS) $(TENSOR_DEPS) $(TENSOR_HDRS)
+$(OUT_DIR)/test_omega_tensor_asan: tests/test_omega_tensor.c $(TENSOR_SRCS) $(TENSOR_DEPS) $(TENSOR_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(OUT_DIR)
 	gcc $(TENSOR_CFLAGS) $(TENSOR_TEST_FLAGS) -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all \
-		-o $@ tests/test_omega_tensor.c $(TENSOR_SRCS) $(TENSOR_DEPS)
+		-o $@ tests/test_omega_tensor.c $(TENSOR_SRCS) $(TENSOR_DEPS) $(CUDAPP_LIB)
 
 test-tensor: $(OUT_DIR)/test_omega_tensor $(OUT_DIR)/test_omega_tensor_asan
 	./$(OUT_DIR)/test_omega_tensor
@@ -54,7 +53,7 @@ test-tensor: $(OUT_DIR)/test_omega_tensor $(OUT_DIR)/test_omega_tensor_asan
 # Default (library) build of the tensor sources: no OMEGA_TENSOR_TEST_HOOKS.
 # Fails if any test-only hook symbol is defined or referenced in the objects.
 test-tensor-no-hooks: src/tensor/omega_tensor.c src/tensor/omega_tensor_cpu.c src/tensor/omega_tensor_reduce_seam.c $(TENSOR_HDRS) \
-		$(TENSOR_STORE_SRCS) $(TENSOR_STORE_HDRS)
+		$(TENSOR_STORE_SRCS) $(TENSOR_STORE_HDRS) | check-cudapp
 	@mkdir -p $(OUT_DIR)/tensor-lib
 	gcc $(TENSOR_CFLAGS) -O2 -c -o $(OUT_DIR)/tensor-lib/omega_tensor.o src/tensor/omega_tensor.c
 	gcc $(TENSOR_CFLAGS) -O2 -c -o $(OUT_DIR)/tensor-lib/omega_tensor_cpu.o src/tensor/omega_tensor_cpu.c
@@ -69,7 +68,7 @@ test-tensor-no-hooks: src/tensor/omega_tensor.c src/tensor/omega_tensor_cpu.c sr
 			echo "test-tensor-no-hooks: FAIL ($$s present in default build)"; exit 1; fi; \
 	done; echo "test-tensor-no-hooks: PASS (test-only hook absent from default build)"
 
-test-tensor-mutations:
+test-tensor-mutations: | check-cudapp
 	tools/tensor_mutations.sh
 
 # Kept as an alias: the seam now always calls omega_reduce_cpu (E1 WP-D, #134 merged).
@@ -85,16 +84,16 @@ test-m20-receipt:
 # only under $TMPDIR (default /tmp). Its mutants run in test-tensor-mutations.
 
 $(OUT_DIR)/test_omega_tensor_store: tests/test_omega_tensor_store.c $(TENSOR_STORE_SRCS) $(TENSOR_SRCS) $(TENSOR_DEPS) \
-		$(TENSOR_HDRS) $(TENSOR_STORE_HDRS)
+		$(TENSOR_HDRS) $(TENSOR_STORE_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(OUT_DIR)
 	gcc $(TENSOR_CFLAGS) $(TENSOR_TEST_FLAGS) -O2 -o $@ tests/test_omega_tensor_store.c $(TENSOR_STORE_SRCS) \
-		$(TENSOR_SRCS) $(TENSOR_DEPS)
+		$(TENSOR_SRCS) $(TENSOR_DEPS) $(CUDAPP_LIB)
 
 $(OUT_DIR)/test_omega_tensor_store_asan: tests/test_omega_tensor_store.c $(TENSOR_STORE_SRCS) $(TENSOR_SRCS) \
-		$(TENSOR_DEPS) $(TENSOR_HDRS) $(TENSOR_STORE_HDRS)
+		$(TENSOR_DEPS) $(TENSOR_HDRS) $(TENSOR_STORE_HDRS) $(CUDAPP_LIB) | check-cudapp
 	@mkdir -p $(OUT_DIR)
 	gcc $(TENSOR_CFLAGS) $(TENSOR_TEST_FLAGS) -O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all \
-		-o $@ tests/test_omega_tensor_store.c $(TENSOR_STORE_SRCS) $(TENSOR_SRCS) $(TENSOR_DEPS)
+		-o $@ tests/test_omega_tensor_store.c $(TENSOR_STORE_SRCS) $(TENSOR_SRCS) $(TENSOR_DEPS) $(CUDAPP_LIB)
 
 test-tensor-store: $(OUT_DIR)/test_omega_tensor_store $(OUT_DIR)/test_omega_tensor_store_asan
 	./$(OUT_DIR)/test_omega_tensor_store
@@ -112,7 +111,7 @@ test-tensor-store: $(OUT_DIR)/test_omega_tensor_store $(OUT_DIR)/test_omega_tens
 #                        unless GB10_CHIP_RUN=1 is set, so it never runs by
 #                        accident. Never pass a quiet flag.
 .PHONY: test-tensor-gb10-host test-tensor-gb10-chip
-test-tensor-gb10-host:
+test-tensor-gb10-host: | check-cudapp
 	@test -n "$(PHYSICS_DIR)" && test -d "$(PHYSICS_DIR)" \
 		|| { echo "test-tensor-gb10-host: set PHYSICS_DIR to the physics checkout"; exit 2; }
 	tools/tensor_mutations.sh --gb10 "$(PHYSICS_DIR)"
diff --git a/mk/visor-authority.mk b/mk/visor-authority.mk
index 946e6cdb0..dec0c45bd 100644
--- a/mk/visor-authority.mk
+++ b/mk/visor-authority.mk
@@ -30,10 +30,10 @@ $(OUT_DIR)/tests-visor-authority:
 $(VISOR_AUTH_TEST): tests/visor/test_visor_authority.c $(VISOR_AUTH_RX_SRCS) \
 		$(OUT_DIR)/visor/visor_effect_request.o $(VISOR_CORE_OBJS) src/visor/visor_effect_request.h \
 		src/runtime/rx_aegis.h src/runtime/rx_caproot.h src/runtime/rx_world.h \
-		src/runtime/rx_generation.h $(VISOR_AUTH_CAP_LIB) | $(OUT_DIR)/tests-visor-authority
+		src/runtime/rx_generation.h $(VISOR_AUTH_CAP_LIB) $(CUDAPP_LIB) | $(OUT_DIR)/tests-visor-authority check-cudapp
 	@test -f "$(VISOR_AUTH_CAP_LIB)" || { echo "error: VISOR_AUTH_CAP_LIB=$(VISOR_AUTH_CAP_LIB) not found (needed by rx_aegis.c); pass VISOR_AUTH_CAP_LIB=<path to libaienos_capability.a>" >&2; exit 1; }
 	$(CC) $(CFLAGS) -Isrc/visor -pthread -o $@ tests/visor/test_visor_authority.c $(VISOR_AUTH_RX_SRCS) \
-		$(OUT_DIR)/visor/visor_effect_request.o $(VISOR_CORE_OBJS) $(VISOR_AUTH_CAP_LIB) -lm
+		$(OUT_DIR)/visor/visor_effect_request.o $(VISOR_CORE_OBJS) $(VISOR_AUTH_CAP_LIB) $(CUDAPP_LIB) -lm
 
 .PHONY: test-visor-authority visor-authority-check
 test-visor-authority: $(VISOR_AUTH_TEST)
diff --git a/mk/visor-console.mk b/mk/visor-console.mk
index d849520e7..f7dd59c2c 100644
--- a/mk/visor-console.mk
+++ b/mk/visor-console.mk
@@ -11,8 +11,8 @@ VISOR_CONSOLE_OBJS = $(OUT_DIR)/visor/visor.o $(OUT_DIR)/visor/visor_console.o $
 $(OUT_DIR)/lane2:
 	mkdir -p $@
 
-$(OUT_DIR)/lane2/test_visor_console: tests/visor/test_visor_console.c $(VISOR_CORE_OBJS) $(VISOR_CONSOLE_OBJS) | $(OUT_DIR)/lane2
-	$(CC) $(VISOR_CFLAGS) -DVISOR_CONSOLE_LANE_ONLY -Itests/visor -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_CONSOLE_OBJS)
+$(OUT_DIR)/lane2/test_visor_console: tests/visor/test_visor_console.c $(VISOR_CORE_OBJS) $(VISOR_CONSOLE_OBJS) $(CUDAPP_LIB) | $(OUT_DIR)/lane2 check-cudapp
+	$(CC) $(VISOR_CFLAGS) -DVISOR_CONSOLE_LANE_ONLY -Itests/visor -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_CONSOLE_OBJS) $(CUDAPP_LIB)
 
 # The full test #includes tools/omega.c (with OMEGA_TOOL_NO_MAIN) for the wiring.
 $(OUT_DIR)/tests-visor/test_visor_console: tools/omega.c
diff --git a/mk/visor-machine.mk b/mk/visor-machine.mk
index 6299c02b4..30c3d99db 100644
--- a/mk/visor-machine.mk
+++ b/mk/visor-machine.mk
@@ -1,16 +1,14 @@
 # Omega Visor V1 lane 5 (machine + realization lab) test targets.
-# The Blackwell realize objects compile and link physics-free (only sha256 +
-# omega_core deps). visor_machine.c references omega_blackwell_get_machine_id
-# WEAKLY, so build/omega links with or without them; these lane tests link
-# them explicitly so the declared Blackwell target shows linked=yes.
-VISOR_BW_CORE = omega_vector omega_blackwell_qmd omega_blackwell_encoder omega_blackwell_realize
-VISOR_BW_OBJS = $(addprefix $(OUT_DIR)/,$(addsuffix .o,$(filter-out $(VISOR_CORE),$(VISOR_BW_CORE))))
+# The Blackwell realization implementation comes from the canonical archive.
+# Its identity is a weak reference in visor_machine.c, so explicitly retain that
+# member for these tests, matching their former explicit local-object linkage.
+VISOR_BW_LINK = -Wl,--undefined=omega_blackwell_get_machine_id
 
-$(OUT_DIR)/tests-visor/test_visor_machine: tests/visor/test_visor_machine.c $(VISOR_CORE_OBJS) $(VISOR_BW_OBJS) $(VISOR_OBJS) $(LANG_OBJS) | $(OUT_DIR)/tests-visor
-	$(CC) $(VISOR_CFLAGS) -Itests/visor -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_BW_OBJS) $(VISOR_OBJS) $(LANG_OBJS)
+$(OUT_DIR)/tests-visor/test_visor_machine: tests/visor/test_visor_machine.c $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(CUDAPP_LIB) | $(OUT_DIR)/tests-visor check-cudapp
+	$(CC) $(VISOR_CFLAGS) -Itests/visor -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(VISOR_BW_LINK) $(CUDAPP_LIB)
 
-$(OUT_DIR)/tests-visor/test_visor_realization: tests/visor/test_visor_realization.c $(VISOR_CORE_OBJS) $(VISOR_BW_OBJS) $(VISOR_OBJS) $(LANG_OBJS) | $(OUT_DIR)/tests-visor
-	$(CC) $(VISOR_CFLAGS) -Itests/visor -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_BW_OBJS) $(VISOR_OBJS) $(LANG_OBJS)
+$(OUT_DIR)/tests-visor/test_visor_realization: tests/visor/test_visor_realization.c $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(CUDAPP_LIB) | $(OUT_DIR)/tests-visor check-cudapp
+	$(CC) $(VISOR_CFLAGS) -Itests/visor -o $@ $< $(VISOR_CORE_OBJS) $(VISOR_OBJS) $(LANG_OBJS) $(VISOR_BW_LINK) $(CUDAPP_LIB)
 
 .PHONY: test-visor-machine test-visor-realization
 test-visor-machine: $(OUT_DIR)/tests-visor/test_visor_machine
diff --git a/om/consumer.om b/om/consumer.om
new file mode 100644
index 000000000..81aa38aec
--- /dev/null
+++ b/om/consumer.om
@@ -0,0 +1,50 @@
+note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+note Existing one-line CUDApp commit lock followed by observed source revision.
+global data uchar 83
+fn main to int
+n = ulong 0
+while lt n 83
+r = read 0 data n sub ulong 83 n
+if lt r 0
+ret 3
+end
+if eq r 0
+break
+end
+n = add n ulong r
+end
+if ne n 82
+ret 3
+end
+if ne get data 40 10
+ret 3
+end
+if ne get data 81 10
+ret 3
+end
+nonzero = false
+for i ulong 40
+c = get data i
+if lt c 48
+ret 3
+end
+if gt c 57
+if lt c 97
+ret 3
+end
+if gt c 102
+ret 3
+end
+end
+if ne c 48
+nonzero = true
+end
+if ne c get data add i 41
+ret 3
+end
+end
+if not nonzero
+ret 3
+end
+ret 0
+end
diff --git a/om/consumer_receipt.om b/om/consumer_receipt.om
new file mode 100644
index 000000000..5b74e905a
--- /dev/null
+++ b/om/consumer_receipt.om
@@ -0,0 +1,121 @@
+om2
+note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+note Receipt serialization only, never admission or qualification authority.
+text JHead "{\"source\":\"git-object\",\"cudapp_pin\":\""
+text JSrc "\",\"source_archive_sha256\":\""
+text JGuard "\",\"guard_sha256\":\""
+text JLib "\",\"library_sha256\":\""
+text JPath "\",\"source_path\":\""
+text JEnd "\"}\n"
+text JHex "0123456789abcdef"
+fn jr_copy dst edit uchar 16384 pos ulong src view uchar * n ulong to ulong
+if gt add pos n len dst
+exit 3
+end
+for i ulong n
+put dst add pos i get src i
+end
+ret add pos n
+end
+fn jr_hex b view uchar 8192 start ulong n ulong to void
+for i ulong n
+c = get b add start i
+if not or and ge c 48 le c 57 and ge c 97 le c 102
+exit 3
+end
+end
+end
+fn main to int
+b = new uchar 8192 0
+dst = new uchar 16384 0
+used = ulong 0
+while lt used len b bound 8192
+r = read 0 b used sub len b used
+if eq r 0
+break
+end
+if eq r -4
+continue
+end
+if lt r 0
+ret 3
+end
+used = add used ulong r
+end
+if or lt used 238 ge used len b
+ret 3
+end
+if or ne get b 40 10 or ne get b 105 10 or ne get b 170 10 ne get b 235 10
+ret 3
+end
+if ne get b sub used 1 10
+ret 3
+end
+jr_hex b 0 40
+jr_hex b 41 64
+jr_hex b 106 64
+jr_hex b 171 64
+pos = jr_copy dst 0 JHead len JHead
+for i ulong 40
+put dst pos get b i
+pos = add pos 1
+end
+pos = jr_copy dst pos JSrc len JSrc
+for i ulong 64
+put dst pos get b add 41 i
+pos = add pos 1
+end
+pos = jr_copy dst pos JGuard len JGuard
+for i ulong 64
+put dst pos get b add 106 i
+pos = add pos 1
+end
+pos = jr_copy dst pos JLib len JLib
+for i ulong 64
+put dst pos get b add 171 i
+pos = add pos 1
+end
+pos = jr_copy dst pos JPath len JPath
+for i ulong sub used 237
+if gt add pos 6 len dst
+ret 3
+end
+c = get b add 236 i
+if eq c 0
+ret 3
+end
+if or eq c 34 eq c 92
+put dst pos 92
+pos = add pos 1
+else
+if lt c 32
+put dst pos 92
+put dst add pos 1 117
+put dst add pos 2 48
+put dst add pos 3 48
+put dst add pos 4 get JHex shr c 4
+put dst add pos 5 get JHex and c 15
+pos = add pos 6
+continue
+end
+end
+put dst pos c
+pos = add pos 1
+end
+pos = jr_copy dst pos JEnd len JEnd
+sent = ulong 0
+while lt sent pos bound 16384
+r = write 1 dst sent sub pos sent
+if eq r -4
+continue
+end
+if le r 0
+ret 3
+end
+sent = add sent ulong r
+end
+if ne sent pos
+ret 3
+end
+ret 0
+end
diff --git a/src/.crumb b/src/.crumb
index 02231d7a7..f2c0ddf32 100644
--- a/src/.crumb
+++ b/src/.crumb
@@ -62,140 +62,140 @@
       "children": [
         {
           "digest": "728ab6985dea994eb78a7eb2521384a911492d1c36819c17970a5dc3a8a0c5e2",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "algebra",
           "purpose": "Directory src/algebra. Purpose not yet described by a human."
         },
         {
           "digest": "1881ed1d139a405a777d24d4b26f97bc8405dee0552d6ce21841ce4833560ce2",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "ans",
           "purpose": "ANS (Alignment Navigation System), Inertial Alignment v1: frozen reference atoms, drift filter o"
         },
         {
           "digest": "92c3e2481f7457afd6c7717e6c1a75ebab950ec9114b48025dd137a6edb2975c",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "autodiff",
           "purpose": "M21 OMEGA_AUTODIFF: reverse-mode tape over M20 tensor CPU ops, caller-owned nodes and scratch, p"
         },
         {
           "digest": "3bd51397fcd28cd54db65c1df72c320883798bc8550779b2b79c8498b28ffb0d",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "compiler",
           "purpose": "Directory src/compiler. Purpose not yet described by a human."
         },
         {
           "digest": "36a66980895553ae73884798bc09a92141e1aeba5e5068a7d9d62a99bad02548",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "crumbline",
           "purpose": "Directory src/crumbline. Purpose not yet described by a human."
         },
         {
           "digest": "c75df77ddb2bae35ac5e1225a0ae9dcef77b24608775c7b8d02dce1af0ec3ca4",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "dual_experiment",
           "purpose": "DUAL applicability experiment library (ARCH-0031 offline evidence lane): deterministic discrete "
         },
         {
           "digest": "8856d5162c55cb33997201cd580638f80ea933b46e11c61e1913185d419731d7",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "estimation",
           "purpose": "Directory src/estimation. Purpose not yet described by a human."
         },
         {
           "digest": "391e337c60cb8b2ae549595394482c23717c1757d83747a7446e81cd780750c1",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "fabric",
           "purpose": "Directory src/fabric. Purpose not yet described by a human."
         },
         {
           "digest": "2d33eb528dafb5954bb027cdd9a7c7923594c177f17181194311155b4e1f40b3",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "language",
           "purpose": "Directory src/language. Purpose not yet described by a human."
         },
         {
           "digest": "cd0551dbfb6fc354741efe9a3ad1808ffaaf6a8d7e9e7345851333d7a721cee0",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "osh",
           "purpose": "osh (Omega-native shell, arch#158) lexer unit: layout list, generator, osh_lex.osc, C reference "
         },
         {
           "digest": "2b5dd2c64d4bbba8c41471dc1af5a0b00bfc1361a2c680d78b99fb30b5b547fe",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "path",
           "purpose": "Directory src/path. Purpose not yet described by a human."
         },
         {
           "digest": "e0b91129cc9c188fc0e47b7f3189a3a9a09f9c55eecd018786794571ffc39aad",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "physics0",
           "purpose": "PD-0 hidden-equation benchmark (Physics-0 Discovery Engine cut 1): world, oracle, scorer, ladder"
         },
         {
           "digest": "8b923fb5dc1de3b04afae043a4770f7b1fb27d959a8f597191ae2556d822a1cf",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "polyglot",
           "purpose": "Directory src/polyglot. Purpose not yet described by a human."
         },
         {
           "digest": "076f486fdf51e12a26160e7f0bf7686fea611db54216f7fef81367620e7a6bdb",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "reservoir",
           "purpose": "Ionic-droplet reservoir simulator (omega#440): binary32 fixed-step RK4 of the authors' droplet m"
         },
         {
           "digest": "1e400d9b84494347892448fd576be7bf596ef810ed6e88bcd70f7e7d9a6b5746",
-          "last_commit": "97a960f5c",
+          "last_commit": "97a960f5",
           "name": "runtime",
           "purpose": "Directory src/runtime. Purpose not yet described by a human."
         },
         {
           "digest": "71502e9ef65e0620b94ea156cef5034e4c97d703d5ea13c489e4b65713014f84",
-          "last_commit": "97a960f5c",
+          "last_commit": "97a960f5",
           "name": "searchtrace",
           "purpose": "Directory src/searchtrace. Purpose not yet described by a human."
         },
         {
           "digest": "b82288db7e732d10f954e921ac98c60e19579a3e58118cc12c49230587929ea2",
-          "last_commit": "ed8de5736",
+          "last_commit": "ed8de573",
           "name": "synapse",
           "purpose": "Synapse ADR 0003 J1 binary codec port: layout list, generator, syn_codec.osc (A1 WAL records + c"
         },
         {
           "digest": "9723dd7c18d4e2c22db631680974e1025bccb9c309619424e2f4dfcc43cc7068",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "tensor",
           "purpose": "M20 OMEGA_TENSOR: immutable tensor semantic layer, views, generation-checked storage, CPU realiz"
         },
         {
           "digest": "06d9fb18dddf7ab0f8ad02fffd15ce8b80808c77d0904609b6baae83c2b05ce5",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "train",
           "purpose": "Directory src/train. Purpose not yet described by a human."
         },
         {
           "digest": "812a7faed07b21e066b732ed596eb0aea609379a2b2af0e8b61dd1ea05bef602",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "turing",
           "purpose": "Directory src/turing. Purpose not yet described by a human."
         },
         {
           "digest": "b2e34b2ea0392059ac30d17e27289b1146e523db60a02ef825edef96036817ab",
-          "last_commit": "d863780eb",
+          "last_commit": "d863780e",
           "name": "visor",
           "purpose": "Directory src/visor. Purpose not yet described by a human."
         }
       ],
       "children_root": "sha256:2f729945214be989a74d7c2064ae4ba3c2deb52ebea3f334b459198a7bd032ed",
-      "compiled_at": "2026-10-28T09:49:40Z",
+      "compiled_at": "2026-10-28T17:51:16Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:36bd5a00a116cad009672752dcac449a48515f0ef74e759d1710492967158315",
+      "digest": "sha256:356bac6620b52492f1e1c8464ce092e11845d12ff857857cf32ad4009228d2c9",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "files": 568,
-      "generated_at_commit": "56dfcbd9b284a88618983e3eac7512630ad70b3e",
-      "source_tree": "sha256:71e9997b13e6e2ba75a76864788474ba76a313e86bab6ba8b74a7f82ea411499"
+      "files": 445,
+      "generated_at_commit": "841001e42fdc87b9d627334add9288f8748a578d",
+      "source_tree": "sha256:3ef8500f74e76a7ffe380b0d5be357be8a7ce0b5fa2f4e233805dad2055c6a12"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/src/omega_blackwell_codegen.c b/src/omega_blackwell_codegen.c
deleted file mode 100644
index debdea0ea..000000000
--- a/src/omega_blackwell_codegen.c
+++ /dev/null
@@ -1,2598 +0,0 @@
-/* SPDX-License-Identifier: Apache-2.0
- * Copyright 2026 Drake Stapleton (AIEN / aien-dev)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "omega_blackwell_codegen.h"
-#include "omega_blackwell_submit.h"
-#include "sha256.h"
-#include <string.h>
-/* native v1 P07 cut A.2 (aienos#286, docs/numeric/OMEGA_GPU_NATIVE_BOUNDARY.md): with OMEGA_GPU_NO_POSIX this file
- * builds -ffreestanding. Code generation then runs only through the allocation-free entry points
- * (omega_blackwell_kernel_encode_into: the caller supplies the code buffer and its capacity); the allocating
- * generators, their diagnostics and the printing variation self-test exist only in the hosted build. */
-#ifndef OMEGA_GPU_NO_POSIX
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#define BW_DIAG(...) fprintf(stderr, __VA_ARGS__)
-#else
-#define BW_DIAG(...) ((void)0)
-#endif
-
-void omega_bw_ir_init(BlackwellIRProgram *prog) {
-    if (!prog) return;
-    memset(prog, 0, sizeof(*prog));
-}
-
-int omega_bw_ir_alloc_vreg(BlackwellIRProgram *prog) {
-    if (!prog || prog->regalloc.num_vregs >= BW_MAX_VREGS) return -1;
-    int v = prog->regalloc.num_vregs++;
-    prog->regalloc.intervals[v].vreg = v;
-    prog->regalloc.intervals[v].first_def = -1;
-    prog->regalloc.intervals[v].last_use = -1;
-    prog->regalloc.intervals[v].phys_reg = -1;
-    prog->regalloc.intervals[v].bundle_size = 1;
-    prog->regalloc.intervals[v].is_pair = false;
-    prog->regalloc.intervals[v].is_quad = false;
-    prog->regalloc.intervals[v].active = false;
-    prog->regalloc.vreg_to_phys[v] = -1;
-    return v;
-}
-
-int omega_bw_ir_alloc_vreg64(BlackwellIRProgram *prog) {
-    if (!prog || prog->regalloc.num_vregs >= BW_MAX_VREGS) return -1;
-    int v = prog->regalloc.num_vregs++;
-    prog->regalloc.intervals[v].vreg = v;
-    prog->regalloc.intervals[v].first_def = -1;
-    prog->regalloc.intervals[v].last_use = -1;
-    prog->regalloc.intervals[v].phys_reg = -1;
-    prog->regalloc.intervals[v].bundle_size = 2;
-    prog->regalloc.intervals[v].is_pair = true;
-    prog->regalloc.intervals[v].is_quad = false;
-    prog->regalloc.intervals[v].active = false;
-    prog->regalloc.vreg_to_phys[v] = -1;
-    return v;
-}
-
-int omega_bw_ir_alloc_vreg128(BlackwellIRProgram *prog) {
-    if (!prog || prog->regalloc.num_vregs >= BW_MAX_VREGS) return -1;
-    int v = prog->regalloc.num_vregs++;
-    prog->regalloc.intervals[v].vreg = v;
-    prog->regalloc.intervals[v].first_def = -1;
-    prog->regalloc.intervals[v].last_use = -1;
-    prog->regalloc.intervals[v].phys_reg = -1;
-    prog->regalloc.intervals[v].bundle_size = 4;
-    prog->regalloc.intervals[v].is_pair = false;
-    prog->regalloc.intervals[v].is_quad = true;
-    prog->regalloc.intervals[v].active = false;
-    prog->regalloc.vreg_to_phys[v] = -1;
-    return v;
-}
-
-int omega_bw_ir_alloc_uvreg(BlackwellIRProgram *prog) {
-    if (!prog || prog->regalloc.num_uvregs >= BW_MAX_UVREGS) return -1;
-    int uv = prog->regalloc.num_uvregs++;
-    prog->regalloc.uintervals[uv].vreg = uv;
-    prog->regalloc.uintervals[uv].first_def = -1;
-    prog->regalloc.uintervals[uv].last_use = -1;
-    prog->regalloc.uintervals[uv].phys_reg = -1;
-    prog->regalloc.uintervals[uv].is_pair = false;
-    prog->regalloc.uintervals[uv].active = false;
-    prog->regalloc.uvreg_to_phys[uv] = -1;
-    return uv;
-}
-
-int omega_bw_ir_alloc_uvreg64(BlackwellIRProgram *prog) {
-    if (!prog || prog->regalloc.num_uvregs >= BW_MAX_UVREGS) return -1;
-    int uv = prog->regalloc.num_uvregs++;
-    prog->regalloc.uintervals[uv].vreg = uv;
-    prog->regalloc.uintervals[uv].first_def = -1;
-    prog->regalloc.uintervals[uv].last_use = -1;
-    prog->regalloc.uintervals[uv].phys_reg = -1;
-    prog->regalloc.uintervals[uv].is_pair = true;
-    prog->regalloc.uintervals[uv].active = false;
-    prog->regalloc.uvreg_to_phys[uv] = -1;
-    return uv;
-}
-
-int omega_bw_ir_append(BlackwellIRProgram *prog, const BlackwellIRInsn *insn) {
-    if (!prog || !insn || prog->count >= BW_MAX_IR_INSNS) return -1;
-    int idx = (int)prog->count++;
-    prog->insns[idx] = *insn;
-
-    /* Update live-interval def/use tracking */
-    if (insn->dst_vreg >= 0 && insn->dst_vreg < prog->regalloc.num_vregs) {
-        if (!insn->is_uniform) {
-            OmegaLiveInterval *iv = &prog->regalloc.intervals[insn->dst_vreg];
-            if (iv->first_def < 0) iv->first_def = idx;
-            if (idx > iv->last_use) iv->last_use = idx;
-        }
-    }
-    if (insn->src1_vreg >= 0 && insn->src1_vreg < prog->regalloc.num_vregs) {
-        OmegaLiveInterval *iv = &prog->regalloc.intervals[insn->src1_vreg];
-        if (iv->first_def < 0) iv->first_def = idx;
-        if (idx > iv->last_use) iv->last_use = idx;
-    }
-    if (insn->src2_vreg >= 0 && insn->src2_vreg < prog->regalloc.num_vregs) {
-        OmegaLiveInterval *iv = &prog->regalloc.intervals[insn->src2_vreg];
-        if (iv->first_def < 0) iv->first_def = idx;
-        if (idx > iv->last_use) iv->last_use = idx;
-    }
-    if (insn->src3_vreg >= 0 && insn->src3_vreg < prog->regalloc.num_vregs) {
-        OmegaLiveInterval *iv = &prog->regalloc.intervals[insn->src3_vreg];
-        if (iv->first_def < 0) iv->first_def = idx;
-        if (idx > iv->last_use) iv->last_use = idx;
-    }
-
-    /* Uniform register def/use tracking */
-    if (insn->is_uniform && insn->dst_vreg >= 0 && insn->dst_vreg < prog->regalloc.num_uvregs) {
-        OmegaLiveInterval *uiv = &prog->regalloc.uintervals[insn->dst_vreg];
-        if (uiv->first_def < 0) uiv->first_def = idx;
-        if (idx > uiv->last_use) uiv->last_use = idx;
-    }
-    if (insn->ureg >= 0 && insn->ureg < prog->regalloc.num_uvregs) {
-        OmegaLiveInterval *uiv = &prog->regalloc.uintervals[insn->ureg];
-        if (uiv->first_def < 0) uiv->first_def = idx;
-        if (idx > uiv->last_use) uiv->last_use = idx;
-    }
-
-    return idx;
-}
-
-int omega_bw_regalloc_solve(BlackwellIRProgram *prog) {
-    if (!prog) return -1;
-    OmegaRegAlloc *ra = &prog->regalloc;
-
-    /*
-     * Bounded deterministic linear-scan register allocator.
-     * Computes genuine live intervals across virtual registers and assigns
-     * available physical GPRs (R2..R127, or up to the program's opt-in gpr_limit) and UGPRs (UR4..UR31).
-     * Enforces even-alignment and dual-register reservation for 64-bit pairs.
-     */
-    const int gpr_lim = ra->gpr_limit ? (int)ra->gpr_limit : BW_PHYS_GPR_MAX;
-    bool gpr_busy[BW_PHYS_GPR_HW_LIMIT];
-    memset(gpr_busy, 0, sizeof(gpr_busy));
-
-    int max_phys_used = BW_PHYS_GPR_START;
-
-    /* Sort virtual register indices chronologically by first_def (Poletto & Sarkar Linear Scan) */
-    int order[BW_MAX_VREGS];
-    int count = 0;
-    for (int v = 0; v < ra->num_vregs; v++) {
-        if (ra->intervals[v].first_def >= 0) {
-            order[count++] = v;
-        } else {
-            ra->intervals[v].phys_reg = BW_PHYS_GPR_START;
-            ra->vreg_to_phys[v] = ra->intervals[v].phys_reg;
-        }
-    }
-    for (int i = 0; i < count - 1; i++) {
-        for (int j = i + 1; j < count; j++) {
-            if (ra->intervals[order[i]].first_def > ra->intervals[order[j]].first_def) {
-                int tmp = order[i];
-                order[i] = order[j];
-                order[j] = tmp;
-            }
-        }
-    }
-
-    for (int idx = 0; idx < count; idx++) {
-        int v = order[idx];
-        OmegaLiveInterval *iv = &ra->intervals[v];
-
-        /* Free physical registers whose virtual live intervals have ended */
-        for (int p = 0; p < ra->num_vregs; p++) {
-            if (ra->intervals[p].active && ra->intervals[p].last_use < iv->first_def) {
-                int freed = ra->intervals[p].phys_reg;
-                if (freed >= 0 && freed < gpr_lim) {
-                    uint32_t bsize = ra->intervals[p].bundle_size ? ra->intervals[p].bundle_size : (ra->intervals[p].is_pair ? 2 : (ra->intervals[p].is_quad ? 4 : 1));
-                    for (uint32_t k = 0; k < bsize && (freed + (int)k) < gpr_lim; k++) {
-                        gpr_busy[freed + k] = false;
-                    }
-                }
-                ra->intervals[p].active = false;
-            }
-        }
-
-        /* Find lowest available physical register */
-        int assigned = -1;
-        uint32_t bsize = iv->bundle_size ? iv->bundle_size : (iv->is_pair ? 2 : (iv->is_quad ? 4 : 1));
-        if (bsize == 4) {
-            /* 128-bit quad requires 4-alignment and 4 contiguous free registers */
-            int start = (BW_PHYS_GPR_START + 3) & ~3;
-            for (int p = start; p <= gpr_lim - 4; p += 4) {
-                if (!gpr_busy[p] && !gpr_busy[p + 1] && !gpr_busy[p + 2] && !gpr_busy[p + 3]) {
-                    assigned = p;
-                    for (int k = 0; k < 4; k++) gpr_busy[p + k] = true;
-                    break;
-                }
-            }
-        } else if (bsize == 2) {
-            /* 64-bit pair requires even alignment and contiguous free registers */
-            int start = (BW_PHYS_GPR_START + 1) & ~1;
-            for (int p = start; p <= gpr_lim - 2; p += 2) {
-                if (!gpr_busy[p] && !gpr_busy[p + 1]) {
-                    assigned = p;
-                    gpr_busy[p] = true;
-                    gpr_busy[p + 1] = true;
-                    break;
-                }
-            }
-        } else {
-            for (int p = BW_PHYS_GPR_START; p < gpr_lim; p++) {
-                if (!gpr_busy[p]) {
-                    assigned = p;
-                    gpr_busy[p] = true;
-                    break;
-                }
-            }
-        }
-
-        if (assigned < 0) {
-            /* Hardware register capacity exceeded: fail closed loudly */
-            return -1;
-        }
-
-        iv->phys_reg = assigned;
-        iv->active = true;
-        ra->vreg_to_phys[v] = assigned;
-
-        int top = assigned + (int)bsize - 1;
-        if (top > max_phys_used) {
-            max_phys_used = top;
-        }
-    }
-    ra->peak_gpr_usage = (uint32_t)(max_phys_used + 1);
-
-    /* Allocate uniform registers */
-    int cur_u = BW_PHYS_UGPR_START;
-    for (int uv = 0; uv < ra->num_uvregs; uv++) {
-        OmegaLiveInterval *uiv = &ra->uintervals[uv];
-        if (uiv->is_pair) {
-            if (cur_u % 2 != 0) cur_u++;
-            if (cur_u + 1 >= BW_PHYS_UGPR_MAX) return -1;
-            uiv->phys_reg = cur_u;
-            ra->uvreg_to_phys[uv] = cur_u;
-            cur_u += 2;
-        } else {
-            if (cur_u >= BW_PHYS_UGPR_MAX) return -1;
-            uiv->phys_reg = cur_u;
-            ra->uvreg_to_phys[uv] = cur_u++;
-        }
-    }
-    ra->peak_ugpr_usage = (uint32_t)cur_u;
-
-    return 0;
-}
-
-static int encode_single_insn(const BlackwellIRInsn *insn, const OmegaRegAlloc *ra, uint32_t w[4]) {
-    memset(w, 0, 16);
-
-    int dst = (insn->dst_vreg >= 0) ? (ra->vreg_to_phys[insn->dst_vreg] + insn->dst_subreg) : 0;
-    int src1 = (insn->src1_vreg >= 0) ? (ra->vreg_to_phys[insn->src1_vreg] + insn->src1_subreg) : 0;
-    int src2 = (insn->src2_vreg >= 0) ? (ra->vreg_to_phys[insn->src2_vreg] + insn->src2_subreg) : 0;
-    int src3 = (insn->src3_vreg >= 0) ? (ra->vreg_to_phys[insn->src3_vreg] + insn->src3_subreg) : 0xff; /* Default to RZ (0xff) */
-    int ureg = (insn->ureg >= 0) ? ra->uvreg_to_phys[insn->ureg] : 0;
-
-    if (insn->is_uniform && insn->dst_vreg >= 0) {
-        dst = ra->uvreg_to_phys[insn->dst_vreg];
-    }
-
-    switch (insn->op) {
-        case BW_IR_NOP:
-            w[0] = 0x00007918;
-            w[1] = 0x00000000;
-            w[2] = 0x00000000;
-            w[3] = insn->control ? insn->control : 0x000fc000; /* control: a timed pause (fragment matmul) */
-            break;
-
-        case BW_IR_MOV_RZ:
-            /* MOV Rd, RZ */
-            w[0] = 0x7202 | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = 0x000000ff;
-            w[2] = 0x00000f00;
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-
-        case BW_IR_MOV_IMM:
-            /* MOV Rd, imm32 */
-            w[0] = 0x7802 | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = insn->imm;
-            w[2] = 0x00000f00;
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-
-        case BW_IR_S2R:
-            /* S2R Rd, SR */
-            w[0] = 0x7919 | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = 0x0;
-            w[2] = (insn->imm & 0xff) << 8;
-            w[3] = insn->control ? insn->control : 0x000e2200;
-            break;
-
-        case BW_IR_LDC:
-            /* LDC Rd, c[0x0][imm] */
-            w[0] = 0xff007b82 | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (insn->imm << 6) & 0x00ffff00;
-            w[2] = 0x00000800;
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-
-        case BW_IR_LDC64:
-            /* LDC.64 Rd:Rd+1, c[0x0][imm] */
-            w[0] = 0xff007b82 | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (insn->imm << 6) & 0x00ffff00;
-            w[2] = 0x00000a00;
-            w[3] = insn->control ? insn->control : 0x000e2200;
-            break;
-
-        case BW_IR_LDCU:
-            /* LDCU URd, c[0x0][imm] */
-            w[0] = 0xff0077ac | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (insn->imm << 5) & 0x00ffff00;
-            w[2] = 0x08000800;
-            w[3] = insn->control ? insn->control : 0x000e2200;
-            break;
-
-        case BW_IR_LDCU64:
-            /* LDCU.64 URd:URd+1, c[0x0][imm] */
-            w[0] = 0xff0077ac | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (insn->imm << 5) & 0x00ffff00;
-            w[2] = 0x08000a00;
-            w[3] = insn->control ? insn->control : 0x000e6e00;
-            break;
-
-        case BW_IR_IMAD:
-            if (insn->src2_vreg >= 0) {
-                /* Register-register: IMAD Rd, Ra, Rb, Rc (0x7224) */
-                w[0] = 0x7224 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-                w[1] = (uint32_t)(src2 & 0xff);
-                w[2] = 0x078e0200 | (uint32_t)(src3 & 0xff);
-                w[3] = insn->control ? insn->control : 0x001fca00;
-            } else if (insn->is_uniform && insn->ureg >= 0) {
-                /* Uniform register multiplier: IMAD Rd, Ra, URb, Rc (0x7c24) */
-                w[0] = 0x7c24 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-                w[1] = (uint32_t)(ureg & 0xff);
-                w[2] = 0x0f8e0200 | (uint32_t)(src3 & 0xff);
-                w[3] = insn->control ? insn->control : 0x001fca00;
-            } else {
-                /* Immediate multiplier: IMAD Rd, Ra, imm, Rc (0x7824) */
-                w[0] = 0x7824 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-                w[1] = insn->imm;
-                w[2] = 0x078e0200 | (uint32_t)(src3 & 0xff);
-                w[3] = insn->control ? insn->control : 0x001fca00;
-            }
-            break;
-
-        case BW_IR_IMAD_WIDE:
-            /* IMAD.WIDE.U32 Rd:Rd+1, Ra, imm, Rc:Rc+1 */
-            w[0] = 0x7825 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = insn->imm;
-            w[2] = 0x078e0000 | (uint32_t)(src3 & 0xff);
-            w[3] = insn->control ? insn->control : 0x001fcc00;
-            break;
-
-        case BW_IR_ISETP_GE:
-            if (insn->is_uniform && insn->ureg >= 0) {
-                w[0] = 0x7c0c | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-                w[1] = (uint32_t)(ureg & 0xff);
-                w[2] = 0x0bf06070;
-                w[3] = insn->control ? insn->control : 0x002fda00;
-            } else {
-                w[0] = 0x780c | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-                w[1] = insn->imm;
-                w[2] = 0x03f06270;
-                w[3] = insn->control ? insn->control : 0x001fda00;
-            }
-            break;
-
-        case BW_IR_LDG_E:
-            /* LDG.E Rd, desc[URd][Ra.64] */
-            w[0] = 0x7981 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(ureg & 0xff);
-            w[2] = 0x0c1e1900;
-            w[3] = insn->control ? insn->control : 0x000f2200;
-            break;
-
-        case BW_IR_STG_E: {
-            /* STG.E desc[URd][Ra.64+imm], Rb. imm = signed 24-bit byte offset at bits 40..63 (w[1] bits
-             * 8..31), as for LDG; words from nvcc 13.0.88 -arch=sm_121 (omega_blackwell_verify_codegen_fixtures_fragmm,
-             * 2026-10-12: STG.E desc[UR4][R4.64+0x4], R9 = 0x0000040904007986 0x000fe8000c101904). */
-            int32_t off = (int32_t)insn->imm;
-            if (off < -(1 << 23) || off >= (1 << 23)) return -1;
-            w[0] = 0x7986 | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff) | (((uint32_t)off & 0xffffffU) << 8);
-            w[2] = 0x0c101900 | (uint32_t)(ureg & 0xff);
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-        }
-
-        case BW_IR_STG_EF:
-            /* STG.E.MMIO.GPU. Uncached store, meant to be visible without a fence. */
-            w[0] = 0x7986 | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x0c111900 | (uint32_t)(ureg & 0xff);
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-
-        case BW_IR_IADD3:
-            /* IADD3 Rd, PT, PT, Ra, Rb, Rc */
-            w[0] = 0x7210 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x07ffe0ff;
-            w[3] = insn->control ? insn->control : 0x010fca00; /* omega-mv#545: the emitter's waits, not a fixed SB4 wait */
-            break;
-
-        case BW_IR_HMMA_F16:
-        case BW_IR_HMMA_BF16: {
-            /* HMMA.16816.F32[.BF16] Rd, Ra, Rb, Rc */
-            w[0] = 0x723c | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            uint32_t prec_bit = (insn->op == BW_IR_HMMA_BF16) ? 0x00040000 : 0x00000000;
-            w[2] = (uint32_t)(src3 & 0xff) | (0x18 << 8) | prec_bit;
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-        }
-
-        case BW_IR_SHF_R:
-            /* SHF.R.U32.HI Rd, RZ, imm, Ra */
-            w[0] = 0x7819U | ((uint32_t)(dst & 0xff) << 16) | (0xffU << 24);
-            w[1] = (uint32_t)insn->imm;
-            w[2] = 0x00011600 | (uint32_t)(src1 & 0xff);
-            w[3] = insn->control ? insn->control : 0x001fca00;
-            break;
-
-        case BW_IR_LOP3_AND:
-            /* LOP3.LUT Rd, Ra, imm, RZ, 0xc0, !PT */
-            w[0] = 0x7812U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)insn->imm;
-            w[2] = 0x078ec0ff;
-            w[3] = insn->control ? insn->control : 0x001fca00;
-            break;
-
-        case BW_IR_LDG_E_64:
-        case BW_IR_LDG_E_128: {
-            /* LDG.E.64 / LDG.E.128 Rd, desc[URd][Ra.64+imm]. imm = signed 24-bit byte offset at
-             * bits 40..63 (w[1] bits 8..31); size field in w[2] bits 9..11 (32 = 4, 64 = 5, 128 = 6).
-             * Words from nvcc 13.0.88 -arch=sm_121 (omega_blackwell_verify_codegen_fixtures_fragmm). */
-            int32_t off = (int32_t)insn->imm;
-            if (off < -(1 << 23) || off >= (1 << 23)) return -1;
-            w[0] = 0x7981U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(ureg & 0xff) | (((uint32_t)off & 0xffffffU) << 8);
-            w[2] = insn->op == BW_IR_LDG_E_64 ? 0x0c1e1b00U : 0x0c1e1d00U;
-            w[3] = insn->control ? insn->control : 0x000f2200;
-            break;
-        }
-
-        case BW_IR_LDG_E_U16:
-            /* LDG.E.U16 Rd, desc[URd][Ra.64] */
-            w[0] = 0x7981U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(ureg & 0xff);
-            w[2] = 0x0c1e1500;
-            w[3] = insn->control ? insn->control : 0x000f2200;
-            break;
-
-        case BW_IR_LDG_STRONG_SYS:
-            /* LDG.E.STRONG.SYS. Same shape as LDG.E; w[2] carries the
-             * system-scope bits (0x0c1e1900 -> 0x0c1f5900). */
-            w[0] = 0x7981 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(ureg & 0xff);
-            w[2] = 0x0c1f5900;
-            w[3] = insn->control ? insn->control : 0x000f2200;
-            break;
-
-        case BW_IR_LDG_MMIO:
-            /* LDG.E.EF. Drop the cached line, then load. */
-            w[0] = 0x7981 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(ureg & 0xff);
-            w[2] = 0x0c0e1900;
-            w[3] = insn->control ? insn->control : 0x000f2200;
-            break;
-
-        case BW_IR_STG_STRONG_SYS:
-            w[0] = 0x7986 | ((uint32_t)(src1 & 0xff) << 24);
-            if (insn->predicate_p0) {
-                uint32_t pred = insn->predicate_not ? 0x8u : 0x0u;
-                w[0] = (w[0] & ~0xF000u) | (pred << 12);
-            }
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x0c115900 | (uint32_t)(ureg & 0xff);
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-
-        case BW_IR_MEMBAR_ALL_SYS:
-            w[0] = 0x00007992;
-            w[1] = 0x00000000;
-            w[2] = 0x0000b000;
-            w[3] = insn->control ? insn->control : 0x000fec00;
-            break;
-
-        case BW_IR_MEMBAR_SC_SYS:
-            w[0] = 0x00007992;
-            w[1] = 0x00000000;
-            w[2] = 0x00003000;
-            w[3] = insn->control ? insn->control : 0x000fec00;
-            break;
-
-        case BW_IR_CCTL_IVALL:
-            w[0] = 0xff00798f;
-            w[1] = 0x00000000;
-            w[2] = 0x02000000;
-            w[3] = insn->control ? insn->control : 0x000fe800;
-            break;
-
-        case BW_IR_ATOMG_ADD_STRONG_SYS:
-            w[0] = 0x79a8 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff) | 0x80000000u;
-            w[2] = 0x081f5100 | (uint32_t)(ureg & 0xff);
-            w[3] = insn->control ? insn->control : 0x00321e00;
-            break;
-
-        case BW_IR_ATOMG_EXCH_STRONG_SYS:
-            w[0] = 0x79a8 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff) | 0x80000000u;
-            w[2] = 0x0c1f5100 | (uint32_t)(ureg & 0xff);
-            w[3] = insn->control ? insn->control : 0x00321e00;
-            break;
-
-        case BW_IR_ISETP_GE_U32:
-            /* ISETP.GE.U32.AND P0, PT, Ra, Rb, PT. Checked with nvdisasm -b SM121. */
-            w[0] = 0x720c | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x03f06070;
-            w[3] = insn->control ? insn->control : 0x001fda00;
-            break;
-
-        case BW_IR_LOP3_XOR:
-            /* LOP3.LUT Rd, Ra, Rb, RZ, 0x3c, !PT. Checked with nvdisasm -b SM121. */
-            w[0] = 0x7212 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x078e3cff;
-            w[3] = insn->control ? insn->control : 0x001fca00;
-            break;
-
-        case BW_IR_FADD:
-            /* FADD Rd, Ra, Rb */
-            w[0] = 0x7221U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x00000000;
-            w[3] = insn->control ? insn->control : 0x004fc400;
-            break;
-
-        case BW_IR_FSUB:
-            /* FSUB Rd, Ra, Rb (FADD Rd, Ra, -Rb) */
-            w[0] = 0x7221U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff) | 0x80000000U;
-            w[2] = 0x00000000;
-            w[3] = insn->control ? insn->control : 0x004fc400;
-            break;
-
-        case BW_IR_FMUL:
-            /* FMUL Rd, Ra, Rb */
-            w[0] = 0x7220U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x00400000;
-            w[3] = insn->control ? insn->control : 0x004fc400;
-            break;
-
-        case BW_IR_FFMA:
-            /* FFMA Rd, Ra, Rb, Rc */
-            w[0] = 0x7223U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = (uint32_t)(src3 & 0xff);
-            w[3] = insn->control ? insn->control : 0x004fc400;
-            break;
-
-        case BW_IR_FSETP:
-            /* FSETP.cond.AND P0, PT, Ra, Rb, PT */
-            w[0] = 0x720bU | ((uint32_t)(dst & 0x7) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = insn->imm ? insn->imm : 0x03f06000; /* Default GE condition */
-            w[3] = insn->control ? insn->control : 0x004fc400;
-            break;
-
-        case BW_IR_FSEL:
-            /* FSEL Rd, Ra, Rb, P0 */
-            w[0] = 0x7208U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = (uint32_t)(src3 & 0x7);
-            w[3] = insn->control ? insn->control : 0x000fca00;
-            break;
-
-        case BW_IR_FMNMX_MIN:
-            /* FMNMX Rd, Ra, Rb, PT (minimum) */
-            w[0] = 0x7209U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x03800000;
-            w[3] = insn->control ? insn->control : 0x004fc400;
-            break;
-
-        case BW_IR_FMNMX_MAX:
-            /* FMNMX Rd, Ra, Rb, !PT (maximum) */
-            w[0] = 0x7209U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x07800000;
-            w[3] = insn->control ? insn->control : 0x004fc400;
-            break;
-
-        case BW_IR_I2FP:
-            /* I2FP.F32.S32 Rd, Ra */
-            w[0] = 0x7245U | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (uint32_t)(src1 & 0xff);
-            w[2] = 0x00201400;
-            w[3] = insn->control ? insn->control : 0x004fe200;
-            break;
-
-        case BW_IR_F2I:
-            /* F2I.TRUNC.NTZ Rd, Ra */
-            w[0] = 0x7305U | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (uint32_t)(src1 & 0xff);
-            w[2] = 0x0020f100;
-            w[3] = insn->control ? insn->control : 0x004e2200;
-            break;
-
-        case BW_IR_MUFU_RCP:
-            /* MUFU.RCP Rd, Ra */
-            w[0] = 0x7308U | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (uint32_t)(src1 & 0xff);
-            w[2] = 0x00001000;
-            w[3] = insn->control ? insn->control : 0x000e2400;
-            break;
-
-        case BW_IR_MUFU_LG2:
-            /* MUFU.LG2 Rd, Ra (nvdisasm 13.0 -b SM121 decodes sub-op 0x0c00 as MUFU.LG2) */
-            w[0] = 0x7308U | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (uint32_t)(src1 & 0xff);
-            w[2] = 0x00000c00;
-            w[3] = insn->control ? insn->control : 0x000e2400;
-            break;
-
-        case BW_IR_MUFU_RSQ:
-            /* MUFU.RSQ Rd, Ra */
-            w[0] = 0x7308U | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (uint32_t)(src1 & 0xff);
-            w[2] = 0x00001400;
-            w[3] = insn->control ? insn->control : 0x000e2400;
-            break;
-
-        case BW_IR_SHFL_DOWN:
-            /* SHFL.DOWN PT, Rd, Ra, offset, 0x1f */
-            w[0] = 0x7f89U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = 0x08001f00U | (((uint32_t)insn->imm & 0x1f) << 21);
-            w[2] = 0x000e0000;
-            w[3] = insn->control ? insn->control : 0x000e2400;
-            break;
-
-        case BW_IR_LDS:
-            /* LDS Rd, [Ra] */
-            w[0] = 0x7984U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = 0x00000000;
-            w[2] = (uint32_t)(insn->imm & 0xffff);
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-
-        case BW_IR_STS:
-            /* STS [Ra], Rb */
-            w[0] = 0x7388U | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = (uint32_t)(insn->imm & 0xffff);
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-
-        case BW_IR_EXIT:
-            w[0] = insn->predicate_p0 ? 0x0000094d : 0x0000794d;
-            w[1] = 0x00000000;
-            w[2] = 0x03800000;
-            w[3] = insn->control ? insn->control : 0x000fea00;
-            break;
-
-        case BW_IR_BRA: {
-            /* sm_121 BRA. Distance is (target - this) - 1, split across the
-             * low six bits at instruction bits 18..23 and the rest at bit 34.
-             * Predicate bits 12..15: 7 = always, 0 = @P0, 8 = @!P0.
-             * A zero delta with no predicate keeps the self-branch word the
-             * existing kernels already emit after EXIT. */
-            int32_t delta = (int32_t)insn->imm;
-            int32_t rel = delta - 1;
-            uint32_t pred_field = 0x7u;
-            if (insn->predicate_p0)
-                pred_field = insn->predicate_not ? 0x8u : 0x0u;
-            w[0] = 0x947u | (pred_field << 12) | (((uint32_t)rel & 0x3fu) << 18);
-            w[1] = (uint32_t)(rel >> 6) << 2;
-            w[2] = (rel < 0) ? 0x0383ffffu : 0x03800000u;
-            if (insn->control)
-                w[3] = insn->control;
-            else if (delta == 0 && !insn->predicate_p0)
-                w[3] = 0x000fc000u;
-            else
-                w[3] = 0x000fea00u;
-            break;
-        }
-
-        case BW_IR_BSSY: {
-            /* BSSY.RECONVERGENT Bn, target (omega #308). nvcc 13.0.88 -arch=sm_121:
-             *   [0070] BSSY.RECONVERGENT B0, 0x140 ; 0x000000c000007945 0x000fe20003800200
-             * opcode 0x945 (NAK sm70_encode.rs:4165), barrier id at bits 16..19 (set_bar_dst
-             * 16..20), guard predicate at bits 12..15 like BRA, relative byte offset
-             * target - (this + 16) at bit 32 (NAK: field 34.. in 4-byte units), the cond
-             * predicate PT at bits 87..89 (0x0380 << 16 in w[2]) and bit 73 (0x200 in w[2]),
-             * which the disassembler prints as .RECONVERGENT; nvcc sets it on every BSSY/BSYNC
-             * for sm_121 and Mesa NAK does not. We follow nvcc. The target is the instruction
-             * after the matching BSYNC, so the delta is at least 2; smaller is refused. */
-            int32_t delta = (int32_t)insn->imm;
-            if (delta < 2 || insn->bar_reg >= BW_RECONV_MAX_BAR) return -1;
-            uint32_t pred_field = 0x7u;
-            if (insn->predicate_p0)
-                pred_field = insn->predicate_not ? 0x8u : 0x0u;
-            w[0] = 0x945u | (pred_field << 12) | ((uint32_t)insn->bar_reg << 16);
-            w[1] = (uint32_t)(delta - 1) * 16u;
-            w[2] = 0x03800200u;
-            w[3] = insn->control ? insn->control : 0x000fe200u;
-            break;
-        }
-
-        case BW_IR_BSYNC: {
-            /* BSYNC.RECONVERGENT Bn: [0130] BSYNC.RECONVERGENT B0 ; 0x0000000000007941 0x000fea0003800200
-             * opcode 0x941 (NAK sm70_encode.rs:4179), barrier id bits 16..19, cond PT, bit 73. */
-            if (insn->bar_reg >= BW_RECONV_MAX_BAR) return -1;
-            uint32_t pred_field = 0x7u;
-            if (insn->predicate_p0)
-                pred_field = insn->predicate_not ? 0x8u : 0x0u;
-            w[0] = 0x941u | (pred_field << 12) | ((uint32_t)insn->bar_reg << 16);
-            w[1] = 0;
-            w[2] = 0x03800200u;
-            w[3] = insn->control ? insn->control : 0x000fea00u;
-            break;
-        }
-
-        case BW_IR_MUFU_EX2:
-            /* MUFU.EX2 Rd, Ra. nvdisasm 13.0 -b SM121: 0x7308 with sub-op 0x0800 decodes
-             * "MUFU.EX2 R2, R4" (RCP is 0x1000, RSQ 0x1400 above). */
-            w[0] = 0x7308U | ((uint32_t)(dst & 0xff) << 16);
-            w[1] = (uint32_t)(src1 & 0xff);
-            w[2] = 0x00000800;
-            w[3] = insn->control ? insn->control : 0x000e2400;
-            break;
-
-        case BW_IR_BAR_SYNC:
-            /* BAR.SYNC.DEFER_BLOCKING 0x0: the exact words src/omega_numeric.c:885 runs on
-             * the chip (nvdisasm: "BAR.SYNC.DEFER_BLOCKING 0x0"). No registers. */
-            w[0] = 0x00007b1dU;
-            w[1] = 0x00000000;
-            w[2] = 0x00010000;
-            w[3] = insn->control ? insn->control : 0x000fec00;
-            break;
-
-        case BW_IR_LDS128: {
-            /* LDS.128 Rd..Rd+3, [Ra+imm]. nvcc 13.0.88 -arch=sm_121 words (fixtures below):
-             *   LDS.128 R4, [R20] ;        0x0000000014047984 0x000fe80000000c00
-             *   LDS.128 R8, [R20+0x40] ;   0x0000400014087984 0x000e280000000c00
-             * imm = byte offset at w[1] bits 8..31; size field 6 (128) at w[2] bits 9..11. */
-            if (insn->imm >= (1u << 23)) return -1;
-            w[0] = 0x7984U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (insn->imm & 0xffffffU) << 8;
-            w[2] = 0x00000c00U;
-            w[3] = insn->control ? insn->control : 0x000fe800;
-            break;
-        }
-
-        case BW_IR_LDS32:
-            /* LDS Rd, [Ra+URZ] (32-bit), the src/omega_numeric.c:886 form. */
-            w[0] = 0x7984U | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = 0x000000ff;
-            w[2] = 0x08000800;
-            w[3] = insn->control ? insn->control : 0x000e2800;
-            break;
-
-        case BW_IR_STS32:
-            /* STS [Ra+URZ], Rb (32-bit), the src/omega_numeric.c:884 form. */
-            w[0] = 0x7988U | ((uint32_t)(src1 & 0xff) << 24);
-            w[1] = (uint32_t)(src2 & 0xff);
-            w[2] = 0x080008ffU;
-            w[3] = insn->control ? insn->control : 0x000fe200;
-            break;
-
-        /* Prime race cut (2026-10-05). An absent operand is RZ for these three ops. */
-        case BW_IR_LOP3_LUT: {
-            /* LOP3.LUT Rd, Ra, Rb, Rc, imm8, !PT. LOP3_XOR above is this form with Rc = RZ, LUT 0x3c. */
-            uint32_t a = (insn->src1_vreg >= 0) ? (uint32_t)(src1 & 0xff) : 0xffU;
-            uint32_t b = (insn->src2_vreg >= 0) ? (uint32_t)(src2 & 0xff) : 0xffU;
-            w[0] = 0x7212U | ((uint32_t)(dst & 0xff) << 16) | (a << 24);
-            w[1] = b;
-            w[2] = 0x078e0000U | ((insn->imm & 0xffU) << 8) | (uint32_t)(src3 & 0xff);
-            w[3] = insn->control ? insn->control : 0x001fca00;
-            break;
-        }
-
-        case BW_IR_SHF_L_U32: {
-            /* SHF.L.U32 Rd, Ra, Rb, Rc: register-amount form (0x7219) of SHF_R's 0x7819, with the
-             * .R (w[2] bit 12) and .HI (bit 16) flags clear. Rc is the funnel high word (RZ). */
-            uint32_t a = (insn->src1_vreg >= 0) ? (uint32_t)(src1 & 0xff) : 0xffU;
-            uint32_t b = (insn->src2_vreg >= 0) ? (uint32_t)(src2 & 0xff) : 0xffU;
-            w[0] = 0x7219U | ((uint32_t)(dst & 0xff) << 16) | (a << 24);
-            w[1] = b;
-            w[2] = 0x00000600U | (uint32_t)(src3 & 0xff);
-            w[3] = insn->control ? insn->control : 0x001fca00;
-            break;
-        }
-
-        case BW_IR_IMAD_HI_U32: {
-            /* IMAD.HI.U32 Rd, Ra, Rb, Rc: opcode 0x227 with the IMAD.WIDE.U32 modifier word. */
-            uint32_t a = (insn->src1_vreg >= 0) ? (uint32_t)(src1 & 0xff) : 0xffU;
-            uint32_t b = (insn->src2_vreg >= 0) ? (uint32_t)(src2 & 0xff) : 0xffU;
-            w[0] = 0x7227U | ((uint32_t)(dst & 0xff) << 16) | (a << 24);
-            w[1] = b;
-            w[2] = 0x078e0000U | (uint32_t)(src3 & 0xff);
-            w[3] = insn->control ? insn->control : 0x001fca00;
-            break;
-        }
-
-        default:
-            return -1;
-    }
-    return 0;
-}
-
-/* Prime race cut (2026-10-05): golden words for LOP3_LUT, SHF_L_U32 and IMAD_HI_U32.
- * Each expected (w0, w1, w2) is the low 96 bits of an instruction nvcc 13.0.88 emitted
- * for sm_121 (nvcc -arch=sm_121 -cubin, cuobjdump -sass; source and dump in
- * bench/prime_race/tests/encoding_oracle.md). Control words (w3) are scheduler output and
- * not compared. nvcc is an offline oracle only; nothing here links CUDA. 0 = all good. */
-int omega_blackwell_verify_codegen_fixtures_intops(void) {
-    OmegaRegAlloc ra;
-    memset(&ra, 0, sizeof(ra));
-    static const int phys[] = { 0, 2, 6, 7, 9, 11, 13 };
-    for (int i = 0; i < (int)(sizeof phys / sizeof phys[0]); i++) ra.vreg_to_phys[i] = phys[i];
-    enum { R0 = 0, R2, R6, R7, R9, R11, R13, RZ = -1 };
-    static const struct {
-        BlackwellIROpcode op; int d, a, b, c; uint32_t imm; uint32_t w0, w1, w2; const char *text;
-    } fx[] = {
-        { BW_IR_LOP3_LUT, R9, R7, R0, RZ, 0xfc, 0x07097212U, 0x00000000U, 0x078efcffU, "LOP3.LUT R9, R7, R0, RZ, 0xfc, !PT" },
-        { BW_IR_LOP3_LUT, R11, R6, R7, R0, 0x78, 0x060b7212U, 0x00000007U, 0x078e7800U, "LOP3.LUT R11, R6, R7, R0, 0x78, !PT" },
-        { BW_IR_LOP3_LUT, R13, R6, R7, R0, 0x10, 0x060d7212U, 0x00000007U, 0x078e1000U, "LOP3.LUT R13, R6, R7, R0, 0x10, !PT" },
-        { BW_IR_LOP3_LUT, R7, RZ, R9, RZ, 0x33, 0xff077212U, 0x00000009U, 0x078e33ffU, "LOP3.LUT R7, RZ, R9, RZ, 0x33, !PT" },
-        { BW_IR_SHF_L_U32, R7, R9, R2, RZ, 0, 0x09077219U, 0x00000002U, 0x000006ffU, "SHF.L.U32 R7, R9, R2, RZ" },
-        { BW_IR_SHF_L_U32, R7, R0, R7, RZ, 0, 0x00077219U, 0x00000007U, 0x000006ffU, "SHF.L.U32 R7, R0, R7, RZ" },
-        { BW_IR_IMAD_HI_U32, R9, R9, R0, R6, 0, 0x09097227U, 0x00000000U, 0x078e0006U, "IMAD.HI.U32 R9, R9, R0, R6" },
-        { BW_IR_IMAD_HI_U32, R7, R0, R7, RZ, 0, 0x00077227U, 0x00000007U, 0x078e00ffU, "IMAD.HI.U32 R7, R0, R7, RZ" },
-    };
-    for (int i = 0; i < (int)(sizeof fx / sizeof fx[0]); i++) {
-        BlackwellIRInsn in;
-        memset(&in, 0, sizeof in);
-        in.op = fx[i].op; in.dst_vreg = fx[i].d; in.src1_vreg = fx[i].a; in.src2_vreg = fx[i].b;
-        in.src3_vreg = fx[i].c; in.ureg = -1; in.imm = fx[i].imm;
-        uint32_t w[4];
-        if (encode_single_insn(&in, &ra, w) != 0) return -(2 * i + 1);
-        if (w[0] != fx[i].w0 || w[1] != fx[i].w1 || w[2] != fx[i].w2) return -(2 * i + 2);
-    }
-    return 0;
-}
-
-int omega_blackwell_encode_one(const BlackwellIRInsn *insn, uint32_t w[4]) {
-    if (!insn || !w) return -1;
-    OmegaRegAlloc ra;
-    memset(&ra, 0, sizeof ra);
-    for (int i = 0; i < BW_MAX_VREGS; i++) ra.vreg_to_phys[i] = i;
-    for (int i = 0; i < BW_MAX_UVREGS; i++) ra.uvreg_to_phys[i] = i;
-    return encode_single_insn(insn, &ra, w);
-}
-
-/* omega #328: golden words for the fragment-major matmul. Oracle: nvcc 13.0.88 -arch=sm_121
- * -cubin -O3, cuobjdump -sass, on a kernel with uint2 / uint4 loads at immediate offsets and a
- * dependent mma.m16n8k16 bf16 chain (source and dump sealed in
- * ~/workspace/investigations/2026-10-07-qwen3-decode-matmul/oracle/frag_plain.{cu,sass}):
- *   LDG.E.64 R2, desc[UR8][R30.64] ;            0x000000081e027981 0x000ea8000c1e1b00
- *   LDG.E.64 R28, desc[UR8][R30.64+0x100] ;     0x000100081e1c7981 0x000ee8000c1e1b00
- *   LDG.E.128 R8, desc[UR8][R32.64] ;           0x0000000820087981 0x000ea8000c1e1d00
- *   LDG.E.128 R20, desc[UR8][R32.64+0x1000] ;   0x0010000820147981 0x000e9e000c1e1d00
- *   HMMA.16816.F32.BF16 R8, R12, R6, R8 ;       0x000000060c08723c 0x010fe20000041808
- *   NOP ;                                       0x0000000000007918 0x000fdc0000000000
- * The dependent HMMA chain nvcc emits is HMMA (stall 15) then NOP (stall 14): 29 cycles from
- * one HMMA to the next that reads its accumulator. w3 is compared for the NOP only (it is the
- * whole point of that instruction). 0 = all good. */
-int omega_blackwell_verify_codegen_fixtures_fragmm(void) {
-    static const struct {
-        BlackwellIROpcode op; int d, a, b, c, u; uint32_t imm, control; uint32_t w0, w1, w2, w3; const char *text;
-    } fx[] = {
-        { BW_IR_LDG_E_64, 2, 30, -1, -1, 8, 0, 0, 0x1e027981U, 0x00000008U, 0x0c1e1b00U, 0, "LDG.E.64 R2, desc[UR8][R30.64]" },
-        { BW_IR_LDG_E_64, 28, 30, -1, -1, 8, 0x100, 0, 0x1e1c7981U, 0x00010008U, 0x0c1e1b00U, 0, "LDG.E.64 R28, desc[UR8][R30.64+0x100]" },
-        { BW_IR_LDG_E_128, 8, 32, -1, -1, 8, 0, 0, 0x20087981U, 0x00000008U, 0x0c1e1d00U, 0, "LDG.E.128 R8, desc[UR8][R32.64]" },
-        { BW_IR_LDG_E_128, 20, 32, -1, -1, 8, 0x1000, 0, 0x20147981U, 0x00100008U, 0x0c1e1d00U, 0, "LDG.E.128 R20, desc[UR8][R32.64+0x1000]" },
-        { BW_IR_HMMA_BF16, 8, 12, 6, 8, -1, 0, 0, 0x0c08723cU, 0x00000006U, 0x00041808U, 0, "HMMA.16816.F32.BF16 R8, R12, R6, R8" },
-        { BW_IR_NOP, -1, -1, -1, -1, -1, 0, 0x000fdc00U, 0x00007918U, 0, 0, 0x000fdc00U, "NOP (stall 14)" },
-        /* LDS.128 with an immediate offset (attention batched loads, 2026-10-12): nvcc 13.0.88 -arch=sm_121 on
-         * float4 shared reads at register + constant offsets (fixture source in the omega speed/attention-batched-loads PR) */
-        { BW_IR_LDS128, 4, 20, -1, -1, -1, 0, 0, 0x14047984U, 0x00000000U, 0x00000c00U, 0, "LDS.128 R4, [R20]" },
-        { BW_IR_LDS128, 8, 20, -1, -1, -1, 0x40, 0, 0x14087984U, 0x00004000U, 0x00000c00U, 0, "LDS.128 R8, [R20+0x40]" },
-        { BW_IR_LDS128, 12, 20, -1, -1, -1, 0x100, 0, 0x140c7984U, 0x00010000U, 0x00000c00U, 0, "LDS.128 R12, [R20+0x100]" },
-        /* STG.E with an immediate offset (blocked prefill matmul, 2026-10-12): nvcc 13.0.88 -arch=sm_121 on float stores
-         * at register + constant offsets (~/.claude/jobs/ade3c837/tmp/stg-oracle/stg.cu); the second word is the
-         * offset-free STG word with UR4 */
-        { BW_IR_STG_E, -1, 4, 8, -1, 4, 0, 0, 0x04007986U, 0x00000008U, 0x0c101904U, 0, "STG.E desc[UR4][R4.64], R8" },
-        { BW_IR_STG_E, -1, 4, 9, -1, 4, 0x4, 0, 0x04007986U, 0x00000409U, 0x0c101904U, 0, "STG.E desc[UR4][R4.64+0x4], R9" },
-        { BW_IR_STG_E, -1, 4, 10, -1, 4, 0x4000, 0, 0x04007986U, 0x0040000aU, 0x0c101904U, 0, "STG.E desc[UR4][R4.64+0x4000], R10" },
-        { BW_IR_STG_E, -1, 6, 11, -1, 4, 0xfff00000u, 0, 0x06007986U, 0xf000000bU, 0x0c101904U, 0, "STG.E desc[UR4][R6.64+-0x100000], R11" },
-    };
-    for (int i = 0; i < (int)(sizeof fx / sizeof fx[0]); i++) {
-        BlackwellIRInsn in;
-        memset(&in, 0, sizeof in);
-        in.op = fx[i].op; in.dst_vreg = fx[i].d; in.src1_vreg = fx[i].a; in.src2_vreg = fx[i].b;
-        in.src3_vreg = fx[i].c; in.ureg = fx[i].u; in.imm = fx[i].imm; in.control = fx[i].control;
-        uint32_t w[4];
-        if (omega_blackwell_encode_one(&in, w) != 0) return -(2 * i + 1);
-        if (w[0] != fx[i].w0 || w[1] != fx[i].w1 || w[2] != fx[i].w2 || (fx[i].w3 && w[3] != fx[i].w3)) return -(2 * i + 2);
-    }
-    /* offsets outside the signed 24-bit field are refused, not wrapped */
-    BlackwellIRInsn big;
-    memset(&big, 0, sizeof big);
-    big.op = BW_IR_LDG_E_64; big.dst_vreg = 2; big.src1_vreg = 30; big.src2_vreg = -1; big.src3_vreg = -1; big.ureg = 8;
-    big.imm = 1u << 23;
-    uint32_t w[4];
-    if (omega_blackwell_encode_one(&big, w) == 0) return -100;
-    big.imm = (uint32_t)-(1 << 23);
-    if (omega_blackwell_encode_one(&big, w) != 0) return -101;
-    return 0;
-}
-
-/* omega #308: BSSY / BSYNC golden words. Oracle: nvcc 13.0.88 -arch=sm_121 -cubin -O3 on the
- * kernels in docs/gpu-reconvergence-308.md, cuobjdump -sass (low 64-bit word, then high; the
- * top 23 bits of the high word are the control word and are not compared here):
- *   k_loop   [0070] BSSY.RECONVERGENT B0, 0x140 ; 0x000000c000007945 0x000fe20003800200  (delta 13)
- *   k_nested [0070] BSSY.RECONVERGENT B0, 0x300 ; 0x0000028000007945 0x000fe20003800200  (delta 41)
- *   k_break  [0070] BSSY.RECONVERGENT B0, 0x110 ; 0x0000009000007945 0x000fe20003800200  (delta 10)
- *   k_loop   [0130] BSYNC.RECONVERGENT B0 ;        0x0000000000007941 0x000fea0003800200
- * Barrier ids other than B0 and the predicated forms are decoded by tools/reconv_nvdisasm_check.sh
- * (nvdisasm -b SM121 text), not by this table. */
-int omega_blackwell_verify_codegen_fixtures_reconv(void) {
-    static const struct { BlackwellIROpcode op; int delta; int bar; uint32_t w0, w1, w2; } fx[] = {
-        { BW_IR_BSSY, 13, 0, 0x00007945U, 0x000000c0U, 0x03800200U },
-        { BW_IR_BSSY, 41, 0, 0x00007945U, 0x00000280U, 0x03800200U },
-        { BW_IR_BSSY, 10, 0, 0x00007945U, 0x00000090U, 0x03800200U },
-        { BW_IR_BSYNC, 0, 0, 0x00007941U, 0x00000000U, 0x03800200U },
-    };
-    for (int i = 0; i < (int)(sizeof fx / sizeof fx[0]); i++) {
-        BlackwellIRInsn in;
-        memset(&in, 0, sizeof in);
-        in.op = fx[i].op; in.dst_vreg = -1; in.src1_vreg = -1; in.src2_vreg = -1; in.src3_vreg = -1; in.ureg = -1;
-        in.imm = (uint32_t)fx[i].delta; in.bar_reg = (uint8_t)fx[i].bar;
-        uint32_t w[4];
-        if (omega_blackwell_encode_one(&in, w) != 0) return -(2 * i + 1);
-        if (w[0] != fx[i].w0 || w[1] != fx[i].w1 || w[2] != fx[i].w2) return -(2 * i + 2);
-        /* control word defaults mirror nvcc's: BSSY 0x000fe200, BSYNC 0x000fea00 */
-        if (w[3] != (fx[i].op == BW_IR_BSSY ? 0x000fe200U : 0x000fea00U)) return -(2 * i + 2);
-    }
-    /* refusals: a BSSY must name a later instruction (delta >= 2), barrier ids stop at B15 */
-    BlackwellIRInsn bad; uint32_t w[4];
-    memset(&bad, 0, sizeof bad); bad.op = BW_IR_BSSY; bad.dst_vreg = bad.src1_vreg = bad.src2_vreg = bad.src3_vreg = bad.ureg = -1;
-    bad.imm = 1; bad.bar_reg = 0;
-    if (omega_blackwell_encode_one(&bad, w) == 0) return -101;
-    bad.imm = (uint32_t)-3;
-    if (omega_blackwell_encode_one(&bad, w) == 0) return -102;
-    bad.imm = 5; bad.bar_reg = 16;
-    if (omega_blackwell_encode_one(&bad, w) == 0) return -103;
-    bad.op = BW_IR_BSYNC; bad.imm = 0; bad.bar_reg = 16;
-    if (omega_blackwell_encode_one(&bad, w) == 0) return -104;
-    bad.bar_reg = 15;
-    if (omega_blackwell_encode_one(&bad, w) != 0 || w[0] != (0x00007941U | (15U << 16))) return -105;
-    return 0;
-}
-
-/* FB-1 cut 4: word-level fixtures for the four additive ops (checked against the
- * nvdisasm decodes recorded in docs/numeric/FB1_CUT4_ELEMENTWISE.md). 0 = all good. */
-int omega_blackwell_verify_codegen_fixtures_fb1cut4(void) {
-    OmegaRegAlloc ra;
-    memset(&ra, 0, sizeof(ra));
-    ra.vreg_to_phys[0] = 2;  /* R2 */
-    ra.vreg_to_phys[1] = 4;  /* R4 */
-    ra.vreg_to_phys[2] = 9;  /* R9 */
-    ra.vreg_to_phys[3] = 10; /* R10 */
-    ra.vreg_to_phys[4] = 8;  /* R8 */
-    uint32_t w[4];
-
-    /* MUFU.EX2 R2, R4 */
-    BlackwellIRInsn ex2 = { .op = BW_IR_MUFU_EX2, .dst_vreg = 0, .src1_vreg = 1 };
-    if (encode_single_insn(&ex2, &ra, w) != 0) return -1;
-    if (w[0] != 0x00027308U || w[1] != 4 || w[2] != 0x00000800U) return -2;
-    /* BAR.SYNC.DEFER_BLOCKING 0x0 */
-    BlackwellIRInsn bar = { .op = BW_IR_BAR_SYNC };
-    if (encode_single_insn(&bar, &ra, w) != 0) return -3;
-    if (w[0] != 0x00007b1dU || w[1] != 0 || w[2] != 0x00010000U || w[3] != 0x000fec00U) return -4;
-    /* LDS R9, [R10+URZ] */
-    BlackwellIRInsn lds = { .op = BW_IR_LDS32, .dst_vreg = 2, .src1_vreg = 3 };
-    if (encode_single_insn(&lds, &ra, w) != 0) return -5;
-    if (w[0] != 0x0a097984U || w[1] != 0xff || w[2] != 0x08000800U) return -6;
-    /* STS [R8+URZ], R2 */
-    BlackwellIRInsn sts = { .op = BW_IR_STS32, .src1_vreg = 4, .src2_vreg = 0 };
-    if (encode_single_insn(&sts, &ra, w) != 0) return -7;
-    if (w[0] != 0x08007988U || w[1] != 2 || w[2] != 0x080008ffU) return -8;
-    return 0;
-}
-
-/* Kernel capture (C6 of docs/OMEGA.md, tools/sm121dis): with OMEGA_KERNEL_DUMP_DIR set, every encoded kernel is written
- * there as <first 16 hex of its SHA-256>.bin, once per distinct body, so the disassembler can be checked against nvdisasm on
- * every kernel the library builds. Unset (the normal case) it does nothing; the freestanding build has no files. */
-void omega_kernel_dump(const uint8_t *code, size_t len) {
-#ifndef OMEGA_GPU_NO_POSIX
-    const char *dir = getenv("OMEGA_KERNEL_DUMP_DIR");
-    if (!dir || !dir[0] || !code || !len) return;
-    uint8_t d[SHA256_DIGEST_SIZE]; sha256_hash(code, len, d);
-    char path[4096];
-    int n = snprintf(path, sizeof path, "%s/%02x%02x%02x%02x%02x%02x%02x%02x.bin",
-                     dir, (unsigned)d[0], (unsigned)d[1], (unsigned)d[2], (unsigned)d[3],
-                     (unsigned)d[4], (unsigned)d[5], (unsigned)d[6], (unsigned)d[7]);
-    if (n < 0 || (size_t)n >= sizeof path) return;
-    /* Private, exclusive creation: an existing body or symlink is left alone. */
-    int fd = open(path, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW | O_CLOEXEC, 0600);
-    if (fd < 0) return;
-    FILE *f = fdopen(fd, "wb");
-    if (!f) { close(fd); return; }
-    if (fwrite(code, 1, len, f) != len) BW_DIAG("omega_kernel_dump: short write %s\n", path);
-    if (fclose(f) != 0) BW_DIAG("omega_kernel_dump: close failed %s\n", path);
-#else
-    (void)code; (void)len;
-#endif
-}
-
-int omega_bw_encode_program(const BlackwellIRProgram *prog, uint8_t *code_buf, size_t max_len, size_t *out_len) {
-    if (!prog || !code_buf || !out_len) return -1;
-
-    size_t padded_insns = (prog->count + 7) & ~7ULL;
-    if (padded_insns < 32) padded_insns = 32;
-
-    size_t req_bytes = padded_insns * 16;
-    if (max_len < req_bytes) return -1;
-
-    uint8_t *p = code_buf;
-    for (size_t i = 0; i < padded_insns; i++) {
-        uint32_t w[4];
-        if (i < prog->count) {
-            if (encode_single_insn(&prog->insns[i], &prog->regalloc, w) != 0) {
-                return -1;
-            }
-        } else {
-            /* Pad with NOP */
-            w[0] = 0x00007918;
-            w[1] = 0x00000000;
-            w[2] = 0x00000000;
-            w[3] = 0x000fc000;
-        }
-
-        p[0] = (uint8_t)(w[0] & 0xff);
-        p[1] = (uint8_t)((w[0] >> 8) & 0xff);
-        p[2] = (uint8_t)((w[0] >> 16) & 0xff);
-        p[3] = (uint8_t)((w[0] >> 24) & 0xff);
-
-        p[4] = (uint8_t)(w[1] & 0xff);
-        p[5] = (uint8_t)((w[1] >> 8) & 0xff);
-        p[6] = (uint8_t)((w[1] >> 16) & 0xff);
-        p[7] = (uint8_t)((w[1] >> 24) & 0xff);
-
-        p[8] = (uint8_t)(w[2] & 0xff);
-        p[9] = (uint8_t)((w[2] >> 8) & 0xff);
-        p[10] = (uint8_t)((w[2] >> 16) & 0xff);
-        p[11] = (uint8_t)((w[2] >> 24) & 0xff);
-
-        p[12] = (uint8_t)(w[3] & 0xff);
-        p[13] = (uint8_t)((w[3] >> 8) & 0xff);
-        p[14] = (uint8_t)((w[3] >> 16) & 0xff);
-        p[15] = (uint8_t)((w[3] >> 24) & 0xff);
-
-        p += 16;
-    }
-
-    omega_kernel_dump(code_buf, req_bytes);
-    *out_len = req_bytes;
-    return 0;
-}
-
-int omega_blackwell_codegen_matmul_i32_prog(const OmegaMatMulSpec *spec, BlackwellIRProgram *prog) {
-    if (!spec || !prog) return -1;
-    if (spec->m == 0 || spec->k == 0 || spec->n == 0) return -1;
-
-    /* Fail closed loudly if K exceeds bounded unroll limit */
-    if (spec->k > 32) {
-        BW_DIAG("ERROR: MatMul integer codegen exceeds bounded unroll limit (K=%u > 32)\n", spec->k);
-        return -1;
-    }
-
-    omega_bw_ir_init(prog);
-
-    /* 1. Allocate virtual registers */
-    /* 64-bit base pointers */
-    int v_ptr_a   = omega_bw_ir_alloc_vreg64(prog);
-    int v_ptr_b   = omega_bw_ir_alloc_vreg64(prog);
-    int v_ptr_c   = omega_bw_ir_alloc_vreg64(prog);
-    int uv_desc   = omega_bw_ir_alloc_uvreg64(prog);
-
-    /* 32-bit CTA / Thread indexing */
-    int v_ctaid_x = omega_bw_ir_alloc_vreg(prog);
-    int v_ctaid_y = omega_bw_ir_alloc_vreg(prog);
-    int v_tid_x   = omega_bw_ir_alloc_vreg(prog);
-    int v_tid_y   = omega_bw_ir_alloc_vreg(prog);
-
-    /* 2D Coordinates & loop invariants */
-    int v_col     = omega_bw_ir_alloc_vreg(prog);
-    int v_row     = omega_bw_ir_alloc_vreg(prog);
-    int v_row_k   = omega_bw_ir_alloc_vreg(prog);
-    int v_const_1 = omega_bw_ir_alloc_vreg(prog);
-    int v_acc     = omega_bw_ir_alloc_vreg(prog);
-
-    /* Working registers for memory address and operands */
-    int v_idx_a   = omega_bw_ir_alloc_vreg(prog);
-    int v_off_a   = omega_bw_ir_alloc_vreg64(prog);
-    int v_val_a   = omega_bw_ir_alloc_vreg(prog);
-
-    int v_idx_b   = omega_bw_ir_alloc_vreg(prog);
-    int v_off_b   = omega_bw_ir_alloc_vreg64(prog);
-    int v_val_b   = omega_bw_ir_alloc_vreg(prog);
-
-    int v_idx_c   = omega_bw_ir_alloc_vreg(prog);
-    int v_off_c   = omega_bw_ir_alloc_vreg64(prog);
-
-    if (v_off_c < 0) return -1;
-
-    /* 2. Load 64-bit global memory descriptor into uniform register pair */
-    /* LDCU.64 uv_desc, c[0x0][0x358] */
-    BlackwellIRInsn insn_desc = { .op = BW_IR_LDCU64, .dst_vreg = uv_desc, .imm = 0x358, .is_uniform = true };
-    omega_bw_ir_append(prog, &insn_desc);
-
-    /* 3. Load 64-bit base pointers from Constant Bank 0 */
-    /* LDC.64 v_ptr_a, c[0x0][0x380] */
-    BlackwellIRInsn insn_ptra = { .op = BW_IR_LDC64, .dst_vreg = v_ptr_a, .imm = 0x380 };
-    omega_bw_ir_append(prog, &insn_ptra);
-
-    /* LDC.64 v_ptr_b, c[0x0][0x388] */
-    BlackwellIRInsn insn_ptrb = { .op = BW_IR_LDC64, .dst_vreg = v_ptr_b, .imm = 0x388 };
-    omega_bw_ir_append(prog, &insn_ptrb);
-
-    /* LDC.64 v_ptr_c, c[0x0][0x390] */
-    BlackwellIRInsn insn_ptrc = { .op = BW_IR_LDC64, .dst_vreg = v_ptr_c, .imm = 0x390 };
-    omega_bw_ir_append(prog, &insn_ptrc);
-
-    /* 4. Query 2D CTA and Thread coordinates */
-    /* S2R v_ctaid_x, SR_CTAID.X */
-    BlackwellIRInsn insn_ctax = { .op = BW_IR_S2R, .dst_vreg = v_ctaid_x, .imm = BW_SR_CTAID_X };
-    omega_bw_ir_append(prog, &insn_ctax);
-
-    /* S2R v_ctaid_y, SR_CTAID.Y */
-    BlackwellIRInsn insn_ctay = { .op = BW_IR_S2R, .dst_vreg = v_ctaid_y, .imm = BW_SR_CTAID_Y };
-    omega_bw_ir_append(prog, &insn_ctay);
-
-    /* S2R v_tid_x, SR_TID.X */
-    BlackwellIRInsn insn_tidx = { .op = BW_IR_S2R, .dst_vreg = v_tid_x, .imm = BW_SR_TID_X };
-    omega_bw_ir_append(prog, &insn_tidx);
-
-    /* S2R v_tid_y, SR_TID.Y */
-    BlackwellIRInsn insn_tidy = { .op = BW_IR_S2R, .dst_vreg = v_tid_y, .imm = BW_SR_TID_Y };
-    omega_bw_ir_append(prog, &insn_tidy);
-
-    /* 5. Compute 2D (row, col) coordinates */
-    /* Standard 16x16 tile threads: col = ctaid_x * 16 + tid_x */
-    BlackwellIRInsn insn_col = { .op = BW_IR_IMAD, .dst_vreg = v_col, .src1_vreg = v_ctaid_x, .src2_vreg = -1, .imm = 16, .src3_vreg = v_tid_x };
-    omega_bw_ir_append(prog, &insn_col);
-
-    /* row = ctaid_y * 16 + tid_y */
-    BlackwellIRInsn insn_row = { .op = BW_IR_IMAD, .dst_vreg = v_row, .src1_vreg = v_ctaid_y, .src2_vreg = -1, .imm = 16, .src3_vreg = v_tid_y };
-    omega_bw_ir_append(prog, &insn_row);
-
-    /* 6. Precompute row base index: v_row_k = v_row * K + RZ */
-    BlackwellIRInsn insn_row_k = { .op = BW_IR_IMAD, .dst_vreg = v_row_k, .src1_vreg = v_row, .src2_vreg = -1, .imm = spec->k, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_row_k);
-
-    /* 7. Initialize v_const_1 = 1 for immediate linear indexing */
-    BlackwellIRInsn insn_c1 = { .op = BW_IR_MOV_IMM, .dst_vreg = v_const_1, .imm = 1 };
-    omega_bw_ir_append(prog, &insn_c1);
-
-    /* 8. Initialize accumulator to zero: MOV v_acc, RZ */
-    BlackwellIRInsn insn_init_acc = { .op = BW_IR_MOV_RZ, .dst_vreg = v_acc };
-    omega_bw_ir_append(prog, &insn_init_acc);
-
-    /* 9. Synthesize inner accumulation loop across K iterations */
-    for (uint32_t step = 0; step < spec->k; step++) {
-        /* A[row, step]: idx_a = v_row_k + step = v_const_1 * step + v_row_k */
-        BlackwellIRInsn insn_idxa = { .op = BW_IR_IMAD, .dst_vreg = v_idx_a, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = step, .src3_vreg = v_row_k };
-        omega_bw_ir_append(prog, &insn_idxa);
-
-        /* off_a = v_ptr_a + idx_a * 4 */
-        BlackwellIRInsn insn_offa = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off_a, .src1_vreg = v_idx_a, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_a };
-        omega_bw_ir_append(prog, &insn_offa);
-
-        /* Load A[row, step]: LDG.E v_val_a, desc[uv_desc][v_off_a.64] */
-        BlackwellIRInsn insn_lda = { .op = BW_IR_LDG_E, .dst_vreg = v_val_a, .src1_vreg = v_off_a, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x001ea800 };
-        omega_bw_ir_append(prog, &insn_lda);
-
-        /* B[step, col]: idx_b = step * N + col = v_const_1 * (step * N) + v_col */
-        uint32_t step_n = step * spec->n;
-        BlackwellIRInsn insn_idxb = { .op = BW_IR_IMAD, .dst_vreg = v_idx_b, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = step_n, .src3_vreg = v_col };
-        omega_bw_ir_append(prog, &insn_idxb);
-
-        /* off_b = v_ptr_b + idx_b * 4 */
-        BlackwellIRInsn insn_offb = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off_b, .src1_vreg = v_idx_b, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_b };
-        omega_bw_ir_append(prog, &insn_offb);
-
-        /* Load B[step, col]: LDG.E v_val_b, desc[uv_desc][v_off_b.64] */
-        BlackwellIRInsn insn_ldb = { .op = BW_IR_LDG_E, .dst_vreg = v_val_b, .src1_vreg = v_off_b, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x002ea800 };
-        omega_bw_ir_append(prog, &insn_ldb);
-
-        /* Multiply and accumulate: IMAD v_acc, v_val_a, v_val_b, v_acc */
-        BlackwellIRInsn insn_acc = { .op = BW_IR_IMAD, .dst_vreg = v_acc, .src1_vreg = v_val_a, .src2_vreg = v_val_b, .src3_vreg = v_acc, .control = 0x004fca00 };
-        omega_bw_ir_append(prog, &insn_acc);
-    }
-
-    /* 10. Compute output index: idx_c = row * N + col */
-    BlackwellIRInsn insn_idxc = { .op = BW_IR_IMAD, .dst_vreg = v_idx_c, .src1_vreg = v_row, .src2_vreg = -1, .imm = spec->n, .src3_vreg = v_col };
-    omega_bw_ir_append(prog, &insn_idxc);
-
-    /* off_c = v_ptr_c + idx_c * 4 */
-    BlackwellIRInsn insn_offc = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off_c, .src1_vreg = v_idx_c, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c };
-    omega_bw_ir_append(prog, &insn_offc);
-
-    /* Store C[row, col]: STG.E desc[uv_desc][v_off_c.64], v_acc */
-    BlackwellIRInsn insn_stc = { .op = BW_IR_STG_E, .src1_vreg = v_off_c, .src2_vreg = v_acc, .src3_vreg = -1, .ureg = uv_desc };
-    omega_bw_ir_append(prog, &insn_stc);
-
-    /* 11. Kernel termination */
-    BlackwellIRInsn insn_exit = { .op = BW_IR_EXIT, .predicate_p0 = false };
-    omega_bw_ir_append(prog, &insn_exit);
-
-    BlackwellIRInsn insn_bra = { .op = BW_IR_BRA };
-    omega_bw_ir_append(prog, &insn_bra);
-
-    /* 12. Solve bounded deterministic register allocation */
-    if (omega_bw_regalloc_solve(prog) != 0) {
-        return -1;
-    }
-    return 0;
-}
-
-/* ---- native v1 P07 cut A.2: allocation-free kernel encoding ---------------------------------
- * The one place a solved IR program becomes a kernel. Hosted and freestanding builds both encode
- * through it, so the two produce the same bytes for the same program (make test-codegen-freestanding
- * compares them). */
-size_t omega_bw_program_code_bytes(const BlackwellIRProgram *prog) {
-    if (!prog) return 0;
-    size_t padded_insns = (prog->count + 7) & ~(size_t)7;
-    if (padded_insns < 32) padded_insns = 32;
-    return padded_insns * 16;
-}
-
-int omega_blackwell_kernel_encode_into(const BlackwellIRProgram *prog, uint8_t *code_buf, size_t code_cap,
-                                       OmegaBlackwellKernel *kernel) {
-    if (!kernel) return -1;
-    memset(kernel, 0, sizeof *kernel);
-    if (!prog || !code_buf) return -1;
-    size_t need = omega_bw_program_code_bytes(prog);
-    if (code_cap < need) return OMEGA_BW_CODE_BUFFER_TOO_SMALL; /* refused before any byte is written */
-    size_t emitted_size = 0;
-    if (omega_bw_encode_program(prog, code_buf, code_cap, &emitted_size) != 0) return -1;
-    kernel->code = code_buf;
-    kernel->code_size = emitted_size;
-    kernel->insn_count = emitted_size / 16;
-    kernel->gpr_count = prog->regalloc.peak_gpr_usage;
-    kernel->uniform_gpr_count = prog->regalloc.peak_ugpr_usage;
-    sha256_hash(kernel->code, kernel->code_size, kernel->code_digest);
-    return 0;
-}
-
-#ifndef OMEGA_GPU_NO_POSIX
-/* Hosted only: the allocating generators keep their names, caps and behavior. Each builds the program,
- * mallocs max_bytes (the cap each generator always had) and encodes through omega_blackwell_kernel_encode_into;
- * omega_blackwell_kernel_free releases the buffer. */
-static int bw_kernel_alloc_encode(const BlackwellIRProgram *prog, size_t max_bytes, OmegaBlackwellKernel *kernel) {
-    uint8_t *buf = (uint8_t *)malloc(max_bytes);
-    if (!buf) { kernel->code = NULL; return -1; }
-    if (omega_blackwell_kernel_encode_into(prog, buf, max_bytes, kernel) != 0) {
-        free(buf);
-        kernel->code = NULL;
-        return -1;
-    }
-    return 0;
-}
-
-int omega_blackwell_codegen_matmul_i32(const OmegaMatMulSpec *spec, OmegaBlackwellKernel *kernel) {
-    if (!spec || !kernel) return -1;
-    BlackwellIRProgram prog;
-    if (omega_blackwell_codegen_matmul_i32_prog(spec, &prog) != 0) return -1;
-    /* 13. the code buffer is exactly the padded program (the i32 generator never had a fixed cap) */
-    return bw_kernel_alloc_encode(&prog, omega_bw_program_code_bytes(&prog), kernel);
-}
-#endif
-
-int omega_blackwell_codegen_matmul_tensor_prog(const OmegaMatMulSpec *spec, BlackwellIRProgram *prog) {
-    if (!spec || !prog) return -1;
-    if (spec->m == 0 || spec->k == 0 || spec->n == 0) return -1;
-    if (spec->precision != OMEGA_MATMUL_PRECISION_FP16 && spec->precision != OMEGA_MATMUL_PRECISION_BF16) return -1;
-    if (spec->m % 16 != 0 || spec->n % 8 != 0 || spec->k != 16) {
-        BW_DIAG("ERROR: MatMul tensor codegen requires M multiple of 16, N multiple of 8, K=16 (got %ux%ux%u)\n",
-                spec->m, spec->k, spec->n);
-        return -1;
-    }
-
-    omega_bw_ir_init(prog);
-
-    /* 1. Allocate virtual registers */
-    /* 64-bit base pointers */
-    int v_ptr_a   = omega_bw_ir_alloc_vreg64(prog);
-    int v_ptr_b   = omega_bw_ir_alloc_vreg64(prog);
-    int v_ptr_c   = omega_bw_ir_alloc_vreg64(prog);
-    int uv_desc   = omega_bw_ir_alloc_uvreg64(prog);
-
-    /* 32-bit CTA / Thread indexing */
-    int v_tid     = omega_bw_ir_alloc_vreg(prog);
-    int v_ctaid_x = omega_bw_ir_alloc_vreg(prog);
-    int v_ctaid_y = omega_bw_ir_alloc_vreg(prog);
-
-    /* Tile and thread coordinates */
-    int v_group_id   = omega_bw_ir_alloc_vreg(prog);
-    int v_tid_in_grp = omega_bw_ir_alloc_vreg(prog);
-    int v_row_base   = omega_bw_ir_alloc_vreg(prog);
-    int v_col_base   = omega_bw_ir_alloc_vreg(prog);
-    int v_r0         = omega_bw_ir_alloc_vreg(prog);
-    int v_r1         = omega_bw_ir_alloc_vreg(prog);
-    int v_col_b      = omega_bw_ir_alloc_vreg(prog);
-    int v_tid_col2   = omega_bw_ir_alloc_vreg(prog);
-    int v_const_1    = omega_bw_ir_alloc_vreg(prog);
-
-    /* Bundles for HMMA */
-    int v_ra = omega_bw_ir_alloc_vreg128(prog); /* Quad: Ra[0]..Ra[3] */
-    int v_rb = omega_bw_ir_alloc_vreg64(prog);  /* Pair: Rb[0]..Rb[1] */
-    int v_rd = omega_bw_ir_alloc_vreg128(prog); /* Quad: Rd[0]..Rd[3] */
-
-    /* Scratch registers for indexing and loads */
-    int v_idx    = omega_bw_ir_alloc_vreg(prog);
-    int v_off    = omega_bw_ir_alloc_vreg64(prog);
-    int v_b_tmp0 = omega_bw_ir_alloc_vreg(prog);
-    int v_b_tmp1 = omega_bw_ir_alloc_vreg(prog);
-
-    if (v_b_tmp1 < 0) return -1;
-
-    /* 2. Load 64-bit global memory descriptor into uniform register pair */
-    /* LDCU.64 uv_desc, c[0x0][0x358] */
-    BlackwellIRInsn insn_desc = { .op = BW_IR_LDCU64, .dst_vreg = uv_desc, .imm = 0x358, .is_uniform = true };
-    omega_bw_ir_append(prog, &insn_desc);
-
-    /* 3. Load 64-bit base pointers from Constant Bank 0 */
-    /* LDC.64 v_ptr_a, c[0x0][0x380] */
-    BlackwellIRInsn insn_ptra = { .op = BW_IR_LDC64, .dst_vreg = v_ptr_a, .imm = 0x380 };
-    omega_bw_ir_append(prog, &insn_ptra);
-
-    /* LDC.64 v_ptr_b, c[0x0][0x388] */
-    BlackwellIRInsn insn_ptrb = { .op = BW_IR_LDC64, .dst_vreg = v_ptr_b, .imm = 0x388 };
-    omega_bw_ir_append(prog, &insn_ptrb);
-
-    /* LDC.64 v_ptr_c, c[0x0][0x390] */
-    BlackwellIRInsn insn_ptrc = { .op = BW_IR_LDC64, .dst_vreg = v_ptr_c, .imm = 0x390 };
-    omega_bw_ir_append(prog, &insn_ptrc);
-
-    /* 4. Query Special Registers */
-    /* S2R v_tid, SR_TID.X */
-    BlackwellIRInsn insn_tidx = { .op = BW_IR_S2R, .dst_vreg = v_tid, .imm = BW_SR_TID_X };
-    omega_bw_ir_append(prog, &insn_tidx);
-
-    /* S2R v_ctaid_x, SR_CTAID.X */
-    BlackwellIRInsn insn_cta_x = { .op = BW_IR_S2R, .dst_vreg = v_ctaid_x, .imm = BW_SR_CTAID_X };
-    omega_bw_ir_append(prog, &insn_cta_x);
-
-    /* S2R v_ctaid_y, SR_CTAID.Y */
-    BlackwellIRInsn insn_cta_y = { .op = BW_IR_S2R, .dst_vreg = v_ctaid_y, .imm = BW_SR_CTAID_Y };
-    omega_bw_ir_append(prog, &insn_cta_y);
-
-    /* 5. Set up constant 1 */
-    BlackwellIRInsn insn_c1 = { .op = BW_IR_MOV_IMM, .dst_vreg = v_const_1, .imm = 1 };
-    omega_bw_ir_append(prog, &insn_c1);
-
-    /* 6. Extract warp-level tile and thread coordinates */
-    /* group_id = tid >> 2 */
-    BlackwellIRInsn insn_grp = { .op = BW_IR_SHF_R, .dst_vreg = v_group_id, .src1_vreg = v_tid, .imm = 2 };
-    omega_bw_ir_append(prog, &insn_grp);
-
-    /* tid_in_grp = tid & 3 */
-    BlackwellIRInsn insn_tig = { .op = BW_IR_LOP3_AND, .dst_vreg = v_tid_in_grp, .src1_vreg = v_tid, .imm = 3 };
-    omega_bw_ir_append(prog, &insn_tig);
-
-    /* row_base = ctaid_y * 16 */
-    BlackwellIRInsn insn_rbase = { .op = BW_IR_IMAD, .dst_vreg = v_row_base, .src1_vreg = v_ctaid_y, .src2_vreg = -1, .imm = 16, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_rbase);
-
-    /* col_base = ctaid_x * 8 */
-    BlackwellIRInsn insn_cbase = { .op = BW_IR_IMAD, .dst_vreg = v_col_base, .src1_vreg = v_ctaid_x, .src2_vreg = -1, .imm = 8, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_cbase);
-
-    /* r0 = row_base + group_id */
-    BlackwellIRInsn insn_r0 = { .op = BW_IR_IADD3, .dst_vreg = v_r0, .src1_vreg = v_row_base, .src2_vreg = v_group_id, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_r0);
-
-    /* r1 = r0 + 8 */
-    BlackwellIRInsn insn_r1 = { .op = BW_IR_IMAD, .dst_vreg = v_r1, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = 8, .src3_vreg = v_r0 };
-    omega_bw_ir_append(prog, &insn_r1);
-
-    /* col_b = col_base + group_id */
-    BlackwellIRInsn insn_colb = { .op = BW_IR_IADD3, .dst_vreg = v_col_b, .src1_vreg = v_col_base, .src2_vreg = v_group_id, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_colb);
-
-    /* tid_col2 = tid_in_grp * 2 */
-    BlackwellIRInsn insn_tcol2 = { .op = BW_IR_IMAD, .dst_vreg = v_tid_col2, .src1_vreg = v_tid_in_grp, .src2_vreg = -1, .imm = 2, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_tcol2);
-
-    /* 7. Load A fragments (16x16 row-major, 2 bytes/element, row stride 32 bytes) */
-    /* Pair 0: a0, a1 at r0 * 32 + tid_col2 * 2 */
-    BlackwellIRInsn insn_a0_idx1 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r0, .src2_vreg = -1, .imm = 32, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_a0_idx1);
-    BlackwellIRInsn insn_a0_idx2 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_tid_col2, .src2_vreg = -1, .imm = 2, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_a0_idx2);
-    BlackwellIRInsn insn_a0_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 1, .src3_vreg = v_ptr_a };
-    omega_bw_ir_append(prog, &insn_a0_off);
-    BlackwellIRInsn insn_lda0    = { .op = BW_IR_LDG_E, .dst_vreg = v_ra, .dst_subreg = 0, .src1_vreg = v_off, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x001ea800 };
-    omega_bw_ir_append(prog, &insn_lda0);
-
-    /* Pair 1: a2, a3 at r1 * 32 + tid_col2 * 2 */
-    BlackwellIRInsn insn_a1_idx1 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r1, .src2_vreg = -1, .imm = 32, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_a1_idx1);
-    BlackwellIRInsn insn_a1_idx2 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_tid_col2, .src2_vreg = -1, .imm = 2, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_a1_idx2);
-    BlackwellIRInsn insn_a1_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 1, .src3_vreg = v_ptr_a };
-    omega_bw_ir_append(prog, &insn_a1_off);
-    BlackwellIRInsn insn_lda1    = { .op = BW_IR_LDG_E, .dst_vreg = v_ra, .dst_subreg = 1, .src1_vreg = v_off, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x001ea800 };
-    omega_bw_ir_append(prog, &insn_lda1);
-
-    /* Pair 2: a4, a5 at r0 * 32 + tid_col2 * 2 + 16 */
-    BlackwellIRInsn insn_a2_idx1 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r0, .src2_vreg = -1, .imm = 32, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_a2_idx1);
-    BlackwellIRInsn insn_a2_idx2 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_tid_col2, .src2_vreg = -1, .imm = 2, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_a2_idx2);
-    BlackwellIRInsn insn_a2_idx3 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = 16, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_a2_idx3);
-    BlackwellIRInsn insn_a2_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 1, .src3_vreg = v_ptr_a };
-    omega_bw_ir_append(prog, &insn_a2_off);
-    BlackwellIRInsn insn_lda2    = { .op = BW_IR_LDG_E, .dst_vreg = v_ra, .dst_subreg = 2, .src1_vreg = v_off, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x001ea800 };
-    omega_bw_ir_append(prog, &insn_lda2);
-
-    /* Pair 3: a6, a7 at r1 * 32 + tid_col2 * 2 + 16 */
-    BlackwellIRInsn insn_a3_idx1 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r1, .src2_vreg = -1, .imm = 32, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_a3_idx1);
-    BlackwellIRInsn insn_a3_idx2 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_tid_col2, .src2_vreg = -1, .imm = 2, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_a3_idx2);
-    BlackwellIRInsn insn_a3_idx3 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = 16, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_a3_idx3);
-    BlackwellIRInsn insn_a3_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 1, .src3_vreg = v_ptr_a };
-    omega_bw_ir_append(prog, &insn_a3_off);
-    BlackwellIRInsn insn_lda3    = { .op = BW_IR_LDG_E, .dst_vreg = v_ra, .dst_subreg = 3, .src1_vreg = v_off, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x001ea800 };
-    omega_bw_ir_append(prog, &insn_lda3);
-
-    /* 8. Load and pack B fragments (16xN row-major, 2 bytes/element) */
-    /* b0 at tid_col2 * N + col_b */
-    BlackwellIRInsn insn_b0_idx = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_tid_col2, .src2_vreg = -1, .imm = spec->n, .src3_vreg = v_col_b };
-    omega_bw_ir_append(prog, &insn_b0_idx);
-    BlackwellIRInsn insn_b0_off = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 2, .src3_vreg = v_ptr_b };
-    omega_bw_ir_append(prog, &insn_b0_off);
-    BlackwellIRInsn insn_ldb0   = { .op = BW_IR_LDG_E_U16, .dst_vreg = v_b_tmp0, .src1_vreg = v_off, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x002ea800 };
-    omega_bw_ir_append(prog, &insn_ldb0);
-
-    /* b1 at (tid_col2 + 1) * N + col_b = b0_idx + N */
-    BlackwellIRInsn insn_b1_idx = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = spec->n, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_b1_idx);
-    BlackwellIRInsn insn_b1_off = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 2, .src3_vreg = v_ptr_b };
-    omega_bw_ir_append(prog, &insn_b1_off);
-    BlackwellIRInsn insn_ldb1   = { .op = BW_IR_LDG_E_U16, .dst_vreg = v_b_tmp1, .src1_vreg = v_off, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x002ea800 };
-    omega_bw_ir_append(prog, &insn_ldb1);
-
-    /* Pack Rb[0] = (b1 << 16) | b0 (wait on barrier 2) */
-    BlackwellIRInsn insn_pack_b0 = { .op = BW_IR_IMAD, .dst_vreg = v_rb, .dst_subreg = 0, .src1_vreg = v_b_tmp1, .src2_vreg = -1, .imm = 0x10000, .src3_vreg = v_b_tmp0, .control = 0x004fca00 };
-    omega_bw_ir_append(prog, &insn_pack_b0);
-
-    /* b2 at (tid_col2 + 8) * N + col_b */
-    BlackwellIRInsn insn_b2_idx1 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_tid_col2, .src2_vreg = -1, .imm = spec->n, .src3_vreg = v_col_b };
-    omega_bw_ir_append(prog, &insn_b2_idx1);
-    BlackwellIRInsn insn_b2_idx2 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = 8 * spec->n, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_b2_idx2);
-    BlackwellIRInsn insn_b2_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 2, .src3_vreg = v_ptr_b };
-    omega_bw_ir_append(prog, &insn_b2_off);
-    BlackwellIRInsn insn_ldb2    = { .op = BW_IR_LDG_E_U16, .dst_vreg = v_b_tmp0, .src1_vreg = v_off, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x002ea800 };
-    omega_bw_ir_append(prog, &insn_ldb2);
-
-    /* b3 at (tid_col2 + 9) * N + col_b = b2_idx + N */
-    BlackwellIRInsn insn_b3_idx = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = spec->n, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_b3_idx);
-    BlackwellIRInsn insn_b3_off = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 2, .src3_vreg = v_ptr_b };
-    omega_bw_ir_append(prog, &insn_b3_off);
-    BlackwellIRInsn insn_ldb3   = { .op = BW_IR_LDG_E_U16, .dst_vreg = v_b_tmp1, .src1_vreg = v_off, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = 0x002ea800 };
-    omega_bw_ir_append(prog, &insn_ldb3);
-
-    /* Pack Rb[1] = (b3 << 16) | b2 (wait on barrier 2) */
-    BlackwellIRInsn insn_pack_b1 = { .op = BW_IR_IMAD, .dst_vreg = v_rb, .dst_subreg = 1, .src1_vreg = v_b_tmp1, .src2_vreg = -1, .imm = 0x10000, .src3_vreg = v_b_tmp0, .control = 0x004fca00 };
-    omega_bw_ir_append(prog, &insn_pack_b1);
-
-    /* 9. Execute HMMA Tensor Core instruction (wait on barrier 1 for A loads) */
-    BlackwellIROpcode mma_op = (spec->precision == OMEGA_MATMUL_PRECISION_BF16) ? BW_IR_HMMA_BF16 : BW_IR_HMMA_F16;
-    BlackwellIRInsn insn_hmma = {
-        .op = mma_op,
-        .dst_vreg = v_rd,
-        .dst_subreg = 0,
-        .src1_vreg = v_ra,
-        .src1_subreg = 0,
-        .src2_vreg = v_rb,
-        .src2_subreg = 0,
-        .src3_vreg = -1, /* RZ accumulator input */
-        .control = 0x002fca00 /* Wait on barrier 1 */
-    };
-    omega_bw_ir_append(prog, &insn_hmma);
-
-    /* 10. Store C output fragments (16xN row-major, 4 bytes/float element) */
-    /* d0: row r0, col col_base + tid_col2 + 0 */
-    BlackwellIRInsn insn_d0_idx1 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r0, .src2_vreg = -1, .imm = spec->n, .src3_vreg = v_col_base };
-    omega_bw_ir_append(prog, &insn_d0_idx1);
-    BlackwellIRInsn insn_d0_idx2 = { .op = BW_IR_IADD3, .dst_vreg = v_idx, .src1_vreg = v_idx, .src2_vreg = v_tid_col2, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_d0_idx2);
-    BlackwellIRInsn insn_d0_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c };
-    omega_bw_ir_append(prog, &insn_d0_off);
-    BlackwellIRInsn insn_std0    = { .op = BW_IR_STG_E, .src1_vreg = v_off, .src2_vreg = v_rd, .src2_subreg = 0, .ureg = uv_desc, .control = 0x000fe200 };
-    omega_bw_ir_append(prog, &insn_std0);
-
-    /* d1: row r0, col col_base + tid_col2 + 1 */
-    BlackwellIRInsn insn_d1_idx  = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = 1, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_d1_idx);
-    BlackwellIRInsn insn_d1_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c };
-    omega_bw_ir_append(prog, &insn_d1_off);
-    BlackwellIRInsn insn_std1    = { .op = BW_IR_STG_E, .src1_vreg = v_off, .src2_vreg = v_rd, .src2_subreg = 1, .ureg = uv_desc, .control = 0x000fe200 };
-    omega_bw_ir_append(prog, &insn_std1);
-
-    /* d2: row r1, col col_base + tid_col2 + 0 */
-    BlackwellIRInsn insn_d2_idx1 = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r1, .src2_vreg = -1, .imm = spec->n, .src3_vreg = v_col_base };
-    omega_bw_ir_append(prog, &insn_d2_idx1);
-    BlackwellIRInsn insn_d2_idx2 = { .op = BW_IR_IADD3, .dst_vreg = v_idx, .src1_vreg = v_idx, .src2_vreg = v_tid_col2, .src3_vreg = -1 };
-    omega_bw_ir_append(prog, &insn_d2_idx2);
-    BlackwellIRInsn insn_d2_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c };
-    omega_bw_ir_append(prog, &insn_d2_off);
-    BlackwellIRInsn insn_std2    = { .op = BW_IR_STG_E, .src1_vreg = v_off, .src2_vreg = v_rd, .src2_subreg = 2, .ureg = uv_desc, .control = 0x000fe200 };
-    omega_bw_ir_append(prog, &insn_std2);
-
-    /* d3: row r1, col col_base + tid_col2 + 1 */
-    BlackwellIRInsn insn_d3_idx  = { .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_const_1, .src2_vreg = -1, .imm = 1, .src3_vreg = v_idx };
-    omega_bw_ir_append(prog, &insn_d3_idx);
-    BlackwellIRInsn insn_d3_off  = { .op = BW_IR_IMAD_WIDE, .dst_vreg = v_off, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c };
-    omega_bw_ir_append(prog, &insn_d3_off);
-    BlackwellIRInsn insn_std3    = { .op = BW_IR_STG_E, .src1_vreg = v_off, .src2_vreg = v_rd, .src2_subreg = 3, .ureg = uv_desc, .control = 0x000fe200 };
-    omega_bw_ir_append(prog, &insn_std3);
-
-    /* 11. Program Exit */
-    BlackwellIRInsn insn_exit = { .op = BW_IR_EXIT };
-    omega_bw_ir_append(prog, &insn_exit);
-    BlackwellIRInsn insn_bra  = { .op = BW_IR_BRA };
-    omega_bw_ir_append(prog, &insn_bra);
-
-    /* 12. Run bounded register allocation */
-    if (omega_bw_regalloc_solve(prog) != 0) {
-        return -1;
-    }
-    return 0;
-}
-
-#ifndef OMEGA_GPU_NO_POSIX
-int omega_blackwell_codegen_matmul_tensor(const OmegaMatMulSpec *spec, OmegaBlackwellKernel *kernel) {
-    if (!spec || !kernel) return -1;
-    BlackwellIRProgram prog;
-    if (omega_blackwell_codegen_matmul_tensor_prog(spec, &prog) != 0) {
-        return -1;
-    }
-
-    return bw_kernel_alloc_encode(&prog, OMEGA_BW_CODE_CAP_SMALL, kernel);
-}
-#endif
-
-/* ---- FB-1 cut 1b: looped tensor matmul ------------------------------------------
- *
- * Control words (bundle bits 105..125, decoded from the chip-proven kernel and from
- * the vendor compiler's SASS for an equivalent HMMA loop on this chip, 2026-10-04):
- *   stall = bits 9..12 of w[3], yield = 13, write barrier = 14..16, read barrier =
- *   17..19, wait mask = 20..25. 7 in a barrier field means "none".
- *   LDG (A)      0x001ea800  stall 4, yield, sets SB2
- *   LDG.U16 (B)  0x002ea800  stall 4, yield, sets SB2
- *   pack IMAD    0x004fca00  stall 5, waits SB2 (every outstanding load has landed)
- *   HMMA         0x002fca00  stall 5 (fixed latency: the vendor compiler sets no
- *                            write barrier on HMMA either; consumers wait by stall count)
- *   STG          0x0007e200  stall 1, yield, read barrier SB3 (the store may read its
- *                            data/address registers late; the next writer waits SB3)
- *   wait SB3     mask bit 23 (0x00800000) on the first instruction that overwrites a
- *                            register a store reads: the C pointer advance.
- * Loop-carried registers are kept live to the end of their loop (keep_alive) because
- * the allocator is a straight-line linear scan and knows nothing about back edges.
- */
-static void bw_keep_alive(BlackwellIRProgram *prog, int from_idx, int to_idx, int last_idx) {
-    /* every vreg first defined in [from_idx, to_idx) stays live until last_idx */
-    for (int v = 0; v < prog->regalloc.num_vregs; v++) {
-        OmegaLiveInterval *iv = &prog->regalloc.intervals[v];
-        if (iv->first_def >= from_idx && iv->first_def < to_idx && iv->last_use < last_idx)
-            iv->last_use = last_idx;
-    }
-}
-
-#define BW_APPEND(prog, ...) do { BlackwellIRInsn _i = { __VA_ARGS__ }; if (omega_bw_ir_append((prog), &_i) < 0) return -1; } while (0)
-
-int omega_blackwell_codegen_matmul_tensor_loop_prog(const OmegaMatMulSpec *spec, uint32_t grid_x,
-                                                    int mutant, BlackwellIRProgram *prog) {
-    if (!spec || !prog) return -1;
-    if (spec->m == 0 || spec->k == 0 || spec->n == 0) return -1;
-    if (spec->precision != OMEGA_MATMUL_PRECISION_FP16 && spec->precision != OMEGA_MATMUL_PRECISION_BF16) return -1;
-    if (spec->m % 16 != 0 || spec->n % 8 != 0 || spec->k % 16 != 0) {
-        BW_DIAG("ERROR: looped MatMul tensor codegen requires M%%16, N%%8, K%%16 (got %ux%ux%u)\n",
-                spec->m, spec->k, spec->n);
-        return -1;
-    }
-    const uint32_t K = spec->k, N = spec->n, NT = N / 8, KSTEPS = K / 16;
-    if (grid_x == 0 || grid_x > NT) return -1;
-    /* every immediate below must fit 32 bits: 32 * N (B row-block stride in bytes) is the largest */
-    if ((uint64_t)N * 32u > 0xffffffffull || (uint64_t)grid_x * 32u > 0xffffffffull) return -1;
-    if (mutant && KSTEPS < 2) return -1;
-
-    omega_bw_ir_init(prog);
-
-    int v_ptr_a = omega_bw_ir_alloc_vreg64(prog), v_ptr_b = omega_bw_ir_alloc_vreg64(prog), v_ptr_c = omega_bw_ir_alloc_vreg64(prog);
-    int uv_desc = omega_bw_ir_alloc_uvreg64(prog);
-    int v_tid = omega_bw_ir_alloc_vreg(prog), v_ctaid_x = omega_bw_ir_alloc_vreg(prog), v_ctaid_y = omega_bw_ir_alloc_vreg(prog);
-    int v_group = omega_bw_ir_alloc_vreg(prog), v_tig = omega_bw_ir_alloc_vreg(prog), v_tcol2 = omega_bw_ir_alloc_vreg(prog);
-    int v_r0 = omega_bw_ir_alloc_vreg(prog), v_r1 = omega_bw_ir_alloc_vreg(prog), v_c1 = omega_bw_ir_alloc_vreg(prog);
-    int v_idx = omega_bw_ir_alloc_vreg(prog), v_col = omega_bw_ir_alloc_vreg(prog), v_cnt = omega_bw_ir_alloc_vreg(prog);
-    int v_pa0 = omega_bw_ir_alloc_vreg64(prog), v_pa1 = omega_bw_ir_alloc_vreg64(prog), v_pbcol = omega_bw_ir_alloc_vreg64(prog);
-    int v_pc0 = omega_bw_ir_alloc_vreg64(prog), v_pc1 = omega_bw_ir_alloc_vreg64(prog);
-    int v_pa0c = omega_bw_ir_alloc_vreg64(prog), v_pa1c = omega_bw_ir_alloc_vreg64(prog), v_pbc = omega_bw_ir_alloc_vreg64(prog);
-    int v_ta2 = omega_bw_ir_alloc_vreg64(prog), v_ta3 = omega_bw_ir_alloc_vreg64(prog);
-    int v_tb1 = omega_bw_ir_alloc_vreg64(prog), v_tb2 = omega_bw_ir_alloc_vreg64(prog), v_tb3 = omega_bw_ir_alloc_vreg64(prog);
-    int v_tc1 = omega_bw_ir_alloc_vreg64(prog), v_tc3 = omega_bw_ir_alloc_vreg64(prog);
-    int v_ra = omega_bw_ir_alloc_vreg128(prog), v_rb = omega_bw_ir_alloc_vreg64(prog), v_rd = omega_bw_ir_alloc_vreg128(prog);
-    int v_b0 = omega_bw_ir_alloc_vreg(prog), v_b1 = omega_bw_ir_alloc_vreg(prog);
-    if (v_b1 < 0 || uv_desc < 0) return -1;
-
-    const uint32_t CTRL_LDA = 0x001ea800u, CTRL_LDB = 0x002ea800u, CTRL_PACK = 0x004fca00u;
-    const uint32_t CTRL_HMMA = 0x002fca00u, CTRL_STG_RDBAR3 = 0x0007e200u, CTRL_IMADW_WAIT3 = 0x009fcc00u;
-    const uint32_t CTRL_MOVRZ_WAIT3 = 0x008fe200u;
-
-    /* prologue: descriptor, pointers, ids */
-    BW_APPEND(prog, .op = BW_IR_LDCU64, .dst_vreg = uv_desc, .imm = 0x358, .is_uniform = true);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_a, .imm = 0x380);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_b, .imm = 0x388);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_c, .imm = 0x390);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_tid, .imm = BW_SR_TID_X);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_ctaid_x, .imm = BW_SR_CTAID_X);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_ctaid_y, .imm = BW_SR_CTAID_Y);
-    BW_APPEND(prog, .op = BW_IR_MOV_IMM, .dst_vreg = v_c1, .imm = 1);
-    BW_APPEND(prog, .op = BW_IR_SHF_R, .dst_vreg = v_group, .src1_vreg = v_tid, .imm = 2);
-    BW_APPEND(prog, .op = BW_IR_LOP3_AND, .dst_vreg = v_tig, .src1_vreg = v_tid, .imm = 3);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_tcol2, .src1_vreg = v_tig, .src2_vreg = -1, .imm = 2, .src3_vreg = -1);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_r0, .src1_vreg = v_ctaid_y, .src2_vreg = -1, .imm = 16, .src3_vreg = v_group);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_r1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 8, .src3_vreg = v_r0);
-    /* pa0 = A + (r0*K + tcol2)*2 ; pa1 likewise with r1 (A row-major, K bf16 per row) */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r0, .src2_vreg = -1, .imm = K, .src3_vreg = v_tcol2);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pa0, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 2, .src3_vreg = v_ptr_a);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r1, .src2_vreg = -1, .imm = K, .src3_vreg = v_tcol2);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pa1, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 2, .src3_vreg = v_ptr_a);
-    /* col = ctaid_x (first column tile of this CTA) */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_col, .src1_vreg = v_ctaid_x, .src2_vreg = -1, .imm = 1, .src3_vreg = -1);
-    /* pbcol = B + (tcol2*N + col*8 + group)*2 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_tcol2, .src2_vreg = -1, .imm = N, .src3_vreg = v_group);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = 8, .src3_vreg = v_idx);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbcol, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 2, .src3_vreg = v_ptr_b);
-    /* pc0 = C + (r0*N + col*8 + tcol2)*4 ; pc1 with r1 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r0, .src2_vreg = -1, .imm = N, .src3_vreg = v_tcol2);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = 8, .src3_vreg = v_idx);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc0, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r1, .src2_vreg = -1, .imm = N, .src3_vreg = v_tcol2);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = 8, .src3_vreg = v_idx);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc1, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c);
-
-    /* ---- column-tile loop ---- */
-    const int L_col = (int)prog->count;
-    /* accumulator = 0 (the first write waits SB3: the previous tile's stores may still read it) */
-    BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd, .dst_subreg = 0, .control = CTRL_MOVRZ_WAIT3);
-    BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd, .dst_subreg = 1);
-    BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd, .dst_subreg = 2);
-    BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd, .dst_subreg = 3);
-    /* K cursors start at the row/column bases (IMAD.WIDE with imm 0 is a 64-bit copy) */
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pa0c, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0, .src3_vreg = v_pa0);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pa1c, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0, .src3_vreg = v_pa1);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbc, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0, .src3_vreg = v_pbcol);
-    BW_APPEND(prog, .op = BW_IR_MOV_IMM, .dst_vreg = v_cnt, .imm = mutant ? KSTEPS - 1 : KSTEPS);
-
-    /* ---- K loop: one 16x16 A fragment and one 16x8 B fragment per step ---- */
-    const int L_k = (int)prog->count;
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_ta2, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 16, .src3_vreg = v_pa0c);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_ta3, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 16, .src3_vreg = v_pa1c);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_tb1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 2u * N, .src3_vreg = v_pbc);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_tb2, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 16u * N, .src3_vreg = v_pbc);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_tb3, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 18u * N, .src3_vreg = v_pbc);
-    /* A: a0,a1 at (r0, kk+tcol2) ; a2,a3 at (r1, ...) ; a4,a5 at (r0, +8) ; a6,a7 at (r1, +8) */
-    BW_APPEND(prog, .op = BW_IR_LDG_E, .dst_vreg = v_ra, .dst_subreg = 0, .src1_vreg = v_pa0c, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_LDA);
-    BW_APPEND(prog, .op = BW_IR_LDG_E, .dst_vreg = v_ra, .dst_subreg = 1, .src1_vreg = v_pa1c, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_LDA);
-    BW_APPEND(prog, .op = BW_IR_LDG_E, .dst_vreg = v_ra, .dst_subreg = 2, .src1_vreg = v_ta2, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_LDA);
-    BW_APPEND(prog, .op = BW_IR_LDG_E, .dst_vreg = v_ra, .dst_subreg = 3, .src1_vreg = v_ta3, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_LDA);
-    /* B: rows kk+tcol2, +1, +8, +9 at column col*8+group */
-    BW_APPEND(prog, .op = BW_IR_LDG_E_U16, .dst_vreg = v_b0, .src1_vreg = v_pbc, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_LDB);
-    BW_APPEND(prog, .op = BW_IR_LDG_E_U16, .dst_vreg = v_b1, .src1_vreg = v_tb1, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_LDB);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_rb, .dst_subreg = 0, .src1_vreg = v_b1, .src2_vreg = -1, .imm = 0x10000, .src3_vreg = v_b0, .control = CTRL_PACK);
-    BW_APPEND(prog, .op = BW_IR_LDG_E_U16, .dst_vreg = v_b0, .src1_vreg = v_tb2, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_LDB);
-    BW_APPEND(prog, .op = BW_IR_LDG_E_U16, .dst_vreg = v_b1, .src1_vreg = v_tb3, .src2_vreg = -1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_LDB);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_rb, .dst_subreg = 1, .src1_vreg = v_b1, .src2_vreg = -1, .imm = 0x10000, .src3_vreg = v_b0, .control = CTRL_PACK);
-    /* rd += ra * rb (accumulate in place) */
-    BW_APPEND(prog, .op = (spec->precision == OMEGA_MATMUL_PRECISION_BF16) ? BW_IR_HMMA_BF16 : BW_IR_HMMA_F16,
-              .dst_vreg = v_rd, .dst_subreg = 0, .src1_vreg = v_ra, .src1_subreg = 0, .src2_vreg = v_rb, .src2_subreg = 0,
-              .src3_vreg = v_rd, .src3_subreg = 0, .control = CTRL_HMMA);
-    /* advance K: A by 16 bf16 (32 bytes), B by 16 rows (32 N bytes); every load above has landed (packs waited SB2) */
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pa0c, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 32, .src3_vreg = v_pa0c);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pa1c, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 32, .src3_vreg = v_pa1c);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbc, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 32u * N, .src3_vreg = v_pbc);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_cnt, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0xffffffffu, .src3_vreg = v_cnt);
-    BW_APPEND(prog, .op = BW_IR_ISETP_GE, .dst_vreg = -1, .src1_vreg = v_cnt, .src2_vreg = -1, .imm = 1, .src3_vreg = -1);
-    {
-        int here = (int)prog->count;
-        BW_APPEND(prog, .op = BW_IR_BRA, .imm = (uint32_t)(int32_t)(L_k - here), .predicate_p0 = true);
-    }
-    const int L_k_end = (int)prog->count - 1;
-
-    /* ---- store the 16x8 tile: d0 (r0, c), d1 (r0, c+1), d2 (r1, c), d3 (r1, c+1) ---- */
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_tc1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 4, .src3_vreg = v_pc0);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_tc3, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 4, .src3_vreg = v_pc1);
-    BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_pc0, .src2_vreg = v_rd, .src2_subreg = 0, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_STG_RDBAR3);
-    BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_tc1, .src2_vreg = v_rd, .src2_subreg = 1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_STG_RDBAR3);
-    BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_pc1, .src2_vreg = v_rd, .src2_subreg = 2, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_STG_RDBAR3);
-    BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_tc3, .src2_vreg = v_rd, .src2_subreg = 3, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_STG_RDBAR3);
-    /* next column tile of this CTA: col += grid_x ; B by grid_x*8 bf16 ; C by grid_x*8 f32 (waits SB3 first) */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_col, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x, .src3_vreg = v_col);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc0, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * 32u, .src3_vreg = v_pc0, .control = CTRL_IMADW_WAIT3);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * 32u, .src3_vreg = v_pc1);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbcol, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * 16u, .src3_vreg = v_pbcol);
-    BW_APPEND(prog, .op = BW_IR_ISETP_GE, .dst_vreg = -1, .src1_vreg = v_col, .src2_vreg = -1, .imm = NT, .src3_vreg = -1);
-    {
-        int here = (int)prog->count;
-        BW_APPEND(prog, .op = BW_IR_BRA, .imm = (uint32_t)(int32_t)(L_col - here), .predicate_p0 = true, .predicate_not = true);
-    }
-    const int L_col_end = (int)prog->count - 1;
-    BW_APPEND(prog, .op = BW_IR_EXIT);
-    BW_APPEND(prog, .op = BW_IR_BRA);
-
-    /* loop-carried values live to the end of their loop */
-    bw_keep_alive(prog, 0, L_col, L_col_end);
-    bw_keep_alive(prog, L_col, L_k, L_k_end);
-    /* K-loop temporaries too: a load's address pair must never be recycled by a
-     * later instruction of the same iteration (the load may read it late). */
-    bw_keep_alive(prog, L_k, L_k_end, L_k_end);
-    /* the accumulator is read by the stores after the K loop */
-    if (prog->regalloc.intervals[v_rd].last_use < L_col_end) prog->regalloc.intervals[v_rd].last_use = L_col_end;
-
-    return omega_bw_regalloc_solve(prog);
-}
-
-#ifndef OMEGA_GPU_NO_POSIX
-int omega_blackwell_codegen_matmul_tensor_loop(const OmegaMatMulSpec *spec, uint32_t grid_x,
-                                               int mutant, OmegaBlackwellKernel *kernel) {
-    if (!spec || !kernel) return -1;
-    BlackwellIRProgram prog;
-    if (omega_blackwell_codegen_matmul_tensor_loop_prog(spec, grid_x, mutant, &prog) != 0) return -1;
-    return bw_kernel_alloc_encode(&prog, OMEGA_BW_CODE_CAP_SMALL, kernel);
-}
-#endif
-
-/* ---- omega #328: fragment-major tensor matmul ----------------------------------------
- *
- * The looped kernel above reads B as four scattered 2-byte loads per K step and waits for
- * them before the next step (pack waits SB2), so each warp has one 256-byte step in flight;
- * at m = 1 on GB10 that streams the weights at about 28 GB/s (omega #328 measurement).
- * Here A and B arrive in the order HMMA.16816 consumes them (omega_matmul_frag_pack_a / _b):
- *   A block (mt, ks): 512 bytes, lane L at L*16: a0..a7, one LDG.E.128 per step;
- *   B block (nt, ks): 256 bytes, lane L at L*8:  b0..b3, one LDG.E.64 per step;
- * consecutive K steps of one tile are adjacent, so a warp streams its column tile. Each loop
- * pass issues `unroll` steps of loads at immediate offsets (A on SB2, B on SB4), then runs the HMMA
- * chain: every HMMA waits SB2 and SB4 (stall 15) and a NOP (stall 14) follows it, the 29 cycles nvcc
- * puts between dependent HMMA.16816 (omega_blackwell_verify_codegen_fixtures_fragmm).
- * The cursors advance only after the chain, when every load has landed (the HMMAs waited
- * SB2 and SB4), as in the looped kernel. Stores, the column-tile loop and the C layout (row-major
- * f32) are the looped kernel's. */
-/* A loads set SB2 and B loads SB4 (nvcc spreads loads over several scoreboards too); at the
- * product unroll of 4 that is 4 loads per scoreboard per pass. The scoreboard depth is not
- * documented to us; splitting did not make unroll 8 complete (omega_matmul_frag_unroll). */
-#define BW_FRAG_CTRL_LDG_A 0x000ea800u /* stall 4, yield, sets SB2 (nvcc word) */
-#define BW_FRAG_CTRL_LDG_B 0x000f2800u /* stall 4, yield, sets SB4 (nvcc word) */
-#define BW_FRAG_CTRL_HMMA  0x014fde00u /* stall 15, waits SB2 and SB4 (nvcc: dependent HMMA chain) */
-#define BW_FRAG_CTRL_NOP  0x000fdc00u /* stall 14 (nvcc, between dependent HMMAs) */
-
-static void bw_live_until(BlackwellIRProgram *prog, int vreg, int last_idx) {
-    if (prog->regalloc.intervals[vreg].last_use < last_idx) prog->regalloc.intervals[vreg].last_use = last_idx;
-}
-
-int omega_blackwell_codegen_matmul_frag_prog(const OmegaMatMulSpec *spec, uint32_t grid_x, uint32_t unroll,
-                                             int mutant, BlackwellIRProgram *prog) {
-    if (!spec || !prog) return -1;
-    if (spec->m == 0 || spec->k == 0 || spec->n == 0) return -1;
-    if (spec->precision != OMEGA_MATMUL_PRECISION_FP16 && spec->precision != OMEGA_MATMUL_PRECISION_BF16) return -1;
-    if (spec->m % 16 != 0 || spec->n % 8 != 0 || spec->k % 16 != 0) return -1;
-    if (unroll != 1 && unroll != 2 && unroll != 4 && unroll != 8) return -1;
-    const uint32_t K = spec->k, N = spec->n, NT = N / 8, KS = K / 16;
-    if (KS % unroll != 0) return -1;
-    const uint32_t ITERS = KS / unroll;
-    if (grid_x == 0 || grid_x > NT) return -1;
-    if (mutant && ITERS < 2) return -1;
-    /* every index and immediate below must fit 32 bits (rows up to OMEGA_BW_MATMUL_MAX_M) */
-    if ((uint64_t)NT * KS * 32u > 0xffffffffull || (uint64_t)(OMEGA_BW_MATMUL_MAX_M / 16u) * KS * 32u > 0xffffffffull ||
-        (uint64_t)grid_x * KS * 256u > 0xffffffffull || (uint64_t)N * 32u > 0xffffffffull ||
-        (uint64_t)OMEGA_BW_MATMUL_MAX_M * N > 0xffffffffull)
-        return -1;
-
-    omega_bw_ir_init(prog);
-    int v_ptr_a = omega_bw_ir_alloc_vreg64(prog), v_ptr_b = omega_bw_ir_alloc_vreg64(prog), v_ptr_c = omega_bw_ir_alloc_vreg64(prog);
-    int uv_desc = omega_bw_ir_alloc_uvreg64(prog);
-    int v_tid = omega_bw_ir_alloc_vreg(prog), v_ctaid_x = omega_bw_ir_alloc_vreg(prog), v_ctaid_y = omega_bw_ir_alloc_vreg(prog);
-    int v_group = omega_bw_ir_alloc_vreg(prog), v_tig = omega_bw_ir_alloc_vreg(prog), v_tcol2 = omega_bw_ir_alloc_vreg(prog);
-    int v_r0 = omega_bw_ir_alloc_vreg(prog), v_r1 = omega_bw_ir_alloc_vreg(prog), v_c1 = omega_bw_ir_alloc_vreg(prog);
-    int v_idx = omega_bw_ir_alloc_vreg(prog), v_col = omega_bw_ir_alloc_vreg(prog), v_cnt = omega_bw_ir_alloc_vreg(prog);
-    int v_pa = omega_bw_ir_alloc_vreg64(prog), v_pbcol = omega_bw_ir_alloc_vreg64(prog);
-    int v_pc0 = omega_bw_ir_alloc_vreg64(prog), v_pc1 = omega_bw_ir_alloc_vreg64(prog);
-    int v_pac = omega_bw_ir_alloc_vreg64(prog), v_pbc = omega_bw_ir_alloc_vreg64(prog);
-    int v_tc1 = omega_bw_ir_alloc_vreg64(prog), v_tc3 = omega_bw_ir_alloc_vreg64(prog);
-    int v_rd = omega_bw_ir_alloc_vreg128(prog);
-    int v_ra[8], v_rb[8];
-    for (uint32_t u = 0; u < unroll; u++) { v_ra[u] = omega_bw_ir_alloc_vreg128(prog); v_rb[u] = omega_bw_ir_alloc_vreg64(prog); }
-    if (v_rb[unroll - 1] < 0 || v_ra[unroll - 1] < 0 || uv_desc < 0) return -1;
-
-    const uint32_t CTRL_STG_RDBAR3 = 0x0007e200u, CTRL_IMADW_WAIT3 = 0x009fcc00u, CTRL_MOVRZ_WAIT3 = 0x008fe200u;
-
-    /* prologue: descriptor, pointers, ids (as the looped kernel) */
-    BW_APPEND(prog, .op = BW_IR_LDCU64, .dst_vreg = uv_desc, .imm = 0x358, .is_uniform = true);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_a, .imm = 0x380);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_b, .imm = 0x388);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_c, .imm = 0x390);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_tid, .imm = BW_SR_TID_X);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_ctaid_x, .imm = BW_SR_CTAID_X);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_ctaid_y, .imm = BW_SR_CTAID_Y);
-    BW_APPEND(prog, .op = BW_IR_MOV_IMM, .dst_vreg = v_c1, .imm = 1);
-    BW_APPEND(prog, .op = BW_IR_SHF_R, .dst_vreg = v_group, .src1_vreg = v_tid, .imm = 2);
-    BW_APPEND(prog, .op = BW_IR_LOP3_AND, .dst_vreg = v_tig, .src1_vreg = v_tid, .imm = 3);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_tcol2, .src1_vreg = v_tig, .src2_vreg = -1, .imm = 2, .src3_vreg = -1);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_r0, .src1_vreg = v_ctaid_y, .src2_vreg = -1, .imm = 16, .src3_vreg = v_group);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_r1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 8, .src3_vreg = v_r0);
-    /* pa = A + (ctaid_y * KS * 32 + tid) * 16: this CTA's row tile, this lane's 16 bytes of step 0 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_ctaid_y, .src2_vreg = -1, .imm = KS * 32u, .src3_vreg = v_tid);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pa, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 16, .src3_vreg = v_ptr_a);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_col, .src1_vreg = v_ctaid_x, .src2_vreg = -1, .imm = 1, .src3_vreg = -1);
-    /* pbcol = B + (col * KS * 32 + tid) * 8: column tile col, this lane's 8 bytes of step 0 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = KS * 32u, .src3_vreg = v_tid);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbcol, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 8, .src3_vreg = v_ptr_b);
-    /* pc0 = C + (r0*N + col*8 + tcol2)*4 ; pc1 with r1 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r0, .src2_vreg = -1, .imm = N, .src3_vreg = v_tcol2);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = 8, .src3_vreg = v_idx);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc0, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r1, .src2_vreg = -1, .imm = N, .src3_vreg = v_tcol2);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = 8, .src3_vreg = v_idx);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc1, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c);
-
-    /* ---- column-tile loop ---- */
-    const int L_col = (int)prog->count;
-    BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd, .dst_subreg = 0, .control = CTRL_MOVRZ_WAIT3);
-    BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd, .dst_subreg = 1);
-    BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd, .dst_subreg = 2);
-    BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd, .dst_subreg = 3);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pac, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0, .src3_vreg = v_pa);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbc, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0, .src3_vreg = v_pbcol);
-    BW_APPEND(prog, .op = BW_IR_MOV_IMM, .dst_vreg = v_cnt, .imm = mutant ? ITERS - 1 : ITERS);
-
-    /* ---- K loop: `unroll` steps of loads, then the HMMA chain ---- */
-    const int L_k = (int)prog->count;
-    for (uint32_t u = 0; u < unroll; u++) {
-        BW_APPEND(prog, .op = BW_IR_LDG_E_128, .dst_vreg = v_ra[u], .src1_vreg = v_pac, .src2_vreg = -1, .src3_vreg = -1,
-                  .ureg = uv_desc, .imm = u * 512u, .control = BW_FRAG_CTRL_LDG_A);
-        BW_APPEND(prog, .op = BW_IR_LDG_E_64, .dst_vreg = v_rb[u], .src1_vreg = v_pbc, .src2_vreg = -1, .src3_vreg = -1,
-                  .ureg = uv_desc, .imm = u * 256u, .control = BW_FRAG_CTRL_LDG_B);
-    }
-    const BlackwellIROpcode hmma = (spec->precision == OMEGA_MATMUL_PRECISION_BF16) ? BW_IR_HMMA_BF16 : BW_IR_HMMA_F16;
-    for (uint32_t u = 0; u < unroll; u++) {
-        BW_APPEND(prog, .op = hmma, .dst_vreg = v_rd, .src1_vreg = v_ra[u], .src2_vreg = v_rb[u], .src3_vreg = v_rd,
-                  .control = BW_FRAG_CTRL_HMMA);
-        BW_APPEND(prog, .op = BW_IR_NOP, .dst_vreg = -1, .src1_vreg = -1, .src2_vreg = -1, .src3_vreg = -1, .ureg = -1,
-                  .control = BW_FRAG_CTRL_NOP);
-    }
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pac, .src1_vreg = v_c1, .src2_vreg = -1, .imm = unroll * 512u, .src3_vreg = v_pac);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbc, .src1_vreg = v_c1, .src2_vreg = -1, .imm = unroll * 256u, .src3_vreg = v_pbc);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_cnt, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0xffffffffu, .src3_vreg = v_cnt);
-    BW_APPEND(prog, .op = BW_IR_ISETP_GE, .dst_vreg = -1, .src1_vreg = v_cnt, .src2_vreg = -1, .imm = 1, .src3_vreg = -1);
-    {
-        int here = (int)prog->count;
-        BW_APPEND(prog, .op = BW_IR_BRA, .imm = (uint32_t)(int32_t)(L_k - here), .predicate_p0 = true);
-    }
-    const int L_k_end = (int)prog->count - 1;
-
-    /* ---- store the 16x8 tile (as the looped kernel) ---- */
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_tc1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 4, .src3_vreg = v_pc0);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_tc3, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 4, .src3_vreg = v_pc1);
-    BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_pc0, .src2_vreg = v_rd, .src2_subreg = 0, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_STG_RDBAR3);
-    BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_tc1, .src2_vreg = v_rd, .src2_subreg = 1, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_STG_RDBAR3);
-    BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_pc1, .src2_vreg = v_rd, .src2_subreg = 2, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_STG_RDBAR3);
-    BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_tc3, .src2_vreg = v_rd, .src2_subreg = 3, .src3_vreg = -1, .ureg = uv_desc, .control = CTRL_STG_RDBAR3);
-    /* next column tile: col += grid_x ; C by grid_x*8 f32 (waits SB3 first) ; B by grid_x tiles of KS*256 bytes */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_col, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x, .src3_vreg = v_col);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc0, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * 32u, .src3_vreg = v_pc0, .control = CTRL_IMADW_WAIT3);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * 32u, .src3_vreg = v_pc1);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbcol, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * KS * 256u, .src3_vreg = v_pbcol);
-    BW_APPEND(prog, .op = BW_IR_ISETP_GE, .dst_vreg = -1, .src1_vreg = v_col, .src2_vreg = -1, .imm = NT, .src3_vreg = -1);
-    {
-        int here = (int)prog->count;
-        BW_APPEND(prog, .op = BW_IR_BRA, .imm = (uint32_t)(int32_t)(L_col - here), .predicate_p0 = true, .predicate_not = true);
-    }
-    const int L_col_end = (int)prog->count - 1;
-    BW_APPEND(prog, .op = BW_IR_EXIT);
-    BW_APPEND(prog, .op = BW_IR_BRA);
-
-    /* Loop-carried values live to the end of their loop (the allocator knows no back edges).
-     * Only these are read in a later pass than the one that wrote them; prologue temporaries
-     * are dead before the first loop and may be reused. K-loop temporaries (fragments) are
-     * kept to the end of the pass, as in the looped kernel. */
-    const int col_carried[] = { v_c1, v_col, v_pa, v_pbcol, v_pc0, v_pc1, v_rd };
-    for (size_t i = 0; i < sizeof col_carried / sizeof col_carried[0]; i++) bw_live_until(prog, col_carried[i], L_col_end);
-    const int k_carried[] = { v_pac, v_pbc, v_cnt };
-    for (size_t i = 0; i < sizeof k_carried / sizeof k_carried[0]; i++) bw_live_until(prog, k_carried[i], L_k_end);
-    bw_keep_alive(prog, L_k, L_k_end, L_k_end);
-    return omega_bw_regalloc_solve(prog);
-}
-
-#ifndef OMEGA_GPU_NO_POSIX
-int omega_blackwell_codegen_matmul_frag(const OmegaMatMulSpec *spec, uint32_t grid_x, uint32_t unroll,
-                                        int mutant, OmegaBlackwellKernel *kernel) {
-    if (!spec || !kernel) return -1;
-    BlackwellIRProgram prog;
-    if (omega_blackwell_codegen_matmul_frag_prog(spec, grid_x, unroll, mutant, &prog) != 0) return -1;
-    return bw_kernel_alloc_encode(&prog, OMEGA_BW_CODE_CAP_SMALL, kernel);
-}
-#endif
-
-/* Capped at 4: unroll 8 (72 registers, 16 loads per pass) never completed on the GB10, with all
- * loads on SB2 and again with A on SB2 and B on SB4 (2026-10-07 07:50Z and 07:54Z, omega #328),
- * while unroll 4 (48 registers) ran every Qwen3 decode shape correctly. Cause UNKNOWN; the next
- * experiment is the unroll-4 kernel launched with 72 declared registers (one variable). */
-/* ---- 2026-10-12: row/column-blocked fragment kernel (prefill rows) ------------------------
- *
- * The kernel above gives one warp one 16x8 output tile: every B fragment is streamed once per row
- * tile and every A fragment once per column tile, so at m = 128 on GB10 the three Qwen3-8B prefill
- * shapes move about 4.7 GB per call at the DRAM rate (128x4096x24576: 20.9 ms, 2026-10-12 baseline).
- * Here one warp owns RT row tiles x CT column tiles (RT*CT accumulators) over all of K: per K step
- * it loads RT A fragments and CT B fragments and runs RT*CT HMMAs, so each loaded fragment feeds
- * RT (B) or CT (A) tensor ops. Same packing, grid rules and C layout as the kernel above: the A
- * fragments of row tile i sit at +i*KS*512 bytes, the B fragments of column tile j at +j*KS*256,
- * both immediate offsets of the same cursors; the C tile (i, j) is at +i*16*N*4 + j*32 bytes from
- * the two row pointers (STG.E immediate offsets, fixtures in omega_blackwell_verify_codegen_fixtures_fragmm).
- * Loads per pass stay at or under 8 (unroll*(RT+CT)), the count the proven unroll-4 kernel issues;
- * unroll 8 of that kernel (16 loads per pass) never completed on the GB10 and the cause is UNKNOWN,
- * so this kernel does not go past that envelope. The HMMA chain keeps the dependent-chain control
- * words (stall 15 then NOP stall 14) although the RT*CT accumulators are independent: a longer stall
- * is never wrong, and the loads dominate the pass. CTA = one warp, as above; a grid of
- * (grid_x, row blocks); column blocks advance by grid_x per pass of the column loop. */
-/* The C store offset of the last tile (rt-1, ct-1) is a signed 24-bit STG immediate; for wide N (lm_head,
- * 151936 columns) rt > 1 does not fit. Shared by the generator below and omega_matmul_frag_block_shape. */
-static int frag_block_store_fits(uint32_t rt, uint32_t ct, uint32_t n) {
-    return (uint64_t)(rt - 1) * 16u * n * 4u + (uint64_t)(ct - 1) * 32u + 4u < (1ull << 23);
-}
-
-int omega_blackwell_codegen_matmul_frag_block_prog(const OmegaMatMulSpec *spec, uint32_t grid_x, uint32_t unroll,
-                                                   uint32_t rt, uint32_t ct, int mutant, BlackwellIRProgram *prog) {
-    if (!spec || !prog) return -1;
-    if (spec->m == 0 || spec->k == 0 || spec->n == 0) return -1;
-    if (spec->precision != OMEGA_MATMUL_PRECISION_FP16 && spec->precision != OMEGA_MATMUL_PRECISION_BF16) return -1;
-    if (spec->m % 16 != 0 || spec->n % 8 != 0 || spec->k % 16 != 0) return -1;
-    if (rt != 1 && rt != 2 && rt != 4 && rt != 8) return -1;
-    if (ct != 1 && ct != 2 && ct != 4) return -1;
-    if (rt * ct > 16 || rt * ct < 2) return -1; /* 1x1 is the kernel above */
-    if (unroll != 1 && unroll != 2) return -1;
-    if (unroll * (rt + ct) > 8) return -1;
-    const uint32_t K = spec->k, N = spec->n, NT = N / 8, KS = K / 16;
-    if (KS % unroll != 0 || NT % ct != 0) return -1;
-    const uint32_t ITERS = KS / unroll, NB = NT / ct;
-    if (grid_x == 0 || grid_x > NB) return -1;
-    if (mutant && ITERS < 2) return -1;
-    /* every index and immediate below must fit: 32 bits for the index arithmetic, signed 24 bits for
-     * the load/store offsets (rows up to OMEGA_BW_MATMUL_MAX_M) */
-    if ((uint64_t)NT * KS * 32u > 0xffffffffull || (uint64_t)(OMEGA_BW_MATMUL_MAX_M / 16u) * KS * 32u > 0xffffffffull ||
-        (uint64_t)grid_x * ct * KS * 256u > 0xffffffffull || (uint64_t)N * 32u > 0xffffffffull ||
-        (uint64_t)OMEGA_BW_MATMUL_MAX_M * N > 0xffffffffull)
-        return -1;
-    if ((uint64_t)(rt - 1) * KS * 512u + (unroll - 1) * 512u >= (1ull << 23) ||
-        (uint64_t)(ct - 1) * KS * 256u + (unroll - 1) * 256u >= (1ull << 23) ||
-        !frag_block_store_fits(rt, ct, N))
-        return -1;
-
-    omega_bw_ir_init(prog);
-    int v_ptr_a = omega_bw_ir_alloc_vreg64(prog), v_ptr_b = omega_bw_ir_alloc_vreg64(prog), v_ptr_c = omega_bw_ir_alloc_vreg64(prog);
-    int uv_desc = omega_bw_ir_alloc_uvreg64(prog);
-    int v_tid = omega_bw_ir_alloc_vreg(prog), v_ctaid_x = omega_bw_ir_alloc_vreg(prog), v_ctaid_y = omega_bw_ir_alloc_vreg(prog);
-    int v_group = omega_bw_ir_alloc_vreg(prog), v_tig = omega_bw_ir_alloc_vreg(prog), v_tcol2 = omega_bw_ir_alloc_vreg(prog);
-    int v_r0 = omega_bw_ir_alloc_vreg(prog), v_r1 = omega_bw_ir_alloc_vreg(prog), v_c1 = omega_bw_ir_alloc_vreg(prog);
-    int v_idx = omega_bw_ir_alloc_vreg(prog), v_col = omega_bw_ir_alloc_vreg(prog), v_cnt = omega_bw_ir_alloc_vreg(prog);
-    int v_pa = omega_bw_ir_alloc_vreg64(prog), v_pbcol = omega_bw_ir_alloc_vreg64(prog);
-    int v_pc0 = omega_bw_ir_alloc_vreg64(prog), v_pc1 = omega_bw_ir_alloc_vreg64(prog);
-    int v_pac = omega_bw_ir_alloc_vreg64(prog), v_pbc = omega_bw_ir_alloc_vreg64(prog);
-    int v_rd[16], v_ra[2][8], v_rb[2][4];
-    for (uint32_t t = 0; t < rt * ct; t++) v_rd[t] = omega_bw_ir_alloc_vreg128(prog);
-    for (uint32_t u = 0; u < unroll; u++) {
-        for (uint32_t i = 0; i < rt; i++) v_ra[u][i] = omega_bw_ir_alloc_vreg128(prog);
-        for (uint32_t j = 0; j < ct; j++) v_rb[u][j] = omega_bw_ir_alloc_vreg64(prog);
-    }
-    if (v_rb[unroll - 1][ct - 1] < 0 || v_ra[unroll - 1][rt - 1] < 0 || v_rd[rt * ct - 1] < 0 || uv_desc < 0) return -1;
-
-    const uint32_t CTRL_STG_RDBAR3 = 0x0007e200u, CTRL_IMADW_WAIT3 = 0x009fcc00u, CTRL_MOVRZ_WAIT3 = 0x008fe200u;
-
-    /* prologue: descriptor, pointers, ids (as the kernel above; a CTA's row block is rt row tiles) */
-    BW_APPEND(prog, .op = BW_IR_LDCU64, .dst_vreg = uv_desc, .imm = 0x358, .is_uniform = true);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_a, .imm = 0x380);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_b, .imm = 0x388);
-    BW_APPEND(prog, .op = BW_IR_LDC64, .dst_vreg = v_ptr_c, .imm = 0x390);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_tid, .imm = BW_SR_TID_X);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_ctaid_x, .imm = BW_SR_CTAID_X);
-    BW_APPEND(prog, .op = BW_IR_S2R, .dst_vreg = v_ctaid_y, .imm = BW_SR_CTAID_Y);
-    BW_APPEND(prog, .op = BW_IR_MOV_IMM, .dst_vreg = v_c1, .imm = 1);
-    BW_APPEND(prog, .op = BW_IR_SHF_R, .dst_vreg = v_group, .src1_vreg = v_tid, .imm = 2);
-    BW_APPEND(prog, .op = BW_IR_LOP3_AND, .dst_vreg = v_tig, .src1_vreg = v_tid, .imm = 3);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_tcol2, .src1_vreg = v_tig, .src2_vreg = -1, .imm = 2, .src3_vreg = -1);
-    /* r0 = ctaid_y * 16 * rt + group: row of this lane in row tile 0 of the block; r1 = r0 + 8 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_r0, .src1_vreg = v_ctaid_y, .src2_vreg = -1, .imm = 16u * rt, .src3_vreg = v_group);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_r1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 8, .src3_vreg = v_r0);
-    /* pa = A + (ctaid_y * rt * KS * 32 + tid) * 16: row tile 0 of this block, this lane's 16 bytes of step 0 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_ctaid_y, .src2_vreg = -1, .imm = rt * KS * 32u, .src3_vreg = v_tid);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pa, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 16, .src3_vreg = v_ptr_a);
-    /* col = ctaid_x * ct: first column tile of this CTA's first column block */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_col, .src1_vreg = v_ctaid_x, .src2_vreg = -1, .imm = ct, .src3_vreg = -1);
-    /* pbcol = B + (col * KS * 32 + tid) * 8: column tile col, this lane's 8 bytes of step 0 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = KS * 32u, .src3_vreg = v_tid);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbcol, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 8, .src3_vreg = v_ptr_b);
-    /* pc0 = C + (r0*N + col*8 + tcol2)*4 ; pc1 with r1 */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r0, .src2_vreg = -1, .imm = N, .src3_vreg = v_tcol2);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = 8, .src3_vreg = v_idx);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc0, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_r1, .src2_vreg = -1, .imm = N, .src3_vreg = v_tcol2);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_idx, .src1_vreg = v_col, .src2_vreg = -1, .imm = 8, .src3_vreg = v_idx);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc1, .src1_vreg = v_idx, .src2_vreg = -1, .imm = 4, .src3_vreg = v_ptr_c);
-
-    /* ---- column-block loop: zero the rt*ct accumulators (the first MOV waits SB3: the previous
-     * block's stores have read them), rewind the K cursors ---- */
-    const int L_col = (int)prog->count;
-    for (uint32_t t = 0; t < rt * ct; t++)
-        for (uint32_t s = 0; s < 4; s++)
-            BW_APPEND(prog, .op = BW_IR_MOV_RZ, .dst_vreg = v_rd[t], .dst_subreg = (int)s,
-                      .control = (t == 0 && s == 0) ? CTRL_MOVRZ_WAIT3 : 0);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pac, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0, .src3_vreg = v_pa);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbc, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0, .src3_vreg = v_pbcol);
-    BW_APPEND(prog, .op = BW_IR_MOV_IMM, .dst_vreg = v_cnt, .imm = mutant ? ITERS - 1 : ITERS);
-
-    /* ---- K loop: `unroll` steps of (rt A + ct B) loads, then the rt*ct*unroll HMMAs ---- */
-    const int L_k = (int)prog->count;
-    for (uint32_t u = 0; u < unroll; u++) {
-        for (uint32_t i = 0; i < rt; i++)
-            BW_APPEND(prog, .op = BW_IR_LDG_E_128, .dst_vreg = v_ra[u][i], .src1_vreg = v_pac, .src2_vreg = -1, .src3_vreg = -1,
-                      .ureg = uv_desc, .imm = u * 512u + i * KS * 512u, .control = BW_FRAG_CTRL_LDG_A);
-        for (uint32_t j = 0; j < ct; j++)
-            BW_APPEND(prog, .op = BW_IR_LDG_E_64, .dst_vreg = v_rb[u][j], .src1_vreg = v_pbc, .src2_vreg = -1, .src3_vreg = -1,
-                      .ureg = uv_desc, .imm = u * 256u + j * KS * 256u, .control = BW_FRAG_CTRL_LDG_B);
-    }
-    const BlackwellIROpcode hmma = (spec->precision == OMEGA_MATMUL_PRECISION_BF16) ? BW_IR_HMMA_BF16 : BW_IR_HMMA_F16;
-    for (uint32_t u = 0; u < unroll; u++)
-        for (uint32_t i = 0; i < rt; i++)
-            for (uint32_t j = 0; j < ct; j++) {
-                const int rd = v_rd[i * ct + j];
-                BW_APPEND(prog, .op = hmma, .dst_vreg = rd, .src1_vreg = v_ra[u][i], .src2_vreg = v_rb[u][j], .src3_vreg = rd,
-                          .control = BW_FRAG_CTRL_HMMA);
-                BW_APPEND(prog, .op = BW_IR_NOP, .dst_vreg = -1, .src1_vreg = -1, .src2_vreg = -1, .src3_vreg = -1, .ureg = -1,
-                          .control = BW_FRAG_CTRL_NOP);
-            }
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pac, .src1_vreg = v_c1, .src2_vreg = -1, .imm = unroll * 512u, .src3_vreg = v_pac);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbc, .src1_vreg = v_c1, .src2_vreg = -1, .imm = unroll * 256u, .src3_vreg = v_pbc);
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_cnt, .src1_vreg = v_c1, .src2_vreg = -1, .imm = 0xffffffffu, .src3_vreg = v_cnt);
-    BW_APPEND(prog, .op = BW_IR_ISETP_GE, .dst_vreg = -1, .src1_vreg = v_cnt, .src2_vreg = -1, .imm = 1, .src3_vreg = -1);
-    {
-        int here = (int)prog->count;
-        BW_APPEND(prog, .op = BW_IR_BRA, .imm = (uint32_t)(int32_t)(L_k - here), .predicate_p0 = true);
-    }
-    const int L_k_end = (int)prog->count - 1;
-
-    /* ---- store the rt*ct tiles: tile (i, j) at +i*16*N*4 + j*32 bytes from pc0 (rows r0) and pc1 (rows r1) ---- */
-    for (uint32_t i = 0; i < rt; i++)
-        for (uint32_t j = 0; j < ct; j++) {
-            const int rd = v_rd[i * ct + j];
-            const uint32_t off = i * 16u * N * 4u + j * 32u;
-            BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_pc0, .src2_vreg = rd, .src2_subreg = 0, .src3_vreg = -1, .ureg = uv_desc, .imm = off, .control = CTRL_STG_RDBAR3);
-            BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_pc0, .src2_vreg = rd, .src2_subreg = 1, .src3_vreg = -1, .ureg = uv_desc, .imm = off + 4u, .control = CTRL_STG_RDBAR3);
-            BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_pc1, .src2_vreg = rd, .src2_subreg = 2, .src3_vreg = -1, .ureg = uv_desc, .imm = off, .control = CTRL_STG_RDBAR3);
-            BW_APPEND(prog, .op = BW_IR_STG_E, .src1_vreg = v_pc1, .src2_vreg = rd, .src2_subreg = 3, .src3_vreg = -1, .ureg = uv_desc, .imm = off + 4u, .control = CTRL_STG_RDBAR3);
-        }
-    /* next column block: col += grid_x*ct ; C by grid_x*ct*8 f32 (waits SB3 first) ; B by grid_x*ct tiles of KS*256 bytes */
-    BW_APPEND(prog, .op = BW_IR_IMAD, .dst_vreg = v_col, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * ct, .src3_vreg = v_col);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc0, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * ct * 32u, .src3_vreg = v_pc0, .control = CTRL_IMADW_WAIT3);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pc1, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * ct * 32u, .src3_vreg = v_pc1);
-    BW_APPEND(prog, .op = BW_IR_IMAD_WIDE, .dst_vreg = v_pbcol, .src1_vreg = v_c1, .src2_vreg = -1, .imm = grid_x * ct * KS * 256u, .src3_vreg = v_pbcol);
-    BW_APPEND(prog, .op = BW_IR_ISETP_GE, .dst_vreg = -1, .src1_vreg = v_col, .src2_vreg = -1, .imm = NT, .src3_vreg = -1);
-    {
-        int here = (int)prog->count;
-        BW_APPEND(prog, .op = BW_IR_BRA, .imm = (uint32_t)(int32_t)(L_col - here), .predicate_p0 = true, .predicate_not = true);
-    }
-    const int L_col_end = (int)prog->count - 1;
-    BW_APPEND(prog, .op = BW_IR_EXIT);
-    BW_APPEND(prog, .op = BW_IR_BRA);
-
-    /* loop-carried values live to the end of their loop (as the kernel above) */
-    const int col_carried[] = { v_c1, v_col, v_pa, v_pbcol, v_pc0, v_pc1 };
-    for (size_t i = 0; i < sizeof col_carried / sizeof col_carried[0]; i++) bw_live_until(prog, col_carried[i], L_col_end);
-    for (uint32_t t = 0; t < rt * ct; t++) bw_live_until(prog, v_rd[t], L_col_end);
-    const int k_carried[] = { v_pac, v_pbc, v_cnt };
-    for (size_t i = 0; i < sizeof k_carried / sizeof k_carried[0]; i++) bw_live_until(prog, k_carried[i], L_k_end);
-    bw_keep_alive(prog, L_k, L_k_end, L_k_end);
-    return omega_bw_regalloc_solve(prog);
-}
-
-#ifndef OMEGA_GPU_NO_POSIX
-int omega_blackwell_codegen_matmul_frag_block(const OmegaMatMulSpec *spec, uint32_t grid_x, uint32_t unroll,
-                                              uint32_t rt, uint32_t ct, int mutant, OmegaBlackwellKernel *kernel) {
-    if (!spec || !kernel) return -1;
-    BlackwellIRProgram prog;
-    if (omega_blackwell_codegen_matmul_frag_block_prog(spec, grid_x, unroll, rt, ct, mutant, &prog) != 0) return -1;
-    return bw_kernel_alloc_encode(&prog, OMEGA_BW_CODE_CAP_MAX, kernel);
-}
-#endif
-
-/* The row and column tiles one warp owns in the blocked kernel: the largest of 4, 2, 1 dividing the
- * row tiles (rt), and for rt > 1 the largest of 4, 2, 1 dividing the column tiles (ct); rt = ct = 1
- * is the single-tile kernel (decode rows). An rt whose last C tile's store offset does not fit the
- * 24-bit immediate (frag_block_store_fits: wide N such as lm_head) steps down, to 1 at the end. */
-void omega_matmul_frag_block_shape(uint32_t mt, uint32_t nt, uint32_t *rt, uint32_t *ct) {
-    uint32_t r = mt % 4u == 0 ? 4u : mt % 2u == 0 ? 2u : 1u, c = 1u;
-    for (; r > 1; r /= 2u) {
-        c = nt % 4u == 0 ? 4u : nt % 2u == 0 ? 2u : 1u;
-        if (frag_block_store_fits(r, c, nt * 8u)) break;
-    }
-    *rt = r;
-    *ct = r > 1 ? c : 1u;
-}
-
-/* loads per pass at or under 8 (see the kernel comment): unroll 2 only when 2*(rt+ct) fits and KS is even */
-uint32_t omega_matmul_frag_block_unroll(uint32_t kp, uint32_t rt, uint32_t ct) {
-    const uint32_t ks = kp / 16u;
-    return (ks % 2u == 0 && 2u * (rt + ct) <= 8u) ? 2u : 1u;
-}
-
-uint32_t omega_matmul_frag_unroll(uint32_t kp) {
-    const uint32_t ks = kp / 16u;
-    return ks % 4u == 0 ? 4u : ks % 2u == 0 ? 2u : 1u;
-}
-
-/* A block (mt, ks) holds rows 16mt..16mt+15 and columns 16ks..16ks+15 as 256 bf16 at element
- * (mt*KS + ks)*256; inside the block, element (rr, cc) sits at lane*8 + e with lane = (rr%8)*4 + (cc%8)/2
- * and e = (cc/8)*4 + (rr/8)*2 + cc%2 (the HMMA.16816 A fragment order, header comment). The 256-entry
- * table makes the pack a tile loop with no per-element division (2026-10-12: the per-element form with
- * six divisions and a conversion call per element was ~2.5 ms per MB of activations at m = 128). */
-static uint16_t g_frag_a_tab[256];
-static void frag_a_tab_init(void) {
-    if (g_frag_a_tab[255]) return;
-    for (uint32_t rr = 0; rr < 16; rr++)
-        for (uint32_t cc = 0; cc < 16; cc++)
-            g_frag_a_tab[rr * 16 + cc] = (uint16_t)((((rr & 7u) * 4u + ((cc & 7u) >> 1)) * 8u) + (cc >> 3) * 4u + (rr >> 3) * 2u + (cc & 1u));
-}
-/* bit for bit what the compiler's (__bf16)f cast gives (gpu_matmul_api_test checks it against
- * omega_fp32_to_bf16 on ties, denormals, inf and NaN payloads): round to nearest even, a NaN keeps
- * its top payload bits and is made quiet. gcc 13 on aarch64 emits the cast as a call to the
- * soft-float routine __truncsfbf2 per element, which was most of the packing cost. */
-static inline uint16_t frag_f32_to_bf16(float f) {
-    uint32_t u;
-    memcpy(&u, &f, 4);
-    if ((u & 0x7f800000u) == 0x7f800000u) return (uint16_t)((u >> 16) | ((u & 0x007fffffu) ? 0x0040u : 0u));
-    return (uint16_t)((u + 0x7fffu + ((u >> 16) & 1u)) >> 16);
-}
-#define FRAG_PACK_A_BODY(LOAD)                                                                          \
-    do {                                                                                                \
-        const uint32_t KS = kp / 16u;                                                                   \
-        frag_a_tab_init();                                                                              \
-        memset(dst, 0, (size_t)mp * kp * sizeof *dst);                                                  \
-        for (uint32_t mt = 0; mt < (m + 15u) / 16u; mt++) {                                             \
-            const uint32_t r1 = m - mt * 16u < 16u ? m - mt * 16u : 16u;                                \
-            for (uint32_t ks = 0; ks < (k + 15u) / 16u; ks++) {                                         \
-                const uint32_t c1 = k - ks * 16u < 16u ? k - ks * 16u : 16u;                            \
-                uint16_t *blk = dst + ((size_t)mt * KS + ks) * 256u;                                    \
-                for (uint32_t rr = 0; rr < r1; rr++) {                                                  \
-                    const uint16_t *tab = g_frag_a_tab + rr * 16u;                                      \
-                    const size_t src = (size_t)(mt * 16u + rr) * k + ks * 16u;                          \
-                    for (uint32_t cc = 0; cc < c1; cc++) blk[tab[cc]] = LOAD(a[src + cc]);              \
-                }                                                                                       \
-            }                                                                                           \
-        }                                                                                               \
-    } while (0)
-#define FRAG_ID(x) (x)
-void omega_matmul_frag_pack_a(const uint16_t *a, uint32_t m, uint32_t k, uint32_t mp, uint32_t kp, uint16_t *dst) {
-    FRAG_PACK_A_BODY(FRAG_ID);
-}
-void omega_matmul_frag_pack_a_f32(const float *a, uint32_t m, uint32_t k, uint32_t mp, uint32_t kp, uint16_t *dst) {
-    FRAG_PACK_A_BODY(frag_f32_to_bf16);
-}
-
-/* Row 0 only, every column of every K block (zeros past k): for a one-row call whose buffer already
- * holds zeros in rows 1..15 of every block from an earlier full pack of the same width. */
-#define FRAG_PACK_A_ROW0_BODY(LOAD)                                                                     \
-    do {                                                                                                \
-        const uint32_t KS = kp / 16u;                                                                   \
-        frag_a_tab_init();                                                                              \
-        const uint16_t *tab = g_frag_a_tab;                                                             \
-        for (uint32_t ks = 0; ks < KS; ks++) {                                                          \
-            uint16_t *blk = dst + (size_t)ks * 256u;                                                    \
-            const uint32_t c0 = ks * 16u, c1 = k - c0 < 16u ? k - c0 : 16u;                             \
-            for (uint32_t cc = 0; cc < c1; cc++) blk[tab[cc]] = LOAD(a[c0 + cc]);                       \
-            for (uint32_t cc = c1; cc < 16u; cc++) blk[tab[cc]] = 0;                                    \
-        }                                                                                               \
-    } while (0)
-void omega_matmul_frag_pack_a_row0(const uint16_t *a, uint32_t k, uint32_t kp, uint16_t *dst) {
-    FRAG_PACK_A_ROW0_BODY(FRAG_ID);
-}
-size_t omega_matmul_result_sentinels(float *cd, uint32_t m, uint32_t n, uint32_t np, float poison, int set) {
-    /* one word per 16 x 8 fragment tile that holds a real output word: the tile's last real row and column */
-    size_t count = 0;
-    if (m == 0 || n == 0) return 0;
-    const uint32_t mt = (m + 15u) / 16u, nt = (n + 7u) / 8u;
-    for (uint32_t ti = 0; ti < mt; ti++) {
-        uint32_t r = ti * 16u + 15u; if (r >= m) r = m - 1u;
-        float *row = cd + (size_t)r * np;
-        for (uint32_t tj = 0; tj < nt; tj++) {
-            uint32_t c = tj * 8u + 7u; if (c >= n) c = n - 1u;
-            if (set) { row[c] = poison; count++; }
-            else if (row[c] == poison) count++;
-        }
-    }
-    return count;
-}
-
-void omega_matmul_frag_pack_a_row0_f32(const float *a, uint32_t k, uint32_t kp, uint16_t *dst) {
-    FRAG_PACK_A_ROW0_BODY(frag_f32_to_bf16);
-}
-
-void omega_matmul_frag_pack_b(const uint16_t *b, uint32_t k, uint32_t n, uint32_t kp,
-                              uint32_t nt0, uint32_t nt1, uint16_t *dst) {
-    const uint32_t KS = kp / 16u;
-    memset(dst, 0, (size_t)(nt1 - nt0) * KS * 128u * sizeof *dst);
-    for (uint32_t row = 0; row < k; row++) {
-        const uint32_t ks = row / 16u, rr = row % 16u, khi = rr / 8u, tig = (rr % 8u) / 2u, lo = rr % 2u;
-        const uint16_t *src = &b[(size_t)row * n];
-        for (uint32_t nt = nt0; nt < nt1; nt++) {
-            const uint32_t c0 = nt * 8u;
-            for (uint32_t group = 0; group < 8u && c0 + group < n; group++) {
-                const size_t lane = group * 4u + tig;
-                dst[(((size_t)(nt - nt0) * KS + ks) * 32u + lane) * 4u + khi * 2u + lo] = src[c0 + group];
-            }
-        }
-    }
-}
-
-int omega_blackwell_verify_codegen_fixtures(void) {
-    OmegaRegAlloc ra;
-    memset(&ra, 0, sizeof(ra));
-    ra.vreg_to_phys[0] = 2;
-    ra.vreg_to_phys[1] = 4;
-    ra.vreg_to_phys[2] = 6;
-    ra.vreg_to_phys[3] = 7;
-    ra.uvreg_to_phys[0] = 4;
-
-    uint32_t w[4];
-
-    /* 1. MOV R7, RZ */
-    BlackwellIRInsn insn_mov_rz = { .op = BW_IR_MOV_RZ, .dst_vreg = 3 };
-    if (encode_single_insn(&insn_mov_rz, &ra, w) != 0) return -1;
-    if (w[0] != (0x7202 | (7 << 16)) || w[1] != 0xff || w[2] != 0x00000f00) return -2;
-
-    /* 2. MOV R2, 1 */
-    BlackwellIRInsn insn_mov_imm = { .op = BW_IR_MOV_IMM, .dst_vreg = 0, .imm = 1 };
-    if (encode_single_insn(&insn_mov_imm, &ra, w) != 0) return -3;
-    if (w[0] != (0x7802 | (2 << 16)) || w[1] != 1 || w[2] != 0x00000f00) return -4;
-
-    /* 3. Register-Register IMAD: IMAD R7, R2, R6, R7 */
-    BlackwellIRInsn insn_imad_rr = { .op = BW_IR_IMAD, .dst_vreg = 3, .src1_vreg = 0, .src2_vreg = 2, .src3_vreg = 3 };
-    if (encode_single_insn(&insn_imad_rr, &ra, w) != 0) return -5;
-    if (w[0] != (0x7224 | (7 << 16) | (2 << 24)) || w[1] != 6 || w[2] != (0x078e0200 | 7)) return -6;
-
-    /* 4. Immediate IMAD: IMAD R6, R2, 16, RZ */
-    BlackwellIRInsn insn_imad_imm = { .op = BW_IR_IMAD, .dst_vreg = 2, .src1_vreg = 0, .src2_vreg = -1, .imm = 16, .src3_vreg = -1 };
-    if (encode_single_insn(&insn_imad_imm, &ra, w) != 0) return -7;
-    if (w[0] != (0x7824 | (6 << 16) | (2 << 24)) || w[1] != 16 || w[2] != 0x078e02ff) return -8;
-
-    /* 5. IMAD.WIDE: IMAD.WIDE R4, R2, 4, R4 */
-    BlackwellIRInsn insn_imad_wide = { .op = BW_IR_IMAD_WIDE, .dst_vreg = 1, .src1_vreg = 0, .imm = 4, .src3_vreg = 1 };
-    if (encode_single_insn(&insn_imad_wide, &ra, w) != 0) return -9;
-    if (w[0] != (0x7825 | (4 << 16) | (2 << 24)) || w[1] != 4 || w[2] != (0x078e0000 | 4)) return -10;
-
-    /* 6. LDC.64 R4, c[0x0][0x380] */
-    BlackwellIRInsn insn_ldc64 = { .op = BW_IR_LDC64, .dst_vreg = 1, .imm = 0x380 };
-    if (encode_single_insn(&insn_ldc64, &ra, w) != 0) return -11;
-    if (w[0] != (0xff007b82 | (4 << 16)) || w[1] != ((0x380 << 6) & 0x00ffff00) || w[2] != 0x00000a00) return -12;
-
-    /* 7. LDCU.64 UR4, c[0x0][0x358] */
-    BlackwellIRInsn insn_ldcu64 = { .op = BW_IR_LDCU64, .dst_vreg = 0, .imm = 0x358, .is_uniform = true };
-    if (encode_single_insn(&insn_ldcu64, &ra, w) != 0) return -13;
-    if (w[0] != (0xff0077ac | (4 << 16)) || w[1] != ((0x358 << 5) & 0x00ffff00) || w[2] != 0x08000a00) return -14;
-
-    /* 8. LDG.E R2, desc[UR4][R4.64] */
-    BlackwellIRInsn insn_ldg = { .op = BW_IR_LDG_E, .dst_vreg = 0, .src1_vreg = 1, .ureg = 0 };
-    if (encode_single_insn(&insn_ldg, &ra, w) != 0) return -15;
-    if (w[0] != (0x7981 | (2 << 16) | (4 << 24)) || w[1] != 4 || w[2] != 0x0c1e1900) return -16;
-
-    /* 9. STG.E desc[UR4][R4.64], R7 */
-    BlackwellIRInsn insn_stg = { .op = BW_IR_STG_E, .src1_vreg = 1, .src2_vreg = 3, .ureg = 0 };
-    if (encode_single_insn(&insn_stg, &ra, w) != 0) return -17;
-    if (w[0] != (0x7986 | (4 << 24)) || w[1] != 7 || w[2] != (0x0c101900 | 4)) return -18;
-
-    /* 10. S2R R2, SR_CTAID.X */
-    BlackwellIRInsn insn_s2r = { .op = BW_IR_S2R, .dst_vreg = 0, .imm = BW_SR_CTAID_X };
-    if (encode_single_insn(&insn_s2r, &ra, w) != 0) return -19;
-    if (w[0] != (0x7919 | (2 << 16)) || w[2] != (BW_SR_CTAID_X << 8)) return -20;
-
-    /* 11. HMMA.16816.F32 R4, R4, R2, RZ */
-    BlackwellIRInsn insn_hmma_f16 = { .op = BW_IR_HMMA_F16, .dst_vreg = 1, .src1_vreg = 1, .src2_vreg = 0, .src3_vreg = -1 };
-    if (encode_single_insn(&insn_hmma_f16, &ra, w) != 0) return -21;
-    if (w[0] != 0x0404723c || w[1] != 0x00000002 || w[2] != 0x000018ff || w[3] != 0x000fe200) return -22;
-
-    /* 12. HMMA.16816.F32.BF16 R4, R4, R2, RZ */
-    BlackwellIRInsn insn_hmma_bf16 = { .op = BW_IR_HMMA_BF16, .dst_vreg = 1, .src1_vreg = 1, .src2_vreg = 0, .src3_vreg = -1 };
-    uint32_t w_bf16[4];
-    if (encode_single_insn(&insn_hmma_bf16, &ra, w_bf16) != 0) return -23;
-    if (w_bf16[0] != 0x0404723c || w_bf16[1] != 0x00000002 || w_bf16[2] != 0x000418ff || w_bf16[3] != 0x000fe200) return -24;
-
-    /* 13. Differential Invariant: w[2] bit 18 toggles strictly between FP16 and BF16 */
-    if ((w[2] ^ w_bf16[2]) != 0x00040000) return -25;
-    if (w[0] != w_bf16[0] || w[1] != w_bf16[1] || w[3] != w_bf16[3]) return -26;
-
-    /* 14. SHF.R.U32.HI R4, RZ, 2, R2 */
-    BlackwellIRInsn insn_shf = { .op = BW_IR_SHF_R, .dst_vreg = 1, .src1_vreg = 0, .imm = 2 };
-    if (encode_single_insn(&insn_shf, &ra, w) != 0) return -27;
-    if (w[0] != 0xff047819 || w[1] != 2 || w[2] != 0x00011602 || w[3] != 0x001fca00) return -28;
-
-    /* 15. LOP3.LUT R4, R2, 3, RZ, 0xc0, !PT */
-    BlackwellIRInsn insn_lop3 = { .op = BW_IR_LOP3_AND, .dst_vreg = 1, .src1_vreg = 0, .imm = 3 };
-    if (encode_single_insn(&insn_lop3, &ra, w) != 0) return -29;
-    if (w[0] != 0x02047812 || w[1] != 3 || w[2] != 0x078ec0ff || w[3] != 0x001fca00) return -30;
-
-    /* 16. LDG.E.U16 R2, desc[UR4][R4.64] */
-    BlackwellIRInsn insn_ldg16 = { .op = BW_IR_LDG_E_U16, .dst_vreg = 0, .src1_vreg = 1, .ureg = 0 };
-    if (encode_single_insn(&insn_ldg16, &ra, w) != 0) return -31;
-    if (w[0] != 0x04027981 || w[1] != 4 || w[2] != 0x0c1e1500 || w[3] != 0x000f2200) return -32;
-
-    /* A zero-delta branch stays the self-branch the matmul kernels already emit. */
-    BlackwellIRInsn insn_bra0 = { .op = BW_IR_BRA };
-    if (encode_single_insn(&insn_bra0, &ra, w) != 0) return -33;
-    if (w[0] != 0x00fc7947 || w[1] != 0xfffffffc || w[2] != 0x0383ffff || w[3] != 0x000fc000) return -34;
-
-    BlackwellIRInsn insn_ge = { .op = BW_IR_ISETP_GE_U32, .src1_vreg = 1, .src2_vreg = 2 };
-    if (encode_single_insn(&insn_ge, &ra, w) != 0) return -35;
-    if (w[0] != (0x720c | (4 << 24)) || w[1] != 6 || w[2] != 0x03f06070) return -36;
-
-    BlackwellIRInsn insn_xor = { .op = BW_IR_LOP3_XOR, .dst_vreg = 1, .src1_vreg = 0, .src2_vreg = 2 };
-    if (encode_single_insn(&insn_xor, &ra, w) != 0) return -37;
-    if (w[0] != (0x7212 | (4 << 16) | (2 << 24)) || w[1] != 6 || w[2] != 0x078e3cff) return -38;
-
-    BlackwellIRInsn insn_ldg_ss = { .op = BW_IR_LDG_STRONG_SYS, .dst_vreg = 0, .src1_vreg = 1, .ureg = 0 };
-    if (encode_single_insn(&insn_ldg_ss, &ra, w) != 0) return -39;
-    if (w[0] != (0x7981 | (2 << 16) | (4 << 24)) || w[1] != 4 || w[2] != 0x0c1f5900) return -40;
-    /* 17. FADD R7, R2, R4 */
-    BlackwellIRInsn insn_fadd = { .op = BW_IR_FADD, .dst_vreg = 3, .src1_vreg = 0, .src2_vreg = 1 };
-    if (encode_single_insn(&insn_fadd, &ra, w) != 0) return -133;
-    if (w[0] != 0x02077221 || w[1] != 4 || w[2] != 0 || w[3] != 0x004fc400) return -134;
-
-    /* 18. FSUB R7, R2, R4 (negated src2) */
-    BlackwellIRInsn insn_fsub = { .op = BW_IR_FSUB, .dst_vreg = 3, .src1_vreg = 0, .src2_vreg = 1 };
-    if (encode_single_insn(&insn_fsub, &ra, w) != 0) return -135;
-    if (w[0] != 0x02077221 || w[1] != 0x80000004 || w[2] != 0 || w[3] != 0x004fc400) return -136;
-
-    /* 19. FMUL R7, R2, R4 */
-    BlackwellIRInsn insn_fmul = { .op = BW_IR_FMUL, .dst_vreg = 3, .src1_vreg = 0, .src2_vreg = 1 };
-    if (encode_single_insn(&insn_fmul, &ra, w) != 0) return -137;
-    if (w[0] != 0x02077220 || w[1] != 4 || w[2] != 0x00400000 || w[3] != 0x004fc400) return -138;
-
-    /* 20. FFMA R7, R2, R4, R6 */
-    BlackwellIRInsn insn_ffma = { .op = BW_IR_FFMA, .dst_vreg = 3, .src1_vreg = 0, .src2_vreg = 1, .src3_vreg = 2 };
-    if (encode_single_insn(&insn_ffma, &ra, w) != 0) return -139;
-    if (w[0] != 0x02077223 || w[1] != 4 || w[2] != 6 || w[3] != 0x004fc400) return -140;
-
-    /* 21. FMNMX_MIN R7, R2, R4 */
-    BlackwellIRInsn insn_min = { .op = BW_IR_FMNMX_MIN, .dst_vreg = 3, .src1_vreg = 0, .src2_vreg = 1 };
-    if (encode_single_insn(&insn_min, &ra, w) != 0) return -141;
-    if (w[0] != 0x02077209 || w[1] != 4 || w[2] != 0x03800000 || w[3] != 0x004fc400) return -142;
-
-    /* 22. FMNMX_MAX R7, R2, R4 */
-    BlackwellIRInsn insn_max = { .op = BW_IR_FMNMX_MAX, .dst_vreg = 3, .src1_vreg = 0, .src2_vreg = 1 };
-    if (encode_single_insn(&insn_max, &ra, w) != 0) return -143;
-    if (w[0] != 0x02077209 || w[1] != 4 || w[2] != 0x07800000 || w[3] != 0x004fc400) return -144;
-
-    /* 23. I2FP R7, R2 */
-    BlackwellIRInsn insn_i2f = { .op = BW_IR_I2FP, .dst_vreg = 3, .src1_vreg = 0 };
-    if (encode_single_insn(&insn_i2f, &ra, w) != 0) return -145;
-    if (w[0] != 0x00077245 || w[1] != 2 || w[2] != 0x00201400 || w[3] != 0x004fe200) return -146;
-
-    /* 24. F2I R7, R2 */
-    BlackwellIRInsn insn_f2i = { .op = BW_IR_F2I, .dst_vreg = 3, .src1_vreg = 0 };
-    if (encode_single_insn(&insn_f2i, &ra, w) != 0) return -147;
-    if (w[0] != 0x00077305 || w[1] != 2 || w[2] != 0x0020f100 || w[3] != 0x004e2200) return -148;
-
-    /* 25. MUFU_RCP R7, R2 */
-    BlackwellIRInsn insn_mufu_rcp = { .op = BW_IR_MUFU_RCP, .dst_vreg = 3, .src1_vreg = 0 };
-    if (encode_single_insn(&insn_mufu_rcp, &ra, w) != 0) return -149;
-    if (w[0] != 0x00077308 || w[1] != 2 || w[2] != 0x00001000 || w[3] != 0x000e2400) return -150;
-
-    /* 26. MUFU_RSQ R7, R2 */
-    BlackwellIRInsn insn_mufu_rsq = { .op = BW_IR_MUFU_RSQ, .dst_vreg = 3, .src1_vreg = 0 };
-    if (encode_single_insn(&insn_mufu_rsq, &ra, w) != 0) return -151;
-    if (w[0] != 0x00077308 || w[1] != 2 || w[2] != 0x00001400 || w[3] != 0x000e2400) return -152;
-
-    /* 27. SHFL_DOWN R7, R2, 16 */
-    BlackwellIRInsn insn_shfl = { .op = BW_IR_SHFL_DOWN, .dst_vreg = 3, .src1_vreg = 0, .imm = 16 };
-    if (encode_single_insn(&insn_shfl, &ra, w) != 0) return -153;
-    if (w[0] != 0x02077f89 || w[1] != 0x0a001f00 || w[2] != 0x000e0000 || w[3] != 0x000e2400) return -154;
-
-    /* 28. LDS R7, [R2] */
-    BlackwellIRInsn insn_lds = { .op = BW_IR_LDS, .dst_vreg = 3, .src1_vreg = 0, .imm = 0 };
-    if (encode_single_insn(&insn_lds, &ra, w) != 0) return -155;
-    if (w[0] != 0x02077984 || w[1] != 0 || w[2] != 0 || w[3] != 0x000fe200) return -156;
-
-    /* 29. STS [R2], R4 */
-    BlackwellIRInsn insn_sts = { .op = BW_IR_STS, .src1_vreg = 0, .src2_vreg = 1, .imm = 0 };
-    if (encode_single_insn(&insn_sts, &ra, w) != 0) return -157;
-    if (w[0] != 0x02007388 || w[1] != 4 || w[2] != 0 || w[3] != 0x000fe200) return -158;
-
-    return 0;
-}
-
-int omega_blackwell_test_regalloc_bounds(void) {
-    BlackwellIRProgram prog;
-    omega_bw_ir_init(&prog);
-
-    int v0 = omega_bw_ir_alloc_vreg64(&prog);
-    int v1 = omega_bw_ir_alloc_vreg(&prog);
-    int v2 = omega_bw_ir_alloc_vreg64(&prog);
-    int v3 = omega_bw_ir_alloc_vreg128(&prog); /* Test 128-bit quad allocation */
-
-    BlackwellIRInsn i0 = { .op = BW_IR_LDC64, .dst_vreg = v0, .imm = 0x380 };
-    omega_bw_ir_append(&prog, &i0);
-    BlackwellIRInsn i1 = { .op = BW_IR_MOV_IMM, .dst_vreg = v1, .imm = 10 };
-    omega_bw_ir_append(&prog, &i1);
-    BlackwellIRInsn i2 = { .op = BW_IR_LDC64, .dst_vreg = v2, .imm = 0x388 };
-    omega_bw_ir_append(&prog, &i2);
-    BlackwellIRInsn i3 = { .op = BW_IR_HMMA_F16, .dst_vreg = v3, .src1_vreg = v3, .src2_vreg = v0, .src3_vreg = -1 };
-    omega_bw_ir_append(&prog, &i3);
-    /* i4 uses v1, v2, v3 simultaneously so all intervals are concurrently active */
-    int v_sink = omega_bw_ir_alloc_vreg(&prog);
-    BlackwellIRInsn i4 = { .op = BW_IR_IADD3, .dst_vreg = v_sink, .src1_vreg = v1, .src2_vreg = v2, .src3_vreg = v3 };
-    omega_bw_ir_append(&prog, &i4);
-
-    if (omega_bw_regalloc_solve(&prog) != 0) return -1;
-
-    int phys_v0 = prog.regalloc.vreg_to_phys[v0];
-    int phys_v1 = prog.regalloc.vreg_to_phys[v1];
-    int phys_v2 = prog.regalloc.vreg_to_phys[v2];
-    int phys_v3 = prog.regalloc.vreg_to_phys[v3];
-
-    if (phys_v0 % 2 != 0) return -2;
-    if (phys_v2 % 2 != 0) return -3;
-    if (phys_v3 % 4 != 0) return -4; /* 4-alignment for 128-bit quad */
-    if (phys_v1 == phys_v0 || phys_v1 == phys_v0 + 1) return -5;
-    if (phys_v2 == phys_v0 || phys_v2 == phys_v0 + 1) return -6;
-    for (int k = 0; k < 4; k++) {
-        if (phys_v3 + k == phys_v0 || phys_v3 + k == phys_v0 + 1) return -7;
-        if (phys_v3 + k == phys_v2 || phys_v3 + k == phys_v2 + 1) return -8;
-        if (phys_v3 + k == phys_v1) return -9;
-    }
-
-    /* Test bounds refusal: intentionally attempt to allocate more registers than hardware capacity */
-    BlackwellIRProgram overflow_prog;
-    omega_bw_ir_init(&overflow_prog);
-    for (int i = 0; i < BW_PHYS_GPR_MAX + 5; i++) {
-        int v = omega_bw_ir_alloc_vreg(&overflow_prog);
-        if (v < 0) break;
-        BlackwellIRInsn insn = { .op = BW_IR_MOV_IMM, .dst_vreg = v, .imm = (uint32_t)i };
-        omega_bw_ir_append(&overflow_prog, &insn);
-    }
-    for (size_t i = 0; i < overflow_prog.count; i++) {
-        for (int v = 0; v < overflow_prog.regalloc.num_vregs; v++) {
-            overflow_prog.regalloc.intervals[v].last_use = (int)overflow_prog.count - 1;
-        }
-    }
-    if (omega_bw_regalloc_solve(&overflow_prog) == 0) {
-        return -6;
-    }
-
-    return 0;
-}
-
-#ifndef OMEGA_GPU_NO_POSIX /* prints: hosted only (the freestanding build has no stdio) */
-int omega_blackwell_test_codegen_variation(void) {
-    OmegaMatMulSpec spec1, spec2;
-    if (omega_matmul_spec_init(&spec1, 16, 16, 16, OMEGA_MATMUL_PRECISION_INT32) != 0) {
-        printf("FAIL: spec1 init failed\n");
-        return -1;
-    }
-    if (omega_matmul_spec_init(&spec2, 32, 16, 64, OMEGA_MATMUL_PRECISION_INT32) != 0) {
-        printf("FAIL: spec2 init failed\n");
-        return -1;
-    }
-
-    OmegaBlackwellKernel k1, k2;
-    memset(&k1, 0, sizeof(k1));
-    memset(&k2, 0, sizeof(k2));
-
-    if (omega_blackwell_codegen_matmul(&spec1, &k1) != 0) {
-        printf("FAIL: k1 codegen failed\n");
-        return -1;
-    }
-    if (omega_blackwell_codegen_matmul(&spec2, &k2) != 0) {
-        printf("FAIL: k2 codegen failed\n");
-        omega_blackwell_kernel_free(&k1);
-        return -1;
-    }
-
-    OmegaBlackwellRealizationIdentity id1, id2;
-    omega_blackwell_bind_matmul_realization(&spec1, &k1, &id1);
-    omega_blackwell_bind_matmul_realization(&spec2, &k2, &id2);
-
-    printf("================================================================================\n");
-    printf("    OMEGA BLACKWELL CODEGEN VARIATION DEMONSTRATION (GATE 7 STAGE-1)\n");
-    printf("================================================================================\n");
-    printf("Config 1: 16x16x16 INT32\n");
-    printf("  Instructions: %zu (%zu bytes, %u GPRs, %u UGPRs)\n", k1.insn_count, k1.code_size, k1.gpr_count, k1.uniform_gpr_count);
-    printf("  Spec ID:      ");
-    for (int i = 0; i < 16; i++) printf("%02x", spec1.spec_id[i]);
-    printf("...\n");
-    printf("  Code Digest:  ");
-    for (int i = 0; i < 16; i++) printf("%02x", k1.code_digest[i]);
-    printf("...\n");
-    printf("  Realization:  ");
-    for (int i = 0; i < 16; i++) printf("%02x", id1.realization_id[i]);
-    printf("...\n\n");
-
-    printf("Config 2: 32x16x64 INT32\n");
-    printf("  Instructions: %zu (%zu bytes, %u GPRs, %u UGPRs)\n", k2.insn_count, k2.code_size, k2.gpr_count, k2.uniform_gpr_count);
-    printf("  Spec ID:      ");
-    for (int i = 0; i < 16; i++) printf("%02x", spec2.spec_id[i]);
-    printf("...\n");
-    printf("  Code Digest:  ");
-    for (int i = 0; i < 16; i++) printf("%02x", k2.code_digest[i]);
-    printf("...\n");
-    printf("  Realization:  ");
-    for (int i = 0; i < 16; i++) printf("%02x", id2.realization_id[i]);
-    printf("...\n");
-    printf("================================================================================\n");
-
-    /* Validation checks */
-    if (memcmp(spec1.spec_id, spec2.spec_id, 32) == 0) {
-        printf("FAIL: spec IDs match (expected distinct)\n");
-        return -2;
-    }
-    if (memcmp(k1.code_digest, k2.code_digest, 32) == 0) {
-        printf("FAIL: code digests match (expected distinct)\n");
-        return -3;
-    }
-    if (memcmp(id1.realization_id, id2.realization_id, 32) == 0) {
-        printf("FAIL: realization IDs match (expected distinct)\n");
-        return -4;
-    }
-
-    printf("PASS: Dynamic codegen variation verified (distinct specifications, code digests, and realization IDs).\n");
-
-    omega_blackwell_kernel_free(&k1);
-    omega_blackwell_kernel_free(&k2);
-    return 0;
-}
-#endif
-
-/* Declared registers: peak + 2 rounded up to 8 (see omega_blackwell_codegen.h for the chip evidence). */
-uint32_t omega_bw_gpr_declared(uint32_t peak) { return ((peak + 2u + 7u) / 8u) * 8u; }
-int omega_bw_gpr_declared_ok(uint32_t declared, uint32_t peak) { return declared % 8u == 0u && declared >= peak + 2u; }
-
-int omega_bw_ir_set_gpr_limit(BlackwellIRProgram *prog, uint32_t limit) {
-    if (!prog || limit <= BW_PHYS_GPR_MAX || limit > BW_PHYS_GPR_HW_LIMIT) return -1;
-    prog->regalloc.gpr_limit = limit;
-    return 0;
-}
diff --git a/src/omega_blackwell_codegen.h b/src/omega_blackwell_codegen.h
deleted file mode 100644
index 30ff38983..000000000
--- a/src/omega_blackwell_codegen.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/* SPDX-License-Identifier: Apache-2.0
- * Copyright 2026 Drake Stapleton (AIEN / aien-dev)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef OMEGA_BLACKWELL_CODEGEN_H
-#define OMEGA_BLACKWELL_CODEGEN_H
-
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-#include "omega_blackwell_matmul.h"
-
-#define BW_MAX_IR_INSNS         1024 /* cut K: the four-head hd 128 attention kernel is ~700 instructions */
-#define BW_MAX_VREGS            256
-#define BW_MAX_UVREGS           32
-#define BW_PHYS_GPR_START       2    /* Reserve R0, R1 */
-#define BW_PHYS_GPR_MAX         128  /* default allocation limit (R2..R127); a program may opt into more (omega_bw_ir_set_gpr_limit) */
-/* Highest limit a program may ask for: the chip allows 255 registers per thread and 64K per block (CUDA Programming
- * Guide, Compute Capabilities appendix: "per thread is 255"); a peak of 246 declares 248 (peak + 2 rounded up to 8).
- * The launcher must keep threads * declared <= 65536 (omega#545). */
-#define BW_PHYS_GPR_HW_LIMIT    246
-#define BW_PHYS_UGPR_START      4    /* Reserve UR0-UR3 */
-#define BW_PHYS_UGPR_MAX        32
-
-/* Minimal Blackwell IR Opcodes for Stage 1 & Stage 2 */
-typedef enum {
-    BW_IR_NOP = 0,
-    BW_IR_MOV_RZ,       /* MOV Rd, RZ (zero initialization) */
-    BW_IR_MOV_IMM,      /* MOV Rd, imm32 */
-    BW_IR_S2R,          /* S2R Rd, SR */
-    BW_IR_LDC,          /* LDC Rd, c[bank][offset] */
-    BW_IR_LDC64,        /* LDC.64 Rd:Rd+1, c[bank][offset] */
-    BW_IR_LDCU,         /* LDCU URd, c[bank][offset] */
-    BW_IR_LDCU64,       /* LDCU.64 URd:URd+1, c[bank][offset] */
-    BW_IR_IMAD,         /* IMAD Rd, Ra, Rb/imm, Rc (multiply-add) */
-    BW_IR_IMAD_WIDE,    /* IMAD.WIDE.U32 Rd:Rd+1, Ra, imm, Rc:Rc+1 */
-    BW_IR_ISETP_GE,     /* ISETP.GE P0, PT, Ra, Rb/imm, PT */
-    BW_IR_LDG_E,        /* LDG.E Rd, desc[URd][Ra.64] */
-    BW_IR_STG_E,        /* STG.E desc[URd][Ra.64], Rb */
-    BW_IR_STG_EF,       /* STG.E.EF: evict the line so the other side can see it */
-    BW_IR_IADD3,        /* IADD3 Rd, PT, PT, Ra, Rb, Rc */
-    BW_IR_HMMA_F16,     /* HMMA.16816.F32 Rd, Ra, Rb, Rc (FP16 input, FP32 accumulator) */
-    BW_IR_HMMA_BF16,    /* HMMA.16816.F32.BF16 Rd, Ra, Rb, Rc (BF16 input, FP32 accumulator) */
-    BW_IR_SHF_R,        /* SHF.R.U32.HI Rd, RZ, imm, Ra */
-    BW_IR_LOP3_AND,     /* LOP3.LUT Rd, Ra, imm, RZ, 0xc0, !PT (Bitwise AND) */
-    BW_IR_LDG_E_U16,    /* LDG.E.U16 Rd, desc[URd][Ra.64] */
-    /* System-scope ordering. Encodings checked against the sm_121 disassembler.
-     * A host build of these opcodes is not a graphics-chip result. */
-    BW_IR_LDG_STRONG_SYS,
-    BW_IR_LDG_MMIO,     /* LDG.E.MMIO.GPU: do not keep a stale cached copy */
-    BW_IR_STG_STRONG_SYS,
-    BW_IR_MEMBAR_ALL_SYS,
-    BW_IR_MEMBAR_SC_SYS,
-    BW_IR_CCTL_IVALL,
-    BW_IR_ATOMG_ADD_STRONG_SYS,
-    BW_IR_ATOMG_EXCH_STRONG_SYS,
-    BW_IR_ISETP_GE_U32, /* ISETP.GE.U32.AND P0, PT, Ra, Rb, PT */
-    BW_IR_LOP3_XOR,     /* LOP3.LUT Rd, Ra, Rb, RZ, 0x3c, !PT */
-    BW_IR_FADD,         /* FADD Rd, Ra, Rb */
-    BW_IR_FSUB,         /* FSUB Rd, Ra, Rb (FADD Rd, Ra, -Rb) */
-    BW_IR_FMUL,         /* FMUL Rd, Ra, Rb */
-    BW_IR_FFMA,         /* FFMA Rd, Ra, Rb, Rc (Rd = Ra * Rb + Rc) */
-    BW_IR_FSETP,        /* FSETP.cond.AND P0, PT, Ra, Rb, PT */
-    BW_IR_FSEL,         /* FSEL Rd, Ra, Rb, P0 */
-    BW_IR_FMNMX_MIN,    /* FMNMX Rd, Ra, Rb, PT (minimum) */
-    BW_IR_FMNMX_MAX,    /* FMNMX Rd, Ra, Rb, !PT (maximum) */
-    BW_IR_I2FP,         /* I2FP.F32.S32 Rd, Ra */
-    BW_IR_F2I,          /* F2I.TRUNC.NTZ Rd, Ra */
-    BW_IR_MUFU_RCP,     /* MUFU.RCP Rd, Ra */
-    BW_IR_MUFU_RSQ,     /* MUFU.RSQ Rd, Ra */
-    BW_IR_SHFL_DOWN,    /* SHFL.DOWN PT, Rd, Ra, offset, 0x1f */
-    BW_IR_LDS,          /* LDS Rd, [Ra] */
-    BW_IR_STS,          /* STS [Ra], Rb */
-    BW_IR_EXIT,         /* EXIT */
-    BW_IR_BRA,          /* BRA. imm = signed instruction delta; predicate_p0 / predicate_not select @P0 or @!P0 */
-    /* FB-1 cut 4 (2026-10-04), additive. Encodings decoded with nvdisasm 13.0 -b SM121
-     * (tools/divsqrt_nvdisasm_check.sh method); the BAR/LDS/STS words are the ones
-     * src/omega_numeric.c:884-886 runs on the chip (LDS_STS op, 148/148 specs PASS). */
-    BW_IR_MUFU_EX2,     /* MUFU.EX2 Rd, Ra (2^x, approximate: PTX ex2.approx.f32 bound 2^-22.5 rel) */
-    BW_IR_BAR_SYNC,     /* BAR.SYNC.DEFER_BLOCKING 0x0 (CTA barrier 0; the QMD declares 1 barrier) */
-    BW_IR_LDS32,        /* LDS Rd, [Ra+URZ]  32-bit shared load  (BW_IR_LDS encodes LDS.U8: byte) */
-    BW_IR_STS32,        /* STS [Ra+URZ], Rb  32-bit shared store (BW_IR_STS encodes STS.U8: byte) */
-    /* Prime race cut (2026-10-05), additive, general integer ops. Words derived from the
-     * register forms of LOP3_XOR / SHF_R / IMAD and matched word for word against
-     * nvcc 13.0.88 -arch=sm_121 -cubin + cuobjdump -sass (offline oracle only; see
-     * omega_blackwell_verify_codegen_fixtures_intops). For these three ops an operand
-     * vreg of -1 encodes RZ (not R0). */
-    BW_IR_LOP3_LUT,     /* LOP3.LUT Rd, Ra, Rb, Rc, imm8, !PT: Rd = LUT(Ra, Rb, Rc). imm & 0xff is the
-                         * truth table over Ra = 0xf0, Rb = 0xcc, Rc = 0xaa (a|b = 0xfc, ~(a|b) = 0x03) */
-    BW_IR_SHF_L_U32,    /* SHF.L.U32 Rd, Ra, Rb, RZ: Rd = Ra << Rb, register amount (the form nvcc emits
-                         * for PTX shl.b32). Amounts >= 32 are NOT chip-verified: callers keep Rb < 32 */
-    BW_IR_IMAD_HI_U32,  /* IMAD.HI.U32 Rd, Ra, Rb, Rc: Rd = hi32(Ra * Rb) + Rc mod 2^32 (nvcc emits this
-                         * word for __umulhi(a, b) + c) */
-    /* Structured warp reconvergence (omega #308, 2026-10-05), additive. Words matched against
-     * nvcc 13.0.88 -arch=sm_121 output (BSSY.RECONVERGENT / BSYNC.RECONVERGENT; the oracle
-     * kernels are listed in docs/gpu-reconvergence-308.md) and the Mesa NAK encoder
-     * (sm70_encode.rs OpBSSy 0x945 / OpBSync 0x941, barrier register at bits 16..19).
-     * bar_reg selects B0..B15. BSSY arms the barrier for the lanes executing it and names
-     * the join point; BSYNC waits for every armed lane that has not exited, then the warp
-     * continues as one. imm of BSSY = signed instruction delta to the join point (the
-     * instruction after the BSYNC), like BW_IR_BRA; the encoder refuses deltas < 1. */
-    BW_IR_BSSY,
-    BW_IR_BSYNC,
-    /* Fragment-major matmul (omega #328, 2026-10-07), additive. Words matched against nvcc 13.0.88
-     * -arch=sm_121 (omega_blackwell_verify_codegen_fixtures_fragmm). imm = signed byte offset,
-     * -2^23 .. 2^23-1; dst is a register pair (64) or an aligned quad (128). */
-    BW_IR_LDG_E_64,     /* LDG.E.64 Rd:Rd+1, desc[URd][Ra.64+imm] */
-    BW_IR_LDG_E_128,    /* LDG.E.128 Rd..Rd+3, desc[URd][Ra.64+imm] */
-    /* Batched attention loads (2026-10-12). Words matched against nvcc 13.0.88 -arch=sm_121
-     * (omega_blackwell_verify_codegen_fixtures_fragmm). imm = unsigned byte offset < 2^23; dst an aligned quad. */
-    BW_IR_LDS128,       /* LDS.128 Rd..Rd+3, [Ra+imm] */
-    /* Gated DeltaNet softplus (2026-10-18, omega#542): sub-op 0x0c00 checked with nvdisasm 13.0 -b SM121, which decodes
-     * "MUFU.LG2 R2, R4" (EX2 0x0800, RCP 0x1000, RSQ 0x1400 decode the same way). log2(x), approximate. */
-    BW_IR_MUFU_LG2      /* MUFU.LG2 Rd, Ra */
-} BlackwellIROpcode;
-
-/* Barrier (reconvergence) registers: the sm_121 BSSY/BSYNC words carry a 4-bit barrier id
- * (NAK sm70_encode.rs set_bar_dst(16..20)), so B0..B15 are encodable. How many the chip
- * provides is not documented to us; chip tests nest to BW_RECONV_CHIP_TESTED_DEPTH. */
-#define BW_RECONV_MAX_BAR 16
-
-/* Special Register Identifiers */
-typedef enum {
-    BW_SR_TID_X   = 0x21,
-    BW_SR_TID_Y   = 0x22,
-    BW_SR_CTAID_X = 0x25,
-    BW_SR_CTAID_Y = 0x26
-} BlackwellSR;
-
-/* IR Instruction Node */
-typedef struct {
-    BlackwellIROpcode op;
-    int dst_vreg;       /* Virtual destination register (-1 if none) */
-    int src1_vreg;      /* Virtual source 1 register (-1 if none) */
-    int src2_vreg;      /* Virtual source 2 register (-1 if none / immediate mode) */
-    int src3_vreg;      /* Virtual source 3 register (-1 if none / RZ) */
-    int ureg;           /* Uniform register (-1 if none) */
-    uint32_t imm;       /* Immediate value / constant bank offset / SR code.
-                         * For BW_IR_BRA: signed instruction delta (target minus
-                         * this instruction). 0 branches to itself. */
-    uint32_t control;   /* Bundle control word */
-    bool is_uniform;    /* True if targets/uses uniform registers */
-    bool predicate_p0;  /* True if predicated on P0 */
-    bool predicate_not; /* With predicate_p0, encode @!P0 */
-    uint8_t dst_subreg; /* Subregister offset (0..3) within register bundle */
-    uint8_t src1_subreg;
-    uint8_t src2_subreg;
-    uint8_t src3_subreg;
-    uint8_t bar_reg;    /* BW_IR_BSSY / BW_IR_BSYNC: barrier register B0..B15 */
-} BlackwellIRInsn;
-
-/* Live Interval for Bounded Linear Register Allocation */
-typedef struct {
-    int vreg;
-    int first_def;
-    int last_use;
-    int phys_reg;
-    uint32_t bundle_size; /* 1: scalar (32-bit), 2: pair (64-bit), 4: quad (128-bit) */
-    bool is_pair;       /* True if 64-bit register pair (requires even-aligned R_2k) */
-    bool is_quad;       /* True if 128-bit register quad (requires 4-aligned R_4k) */
-    bool active;
-} OmegaLiveInterval;
-
-/* Register Allocator State */
-typedef struct {
-    int num_vregs;
-    int num_uvregs;
-    OmegaLiveInterval intervals[BW_MAX_VREGS];
-    OmegaLiveInterval uintervals[BW_MAX_UVREGS];
-    int vreg_to_phys[BW_MAX_VREGS];
-    int uvreg_to_phys[BW_MAX_UVREGS];
-    uint32_t peak_gpr_usage;
-    uint32_t peak_ugpr_usage;
-    uint32_t gpr_limit;      /* 0: BW_PHYS_GPR_MAX; else the exclusive physical limit, <= BW_PHYS_GPR_HW_LIMIT */
-} OmegaRegAlloc;
-
-/* IR Program */
-typedef struct {
-    BlackwellIRInsn insns[BW_MAX_IR_INSNS];
-    size_t count;
-    OmegaRegAlloc regalloc;
-} BlackwellIRProgram;
-
-/* Initializes IR program */
-void omega_bw_ir_init(BlackwellIRProgram *prog);
-
-/* Appends an instruction node to IR program */
-int omega_bw_ir_append(BlackwellIRProgram *prog, const BlackwellIRInsn *insn);
-
-/* Allocates a new 32-bit virtual general-purpose register */
-int omega_bw_ir_alloc_vreg(BlackwellIRProgram *prog);
-
-/* Allocates a new 64-bit aligned virtual register pair (for 64-bit memory addresses or HMMA B matrix) */
-int omega_bw_ir_alloc_vreg64(BlackwellIRProgram *prog);
-
-/* Allocates a new 128-bit aligned virtual register quad (for HMMA accumulator and A matrix) */
-int omega_bw_ir_alloc_vreg128(BlackwellIRProgram *prog);
-
-/* Allocates a new 32-bit virtual uniform register */
-int omega_bw_ir_alloc_uvreg(BlackwellIRProgram *prog);
-
-/* Allocates a new 64-bit aligned virtual uniform register pair */
-int omega_bw_ir_alloc_uvreg64(BlackwellIRProgram *prog);
-
-/* Solves bounded deterministic live-interval register allocation */
-int omega_bw_regalloc_solve(BlackwellIRProgram *prog);
-/* Opt this program into physical registers up to limit - 1 (BW_PHYS_GPR_MAX < limit <= BW_PHYS_GPR_HW_LIMIT); call after
- * omega_bw_ir_init. Every other program keeps the default, so its allocation is unchanged. 0 ok, -1 out of range. */
-int omega_bw_ir_set_gpr_limit(BlackwellIRProgram *prog, uint32_t limit);
-
-/* Encodes scheduled IR program into 128-bit sm_121 machine code */
-int omega_bw_encode_program(const BlackwellIRProgram *prog, uint8_t *code_buf, size_t max_len, size_t *out_len);
-/* C6 kernel capture: writes code to $OMEGA_KERNEL_DUMP_DIR/<sha16>.bin when that is set; no-op otherwise (see the .c) */
-void omega_kernel_dump(const uint8_t *code, size_t len);
-
-/* ---- native v1 P07 cut A.2: allocation-free code generation (aienos#286) ----------------------------
- * The freestanding build (OMEGA_GPU_NO_POSIX, make gpu-engine-freestanding) has no allocator: the caller
- * supplies the code buffer and its capacity. Build the program with one of the *_prog generators, then
- * encode it with omega_blackwell_kernel_encode_into. The hosted allocating generators below encode through
- * the same function, so both builds emit the same bytes (make test-codegen-freestanding).
- *
- * omega_bw_program_code_bytes: the exact bytes the encoder writes for prog (padded to 8 instructions,
- * at least 32), 0 for NULL.
- * omega_blackwell_kernel_encode_into: zeroes *kernel, then encodes prog into code_buf. Refuses with
- * OMEGA_BW_CODE_BUFFER_TOO_SMALL, writing no byte of code_buf, when code_cap is below
- * omega_bw_program_code_bytes(prog); -1 for NULL arguments or an instruction the encoder rejects. On
- * success kernel->code points INTO the caller's buffer: the kernel owns nothing, the caller keeps
- * code_buf alive as long as the kernel is used and never passes such a kernel to
- * omega_blackwell_kernel_free (which exists only in the hosted build). */
-#define OMEGA_BW_CODE_BUFFER_TOO_SMALL (-2)
-#define OMEGA_BW_CODE_CAP_SMALL 4096u                          /* cap of the tensor, tensor_loop and frag generators */
-#define OMEGA_BW_CODE_CAP_MAX ((size_t)BW_MAX_IR_INSNS * 16u)  /* cap of frag_block; no program encodes past it */
-size_t omega_bw_program_code_bytes(const BlackwellIRProgram *prog);
-int omega_blackwell_kernel_encode_into(const BlackwellIRProgram *prog, uint8_t *code_buf, size_t code_cap,
-                                       OmegaBlackwellKernel *kernel);
-/* The integer generator's program (K <= 32); the allocating omega_blackwell_codegen_matmul_i32 encodes it. */
-int omega_blackwell_codegen_matmul_i32_prog(const OmegaMatMulSpec *spec, BlackwellIRProgram *prog);
-
-/* The allocating generators (omega_blackwell_codegen_matmul_i32, _tensor, _tensor_loop, _frag, _frag_block),
- * omega_blackwell_codegen_matmul, omega_blackwell_kernel_free and omega_blackwell_test_codegen_variation exist
- * only in the hosted build. */
-
-/* Top-level dynamic code generator for integer matrix multiplication */
-int omega_blackwell_codegen_matmul_i32(const OmegaMatMulSpec *spec, OmegaBlackwellKernel *kernel);
-
-/* Dynamic sm_121 Tensor Core code generator (FP16 & BF16 via HMMA.16816) */
-int omega_blackwell_codegen_matmul_tensor_prog(const OmegaMatMulSpec *spec, BlackwellIRProgram *prog);
-int omega_blackwell_codegen_matmul_tensor(const OmegaMatMulSpec *spec, OmegaBlackwellKernel *kernel);
-
-/* FB-1 cut 1b: looped Tensor Core matmul. One warp per CTA. CTA (x, y) owns row
- * tile y (16 rows) and column tiles x, x + grid_x, x + 2 grid_x, ... (8 columns
- * each); the whole K dimension is accumulated in the HMMA accumulator on the
- * chip (no host K slicing). Requires M % 16 == 0, N % 8 == 0, K % 16 == 0 and
- * 1 <= grid_x <= N / 8. The kernel does not depend on M (rows come from
- * CTAID.Y), so one kernel serves every row count of a (K, N, grid_x) triple.
- * Uses only instructions already present in the chip-proven single-tile kernel
- * plus the predicated backward BRA and ISETP.GE this IR already encodes.
- * mutant != 0 drops the last K step (test oracle: the wrong kernel must be
- * caught by the parity test; never set in production). */
-int omega_blackwell_codegen_matmul_tensor_loop_prog(const OmegaMatMulSpec *spec, uint32_t grid_x,
-                                                    int mutant, BlackwellIRProgram *prog);
-int omega_blackwell_codegen_matmul_tensor_loop(const OmegaMatMulSpec *spec, uint32_t grid_x,
-                                               int mutant, OmegaBlackwellKernel *kernel);
-
-/* omega #328: fragment-major tensor matmul. Same grid, C layout (row-major f32) and argument
- * words as the looped kernel; A and B are in fragment order instead of row-major:
- *   A (mp x kp, from omega_matmul_frag_pack_a): block (mt, ks) of 256 bf16 at ((mt*KS + ks)*32
- *     + lane)*8, lane = group*4 + tig, holding A[r][c], A[r][c+1], A[r+8][c], A[r+8][c+1],
- *     A[r][c+8], A[r][c+9], A[r+8][c+8], A[r+8][c+9] with r = 16mt + group, c = 16ks + 2tig;
- *   B (kp x np, from omega_matmul_frag_pack_b): block (nt, ks) of 128 bf16 at ((nt*KS + ks)*32
- *     + lane)*4 holding B[k][j], B[k+1][j], B[k+8][j], B[k+9][j] with k = 16ks + 2tig,
- *     j = 8nt + group;  KS = kp / 16, entries outside the real matrix are zero.
- * One LDG.E.128 (A) and one LDG.E.64 (B) per K step; `unroll` (1, 2, 4 or 8, dividing KS)
- * steps of loads are issued before the HMMA chain. mutant != 0 drops the last pass (test
- * oracle only). Each tile occupies 16*kp (A) and 8*kp (B) elements, so a row-tile offset into
- * A is the same in bytes as for row-major A. */
-int omega_blackwell_codegen_matmul_frag_prog(const OmegaMatMulSpec *spec, uint32_t grid_x, uint32_t unroll,
-                                             int mutant, BlackwellIRProgram *prog);
-int omega_blackwell_codegen_matmul_frag(const OmegaMatMulSpec *spec, uint32_t grid_x, uint32_t unroll,
-                                        int mutant, OmegaBlackwellKernel *kernel);
-/* The largest of 4, 2, 1 that divides kp / 16 (unroll 8 is generated for experiments only: it
- * did not complete on the GB10, see the definition). */
-uint32_t omega_matmul_frag_unroll(uint32_t kp);
-/* 2026-10-12: blocked fragment kernel for prefill rows. One warp owns rt row tiles x ct column tiles
- * (rt in 1, 2, 4, 8; ct in 1, 2, 4; 2 <= rt*ct <= 16; unroll 1 or 2 with unroll*(rt+ct) <= 8; nt % ct == 0;
- * grid_x <= nt/ct). Same packing, argument words and C layout as the single-tile kernel; a CTA's
- * row block is rt row tiles (grid_y = row tiles / rt). mutant != 0 drops the last K pass. */
-int omega_blackwell_codegen_matmul_frag_block_prog(const OmegaMatMulSpec *spec, uint32_t grid_x, uint32_t unroll,
-                                                   uint32_t rt, uint32_t ct, int mutant, BlackwellIRProgram *prog);
-int omega_blackwell_codegen_matmul_frag_block(const OmegaMatMulSpec *spec, uint32_t grid_x, uint32_t unroll,
-                                              uint32_t rt, uint32_t ct, int mutant, OmegaBlackwellKernel *kernel);
-/* rt, ct for mt row tiles and nt column tiles (1, 1 = the single-tile kernel), and the unroll the API uses */
-void omega_matmul_frag_block_shape(uint32_t mt, uint32_t nt, uint32_t *rt, uint32_t *ct);
-uint32_t omega_matmul_frag_block_unroll(uint32_t kp, uint32_t rt, uint32_t ct);
-
-/* Registers to declare in the QMD for a kernel whose allocator peak (OmegaLiveInterval count, regalloc.peak_gpr_usage)
- * is `peak`: peak + 2, rounded up to a multiple of 8 (the session raises anything below 64 to 64).
- * Chip evidence (OWN-30B, 2026-10-13): the fp8 grouped GEMM (lane 8, 8 rows) with peak 103 declared 104 (= peak + 1
- * rounded up, the earlier rule) hung the chip in 7 of 7 runs; the same program declared 112 ran every gate. Earlier
- * evidence: peak 64 declared 64 faulted (Xid 13 Out Of Range Register). Declared >= peak + 2 has run everywhere else
- * (router peak 46 declared 48). The exact minimum is UNKNOWN (declarations are multiples of 8); the rule is INFERRED. */
-uint32_t omega_bw_gpr_declared(uint32_t peak);
-/* 1 iff `declared` is a legal declaration for `peak`: a multiple of 8 and >= peak + 2. Launchers refuse otherwise. */
-int omega_bw_gpr_declared_ok(uint32_t declared, uint32_t peak);
-/* a: m x k row-major. dst: mp x kp elements, fully written (zero padding). */
-void omega_matmul_frag_pack_a(const uint16_t *a, uint32_t m, uint32_t k, uint32_t mp, uint32_t kp, uint16_t *dst);
-/* the same from f32 rows, converted to bf16 as omega_fp32_to_bf16 does (one pass, no staging copy) */
-void omega_matmul_frag_pack_a_f32(const float *a, uint32_t m, uint32_t k, uint32_t mp, uint32_t kp, uint16_t *dst);
-/* Row 0 of a one-row call into a buffer whose rows 1..15 already hold zeros for this kp (every column,
- * zeros past k); the caller tracks that the zeros are there (omega_gpu_matmul_api.c, m = 1 path). */
-void omega_matmul_frag_pack_a_row0(const uint16_t *a, uint32_t k, uint32_t kp, uint16_t *dst);
-void omega_matmul_frag_pack_a_row0_f32(const float *a, uint32_t k, uint32_t kp, uint16_t *dst);
-/* Result sentinels (host side of the poison check): one word per 16 x 8 fragment tile that holds a real
- * output word, at the tile's last real row and column, in the row-major m x np result. set != 0 writes
- * poison into every sentinel and returns their count; set == 0 returns how many still hold poison. The
- * kernel's epilogue stores a fragment tile as one straight-line run of STG.E words, so a tile whose
- * sentinel survived was never stored. */
-size_t omega_matmul_result_sentinels(float *cd, uint32_t m, uint32_t n, uint32_t np, float poison, int set);
-/* b: k x n row-major. dst: the column tiles [nt0, nt1), (nt1 - nt0) * kp * 8 elements, fully
- * written; it is the part of the packed tensor starting at element nt0 * kp * 8. */
-void omega_matmul_frag_pack_b(const uint16_t *b, uint32_t k, uint32_t n, uint32_t kp,
-                              uint32_t nt0, uint32_t nt1, uint16_t *dst);
-
-/* Unit test for instruction encoding bitfield fixtures (Gate 3) */
-int omega_blackwell_verify_codegen_fixtures(void);
-
-/* FB-1 cut 4: fixtures for MUFU_EX2, BAR_SYNC, LDS32, STS32 (0 = pass) */
-int omega_blackwell_verify_codegen_fixtures_fb1cut4(void);
-
-/* Prime race cut: golden words for LOP3_LUT, SHF_L_U32, IMAD_HI_U32 (0 = pass) */
-int omega_blackwell_verify_codegen_fixtures_intops(void);
-
-/* omega #328: golden words for LDG.E.64 / LDG.E.128 with offsets and the timed NOP (0 = pass) */
-int omega_blackwell_verify_codegen_fixtures_fragmm(void);
-
-/* omega #308: golden words for BSSY / BSYNC (nvcc 13.0.88 sm_121 oracle), plus the
- * encoder's refusals (negative delta, barrier id > 15). 0 = pass. */
-int omega_blackwell_verify_codegen_fixtures_reconv(void);
-
-/* omega #308: encodes one instruction with a given physical register map of
- * identity (vreg n -> Rn) so offline tools can disassemble single words. 0 = ok. */
-int omega_blackwell_encode_one(const BlackwellIRInsn *insn, uint32_t w[4]);
-
-/* Unit test for bounded register allocation live intervals and bounds enforcement (Gate 4) */
-int omega_blackwell_test_regalloc_bounds(void);
-
-/* Stage-1 dynamic codegen variation demonstration between 16x16x16 and 32x16x64 (Gate 7) */
-int omega_blackwell_test_codegen_variation(void);
-
-#endif /* OMEGA_BLACKWELL_CODEGEN_H */
diff --git a/src/omega_blackwell_codegen_attn.c b/src/omega_blackwell_codegen_attn.c
deleted file mode 100644
index 060e25cff..000000000
--- a/src/omega_blackwell_codegen_attn.c
+++ /dev/null
@@ -1,565 +0,0 @@
-/* SPDX-License-Identifier: Apache-2.0
- * Copyright 2026 Drake Stapleton (AIEN / aien-dev)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * omega_blackwell_codegen_attn.c: the one-launch decode attention kernel (see the header). Emitter rules follow
- * omega_blackwell_codegen_moe.c (control words, read barrier on every load, loop live ranges).
- */
-#include "omega_blackwell_codegen_attn.h"
-#include <string.h>
-
-#define CW(stall, wbar, rbar, wait) \
-    (((uint32_t)(stall) << 9) | ((uint32_t)(wbar) << 14) | ((uint32_t)(rbar) << 17) | ((uint32_t)(wait) << 20))
-#define CW_YIELD 0x2000u
-#define SB_NONE 7u
-#define SB_GPR 0u
-#define SB_RD 1u
-#define SB_UGPR 2u
-#define NOREG (-1)
-#define MAX_LOOPS 4
-
-enum { K_FIXED, K_PRED, K_VAR, K_VAR_MORE, K_UVAR, K_STORE, K_SYNC, K_EXIT, K_BRA, K_BSSY, K_BSYNC };
-
-typedef struct {
-    BlackwellIRProgram *p;
-    uint32_t pending;
-    int err;
-    int open_start[MAX_LOOPS];
-    int depth;
-} Em;
-
-static void emit(Em *e, BlackwellIRInsn in, int kind) {
-    uint32_t wait = e->pending;
-    switch (kind) {
-    case K_FIXED: in.control = CW(6, SB_NONE, SB_NONE, wait); e->pending = 0; break;
-    case K_PRED:  in.control = CW(14, SB_NONE, SB_NONE, wait); e->pending = 0; break;
-    case K_VAR:   in.control = CW(4, SB_GPR, SB_RD, wait) | CW_YIELD; e->pending = (1u << SB_GPR) | (1u << SB_RD); break;
-    case K_VAR_MORE: in.control = CW(4, SB_GPR, SB_RD, (e->pending & (1u << SB_RD))) | CW_YIELD; e->pending |= (1u << SB_GPR) | (1u << SB_RD); break;
-    case K_UVAR:  in.control = CW(4, SB_UGPR, SB_NONE, wait) | CW_YIELD; e->pending = 1u << SB_UGPR; break;
-    case K_STORE: in.control = CW(4, SB_NONE, SB_RD, wait) | CW_YIELD; e->pending = 1u << SB_RD; break;
-    case K_SYNC:  in.control = CW(6, SB_NONE, SB_NONE, wait); e->pending = 0; break;
-    case K_EXIT:  in.control = CW(5, SB_NONE, SB_NONE, wait); e->pending = in.predicate_p0 ? wait : 0; break;
-    case K_BRA:   in.control = CW(5, SB_NONE, SB_NONE, wait); e->pending = in.predicate_p0 ? wait : 0; break;
-    case K_BSSY:  in.control = CW(1, SB_NONE, SB_NONE, wait) | CW_YIELD; e->pending = 0; break;
-    case K_BSYNC: in.control = CW(5, SB_NONE, SB_NONE, wait) | CW_YIELD; e->pending = 0; break;
-    default: e->err = -1; return;
-    }
-    if (omega_bw_ir_append(e->p, &in) < 0) e->err = -1;
-}
-
-static BlackwellIRInsn I0(BlackwellIROpcode op) {
-    BlackwellIRInsn i; memset(&i, 0, sizeof i);
-    i.op = op; i.dst_vreg = NOREG; i.src1_vreg = NOREG; i.src2_vreg = NOREG; i.src3_vreg = NOREG; i.ureg = NOREG;
-    return i;
-}
-static int V(Em *e) { int v = omega_bw_ir_alloc_vreg(e->p); if (v < 0) e->err = -1; return v; }
-static int V64(Em *e) { int v = omega_bw_ir_alloc_vreg64(e->p); if (v < 0) e->err = -1; return v; }
-static int V128(Em *e) { int v = omega_bw_ir_alloc_vreg128(e->p); if (v < 0) e->err = -1; return v; }
-static int UV64(Em *e) { int v = omega_bw_ir_alloc_uvreg64(e->p); if (v < 0) e->err = -1; return v; }
-static int here(const Em *e) { return (int)e->p->count; }
-
-/* operand with subregister */
-typedef struct { int v; unsigned s; } Op;
-static Op R(int v) { Op o = { v, 0 }; return o; }
-static Op S(int v, unsigned s) { Op o = { v, s }; return o; }
-
-static void ldcu64(Em *e, int ud, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDCU64); i.dst_vreg = ud; i.imm = off; i.is_uniform = true; emit(e, i, K_UVAR); }
-static void ldc64(Em *e, int d, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDC64); i.dst_vreg = d; i.imm = off; emit(e, i, K_VAR); }
-static void ldc32(Em *e, int d, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDC); i.dst_vreg = d; i.imm = off; emit(e, i, K_VAR); }
-static void s2r(Em *e, int d, uint32_t sr) { BlackwellIRInsn i = I0(BW_IR_S2R); i.dst_vreg = d; i.imm = sr; emit(e, i, K_VAR); }
-static void movi(Em *e, int d, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_MOV_IMM); i.dst_vreg = d; i.imm = imm; emit(e, i, K_FIXED); }
-static void movrz(Em *e, Op d) { BlackwellIRInsn i = I0(BW_IR_MOV_RZ); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; emit(e, i, K_FIXED); }
-/* d = a * imm + c */
-static void imadi(Em *e, Op d, Op a, uint32_t imm, int c) { BlackwellIRInsn i = I0(BW_IR_IMAD); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; i.imm = imm; i.src3_vreg = c; emit(e, i, K_FIXED); }
-/* d = a * b + c (registers) */
-static void imadr(Em *e, int d, int a, int b, int c) { BlackwellIRInsn i = I0(BW_IR_IMAD); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; i.src3_vreg = c; emit(e, i, K_FIXED); }
-/* d64 = a * imm + c64 */
-static void imadw(Em *e, int d64, int a, uint32_t imm, int c64) { BlackwellIRInsn i = I0(BW_IR_IMAD_WIDE); i.dst_vreg = d64; i.src1_vreg = a; i.imm = imm; i.src3_vreg = c64; emit(e, i, K_FIXED); }
-static void mov(Em *e, Op d, Op a) { imadi(e, d, a, 1u, NOREG); }
-static void shrs(Em *e, int d, Op a, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_SHF_R); i.dst_vreg = d; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; i.imm = imm; emit(e, i, K_FIXED); }
-static void shr(Em *e, int d, int a, uint32_t imm) { shrs(e, d, R(a), imm); }
-static void andi(Em *e, Op d, Op a, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_LOP3_AND); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; i.imm = imm; emit(e, i, K_FIXED); }
-static void xorr(Em *e, Op d, Op a, Op b) { BlackwellIRInsn i = I0(BW_IR_LOP3_XOR); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; i.src2_vreg = b.v; i.src2_subreg = (uint8_t)b.s; emit(e, i, K_FIXED); }
-static void iadd(Em *e, int d, int a, int b) { BlackwellIRInsn i = I0(BW_IR_IADD3); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); }
-static void ldg_wide(Em *e, BlackwellIROpcode op, int d, int addr64, uint32_t imm, int udesc, int first) {
-    BlackwellIRInsn i = I0(op); i.dst_vreg = d; i.src1_vreg = addr64; i.imm = imm; i.ureg = udesc; emit(e, i, first ? K_VAR : K_VAR_MORE);
-}
-static void ldg32(Em *e, BlackwellIROpcode op, int d, int addr64, int udesc, int first) { BlackwellIRInsn i = I0(op); i.dst_vreg = d; i.src1_vreg = addr64; i.ureg = udesc; emit(e, i, first ? K_VAR : K_VAR_MORE); }
-static void stg(Em *e, BlackwellIROpcode op, int addr64, Op val, int udesc) { BlackwellIRInsn i = I0(op); i.src1_vreg = addr64; i.src2_vreg = val.v; i.src2_subreg = (uint8_t)val.s; i.ureg = udesc; emit(e, i, K_STORE); }
-static void atom_add(Em *e, int d, int addr64, int val, int udesc) { BlackwellIRInsn i = I0(BW_IR_ATOMG_ADD_STRONG_SYS); i.dst_vreg = d; i.src1_vreg = addr64; i.src2_vreg = val; i.ureg = udesc; emit(e, i, K_VAR); }
-static void membar(Em *e) { emit(e, I0(BW_IR_MEMBAR_ALL_SYS), K_FIXED); }
-static void lds128(Em *e, int d128, int addr, uint32_t imm, int first) { BlackwellIRInsn i = I0(BW_IR_LDS128); i.dst_vreg = d128; i.src1_vreg = addr; i.imm = imm; emit(e, i, first ? K_VAR : K_VAR_MORE); }
-static void lds32(Em *e, Op d, int addr, int first) { BlackwellIRInsn i = I0(BW_IR_LDS32); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = addr; emit(e, i, first ? K_VAR : K_VAR_MORE); }
-static void sts32(Em *e, int addr, Op val) { BlackwellIRInsn i = I0(BW_IR_STS32); i.src1_vreg = addr; i.src2_vreg = val.v; i.src2_subreg = (uint8_t)val.s; emit(e, i, K_STORE); }
-static void bar_sync(Em *e) { emit(e, I0(BW_IR_BAR_SYNC), K_SYNC); }
-static void fop(Em *e, BlackwellIROpcode op, Op d, Op a, Op b, Op c) {
-    BlackwellIRInsn i = I0(op); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s;
-    i.src2_vreg = b.v; i.src2_subreg = (uint8_t)b.s; i.src3_vreg = c.v; i.src3_subreg = (uint8_t)c.s; emit(e, i, K_FIXED);
-}
-static void fadd(Em *e, Op d, Op a, Op b) { fop(e, BW_IR_FADD, d, a, b, R(NOREG)); }
-static void fsub(Em *e, Op d, Op a, Op b) { fop(e, BW_IR_FSUB, d, a, b, R(NOREG)); }
-static void fmul(Em *e, Op d, Op a, Op b) { fop(e, BW_IR_FMUL, d, a, b, R(NOREG)); }
-static void ffma(Em *e, Op d, Op a, Op b, Op c) { fop(e, BW_IR_FFMA, d, a, b, c); }
-static void fmaxx(Em *e, Op d, Op a, Op b) { fop(e, BW_IR_FMNMX_MAX, d, a, b, R(NOREG)); }
-static void mufu(Em *e, BlackwellIROpcode op, Op d, Op a) { BlackwellIRInsn i = I0(op); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; emit(e, i, K_VAR); }
-static void shfl_down(Em *e, int d, int a, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_SHFL_DOWN); i.dst_vreg = d; i.src1_vreg = a; i.imm = off; emit(e, i, K_VAR); }
-static void isetp_ge_u32(Em *e, int a, int b) { BlackwellIRInsn i = I0(BW_IR_ISETP_GE_U32); i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_PRED); }
-static void bra(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = (uint32_t)(target - here(e)); emit(e, i, K_BRA); }
-static int bra_if_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; }
-static void patch_bra(Em *e, int at, int target) { if (!e->err) e->p->insns[at].imm = (uint32_t)(target - at); }
-static int bssy_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); return at; }
-static void bsync(Em *e) { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); }
-static void exit_k(Em *e) { emit(e, I0(BW_IR_EXIT), K_EXIT); }
-static void tail(Em *e) {
-    exit_k(e);
-    BlackwellIRInsn self = I0(BW_IR_BRA);
-    self.control = 0x000fc000u;
-    if (omega_bw_ir_append(e->p, &self) < 0) e->err = -1;
-}
-static void loop_begin(Em *e) { if (e->depth >= MAX_LOOPS) { e->err = -1; return; } e->open_start[e->depth++] = here(e); }
-static void loop_end(Em *e) {
-    if (e->depth <= 0) { e->err = -1; return; }
-    int start = e->open_start[--e->depth], end = here(e) - 1;
-    OmegaRegAlloc *ra = &e->p->regalloc;
-    for (int v = 0; v < ra->num_vregs; v++) {
-        OmegaLiveInterval *iv = &ra->intervals[v];
-        if (iv->first_def >= 0 && iv->first_def < start && iv->last_use >= start && iv->last_use < end) iv->last_use = end;
-    }
-}
-
-/* A region only some lanes of a warp execute: BSSY ... @P0 BRA join ... BSYNC. P0 true = skip. */
-typedef struct { int bssy, bra; } Region;
-static Region region_skip_if_p0(Em *e) { Region r; r.bssy = bssy_fwd(e); r.bra = bra_if_p0_fwd(e); return r; }
-static void region_end(Em *e, Region r) { int at = here(e); bsync(e); patch_bra(e, r.bra, at); patch_bra(e, r.bssy, at + 1); }
-
-/* bf16 round-to-nearest-even of f32 x into the low 16 bits of d: r = x + 0x7fff + ((x >> 16) & 1); d = r >> 16 */
-static void bf16_of(Em *e, int d, Op x, int c7fff, int t) {
-    shrs(e, t, x, 16);
-    andi(e, R(t), R(t), 1u);
-    iadd(e, t, t, c7fff);
-    fop(e, BW_IR_IADD3, R(d), x, R(t), R(NOREG)); /* IADD3 d = x + t */
-    shr(e, d, d, 16);
-}
-
-static const uint32_t NEG_BIG = 0xF149F2CAu; /* -1e30f */
-
-int omega_blackwell_codegen_decode_attn_prog(const OmegaDecodeAttnSpec *spec, BlackwellIRProgram *prog) {
-    if (!spec || !prog || spec->depth < 1 || spec->depth > OMEGA_DATTN_MAX_DEPTH || spec->mutant < 0 || spec->mutant > 4) return -1;
-    omega_bw_ir_init(prog);
-    Em em; memset(&em, 0, sizeof em); em.p = prog; Em *e = &em;
-    const uint32_t D = spec->depth;
-    const int MUT = spec->mutant;
-
-    /* ---- arguments and identities ---- */
-    int udesc = UV64(e);
-    int pqkv = V64(e), pkc = V64(e), pvc = V64(e), prope = V64(e), pqn = V64(e), pkn = V64(e);
-    int pos = V(e), per = V(e), splits = V(e), kvs = V(e), eps = V(e), qks = V(e);
-    /* pout, ppart, pcnt, oscale are loaded from the constant bank in the epilogue (register pressure: the chip allocator has 128) */
-    int tid = V(e), cx = V(e), cy = V(e), warp = V(e), lane = V(e), one = V(e), zero = V(e), c7fff = V(e), c16 = V(e);
-    if (e->err) return -1;
-    ldcu64(e, udesc, 0x358);
-    ldc64(e, pqkv, OMEGA_DATTN_ARG_QKV); ldc64(e, pkc, OMEGA_DATTN_ARG_KC); ldc64(e, pvc, OMEGA_DATTN_ARG_VC);
-    ldc64(e, prope, OMEGA_DATTN_ARG_ROPE); ldc64(e, pqn, OMEGA_DATTN_ARG_QN); ldc64(e, pkn, OMEGA_DATTN_ARG_KN);
-    ldc32(e, pos, OMEGA_DATTN_ARG_POS); ldc32(e, per, OMEGA_DATTN_ARG_PER_SPLIT); ldc32(e, splits, OMEGA_DATTN_ARG_SPLITS);
-    ldc32(e, kvs, OMEGA_DATTN_ARG_KV_STRIDE); ldc32(e, eps, OMEGA_DATTN_ARG_EPS);
-    ldc32(e, qks, OMEGA_DATTN_ARG_QK_SCALE);
-    s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); s2r(e, cy, BW_SR_CTAID_Y);
-    movi(e, one, 1); movrz(e, R(zero)); movi(e, c7fff, 0x7fffu); movi(e, c16, 16);
-    shr(e, warp, tid, 5);
-    andi(e, R(lane), R(tid), 31u);
-
-    /* range of this CTA: base = cx * per; end = min(base + per, pos + 1) */
-    int base = V(e), bend = V(e), ctx = V(e), t1 = V(e), t2 = V(e), end = V(e), endm1 = V(e), negendm1 = V(e), splitsm1 = V(e), cyk = V(e);
-    imadr(e, base, cx, per, NOREG);
-    imadi(e, R(bend), R(base), 1u, per);
-    imadi(e, R(ctx), R(pos), 1u, one);
-    imadi(e, R(t1), R(ctx), 0xffffffffu, bend);      /* t1 = bend - ctx */
-    imadi(e, R(t2), R(t1), 0xffffffffu, NOREG);      /* t2 = ctx - bend */
-    shr(e, t2, t2, 31);                              /* 1 when bend > ctx */
-    imadr(e, t2, t2, t1, NOREG);                     /* t2 = over * (bend - ctx) */
-    imadi(e, R(end), R(t2), 0xffffffffu, bend);      /* end = bend - t2 */
-    imadi(e, R(endm1), R(one), 0xffffffffu, end);
-    imadi(e, R(negendm1), R(endm1), 0xffffffffu, NOREG);
-    imadi(e, R(splitsm1), R(one), 0xffffffffu, splits);
-    imadr(e, cyk, cy, kvs, NOREG);                   /* byte offset of this KV head's plane */
-
-    /* ---- prologue: q' for the 8 heads of the group (warp = head) ---- */
-    int q4 = V128(e), w4 = V128(e), pt4 = V128(e), cos4 = V128(e), sin4 = V128(e), k4 = V128(e), v4 = V128(e);
-    int sq = V(e), ts = V(e), rs = V(e), a0 = V(e), a1 = V(e), a2 = V(e), a3 = V(e), ad64 = V64(e), rope64 = V64(e), sgn = V(e), pl = V(e);
-    if (e->err) return -1;
-    imadi(e, R(t1), R(cy), 8u, warp);                /* q head index */
-    imadi(e, R(t1), R(t1), 512u, NOREG);
-    imadi(e, R(t1), R(lane), 16u, t1);
-    imadw(e, ad64, t1, 1u, pqkv);
-    ldg_wide(e, BW_IR_LDG_E_128, q4, ad64, 0, udesc, 1);
-    imadw(e, ad64, lane, 16u, pqn);
-    ldg_wide(e, BW_IR_LDG_E_128, w4, ad64, 0, udesc, 0);
-    /* rope row for this lane: cos/sin index = lane & 15 (dims 4i..4i+3 for lanes < 16, dims 64 + 4(i-16) above) */
-    andi(e, R(t2), R(lane), 15u);
-    imadi(e, R(t2), R(t2), 16u, NOREG);
-    imadi(e, R(t2), R(pos), OMEGA_DATTN_ROPE_ROW_BYTES, t2);
-    imadw(e, rope64, t2, 1u, prope);
-    ldg_wide(e, BW_IR_LDG_E_128, cos4, rope64, 0, udesc, 0);
-    ldg_wide(e, BW_IR_LDG_E_128, sin4, rope64, 256, udesc, 0);
-    /* sign of the sin term: lanes < 16 take q[d] * cos - q[d+64] * sin, lanes >= 16 take q[d] * cos + q[d-64] * sin */
-    imadi(e, R(sgn), R(one), 0xfffffff0u, lane);     /* lane - 16 */
-    shr(e, sgn, sgn, 31);
-    imadi(e, R(sgn), R(sgn), 0x80000000u, NOREG);
-    for (unsigned i = 0; i < 4; i++) xorr(e, S(sin4, i), S(sin4, i), R(sgn));
-    xorr(e, R(pl), R(lane), R(c16));                 /* partner lane */
-
-    /* RMSNorm of the quad's head: sum of squares over the warp, broadcast through shared memory */
-    fmul(e, R(sq), S(q4, 0), S(q4, 0));
-    for (unsigned i = 1; i < 4; i++) ffma(e, R(sq), S(q4, i), S(q4, i), R(sq));
-    for (uint32_t o = 16; o >= 1; o /= 2) { shfl_down(e, ts, sq, o); fadd(e, R(sq), R(sq), R(ts)); }
-    imadi(e, R(a0), R(warp), 4u, NOREG); imadi(e, R(a0), R(one), OMEGA_DATTN_SM_L, a0);
-    isetp_ge_u32(e, lane, one);
-    { Region r = region_skip_if_p0(e); sts32(e, a0, R(sq)); region_end(e, r); }
-    bar_sync(e);
-    lds32(e, R(sq), a0, 1);
-    movi(e, ts, 0x3c000000u);                         /* 1/128 */
-    ffma(e, R(rs), R(sq), R(ts), R(eps));
-    mufu(e, BW_IR_MUFU_RSQ, R(rs), R(rs));
-    for (unsigned i = 0; i < 4; i++) { fmul(e, S(q4, i), S(q4, i), R(rs)); fmul(e, S(q4, i), S(q4, i), S(w4, i)); }
-    /* stage, read the partner half, rotate */
-    imadi(e, R(a0), R(warp), 512u, NOREG); imadi(e, R(a0), R(lane), 16u, a0); /* SM_Q + warp*512 + lane*16 (SM_Q = 0) */
-    imadi(e, R(a1), R(one), 4u, a0); imadi(e, R(a2), R(one), 8u, a0); imadi(e, R(a3), R(one), 12u, a0);
-    sts32(e, a0, S(q4, 0)); sts32(e, a1, S(q4, 1)); sts32(e, a2, S(q4, 2)); sts32(e, a3, S(q4, 3));
-    bar_sync(e);
-    imadi(e, R(t2), R(warp), 512u, NOREG); imadi(e, R(t2), R(pl), 16u, t2);
-    lds128(e, pt4, t2, 0, 1);
-    if (MUT != 1) for (unsigned i = 0; i < 4; i++) { fmul(e, R(ts), S(q4, i), S(cos4, i)); ffma(e, S(q4, i), S(pt4, i), S(sin4, i), R(ts)); }
-    for (unsigned i = 0; i < 4; i++) fmul(e, S(q4, i), S(q4, i), R(qks));
-    bar_sync(e);                                      /* every partner read done before q' overwrites the staging */
-    sts32(e, a0, S(q4, 0)); sts32(e, a1, S(q4, 1)); sts32(e, a2, S(q4, 2)); sts32(e, a3, S(q4, 3));
-
-    /* ---- the new token's K (norm + rope) and V, bf16 into the cache by the CTA that owns `pos` ---- */
-    imadi(e, R(t1), R(cy), 512u, NOREG); imadi(e, R(t1), R(lane), 16u, t1);
-    imadi(e, R(t1), R(one), 32u * 128u * 4u, t1);    /* k block of qkv */
-    imadw(e, ad64, t1, 1u, pqkv);
-    ldg_wide(e, BW_IR_LDG_E_128, k4, ad64, 0, udesc, 1);
-    ldg_wide(e, BW_IR_LDG_E_128, v4, ad64, 4u * 128u * 4u, udesc, 0); /* v block follows the 4 k heads */
-    imadw(e, ad64, lane, 16u, pkn);
-    ldg_wide(e, BW_IR_LDG_E_128, w4, ad64, 0, udesc, 0);
-    fmul(e, R(sq), S(k4, 0), S(k4, 0));
-    for (unsigned i = 1; i < 4; i++) ffma(e, R(sq), S(k4, i), S(k4, i), R(sq));
-    for (uint32_t o = 16; o >= 1; o /= 2) { shfl_down(e, ts, sq, o); fadd(e, R(sq), R(sq), R(ts)); }
-    imadi(e, R(a1), R(warp), 4u, NOREG); imadi(e, R(a1), R(one), OMEGA_DATTN_SM_L, a1);
-    isetp_ge_u32(e, lane, one);
-    { Region r = region_skip_if_p0(e); sts32(e, a1, R(sq)); region_end(e, r); }
-    bar_sync(e);
-    lds32(e, R(sq), a1, 1);
-    movi(e, ts, 0x3c000000u);
-    ffma(e, R(rs), R(sq), R(ts), R(eps));
-    mufu(e, BW_IR_MUFU_RSQ, R(rs), R(rs));
-    for (unsigned i = 0; i < 4; i++) { fmul(e, S(k4, i), S(k4, i), R(rs)); fmul(e, S(k4, i), S(k4, i), S(w4, i)); }
-    imadi(e, R(a1), R(lane), 16u, NOREG); imadi(e, R(a1), R(one), OMEGA_DATTN_SM_K, a1);
-    imadi(e, R(a2), R(one), 4u, a1); imadi(e, R(a3), R(one), 8u, a1); imadi(e, R(t2), R(one), 12u, a1);
-    sts32(e, a1, S(k4, 0)); sts32(e, a2, S(k4, 1)); sts32(e, a3, S(k4, 2)); sts32(e, t2, S(k4, 3)); /* every warp writes the same words */
-    bar_sync(e);
-    imadi(e, R(t2), R(pl), 16u, NOREG); imadi(e, R(t2), R(one), OMEGA_DATTN_SM_K, t2);
-    lds128(e, pt4, t2, 0, 1);
-    if (MUT != 1) for (unsigned i = 0; i < 4; i++) { fmul(e, R(ts), S(k4, i), S(cos4, i)); ffma(e, S(k4, i), S(pt4, i), S(sin4, i), R(ts)); }
-    /* bf16 words: k4 -> (a2, a3), v4 -> (sq, ts) */
-    {
-        int h0 = V(e), h1 = V(e), tb = V(e);
-        bf16_of(e, h0, S(k4, 0), c7fff, tb); bf16_of(e, h1, S(k4, 1), c7fff, tb); imadi(e, R(a2), R(h1), 65536u, h0);
-        bf16_of(e, h0, S(k4, 2), c7fff, tb); bf16_of(e, h1, S(k4, 3), c7fff, tb); imadi(e, R(a3), R(h1), 65536u, h0);
-        bf16_of(e, h0, S(v4, 0), c7fff, tb); bf16_of(e, h1, S(v4, 1), c7fff, tb); imadi(e, R(sq), R(h1), 65536u, h0);
-        bf16_of(e, h0, S(v4, 2), c7fff, tb); bf16_of(e, h1, S(v4, 3), c7fff, tb); imadi(e, R(ts), R(h1), 65536u, h0);
-    }
-    /* cache row address of position pos for this lane */
-    imadi(e, R(t1), R(pos), OMEGA_DATTN_ROW_BYTES, cyk); imadi(e, R(t1), R(lane), 8u, t1);          /* 4 bf16 = 8 bytes per lane */
-    /* key = (splits - 1 - cx) + warp: zero only for warp 0 of the last split */
-    imadi(e, R(t2), R(cx), 0xffffffffu, splitsm1);
-    if (MUT != 3) {
-        int ka = V64(e), kb = V64(e), key = V(e);
-        imadi(e, R(key), R(t2), 1u, warp);
-        isetp_ge_u32(e, key, one);
-        int b1 = bra_if_p0_fwd(e);
-        imadw(e, ka, t1, 1u, pkc); imadw(e, kb, one, 4u, ka);
-        stg(e, BW_IR_STG_E, ka, R(a2), udesc); stg(e, BW_IR_STG_E, kb, R(a3), udesc);
-        patch_bra(e, b1, here(e));
-        xorr(e, R(key), R(warp), R(one)); imadi(e, R(key), R(t2), 1u, key);
-        isetp_ge_u32(e, key, one);
-        int b2 = bra_if_p0_fwd(e);
-        imadw(e, ka, t1, 1u, pvc); imadw(e, kb, one, 4u, ka);
-        stg(e, BW_IR_STG_E, ka, R(sq), udesc); stg(e, BW_IR_STG_E, kb, R(ts), udesc);
-        patch_bra(e, b2, here(e));
-    }
-    membar(e);
-    bar_sync(e);
-
-    /* ---- running state ---- */
-    int acc[8], m[8], l[8], sc[8], dl[8], wd[8], mn = V(e);
-    for (unsigned h = 0; h < 8; h++) { acc[h] = V128(e); m[h] = V(e); l[h] = V(e); sc[h] = V(e); dl[h] = V(e); wd[h] = V(e); }
-    int kq[OMEGA_DATTN_MAX_DEPTH], vq[OMEGA_DATTN_MAX_DEPTH];
-    for (uint32_t d = 0; d < D; d++) { kq[d] = V128(e); vq[d] = V64(e); }
-    int qa4 = V128(e), qb4 = V128(e);
-    int cb = V(e), tpos = V(e), over = V(e), krow = V64(e), kpf = V64(e), qoff = V(e), j = V(e), sa = V(e), smS = V(e);
-    int n = V(e), vrow = V64(e), vpf = V64(e), pa = V(e), i = V(e), dsum = V(e), lane8 = V(e), negwarp = V(e), ccnt = V(e);
-    if (e->err) return -1;
-    for (unsigned h = 0; h < 8; h++) { for (unsigned q = 0; q < 4; q++) movrz(e, S(acc[h], q)); movi(e, m[h], NEG_BIG); movrz(e, R(l[h])); }
-    movi(e, smS, OMEGA_DATTN_SM_S);
-    imadi(e, R(lane8), R(lane), 8u, NOREG);
-    if (MUT == 2) imadi(e, R(lane8), R(one), OMEGA_DATTN_ROW_BYTES, lane8);
-    imadi(e, R(negwarp), R(warp), 0xffffffffu, NOREG);
-    movi(e, ccnt, 16);
-    mov(e, R(cb), R(base));
-
-    /* ---- chunk loop ---- */
-    const int L_chunk = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, cb, end);
-    const int bra_done = bra_if_p0_fwd(e);
-    /* score pass: thread = position cb + tid, clamped to end - 1 (clamped lanes compute a score nobody reads) */
-    imadi(e, R(tpos), R(cb), 1u, tid);
-    imadi(e, R(over), R(tpos), 0xffffffffu, endm1);  /* endm1 - tpos */
-    shr(e, over, over, 31);                           /* 1 when tpos > endm1 */
-    imadi(e, R(t1), R(tpos), 1u, negendm1);           /* tpos - endm1 */
-    imadr(e, t1, over, t1, NOREG);
-    imadi(e, R(t1), R(t1), 0xffffffffu, tpos);        /* clamped position */
-    imadi(e, R(t1), R(t1), OMEGA_DATTN_ROW_BYTES, cyk);
-    imadw(e, krow, t1, 1u, pkc);
-    for (unsigned h = 0; h < 8; h++) movrz(e, R(sc[h]));
-    for (uint32_t d = 0; d < D; d++) ldg_wide(e, BW_IR_LDG_E_128, kq[d], krow, d * 16u, udesc, d == 0);
-    imadw(e, kpf, one, D * 16u, krow);
-    movrz(e, R(qoff)); movrz(e, R(j));
-    const int L_q = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, j, ccnt);
-    const int bra_qend = bra_if_p0_fwd(e);
-    for (unsigned w = 0; w < 4; w++) { imadi(e, R(wd[2 * w]), S(kq[0], w), 65536u, NOREG); andi(e, R(wd[2 * w + 1]), S(kq[0], w), 0xffff0000u); }
-    for (unsigned h = 0; h < 8; h++) {
-        lds128(e, qa4, qoff, h * 512u, 1); lds128(e, qb4, qoff, h * 512u + 16u, 0);
-        for (unsigned q = 0; q < 4; q++) ffma(e, R(sc[h]), R(wd[q]), S(qa4, q), R(sc[h]));
-        for (unsigned q = 0; q < 4; q++) ffma(e, R(sc[h]), R(wd[4 + q]), S(qb4, q), R(sc[h]));
-    }
-    for (uint32_t d = 0; d + 1 < D; d++) for (unsigned w = 0; w < 4; w++) mov(e, S(kq[d], w), S(kq[d + 1], w));
-    ldg_wide(e, BW_IR_LDG_E_128, kq[D - 1], kpf, 0, udesc, 1);
-    imadw(e, kpf, one, 16u, kpf);
-    imadi(e, R(qoff), R(one), 32u, qoff);
-    imadi(e, R(j), R(one), 1u, j);
-    bra(e, L_q);
-    loop_end(e);
-    patch_bra(e, bra_qend, here(e));
-    imadi(e, R(sa), R(tid), 32u, smS);
-    for (unsigned h = 0; h < 8; h++) { imadi(e, R(t1), R(one), h * 4u, sa); sts32(e, t1, R(sc[h])); }
-    bar_sync(e);
-    /* V pass: this warp's positions cb + warp + 8 i, i < n = max(0, ceil((min(end, cb + 256) - cb - warp) / 8)) */
-    imadi(e, R(t1), R(one), OMEGA_DATTN_CHUNK, cb);     /* cb + 256 */
-    imadi(e, R(t2), R(t1), 0xffffffffu, end);           /* end - (cb + 256) */
-    shr(e, over, t2, 31);                               /* 1 when the chunk is cut short by end */
-    imadr(e, t2, over, t2, t1);                         /* cend = min(end, cb + 256) */
-    imadi(e, R(t1), R(cb), 0xffffffffu, t2);            /* cend - cb */
-    imadi(e, R(t1), R(t1), 1u, negwarp);              /* x = end - cb - warp */
-    shr(e, over, t1, 31);
-    imadi(e, R(n), R(one), 7u, t1);
-    shr(e, n, n, 3);
-    imadr(e, t2, over, n, NOREG);
-    imadi(e, R(n), R(t2), 0xffffffffu, n);
-    imadi(e, R(t1), R(cb), 1u, warp);
-    imadi(e, R(t1), R(t1), OMEGA_DATTN_ROW_BYTES, lane8);
-    imadi(e, R(t1), R(t1), 1u, cyk);
-    imadw(e, vrow, t1, 1u, pvc);
-    for (uint32_t d = 0; d < D; d++) ldg_wide(e, BW_IR_LDG_E_64, vq[d], vrow, d * 8u * OMEGA_DATTN_ROW_BYTES, udesc, d == 0);
-    imadw(e, vpf, one, D * 8u * OMEGA_DATTN_ROW_BYTES, vrow);
-    imadi(e, R(pa), R(warp), 32u, smS);
-    movrz(e, R(i));
-    const int L_v = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, i, n);
-    const int bra_vend = bra_if_p0_fwd(e);
-    imadi(e, R(wd[0]), S(vq[0], 0), 65536u, NOREG); andi(e, R(wd[1]), S(vq[0], 0), 0xffff0000u);
-    imadi(e, R(wd[2]), S(vq[0], 1), 65536u, NOREG); andi(e, R(wd[3]), S(vq[0], 1), 0xffff0000u);
-    lds128(e, qa4, pa, 0, 1); lds128(e, qb4, pa, 16, 0);
-    for (unsigned h = 0; h < 8; h++) { fmaxx(e, R(mn), R(m[h]), h < 4 ? S(qa4, h) : S(qb4, h - 4)); fsub(e, R(dl[h]), R(m[h]), R(mn)); mov(e, R(m[h]), R(mn)); } /* dl <= 0; exactly +0 when the max stayed */
-    fadd(e, R(dsum), R(dl[0]), R(dl[1]));
-    for (unsigned h = 2; h < 8; h++) fadd(e, R(dsum), R(dsum), R(dl[h]));
-    isetp_ge_u32(e, one, dsum);                       /* 1 >= bits(dsum): no head's max moved (dsum is +0); a negative dsum has the sign bit */
-    const int bra_nores = bra_if_p0_fwd(e);
-    for (unsigned h = 0; h < 8; h++) mufu(e, BW_IR_MUFU_EX2, R(dl[h]), R(dl[h]));
-    for (unsigned h = 0; h < 8; h++) { for (unsigned q = 0; q < 4; q++) fmul(e, S(acc[h], q), S(acc[h], q), R(dl[h])); fmul(e, R(l[h]), R(l[h]), R(dl[h])); }
-    patch_bra(e, bra_nores, here(e));
-    for (unsigned h = 0; h < 8; h++) { fsub(e, R(dl[h]), h < 4 ? S(qa4, h) : S(qb4, h - 4), R(m[h])); mufu(e, BW_IR_MUFU_EX2, R(dl[h]), R(dl[h])); }
-    for (unsigned h = 0; h < 8; h++) { for (unsigned q = 0; q < 4; q++) ffma(e, S(acc[h], q), R(dl[h]), R(wd[q]), S(acc[h], q)); fadd(e, R(l[h]), R(l[h]), R(dl[h])); }
-    for (uint32_t d = 0; d + 1 < D; d++) for (unsigned w = 0; w < 2; w++) mov(e, S(vq[d], w), S(vq[d + 1], w));
-    ldg_wide(e, BW_IR_LDG_E_64, vq[D - 1], vpf, 0, udesc, 1);
-    imadw(e, vpf, one, 8u * OMEGA_DATTN_ROW_BYTES, vpf);
-    imadi(e, R(pa), R(one), 8u * 32u, pa);
-    imadi(e, R(i), R(one), 1u, i);
-    bra(e, L_v);
-    loop_end(e);
-    patch_bra(e, bra_vend, here(e));
-    bar_sync(e);                                      /* the next score pass overwrites s[][] */
-    imadi(e, R(cb), R(one), OMEGA_DATTN_CHUNK, cb);
-    bra(e, L_chunk);
-    loop_end(e);
-    patch_bra(e, bra_done, here(e));
-
-    /* ---- epilogue: combine the warps, write the partial ---- */
-    int ep[8], ea[8], eb[8];
-    for (unsigned h = 0; h < 8; h++) { ep[h] = V(e); ea[h] = V(e); eb[h] = V(e); }
-    int pout = V64(e), ppart = V64(e), pcnt = V64(e), oscale = V(e);
-    if (e->err) return -1;
-    ldc64(e, pout, OMEGA_DATTN_ARG_OUT); ldc64(e, ppart, OMEGA_DATTN_ARG_PART); ldc64(e, pcnt, OMEGA_DATTN_ARG_CNT); ldc32(e, oscale, OMEGA_DATTN_ARG_OUT_SCALE);
-    /* per-warp maxes to shared: lane 0 of warp w writes m[h] at SM_M + w*32 + h*4 */
-    imadi(e, R(a0), R(warp), 32u, NOREG); imadi(e, R(a0), R(one), OMEGA_DATTN_SM_M, a0);
-    isetp_ge_u32(e, lane, one);
-    { Region r = region_skip_if_p0(e); for (unsigned h = 0; h < 8; h++) { imadi(e, R(t1), R(one), h * 4u, a0); sts32(e, t1, R(m[h])); } region_end(e, r); }
-    bar_sync(e);
-    /* lanes 0..7 of every warp: M[lane] = max over the 8 warps; lanes of warp 0 write it at SM_M + 256 + lane*4 */
-    movi(e, ccnt, 8);
-    isetp_ge_u32(e, lane, ccnt);
-    {
-        Region r = region_skip_if_p0(e);
-        imadi(e, R(a1), R(lane), 4u, NOREG); imadi(e, R(a1), R(one), OMEGA_DATTN_SM_M, a1);
-        for (unsigned w = 0; w < 8; w++) { imadi(e, R(t1), R(one), w * 32u, a1); lds32(e, R(ep[w]), t1, w == 0); }
-        for (unsigned w = 1; w < 8; w++) fmaxx(e, R(ep[0]), R(ep[0]), R(ep[w]));
-        imadi(e, R(t1), R(one), 256u, a1);
-        sts32(e, t1, R(ep[0]));
-        region_end(e, r);
-    }
-    bar_sync(e);
-    movi(e, t1, OMEGA_DATTN_SM_M + 256u);
-    lds128(e, qa4, t1, 0, 1); lds128(e, qb4, t1, 16, 0);
-    for (unsigned h = 0; h < 8; h++) { fsub(e, R(ea[h]), R(m[h]), h < 4 ? S(qa4, h) : S(qb4, h - 4)); mufu(e, BW_IR_MUFU_EX2, R(ea[h]), R(ea[h])); }
-    for (unsigned h = 0; h < 8; h++) { for (unsigned q = 0; q < 4; q++) fmul(e, S(acc[h], q), S(acc[h], q), R(ea[h])); fmul(e, R(l[h]), R(l[h]), R(ea[h])); }
-    /* per-warp l to shared, then the partial's m and l by threads 0..7 */
-    imadi(e, R(a0), R(warp), 32u, NOREG); imadi(e, R(a0), R(one), OMEGA_DATTN_SM_L, a0);
-    isetp_ge_u32(e, lane, one);
-    { Region r = region_skip_if_p0(e); for (unsigned h = 0; h < 8; h++) { imadi(e, R(t1), R(one), h * 4u, a0); sts32(e, t1, R(l[h])); } region_end(e, r); }
-    bar_sync(e);
-    int pp = V64(e), pa64 = V64(e), pb64 = V64(e);
-    imadr(e, t2, cy, splits, cx);
-    imadi(e, R(t2), R(t2), OMEGA_DATTN_PARTIAL_WORDS * 4u, NOREG);
-    imadw(e, pp, t2, 1u, ppart);
-    isetp_ge_u32(e, tid, ccnt);                       /* tid >= 8 skips */
-    {
-        Region r = region_skip_if_p0(e);
-        imadi(e, R(a1), R(tid), 4u, NOREG); imadi(e, R(a1), R(one), OMEGA_DATTN_SM_L, a1);
-        for (unsigned w = 0; w < 8; w++) { imadi(e, R(t1), R(one), w * 32u, a1); lds32(e, R(ep[w]), t1, w == 0); }
-        for (unsigned w = 1; w < 8; w++) fadd(e, R(ep[0]), R(ep[0]), R(ep[w]));
-        imadi(e, R(t1), R(tid), 4u, NOREG); imadi(e, R(t1), R(one), OMEGA_DATTN_SM_M + 256u, t1);
-        lds32(e, R(ep[1]), t1, 1);
-        imadw(e, pa64, tid, 4u, pp);
-        stg(e, BW_IR_STG_E, pa64, R(ep[1]), udesc);  /* m[h] */
-        imadw(e, pb64, one, 32u, pa64);
-        stg(e, BW_IR_STG_E, pb64, R(ep[0]), udesc);  /* l[h] */
-        region_end(e, r);
-    }
-    /* acc: 4 rounds of 2 heads through the s[][] region: r[w][h'][128]; the 8 store and 8 load addresses computed once */
-    imadi(e, R(a0), R(warp), 1024u, NOREG); imadi(e, R(a0), R(lane), 16u, a0); imadi(e, R(a0), R(one), OMEGA_DATTN_SM_S, a0);
-    imadi(e, R(a1), R(tid), 4u, NOREG); imadi(e, R(a1), R(one), OMEGA_DATTN_SM_S, a1);
-    for (unsigned q = 0; q < 8; q++) imadi(e, R(eb[q]), R(one), (q / 4u) * 512u + (q % 4u) * 4u, a0);
-    for (unsigned w = 0; w < 8; w++) imadi(e, R(ea[w]), R(one), w * 1024u, a1);
-    imadw(e, pa64, tid, 4u, pp);
-    for (unsigned rd = 0; rd < 4; rd++) {
-        for (unsigned hh = 0; hh < 2; hh++) for (unsigned q = 0; q < 4; q++) sts32(e, eb[hh * 4 + q], S(acc[2 * rd + hh], q));
-        bar_sync(e);
-        for (unsigned w = 0; w < 8; w++) lds32(e, R(ep[w]), ea[w], w == 0);
-        for (unsigned w = 1; w < 8; w++) fadd(e, R(ep[0]), R(ep[0]), R(ep[w]));
-        imadw(e, pb64, one, 64u + rd * 1024u, pa64);
-        stg(e, BW_IR_STG_E, pb64, R(ep[0]), udesc);
-        bar_sync(e);
-    }
-    /* publish, count, the last CTA combines */
-    membar(e);
-    bar_sync(e);
-    movi(e, t1, OMEGA_DATTN_SM_FLAG);
-    isetp_ge_u32(e, tid, one);
-    {
-        Region r = region_skip_if_p0(e);
-        imadw(e, pb64, cy, 4u, pcnt);
-        atom_add(e, ep[0], pb64, one, udesc);
-        sts32(e, t1, R(ep[0]));
-        region_end(e, r);
-    }
-    bar_sync(e);
-    lds32(e, R(ep[0]), t1, 1);
-    isetp_ge_u32(e, ep[0], splitsm1);
-    const int bra_last = bra_if_p0_fwd(e);
-    exit_k(e);
-    patch_bra(e, bra_last, here(e));
-    /* combine: thread tid, outputs o = tid + 256 r (head o >> 7, dim o & 127), r = 0..3 */
-    int ho = V(e), oidx = V(e), ma = V64(e), la = V64(e), aa = V64(e), num = V(e), den = V(e), mx = V(e), s_i = V(e), rr = V(e);
-    if (e->err) return -1;
-    shr(e, ho, tid, 7);
-    mov(e, R(oidx), R(tid));
-    movrz(e, R(rr));
-    movi(e, ccnt, 4);
-    imadr(e, t2, cy, splits, NOREG);
-    imadi(e, R(t2), R(t2), OMEGA_DATTN_PARTIAL_WORDS * 4u, NOREG); /* byte offset of partials[cy][0] */
-    const int L_r = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, rr, ccnt);
-    const int bra_rend = bra_if_p0_fwd(e);
-    imadi(e, R(t1), R(ho), 4u, t2); imadw(e, ma, t1, 1u, ppart);
-    imadw(e, la, one, 32u, ma);
-    imadi(e, R(t1), R(oidx), 4u, t2); imadw(e, aa, t1, 1u, ppart); imadw(e, aa, one, 64u, aa);
-    movrz(e, R(num)); movrz(e, R(den)); movi(e, mx, NEG_BIG); movrz(e, R(s_i));
-    const int L_s = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, s_i, splits);
-    const int bra_send = bra_if_p0_fwd(e);
-    ldg32(e, BW_IR_LDG_STRONG_SYS, ep[0], ma, udesc, 1);
-    ldg32(e, BW_IR_LDG_STRONG_SYS, ep[1], la, udesc, 0);
-    ldg32(e, BW_IR_LDG_STRONG_SYS, ep[2], aa, udesc, 0);
-    if (MUT != 4) {
-        fmaxx(e, R(ep[3]), R(mx), R(ep[0]));
-        fsub(e, R(ep[4]), R(mx), R(ep[3])); mufu(e, BW_IR_MUFU_EX2, R(ep[4]), R(ep[4]));
-        fsub(e, R(ep[5]), R(ep[0]), R(ep[3])); mufu(e, BW_IR_MUFU_EX2, R(ep[5]), R(ep[5]));
-        mov(e, R(mx), R(ep[3]));
-        fmul(e, R(num), R(num), R(ep[4])); fmul(e, R(den), R(den), R(ep[4]));
-    } else {
-        movi(e, ep[5], 0x3f800000u);
-    }
-    ffma(e, R(num), R(ep[5]), R(ep[2]), R(num));
-    ffma(e, R(den), R(ep[5]), R(ep[1]), R(den));
-    imadw(e, ma, one, OMEGA_DATTN_PARTIAL_WORDS * 4u, ma);
-    imadw(e, la, one, OMEGA_DATTN_PARTIAL_WORDS * 4u, la);
-    imadw(e, aa, one, OMEGA_DATTN_PARTIAL_WORDS * 4u, aa);
-    imadi(e, R(s_i), R(one), 1u, s_i);
-    bra(e, L_s);
-    loop_end(e);
-    patch_bra(e, bra_send, here(e));
-    mufu(e, BW_IR_MUFU_RCP, R(den), R(den));
-    fmul(e, R(num), R(num), R(den));
-    fmul(e, R(num), R(num), R(oscale));
-    imadi(e, R(t1), R(cy), 1024u, oidx);
-    imadw(e, pb64, t1, 4u, pout);
-    stg(e, BW_IR_STG_E, pb64, R(num), udesc);
-    imadi(e, R(ho), R(one), 2u, ho);
-    imadi(e, R(oidx), R(one), 256u, oidx);
-    imadi(e, R(rr), R(one), 1u, rr);
-    bra(e, L_r);
-    loop_end(e);
-    patch_bra(e, bra_rend, here(e));
-    /* thread 0 resets the counter for the next launch (every other CTA of this head has already added) */
-    isetp_ge_u32(e, tid, one);
-    { Region r = region_skip_if_p0(e); imadw(e, pb64, cy, 4u, pcnt); stg(e, BW_IR_STG_STRONG_SYS, pb64, R(zero), udesc); region_end(e, r); }
-    tail(e);
-    if (e->err) return -1;
-    return omega_bw_regalloc_solve(prog);
-}
-
-int omega_decode_attn_prog_stats(const OmegaDecodeAttnSpec *spec, uint32_t *insns, uint32_t *gprs) {
-    static BlackwellIRProgram prog;
-    if (omega_blackwell_codegen_decode_attn_prog(spec, &prog) != 0) return -1;
-    if (insns) *insns = (uint32_t)prog.count;
-    if (gprs) *gprs = prog.regalloc.peak_gpr_usage;
-    return 0;
-}
diff --git a/src/omega_blackwell_codegen_attn.h b/src/omega_blackwell_codegen_attn.h
deleted file mode 100644
index 4f84bba33..000000000
--- a/src/omega_blackwell_codegen_attn.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* SPDX-License-Identifier: Apache-2.0
- * Copyright 2026 Drake Stapleton (AIEN / aien-dev)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef OMEGA_BLACKWELL_CODEGEN_ATTN_H
-#define OMEGA_BLACKWELL_CODEGEN_ATTN_H
-/*
- * omega_blackwell_codegen_attn: decode attention for Qwen3-30B-A3B in ONE launch per layer (OWN-30B cut 8,
- * 2026-10-13). Grouped-query attention with 8 query heads per KV head, head_dim 128, per-head RMSNorm on q
- * and k, rotary embedding from a host-built cos/sin table, the new token's K/V appended to a GPU-resident
- * bf16 cache inside the kernel, softmax over the whole context, output ready for o_proj (scaled by
- * `out_scale`, so it can be the x' row of the FP8 GEMV without a host round trip).
- *
- * Grid: (splits, kv_heads). CTA (cx, cy) handles KV head cy and the positions [cx*per_split, min(+per_split,
- * pos+1)) of the context; the host picks splits = ceil((pos+1)/per_split), so no CTA is empty. 8 warps = 256
- * threads per CTA (fixed: warp h = query head h of the group in the prologue, lane = position in the score pass).
- *
- * Per CTA:
- *   prologue  warp h: q[cy*8+h] (f32 quad per lane) -> RMSNorm(q_norm, eps) -> RoPE(table[pos]) -> * qk_scale,
- *             staged in shared memory as q'[h][128]. Every warp also computes k_new = RoPE(RMSNorm(k[cy]))
- *             and v_new; the CTA whose range holds `pos` (the last split) writes them as bf16 into the cache at
- *             [cy][pos] (warp 0 K, warp 1 V), then MEMBAR + BAR.SYNC, so its own stream reads them back.
- *   chunks    of 256 positions: score pass (thread = position: the bf16 K row streamed in 16 quads with a
- *             `depth`-deep prefetch, 8 dot products against q' from shared memory, scores to shared s[t][8]);
- *             V pass (warp w: positions w, w+8, ...; lane = 4 dims; online softmax per warp: running max,
- *             alpha = EX2(m_old - m_new) applied only when the max moved (warp-uniform branch), p = EX2(s - m),
- *             acc += p * v, l += p).
- *   epilogue  warps combine (m, l, acc) through shared memory and write the CTA partial
- *             {m[8], l[8], acc[8][128]} to partials[cy][cx]; then one ATOMG.ADD on counters[cy]; the last CTA
- *             of the KV head combines the partials with the usual max rescale and writes out[(cy*8+h)*128+d]
- *             * out_scale, and resets the counter.
- *
- * Numbers (f32 on the chip, double in the host reference, tolerances in tests/gpu_decode_attn_test.c):
- *   scores in log2 units: q' already carries (1/sqrt(128)) * log2(e), so p = EX2(s - m) = exp((q.k)/sqrt(d) - M).
- *   bf16 K/V are widened by a 16-bit shift; the new K/V are rounded to bf16 round-to-nearest-even before storing
- *   (the reference rounds the same way, so the attention of the new token sees the stored value).
- *
- * The host simulator (tests/bw_warp_sim_k.h) runs this kernel at 8 warps; a simulator pass is never a chip result.
- */
-#include "omega_blackwell_codegen.h"
-#include <stdint.h>
-
-#define OMEGA_DATTN_HEAD_DIM 128u
-#define OMEGA_DATTN_Q_PER_KV 8u
-#define OMEGA_DATTN_WARPS 8u
-#define OMEGA_DATTN_CHUNK 256u                 /* positions per score pass = threads per CTA */
-#define OMEGA_DATTN_ROW_BYTES 256u             /* one bf16 K or V row */
-#define OMEGA_DATTN_ROPE_ROW_BYTES 512u        /* cos[64] then sin[64], f32 */
-#define OMEGA_DATTN_PARTIAL_WORDS 1040u        /* m[8], l[8], acc[8][128] */
-#define OMEGA_DATTN_MAX_DEPTH 4u
-/* bytes past the last row of a K or V plane the prefetch may touch (clamped reads of the last rows) */
-#define OMEGA_DATTN_PLANE_SLACK (OMEGA_DATTN_MAX_DEPTH * 8u * OMEGA_DATTN_ROW_BYTES + 64u)
-
-/* constant bank: every address at 0x380 + 8n, then the scalars */
-#define OMEGA_DATTN_ARG_QKV 0x380u      /* f32 [32*128 q | 4*128 k | 4*128 v] */
-#define OMEGA_DATTN_ARG_KC 0x388u       /* bf16 K cache base: [kv_head][max_pos][128], kv_stride bytes per head */
-#define OMEGA_DATTN_ARG_VC 0x390u       /* bf16 V cache base, same layout */
-#define OMEGA_DATTN_ARG_ROPE 0x398u     /* f32 [max_pos][cos 64 | sin 64] */
-#define OMEGA_DATTN_ARG_QN 0x3a0u       /* f32 [128] q_norm weight */
-#define OMEGA_DATTN_ARG_KN 0x3a8u       /* f32 [128] k_norm weight */
-#define OMEGA_DATTN_ARG_OUT 0x3b0u      /* f32 [32][128] */
-#define OMEGA_DATTN_ARG_PART 0x3b8u     /* f32 [kv_heads][splits][1040] */
-#define OMEGA_DATTN_ARG_CNT 0x3c0u      /* u32 [kv_heads], zero before the launch */
-#define OMEGA_DATTN_ARG_POS 0x3c8u      /* u32 position of the new token; context = pos + 1 */
-#define OMEGA_DATTN_ARG_PER_SPLIT 0x3ccu /* u32 positions per CTA (multiple of 256) */
-#define OMEGA_DATTN_ARG_SPLITS 0x3d0u   /* u32 = grid_x */
-#define OMEGA_DATTN_ARG_KV_STRIDE 0x3d4u /* u32 bytes per KV head plane */
-#define OMEGA_DATTN_ARG_EPS 0x3d8u      /* f32 rms eps */
-#define OMEGA_DATTN_ARG_OUT_SCALE 0x3dcu /* f32 multiplier on the output (2^64 for the FP8 GEMV x' row, 1 otherwise) */
-#define OMEGA_DATTN_ARG_QK_SCALE 0x3e0u /* f32 (1/sqrt(128)) * log2(e) */
-#define OMEGA_DATTN_ARGS_WORDS 25u
-
-/* shared memory map (bytes) */
-#define OMEGA_DATTN_SM_Q 0u            /* q'[8][128] f32: 4096 */
-#define OMEGA_DATTN_SM_S 4096u         /* s[256][8] f32: 8192; reused as the reduce buffer r[8 warps][256] */
-#define OMEGA_DATTN_SM_M 12288u        /* m[8 warps][8] then the head maxes M[8]: 256 + 32 */
-#define OMEGA_DATTN_SM_L 12576u        /* l[8 warps][8]: 256 */
-#define OMEGA_DATTN_SM_FLAG 12832u     /* the atomic's old value: 16 */
-#define OMEGA_DATTN_SM_K 12864u        /* k_new[128] f32 staging: 512 */
-#define OMEGA_DATTN_SHARED_BYTES 13376u
-
-typedef struct {
-    uint32_t depth;  /* prefetch depth of the K and V streams, 1..4 */
-    int mutant;      /* TEST ONLY. 0 none; 1 no RoPE on q and k; 2 V read one position late; 3 the new K/V are not
-                      * written to the cache; 4 the cross-split combine ignores the max (differs only when splits > 1). */
-} OmegaDecodeAttnSpec;
-
-/* Builds the IR program (register-allocated) into *prog. 0 ok, -1 refused (depth 0 or > 4, mutant outside 0..4,
- * or the program outgrew BW_MAX_IR_INSNS / BW_MAX_VREGS). */
-int omega_blackwell_codegen_decode_attn_prog(const OmegaDecodeAttnSpec *spec, BlackwellIRProgram *prog);
-/* Instruction and peak-register counts of the program (host, no device). */
-int omega_decode_attn_prog_stats(const OmegaDecodeAttnSpec *spec, uint32_t *insns, uint32_t *gprs);
-
-#endif
diff --git a/src/omega_blackwell_codegen_attn256.c b/src/omega_blackwell_codegen_attn256.c
deleted file mode 100644
index ecb4c1dae..000000000
--- a/src/omega_blackwell_codegen_attn256.c
+++ /dev/null
@@ -1,646 +0,0 @@
-/*
- * omega_blackwell_codegen_attn256.c: the one-launch decode attention kernel for head_dim 256 (see the header). The
- * emitter helpers are the ones of omega_blackwell_codegen_attn.c (control words, read barrier on every load, loop
- * live ranges); the program follows that kernel with the 27B geometry and the dim-split V pass.
- */
-#include "omega_blackwell_codegen_attn256.h"
-#include "omega_blackwell_codegen_attn.h"
-#include <string.h>
-
-#define CW(stall, wbar, rbar, wait) \
-    (((uint32_t)(stall) << 9) | ((uint32_t)(wbar) << 14) | ((uint32_t)(rbar) << 17) | ((uint32_t)(wait) << 20))
-#define CW_YIELD 0x2000u
-#define SB_NONE 7u
-#define SB_GPR 0u
-#define SB_RD 1u
-#define SB_UGPR 2u
-#define NOREG (-1)
-#define MAX_LOOPS 4
-
-enum { K_FIXED, K_PRED, K_VAR, K_VAR_MORE, K_UVAR, K_STORE, K_SYNC, K_EXIT, K_BRA, K_BSSY, K_BSYNC };
-
-typedef struct {
-    BlackwellIRProgram *p;
-    uint32_t pending;
-    int err;
-    int open_start[MAX_LOOPS];
-    int depth;
-} Em;
-
-static void emit(Em *e, BlackwellIRInsn in, int kind) {
-    uint32_t wait = e->pending;
-    switch (kind) {
-    case K_FIXED: in.control = CW(6, SB_NONE, SB_NONE, wait); e->pending = 0; break;
-    case K_PRED:  in.control = CW(14, SB_NONE, SB_NONE, wait); e->pending = 0; break;
-    case K_VAR:   in.control = CW(4, SB_GPR, SB_RD, wait) | CW_YIELD; e->pending = (1u << SB_GPR) | (1u << SB_RD); break;
-    case K_VAR_MORE: in.control = CW(4, SB_GPR, SB_RD, (e->pending & (1u << SB_RD))) | CW_YIELD; e->pending |= (1u << SB_GPR) | (1u << SB_RD); break;
-    case K_UVAR:  in.control = CW(4, SB_UGPR, SB_NONE, wait) | CW_YIELD; e->pending = 1u << SB_UGPR; break;
-    case K_STORE: in.control = CW(4, SB_NONE, SB_RD, wait) | CW_YIELD; e->pending = 1u << SB_RD; break;
-    case K_SYNC:  in.control = CW(6, SB_NONE, SB_NONE, wait); e->pending = 0; break;
-    case K_EXIT:  in.control = CW(5, SB_NONE, SB_NONE, wait); e->pending = in.predicate_p0 ? wait : 0; break;
-    case K_BRA:   in.control = CW(5, SB_NONE, SB_NONE, wait); e->pending = in.predicate_p0 ? wait : 0; break;
-    case K_BSSY:  in.control = CW(1, SB_NONE, SB_NONE, wait) | CW_YIELD; e->pending = 0; break;
-    case K_BSYNC: in.control = CW(5, SB_NONE, SB_NONE, wait) | CW_YIELD; e->pending = 0; break;
-    default: e->err = -1; return;
-    }
-    if (omega_bw_ir_append(e->p, &in) < 0) e->err = -1;
-}
-
-static BlackwellIRInsn I0(BlackwellIROpcode op) {
-    BlackwellIRInsn i; memset(&i, 0, sizeof i);
-    i.op = op; i.dst_vreg = NOREG; i.src1_vreg = NOREG; i.src2_vreg = NOREG; i.src3_vreg = NOREG; i.ureg = NOREG;
-    return i;
-}
-static int V(Em *e) { int v = omega_bw_ir_alloc_vreg(e->p); if (v < 0) e->err = -1; return v; }
-static int V64(Em *e) { int v = omega_bw_ir_alloc_vreg64(e->p); if (v < 0) e->err = -1; return v; }
-static int V128(Em *e) { int v = omega_bw_ir_alloc_vreg128(e->p); if (v < 0) e->err = -1; return v; }
-static int UV64(Em *e) { int v = omega_bw_ir_alloc_uvreg64(e->p); if (v < 0) e->err = -1; return v; }
-static int here(const Em *e) { return (int)e->p->count; }
-
-/* operand with subregister */
-typedef struct { int v; unsigned s; } Op;
-static Op R(int v) { Op o = { v, 0 }; return o; }
-static Op S(int v, unsigned s) { Op o = { v, s }; return o; }
-
-static void ldcu64(Em *e, int ud, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDCU64); i.dst_vreg = ud; i.imm = off; i.is_uniform = true; emit(e, i, K_UVAR); }
-static void ldc64(Em *e, int d, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDC64); i.dst_vreg = d; i.imm = off; emit(e, i, K_VAR); }
-static void ldc32(Em *e, int d, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDC); i.dst_vreg = d; i.imm = off; emit(e, i, K_VAR); }
-static void s2r(Em *e, int d, uint32_t sr) { BlackwellIRInsn i = I0(BW_IR_S2R); i.dst_vreg = d; i.imm = sr; emit(e, i, K_VAR); }
-static void movi(Em *e, int d, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_MOV_IMM); i.dst_vreg = d; i.imm = imm; emit(e, i, K_FIXED); }
-static void movrz(Em *e, Op d) { BlackwellIRInsn i = I0(BW_IR_MOV_RZ); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; emit(e, i, K_FIXED); }
-/* d = a * imm + c */
-static void imadi(Em *e, Op d, Op a, uint32_t imm, int c) { BlackwellIRInsn i = I0(BW_IR_IMAD); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; i.imm = imm; i.src3_vreg = c; emit(e, i, K_FIXED); }
-/* d = a * b + c (registers) */
-static void imadr(Em *e, int d, int a, int b, int c) { BlackwellIRInsn i = I0(BW_IR_IMAD); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; i.src3_vreg = c; emit(e, i, K_FIXED); }
-/* d64 = a * imm + c64 */
-static void imadw(Em *e, int d64, int a, uint32_t imm, int c64) { BlackwellIRInsn i = I0(BW_IR_IMAD_WIDE); i.dst_vreg = d64; i.src1_vreg = a; i.imm = imm; i.src3_vreg = c64; emit(e, i, K_FIXED); }
-static void mov(Em *e, Op d, Op a) { imadi(e, d, a, 1u, NOREG); }
-static void shrs(Em *e, int d, Op a, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_SHF_R); i.dst_vreg = d; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; i.imm = imm; emit(e, i, K_FIXED); }
-static void shr(Em *e, int d, int a, uint32_t imm) { shrs(e, d, R(a), imm); }
-static void andi(Em *e, Op d, Op a, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_LOP3_AND); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; i.imm = imm; emit(e, i, K_FIXED); }
-static void xorr(Em *e, Op d, Op a, Op b) { BlackwellIRInsn i = I0(BW_IR_LOP3_XOR); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; i.src2_vreg = b.v; i.src2_subreg = (uint8_t)b.s; emit(e, i, K_FIXED); }
-static void iadd(Em *e, int d, int a, int b) { BlackwellIRInsn i = I0(BW_IR_IADD3); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); }
-static void ldg_wide(Em *e, BlackwellIROpcode op, int d, int addr64, uint32_t imm, int udesc, int first) {
-    BlackwellIRInsn i = I0(op); i.dst_vreg = d; i.src1_vreg = addr64; i.imm = imm; i.ureg = udesc; emit(e, i, first ? K_VAR : K_VAR_MORE);
-}
-static void ldg32(Em *e, BlackwellIROpcode op, int d, int addr64, int udesc, int first) { BlackwellIRInsn i = I0(op); i.dst_vreg = d; i.src1_vreg = addr64; i.ureg = udesc; emit(e, i, first ? K_VAR : K_VAR_MORE); }
-static void stg(Em *e, BlackwellIROpcode op, int addr64, Op val, int udesc) { BlackwellIRInsn i = I0(op); i.src1_vreg = addr64; i.src2_vreg = val.v; i.src2_subreg = (uint8_t)val.s; i.ureg = udesc; emit(e, i, K_STORE); }
-static void atom_add(Em *e, int d, int addr64, int val, int udesc) { BlackwellIRInsn i = I0(BW_IR_ATOMG_ADD_STRONG_SYS); i.dst_vreg = d; i.src1_vreg = addr64; i.src2_vreg = val; i.ureg = udesc; emit(e, i, K_VAR); }
-static void membar(Em *e) { emit(e, I0(BW_IR_MEMBAR_ALL_SYS), K_FIXED); }
-static void lds128(Em *e, int d128, int addr, uint32_t imm, int first) { BlackwellIRInsn i = I0(BW_IR_LDS128); i.dst_vreg = d128; i.src1_vreg = addr; i.imm = imm; emit(e, i, first ? K_VAR : K_VAR_MORE); }
-static void lds32(Em *e, Op d, int addr, int first) { BlackwellIRInsn i = I0(BW_IR_LDS32); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = addr; emit(e, i, first ? K_VAR : K_VAR_MORE); }
-static void sts32(Em *e, int addr, Op val) { BlackwellIRInsn i = I0(BW_IR_STS32); i.src1_vreg = addr; i.src2_vreg = val.v; i.src2_subreg = (uint8_t)val.s; emit(e, i, K_STORE); }
-static void bar_sync(Em *e) { emit(e, I0(BW_IR_BAR_SYNC), K_SYNC); }
-static void fop(Em *e, BlackwellIROpcode op, Op d, Op a, Op b, Op c) {
-    BlackwellIRInsn i = I0(op); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s;
-    i.src2_vreg = b.v; i.src2_subreg = (uint8_t)b.s; i.src3_vreg = c.v; i.src3_subreg = (uint8_t)c.s; emit(e, i, K_FIXED);
-}
-static void fadd(Em *e, Op d, Op a, Op b) { fop(e, BW_IR_FADD, d, a, b, R(NOREG)); }
-static void fsub(Em *e, Op d, Op a, Op b) { fop(e, BW_IR_FSUB, d, a, b, R(NOREG)); }
-static void fmul(Em *e, Op d, Op a, Op b) { fop(e, BW_IR_FMUL, d, a, b, R(NOREG)); }
-static void ffma(Em *e, Op d, Op a, Op b, Op c) { fop(e, BW_IR_FFMA, d, a, b, c); }
-static void fmaxx(Em *e, Op d, Op a, Op b) { fop(e, BW_IR_FMNMX_MAX, d, a, b, R(NOREG)); }
-static void mufu(Em *e, BlackwellIROpcode op, Op d, Op a) { BlackwellIRInsn i = I0(op); i.dst_vreg = d.v; i.dst_subreg = (uint8_t)d.s; i.src1_vreg = a.v; i.src1_subreg = (uint8_t)a.s; emit(e, i, K_VAR); }
-static void shfl_down(Em *e, int d, int a, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_SHFL_DOWN); i.dst_vreg = d; i.src1_vreg = a; i.imm = off; emit(e, i, K_VAR); }
-static void isetp_ge_u32(Em *e, int a, int b) { BlackwellIRInsn i = I0(BW_IR_ISETP_GE_U32); i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_PRED); }
-static void bra(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = (uint32_t)(target - here(e)); emit(e, i, K_BRA); }
-static int bra_if_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; }
-static void patch_bra(Em *e, int at, int target) { if (!e->err) e->p->insns[at].imm = (uint32_t)(target - at); }
-static int bssy_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); return at; }
-static void bsync(Em *e) { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); }
-static void exit_k(Em *e) { emit(e, I0(BW_IR_EXIT), K_EXIT); }
-static void tail(Em *e) {
-    exit_k(e);
-    BlackwellIRInsn self = I0(BW_IR_BRA);
-    self.control = 0x000fc000u;
-    if (omega_bw_ir_append(e->p, &self) < 0) e->err = -1;
-}
-static void loop_begin(Em *e) { if (e->depth >= MAX_LOOPS) { e->err = -1; return; } e->open_start[e->depth++] = here(e); }
-static void loop_end(Em *e) {
-    if (e->depth <= 0) { e->err = -1; return; }
-    int start = e->open_start[--e->depth], end = here(e) - 1;
-    OmegaRegAlloc *ra = &e->p->regalloc;
-    for (int v = 0; v < ra->num_vregs; v++) {
-        OmegaLiveInterval *iv = &ra->intervals[v];
-        if (iv->first_def >= 0 && iv->first_def < start && iv->last_use >= start && iv->last_use < end) iv->last_use = end;
-    }
-}
-
-/* A region only some lanes of a warp execute: BSSY ... @P0 BRA join ... BSYNC. P0 true = skip. */
-typedef struct { int bssy, bra; } Region;
-static Region region_skip_if_p0(Em *e) { Region r; r.bssy = bssy_fwd(e); r.bra = bra_if_p0_fwd(e); return r; }
-static void region_end(Em *e, Region r) { int at = here(e); bsync(e); patch_bra(e, r.bra, at); patch_bra(e, r.bssy, at + 1); }
-
-/* bf16 round-to-nearest-even of f32 x into the low 16 bits of d: r = x + 0x7fff + ((x >> 16) & 1); d = r >> 16 */
-static void bf16_of(Em *e, int d, Op x, int c7fff, int t) {
-    shrs(e, t, x, 16);
-    andi(e, R(t), R(t), 1u);
-    iadd(e, t, t, c7fff);
-    fop(e, BW_IR_IADD3, R(d), x, R(t), R(NOREG)); /* IADD3 d = x + t */
-    shr(e, d, d, 16);
-}
-
-static const uint32_t NEG_BIG = 0xF149F2CAu; /* -1e30f */
-
-int omega_dattn256_shape(const OmegaDecodeAttn256Spec *spec, OmegaDattn256Shape *s) {
-    const uint32_t qh = spec->q_heads ? spec->q_heads : OMEGA_DATTN256_Q_HEADS;
-    const uint32_t kvh = spec->kv_heads ? spec->kv_heads : OMEGA_DATTN256_KV_HEADS;
-    const uint32_t h = spec->q_per_cta ? spec->q_per_cta : OMEGA_DATTN256_Q_PER_KV;
-    if (h < 1u || h > 6u || qh % h || kvh == 0 || (qh / h) % kvh) return -1;
-    const uint32_t g = (qh / h) / kvh;
-    if (g != 1u && g != 2u) return -1;
-    s->qh = qh; s->kvh = kvh; s->h = h; s->vy = qh / h; s->g = g;
-    s->qkv_words = (qh + 2u * kvh) * 256u; s->out_words = qh * 256u;
-    return 0;
-}
-#define RB OMEGA_DATTN256_ROW_BYTES
-#define PBYTES (OMEGA_DATTN256_PARTIAL_WORDS * 4u)
-
-/* 8 consecutive f32 words (two quads) to shared at base + 0 .. 28 */
-static void sts8(Em *e, int base, int one, int t, int qa, int qb) {
-    for (unsigned i = 0; i < 8; i++) { imadi(e, R(t), R(one), i * 4u, base); sts32(e, t, i < 4 ? S(qa, i) : S(qb, i - 4)); }
-}
-/* sum of squares of 8 values, warp-reduced, broadcast through shared word `addr` (lane 0 writes), rs = RSQ(sum/256 + eps) */
-static void rms_scale(Em *e, int qa, int qb, int sq, int ts, int rs, int addr, int lane, int one, int eps) {
-    fmul(e, R(sq), S(qa, 0), S(qa, 0));
-    for (unsigned i = 1; i < 4; i++) ffma(e, R(sq), S(qa, i), S(qa, i), R(sq));
-    for (unsigned i = 0; i < 4; i++) ffma(e, R(sq), S(qb, i), S(qb, i), R(sq));
-    for (uint32_t o = 16; o >= 1; o /= 2) { shfl_down(e, ts, sq, o); fadd(e, R(sq), R(sq), R(ts)); }
-    isetp_ge_u32(e, lane, one);
-    { Region r = region_skip_if_p0(e); sts32(e, addr, R(sq)); region_end(e, r); }
-    bar_sync(e);
-    lds32(e, R(sq), addr, 1);
-    movi(e, ts, 0x3b800000u);                         /* 1/256 */
-    ffma(e, R(rs), R(sq), R(ts), R(eps));
-    mufu(e, BW_IR_MUFU_RSQ, R(rs), R(rs));
-}
-
-int omega_blackwell_codegen_decode_attn256_prog(const OmegaDecodeAttn256Spec *spec, BlackwellIRProgram *prog) {
-    if (!spec || !prog || spec->depth < 1 || spec->depth > OMEGA_DATTN256_MAX_DEPTH || spec->mutant < 0 || spec->mutant > 5 || spec->prep > 1 || spec->multi > 1) return -1;
-    omega_bw_ir_init(prog);
-    Em em; memset(&em, 0, sizeof em); em.p = prog; Em *e = &em;
-    const uint32_t D = spec->depth;
-    OmegaDattn256Shape SH;
-    if (omega_dattn256_shape(spec, &SH)) return -1;
-    const uint32_t H = SH.h;                         /* q heads per CTA row */
-    const int OLD = SH.qh == OMEGA_DATTN256_Q_HEADS && SH.kvh == OMEGA_DATTN256_KV_HEADS && H == OMEGA_DATTN256_Q_PER_KV;
-    const int MUT = spec->mutant;
-
-    /* ---- arguments and identities ---- */
-    int udesc = UV64(e);
-    int pqkv = V64(e), pkc = V64(e), pvc = V64(e), prope = V64(e), pqn = V64(e);
-    int pos = V(e), per = V(e), splits = V(e), kvs = V(e), eps = V(e), qks = V(e);
-    int tid = V(e), cx = V(e), cy = V(e), warp = V(e), lane = V(e), one = V(e), zero = V(e), c7fff = V(e), c16 = V(e);
-    if (e->err) return -1;
-    ldcu64(e, udesc, 0x358);
-    ldc64(e, pqkv, OMEGA_DATTN256_ARG_QKV); ldc64(e, pkc, OMEGA_DATTN256_ARG_KC); ldc64(e, pvc, OMEGA_DATTN256_ARG_VC);
-    ldc64(e, prope, OMEGA_DATTN256_ARG_ROPE); ldc64(e, pqn, OMEGA_DATTN256_ARG_QN); /* k_norm is read at q_norm + 1024 bytes (ARG_KN is informational) */
-    ldc32(e, pos, OMEGA_DATTN256_ARG_POS); ldc32(e, per, OMEGA_DATTN256_ARG_PER_SPLIT); ldc32(e, splits, OMEGA_DATTN256_ARG_SPLITS);
-    ldc32(e, kvs, OMEGA_DATTN256_ARG_KV_STRIDE); ldc32(e, eps, OMEGA_DATTN256_ARG_EPS);
-    ldc32(e, qks, OMEGA_DATTN256_ARG_QK_SCALE);
-    s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); s2r(e, cy, BW_SR_CTAID_Y);
-    if (spec->prep && !spec->multi) {                /* prefill prep (#545): CTA cx = token cx at position pos0 + cx, its qkv row */
-        iadd(e, pos, pos, cx);
-        { int rowoff = V(e); if (e->err) return -1; imadi(e, R(rowoff), R(cx), SH.qkv_words * 4u, NOREG); imadw(e, pqkv, rowoff, 1u, pqkv); }
-    }
-    movi(e, one, 1); movrz(e, R(zero)); movi(e, c7fff, 0x7fffu); movi(e, c16, 16);
-    shr(e, warp, tid, 5);
-    andi(e, R(lane), R(tid), 31u);
-    if (spec->multi) {                               /* L369 multi-token: the token, its position and qkv row (ARG_XSTRIDE bytes per row) */
-        int tok = V(e), xs = V(e); if (e->err) return -1;
-        ldc32(e, xs, OMEGA_DATTN256_ARG_XSTRIDE);
-        if (spec->prep) mov(e, R(tok), R(cx));       /* prep: CTA (token, row) */
-        else {                                       /* attend: CTA (split, token * vy + row) */
-            uint32_t lg = 0; while ((1u << lg) < SH.vy) lg++;
-            if ((1u << lg) != SH.vy) return -1;
-            shr(e, tok, cy, lg); andi(e, R(cy), R(cy), SH.vy - 1u);
-        }
-        iadd(e, pos, pos, tok);
-        imadr(e, xs, tok, xs, NOREG); imadw(e, pqkv, xs, 1u, pqkv);
-        if (!spec->prep) {                           /* this token's splits (per_split 256): CTAs past them exit */
-            shr(e, splits, pos, 8); imadi(e, R(splits), R(splits), 1u, one);
-            imadi(e, R(xs), R(one), 0xffffffffu, splits);
-            isetp_ge_u32(e, xs, cx);
-            int bk = bra_if_p0_fwd(e); exit_k(e); patch_bra(e, bk, here(e));
-        }
-    }
-
-    /* range of this CTA: base = cx * per; end = min(base + per, pos + 1) */
-    int base = V(e), bend = V(e), ctx = V(e), t1 = V(e), t2 = V(e), end = V(e), endm1 = V(e), negendm1 = V(e), splitsm1 = V(e), cyk = V(e);
-    imadr(e, base, cx, per, NOREG);
-    imadi(e, R(bend), R(base), 1u, per);
-    imadi(e, R(ctx), R(pos), 1u, one);
-    imadi(e, R(t1), R(ctx), 0xffffffffu, bend);      /* t1 = bend - ctx */
-    imadi(e, R(t2), R(t1), 0xffffffffu, NOREG);      /* t2 = ctx - bend */
-    shr(e, t2, t2, 31);                              /* 1 when bend > ctx */
-    imadr(e, t2, t2, t1, NOREG);                     /* t2 = over * (bend - ctx) */
-    imadi(e, R(end), R(t2), 0xffffffffu, bend);      /* end = bend - t2 */
-    imadi(e, R(endm1), R(one), 0xffffffffu, end);
-    imadi(e, R(negendm1), R(endm1), 0xffffffffu, NOREG);
-    imadi(e, R(splitsm1), R(one), 0xffffffffu, splits);
-    if (SH.g == 1u) imadr(e, cyk, cy, kvs, NOREG);   /* byte offset of this KV head's plane */
-    else { shr(e, t1, cy, 1); imadr(e, cyk, t1, kvs, NOREG); }   /* G = 2: KV head cy / 2 */
-
-    /* ---- prologue: one norm + rope block for all 8 warps. Warp h < 6 builds q'[h] (head cy*6+h, q_norm, * qk_scale);
-     *      warp 6 builds k_new (k[cy], k_norm = q_norm + 1024 bytes, scale 1); warp 7 runs the block on v[cy] (the result is
-     *      discarded) and reloads the raw v at the store. Warps 6, 7 stage in the s[][] region (unused until the chunk loop). ---- */
-    int qa = V128(e), qb = V128(e), wa = V128(e), wb = V128(e), pa_ = V128(e), pb_ = V128(e);
-    int cosa = V128(e), cosb = V128(e), sina = V128(e), sinb = V128(e);
-    int sq = V(e), ts = V(e), rs = V(e), a0 = V(e), a1 = V(e), ad64 = V64(e), rope64 = V64(e), sgn = V(e), pl = V(e), f = V(e), voff = V(e), qksw = V(e);
-    if (e->err) return -1;
-    movi(e, t1, 5u); imadi(e, R(t1), R(warp), 0xffffffffu, t1); /* 5 - warp */
-    shr(e, f, t1, 31);                               /* f = 1 for warps 6, 7 */
-    /* byte offset of the vector in qkv: q head cy*6 + warp at (cy*6 + warp)*1024; k[cy] at 24576 + cy*1024 = warp*4096 + cy*1024
-     * for warp 6; v[cy] at 28672 + cy*1024 = warp*4096 + cy*1024 for warp 7 */
-    imadi(e, R(t1), R(cy), H, warp); imadi(e, R(t1), R(t1), 1024u, NOREG);
-    if (OLD) { imadi(e, R(t2), R(warp), 4096u, NOREG); imadi(e, R(t2), R(cy), 1024u, t2); }
-    else {                                           /* q_heads*1024 + (warp - 6)*kv_heads*1024 + (cy / G)*1024 */
-        if (SH.g == 1u) mov(e, R(t2), R(cy)); else shr(e, t2, cy, 1);
-        imadi(e, R(t2), R(t2), 1024u, NOREG);
-        imadi(e, R(t2), R(warp), SH.kvh * 1024u, t2);
-        imadi(e, R(t2), R(one), (SH.qh - 6u * SH.kvh) * 1024u, t2);
-    }
-    imadi(e, R(t2), R(t1), 0xffffffffu, t2);         /* off_kv - off_q */
-    imadr(e, voff, f, t2, t1);                       /* f ? off_kv : off_q */
-    imadi(e, R(voff), R(lane), 32u, voff);           /* + this lane's 8 dims */
-    imadw(e, ad64, voff, 1u, pqkv);
-    ldg_wide(e, BW_IR_LDG_E_128, qa, ad64, 0, udesc, 1);
-    ldg_wide(e, BW_IR_LDG_E_128, qb, ad64, 16, udesc, 0);
-    imadi(e, R(t2), R(f), 1024u, NOREG); imadi(e, R(t2), R(lane), 32u, t2); /* q_norm, or k_norm 1024 bytes after it */
-    imadw(e, ad64, t2, 1u, pqn);
-    ldg_wide(e, BW_IR_LDG_E_128, wa, ad64, 0, udesc, 0);
-    ldg_wide(e, BW_IR_LDG_E_128, wb, ad64, 16, udesc, 0);
-    /* rope row for this lane: pair index = (lane & 15) * 8 .. +7 (dims 8i..8i+7 for lanes < 16, dims 128 + 8(i-16) above) */
-    andi(e, R(t2), R(lane), 15u);
-    imadi(e, R(t2), R(t2), 32u, NOREG);
-    imadi(e, R(t2), R(pos), OMEGA_DATTN256_ROPE_ROW_BYTES, t2);
-    imadw(e, rope64, t2, 1u, prope);
-    ldg_wide(e, BW_IR_LDG_E_128, cosa, rope64, 0, udesc, 0);
-    ldg_wide(e, BW_IR_LDG_E_128, cosb, rope64, 16, udesc, 0);
-    ldg_wide(e, BW_IR_LDG_E_128, sina, rope64, 512, udesc, 0);
-    ldg_wide(e, BW_IR_LDG_E_128, sinb, rope64, 528, udesc, 0);
-    /* sign of the sin term: lanes < 16 take x[d] * cos - x[d+128] * sin, lanes >= 16 take x[d] * cos + x[d-128] * sin */
-    imadi(e, R(sgn), R(one), 0xfffffff0u, lane);     /* lane - 16 */
-    shr(e, sgn, sgn, 31);
-    imadi(e, R(sgn), R(sgn), 0x80000000u, NOREG);
-    for (unsigned i = 0; i < 4; i++) { xorr(e, S(sina, i), S(sina, i), R(sgn)); xorr(e, S(sinb, i), S(sinb, i), R(sgn)); }
-    xorr(e, R(pl), R(lane), R(c16));                 /* partner lane */
-
-    /* RMSNorm of the lane's 8 dims: sum of squares over the warp, broadcast through shared memory */
-    imadi(e, R(a0), R(warp), 4u, NOREG); imadi(e, R(a0), R(one), OMEGA_DATTN256_SM_L, a0);
-    rms_scale(e, qa, qb, sq, ts, rs, a0, lane, one, eps);
-    for (unsigned i = 0; i < 4; i++) { fmul(e, S(qa, i), S(qa, i), R(rs)); fmul(e, S(qa, i), S(qa, i), S(wa, i)); fmul(e, S(qb, i), S(qb, i), R(rs)); fmul(e, S(qb, i), S(qb, i), S(wb, i)); }
-    /* stage, read the partner half, rotate */
-    imadi(e, R(a0), R(warp), 1024u, NOREG); imadi(e, R(a0), R(lane), 32u, a0); /* SM_Q + warp*1024 + lane*32 (SM_Q = 0) */
-    sts8(e, a0, one, t1, qa, qb);
-    bar_sync(e);
-    imadi(e, R(t2), R(warp), 1024u, NOREG); imadi(e, R(t2), R(pl), 32u, t2);
-    lds128(e, pa_, t2, 0, 1); lds128(e, pb_, t2, 16, 0);
-    if (MUT != 1) for (unsigned i = 0; i < 4; i++) {
-        fmul(e, R(ts), S(qa, i), S(cosa, i)); ffma(e, S(qa, i), S(pa_, i), S(sina, i), R(ts));
-        fmul(e, R(ts), S(qb, i), S(cosb, i)); ffma(e, S(qb, i), S(pb_, i), S(sinb, i), R(ts));
-    }
-    /* qksw = qk_scale for the q warps, 1.0f for warps 6, 7 (integer select on the bit patterns) */
-    movi(e, ts, 0x3f800000u); imadi(e, R(ts), R(qks), 0xffffffffu, ts); imadr(e, qksw, f, ts, qks);
-    for (unsigned i = 0; i < 4; i++) { fmul(e, S(qa, i), S(qa, i), R(qksw)); fmul(e, S(qb, i), S(qb, i), R(qksw)); }
-    bar_sync(e);                                      /* every partner read done before q' overwrites the staging */
-    sts8(e, a0, one, t1, qa, qb);                     /* warps 6, 7 write scratch inside s[][] */
-    if (spec->prep && !spec->multi) {
-        /* q' as bf16 in the attend kernel's A-fragment layout (omega_blackwell_codegen_pattn256.h, OMEGA_PATTN256_QF_*):
-         * word i of lane L (dims 8L+2i, +1) goes to ((((cx>>1)*4 + cy)*6 + warp)*16 + (L>>1))*64 + i*16 + ((L&1)*2 + (cx&1))*4.
-         * Warps 6, 7 (k, v) skip it. */
-        int qw = V128(e), pqf = V64(e), qa64 = V64(e), h0q = V(e), h1q = V(e), tbq = V(e), fq = f; if (e->err) return -1;
-        if (H < 6u) {                                /* warps H .. 5 hold no head of this row: they skip q' too */
-            fq = V(e); if (e->err) return -1;
-            movi(e, t1, H - 1u); imadi(e, R(t1), R(warp), 0xffffffffu, t1); shr(e, fq, t1, 31);
-        }
-        isetp_ge_u32(e, fq, one);
-        int bq = bra_if_p0_fwd(e);
-        for (unsigned w = 0; w < 4; w++) {
-            int src = w < 2 ? qa : qb; unsigned s0 = (2 * w) % 4;
-            bf16_of(e, h0q, S(src, s0), c7fff, tbq); bf16_of(e, h1q, S(src, s0 + 1), c7fff, tbq); imadi(e, S(qw, w), R(h1q), 65536u, h0q);
-        }
-        ldc64(e, pqf, OMEGA_DATTN256_ARG_OUT);
-        shr(e, t1, cx, 1); imadi(e, R(t1), R(t1), SH.vy, cy); imadi(e, R(t1), R(t1), H, warp);
-        shr(e, t2, lane, 1); imadi(e, R(t1), R(t1), 16u, t2); imadi(e, R(t1), R(t1), 64u, NOREG);
-        andi(e, R(t2), R(lane), 1u); imadi(e, R(t2), R(t2), 2u, NOREG);
-        { int cb = V(e); if (e->err) return -1; andi(e, R(cb), R(cx), 1u); iadd(e, t2, t2, cb); }
-        imadi(e, R(t1), R(t2), 4u, t1);
-        for (unsigned w = 0; w < 4; w++) { imadi(e, R(t2), R(one), 16u * w, t1); imadw(e, qa64, t2, 1u, pqf); stg(e, BW_IR_STG_E, qa64, S(qw, w), udesc); }
-        patch_bra(e, bq, here(e));
-    }
-
-    /* ---- the new token's K (warp 6: the rotated k) and V (warp 7: the raw v), bf16 into the cache by the CTA that owns `pos` ---- */
-    if (MUT != 3 && !(spec->multi && !spec->prep)) { /* multi attend: the prep launch wrote every token's K/V */
-        int sa64 = V64(e), sb64 = V64(e), key = V(e), h0 = V(e), h1 = V(e), tb = V(e);
-        /* key = (splits - 1 - cx) + 1 - f: zero only for warps 6, 7 of the last split */
-        imadi(e, R(t2), R(cx), 0xffffffffu, splitsm1);
-        imadi(e, R(t2), R(one), 1u, t2);
-        if (spec->prep) imadi(e, R(key), R(f), 0xffffffffu, one);   /* prep: every CTA owns its token: key = 1 - f */
-        else imadi(e, R(key), R(f), 0xffffffffu, t2);
-        isetp_ge_u32(e, key, one);
-        int b1 = bra_if_p0_fwd(e);
-        /* cache row address of position pos for this lane: 8 bf16 = 16 bytes per lane; K plane, V plane for warp 7 */
-        imadi(e, R(t1), R(pos), RB, cyk); imadi(e, R(t1), R(lane), 16u, t1);
-        imadw(e, sa64, t1, 1u, pkc);
-        movi(e, t2, 7u); imadi(e, R(t2), R(warp), 0xffffffffu, t2); /* 7 - warp: zero for warp 7 */
-        isetp_ge_u32(e, t2, one);
-        { Region r = region_skip_if_p0(e);
-          imadw(e, sb64, voff, 1u, pqkv);
-          ldg_wide(e, BW_IR_LDG_E_128, qa, sb64, 0, udesc, 1);
-          ldg_wide(e, BW_IR_LDG_E_128, qb, sb64, 16, udesc, 0);
-          imadw(e, sa64, t1, 1u, pvc);
-          region_end(e, r); }
-        for (unsigned w = 0; w < 4; w++) {
-            int src = w < 2 ? qa : qb; unsigned s0 = (2 * w) % 4;
-            bf16_of(e, h0, S(src, s0), c7fff, tb); bf16_of(e, h1, S(src, s0 + 1), c7fff, tb); imadi(e, S(wa, w), R(h1), 65536u, h0);
-        }
-        for (unsigned w = 0; w < 4; w++) { imadw(e, sb64, one, 4u * w, sa64); stg(e, BW_IR_STG_E, sb64, S(wa, w), udesc); }
-        patch_bra(e, b1, here(e));
-    }
-    membar(e);
-    if (spec->prep) {                                /* prep ends here: the K/V rows and q' are written */
-        tail(e);
-        if (e->err) return -1;
-        return omega_bw_regalloc_solve(prog);
-    }
-    bar_sync(e);
-
-    /* ---- running state ---- */
-    int acc[6], m[6], l[6], sc[6], dl[6], wd[8], mn = V(e);
-    for (unsigned h = 0; h < H; h++) { acc[h] = V128(e); m[h] = V(e); l[h] = V(e); sc[h] = V(e); dl[h] = V(e); }
-    for (unsigned q = 0; q < 8; q++) wd[q] = V(e);
-    int kq[OMEGA_DATTN256_MAX_DEPTH], vq[OMEGA_DATTN256_MAX_DEPTH];
-    for (uint32_t d = 0; d < D; d++) { kq[d] = V128(e); vq[d] = V64(e); }
-    int qa4 = V128(e), qb4 = V128(e);
-    int cb = V(e), tpos = V(e), over = V(e), krow = V64(e), kpf = V64(e), qoff = V(e), j = V(e), sa = V(e), smS = V(e);
-    int n = V(e), vrow = V64(e), vpf = V64(e), pa = V(e), i = V(e), dsum = V(e), hoff = V(e), wp = V(e), negwp = V(e), ccnt = V(e);
-    if (e->err) return -1;
-    for (unsigned h = 0; h < H; h++) { for (unsigned q = 0; q < 4; q++) movrz(e, S(acc[h], q)); movi(e, m[h], NEG_BIG); movrz(e, R(l[h])); }
-    movi(e, smS, OMEGA_DATTN256_SM_S);
-    shr(e, wp, warp, 1);                              /* warp pair index 0..3 */
-    imadi(e, R(negwp), R(wp), 0xffffffffu, NOREG);
-    andi(e, R(hoff), R(warp), 1u);
-    imadi(e, R(hoff), R(hoff), 256u, NOREG);          /* byte offset of this warp's dim half in the row */
-    imadi(e, R(hoff), R(lane), 8u, hoff);             /* + 4 bf16 = 8 bytes per lane */
-    if (MUT == 2) imadi(e, R(hoff), R(one), RB, hoff);
-    movi(e, ccnt, 32);
-    mov(e, R(cb), R(base));
-
-    /* ---- chunk loop ---- */
-    const int L_chunk = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, cb, end);
-    const int bra_done = bra_if_p0_fwd(e);
-    /* score pass: thread = position cb + tid, clamped to end - 1 (clamped lanes compute a score nobody reads) */
-    imadi(e, R(tpos), R(cb), 1u, tid);
-    imadi(e, R(over), R(tpos), 0xffffffffu, endm1);  /* endm1 - tpos */
-    shr(e, over, over, 31);                           /* 1 when tpos > endm1 */
-    imadi(e, R(t1), R(tpos), 1u, negendm1);           /* tpos - endm1 */
-    imadr(e, t1, over, t1, NOREG);
-    imadi(e, R(t1), R(t1), 0xffffffffu, tpos);        /* clamped position */
-    imadi(e, R(t1), R(t1), RB, cyk);
-    imadw(e, krow, t1, 1u, pkc);
-    for (unsigned h = 0; h < H; h++) movrz(e, R(sc[h]));
-    for (uint32_t d = 0; d < D; d++) ldg_wide(e, BW_IR_LDG_E_128, kq[d], krow, d * 16u, udesc, d == 0);
-    imadw(e, kpf, one, D * 16u, krow);
-    movrz(e, R(qoff)); movrz(e, R(j));
-    const int L_q = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, j, ccnt);
-    const int bra_qend = bra_if_p0_fwd(e);
-    for (unsigned w = 0; w < 4; w++) { imadi(e, R(wd[2 * w]), S(kq[0], w), 65536u, NOREG); andi(e, R(wd[2 * w + 1]), S(kq[0], w), 0xffff0000u); }
-    for (unsigned h = 0; h < H; h++) {
-        lds128(e, qa4, qoff, h * 1024u, 1); lds128(e, qb4, qoff, h * 1024u + 16u, 0);
-        for (unsigned q = 0; q < 4; q++) ffma(e, R(sc[h]), R(wd[q]), S(qa4, q), R(sc[h]));
-        for (unsigned q = 0; q < 4; q++) ffma(e, R(sc[h]), R(wd[4 + q]), S(qb4, q), R(sc[h]));
-    }
-    for (uint32_t d = 0; d + 1 < D; d++) for (unsigned w = 0; w < 4; w++) mov(e, S(kq[d], w), S(kq[d + 1], w));
-    ldg_wide(e, BW_IR_LDG_E_128, kq[D - 1], kpf, 0, udesc, 1);
-    imadw(e, kpf, one, 16u, kpf);
-    imadi(e, R(qoff), R(one), 32u, qoff);
-    imadi(e, R(j), R(one), 1u, j);
-    bra(e, L_q);
-    loop_end(e);
-    patch_bra(e, bra_qend, here(e));
-    imadi(e, R(sa), R(tid), 32u, smS);
-    for (unsigned h = 0; h < H; h++) { imadi(e, R(t1), R(one), h * 4u, sa); sts32(e, t1, R(sc[h])); }
-    bar_sync(e);
-    /* V pass: this warp's positions cb + wp + 4 i, i < n = max(0, ceil((min(end, cb + 256) - cb - wp) / 4)) */
-    imadi(e, R(t1), R(one), OMEGA_DATTN256_CHUNK, cb);  /* cb + 256 */
-    imadi(e, R(t2), R(t1), 0xffffffffu, end);           /* end - (cb + 256) */
-    shr(e, over, t2, 31);                               /* 1 when the chunk is cut short by end */
-    imadr(e, t2, over, t2, t1);                         /* cend = min(end, cb + 256) */
-    imadi(e, R(t1), R(cb), 0xffffffffu, t2);            /* cend - cb */
-    imadi(e, R(t1), R(t1), 1u, negwp);                  /* x = cend - cb - wp */
-    shr(e, over, t1, 31);
-    imadi(e, R(n), R(one), 3u, t1);
-    shr(e, n, n, 2);
-    imadr(e, t2, over, n, NOREG);
-    imadi(e, R(n), R(t2), 0xffffffffu, n);
-    imadi(e, R(t1), R(cb), 1u, wp);
-    imadi(e, R(t1), R(t1), RB, hoff);
-    imadi(e, R(t1), R(t1), 1u, cyk);
-    imadw(e, vrow, t1, 1u, pvc);
-    for (uint32_t d = 0; d < D; d++) ldg_wide(e, BW_IR_LDG_E_64, vq[d], vrow, d * 4u * RB, udesc, d == 0);
-    imadw(e, vpf, one, D * 4u * RB, vrow);
-    imadi(e, R(pa), R(wp), 32u, smS);
-    movrz(e, R(i));
-    const int L_v = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, i, n);
-    const int bra_vend = bra_if_p0_fwd(e);
-    imadi(e, R(wd[0]), S(vq[0], 0), 65536u, NOREG); andi(e, R(wd[1]), S(vq[0], 0), 0xffff0000u);
-    imadi(e, R(wd[2]), S(vq[0], 1), 65536u, NOREG); andi(e, R(wd[3]), S(vq[0], 1), 0xffff0000u);
-    lds128(e, qa4, pa, 0, 1); lds128(e, qb4, pa, 16, 0);
-#define SH(h) ((h) < 4 ? S(qa4, (h)) : S(qb4, (h) - 4))
-    for (unsigned h = 0; h < H; h++) { fmaxx(e, R(mn), R(m[h]), SH(h)); fsub(e, R(dl[h]), R(m[h]), R(mn)); mov(e, R(m[h]), R(mn)); } /* dl <= 0; exactly +0 when the max stayed */
-    fadd(e, R(dsum), R(dl[0]), R(dl[1]));
-    for (unsigned h = 2; h < H; h++) fadd(e, R(dsum), R(dsum), R(dl[h]));
-    isetp_ge_u32(e, one, dsum);                       /* 1 >= bits(dsum): no head's max moved (dsum is +0); a negative dsum has the sign bit */
-    const int bra_nores = bra_if_p0_fwd(e);
-    for (unsigned h = 0; h < H; h++) mufu(e, BW_IR_MUFU_EX2, R(dl[h]), R(dl[h]));
-    for (unsigned h = 0; h < H; h++) { for (unsigned q = 0; q < 4; q++) fmul(e, S(acc[h], q), S(acc[h], q), R(dl[h])); fmul(e, R(l[h]), R(l[h]), R(dl[h])); }
-    patch_bra(e, bra_nores, here(e));
-    for (unsigned h = 0; h < H; h++) { fsub(e, R(dl[h]), SH(h), R(m[h])); mufu(e, BW_IR_MUFU_EX2, R(dl[h]), R(dl[h])); }
-#undef SH
-    for (unsigned h = 0; h < H; h++) { for (unsigned q = 0; q < 4; q++) ffma(e, S(acc[h], q), R(dl[h]), R(wd[q]), S(acc[h], q)); fadd(e, R(l[h]), R(l[h]), R(dl[h])); }
-    for (uint32_t d = 0; d + 1 < D; d++) for (unsigned w = 0; w < 2; w++) mov(e, S(vq[d], w), S(vq[d + 1], w));
-    ldg_wide(e, BW_IR_LDG_E_64, vq[D - 1], vpf, 0, udesc, 1);
-    imadw(e, vpf, one, 4u * RB, vpf);
-    imadi(e, R(pa), R(one), 4u * 32u, pa);
-    imadi(e, R(i), R(one), 1u, i);
-    bra(e, L_v);
-    loop_end(e);
-    patch_bra(e, bra_vend, here(e));
-    bar_sync(e);                                      /* the next score pass overwrites s[][] */
-    imadi(e, R(cb), R(one), OMEGA_DATTN256_CHUNK, cb);
-    bra(e, L_chunk);
-    loop_end(e);
-    patch_bra(e, bra_done, here(e));
-
-    /* ---- epilogue: combine the warps, write the partial ---- */
-    int ep[8], ea[8], eb[8];
-    for (unsigned h = 0; h < 8; h++) { ep[h] = V(e); ea[h] = V(e); eb[h] = V(e); }
-    int pout = V64(e), ppart = V64(e), pcnt = V64(e), oscale = V(e);
-    if (e->err) return -1;
-    ldc64(e, pout, OMEGA_DATTN256_ARG_OUT); ldc64(e, ppart, OMEGA_DATTN256_ARG_PART); ldc64(e, pcnt, OMEGA_DATTN256_ARG_CNT); ldc32(e, oscale, OMEGA_DATTN256_ARG_OUT_SCALE);
-    if (spec->multi) {                               /* the token's output row, partials block and counters (ctaid.y re-read: no live register) */
-        int tk = V(e), so = V(e); if (e->err) return -1;
-        uint32_t lg = 0; while ((1u << lg) < SH.vy) lg++;
-        s2r(e, tk, BW_SR_CTAID_Y); shr(e, tk, tk, lg);
-        ldc32(e, so, OMEGA_DATTN256_ARG_OSTRIDE); imadr(e, so, tk, so, NOREG); imadw(e, pout, so, 1u, pout);
-        ldc32(e, so, OMEGA_DATTN256_ARG_PSTRIDE); imadr(e, so, tk, so, NOREG); imadw(e, ppart, so, 1u, ppart);
-        imadi(e, R(so), R(tk), SH.vy * 4u, NOREG); imadw(e, pcnt, so, 1u, pcnt);
-    }
-    /* per-warp maxes to shared: lane 0 of warp w writes m[h] at SM_M + w*32 + h*4 */
-    imadi(e, R(a0), R(warp), 32u, NOREG); imadi(e, R(a0), R(one), OMEGA_DATTN256_SM_M, a0);
-    isetp_ge_u32(e, lane, one);
-    { Region r = region_skip_if_p0(e); for (unsigned h = 0; h < H; h++) { imadi(e, R(t1), R(one), h * 4u, a0); sts32(e, t1, R(m[h])); } region_end(e, r); }
-    bar_sync(e);
-    /* lanes 0..5 of every warp: M[lane] = max over the 8 warps; lanes of warp 0 write it at SM_M + 256 + lane*4 */
-    movi(e, ccnt, H);
-    isetp_ge_u32(e, lane, ccnt);
-    {
-        Region r = region_skip_if_p0(e);
-        imadi(e, R(a1), R(lane), 4u, NOREG); imadi(e, R(a1), R(one), OMEGA_DATTN256_SM_M, a1);
-        for (unsigned w = 0; w < 8; w++) { imadi(e, R(t1), R(one), w * 32u, a1); lds32(e, R(ep[w]), t1, w == 0); }
-        for (unsigned w = 1; w < 8; w++) fmaxx(e, R(ep[0]), R(ep[0]), R(ep[w]));
-        imadi(e, R(t1), R(one), 256u, a1);
-        sts32(e, t1, R(ep[0]));
-        region_end(e, r);
-    }
-    bar_sync(e);
-    movi(e, t1, OMEGA_DATTN256_SM_M + 256u);
-    lds128(e, qa4, t1, 0, 1); lds128(e, qb4, t1, 16, 0);
-    for (unsigned h = 0; h < H; h++) { fsub(e, R(ea[h]), R(m[h]), h < 4 ? S(qa4, h) : S(qb4, h - 4)); mufu(e, BW_IR_MUFU_EX2, R(ea[h]), R(ea[h])); }
-    for (unsigned h = 0; h < H; h++) { for (unsigned q = 0; q < 4; q++) fmul(e, S(acc[h], q), S(acc[h], q), R(ea[h])); fmul(e, R(l[h]), R(l[h]), R(ea[h])); }
-    /* per-warp l to shared, then the partial's m and l by threads 0..5 (l summed over the even warps: the odd ones repeat them) */
-    imadi(e, R(a0), R(warp), 32u, NOREG); imadi(e, R(a0), R(one), OMEGA_DATTN256_SM_L, a0);
-    isetp_ge_u32(e, lane, one);
-    { Region r = region_skip_if_p0(e); for (unsigned h = 0; h < H; h++) { imadi(e, R(t1), R(one), h * 4u, a0); sts32(e, t1, R(l[h])); } region_end(e, r); }
-    bar_sync(e);
-    int pp = V64(e), pa64 = V64(e), pb64 = V64(e);
-    imadr(e, t2, cy, splits, cx);
-    imadi(e, R(t2), R(t2), PBYTES, NOREG);
-    imadw(e, pp, t2, 1u, ppart);
-    isetp_ge_u32(e, tid, ccnt);                       /* tid >= 6 skips */
-    {
-        Region r = region_skip_if_p0(e);
-        imadi(e, R(a1), R(tid), 4u, NOREG); imadi(e, R(a1), R(one), OMEGA_DATTN256_SM_L, a1);
-        for (unsigned w = 0; w < 4; w++) { imadi(e, R(t1), R(one), w * 64u, a1); lds32(e, R(ep[w]), t1, w == 0); }
-        for (unsigned w = 1; w < 4; w++) fadd(e, R(ep[0]), R(ep[0]), R(ep[w]));
-        imadi(e, R(t1), R(tid), 4u, NOREG); imadi(e, R(t1), R(one), OMEGA_DATTN256_SM_M + 256u, t1);
-        lds32(e, R(ep[1]), t1, 1);
-        imadw(e, pa64, tid, 4u, pp);
-        stg(e, BW_IR_STG_E, pa64, R(ep[1]), udesc);  /* m[h] */
-        imadw(e, pb64, one, 4u * H, pa64);
-        stg(e, BW_IR_STG_E, pb64, R(ep[0]), udesc);  /* l[h] */
-        region_end(e, r);
-    }
-    /* acc: 6 rounds of one head through the s[][] region as r[w][256]: warp w writes its dim half, thread tid sums the
-     * 4 warps that hold dim tid (warps (tid >> 7) + 2k); the store and load addresses computed once */
-    imadi(e, R(a0), R(warp), 1024u, NOREG); imadi(e, R(a0), R(lane), 16u, a0);
-    andi(e, R(t1), R(warp), 1u); imadi(e, R(a0), R(t1), 512u, a0); imadi(e, R(a0), R(one), OMEGA_DATTN256_SM_S, a0);
-    shr(e, t1, tid, 7);
-    if (MUT == 5) movrz(e, R(t1));
-    imadi(e, R(a1), R(t1), 1024u, NOREG); imadi(e, R(a1), R(tid), 4u, a1); imadi(e, R(a1), R(one), OMEGA_DATTN256_SM_S, a1);
-    for (unsigned q = 0; q < 4; q++) imadi(e, R(eb[q]), R(one), q * 4u, a0);
-    for (unsigned w = 0; w < 4; w++) imadi(e, R(ea[w]), R(one), w * 2048u, a1);
-    imadw(e, pa64, tid, 4u, pp);
-    for (unsigned rd = 0; rd < H; rd++) {
-        for (unsigned q = 0; q < 4; q++) sts32(e, eb[q], S(acc[rd], q));
-        bar_sync(e);
-        for (unsigned w = 0; w < 4; w++) lds32(e, R(ep[w]), ea[w], w == 0);
-        for (unsigned w = 1; w < 4; w++) fadd(e, R(ep[0]), R(ep[0]), R(ep[w]));
-        imadw(e, pb64, one, 8u * H + rd * 1024u, pa64);
-        stg(e, BW_IR_STG_E, pb64, R(ep[0]), udesc);
-        bar_sync(e);
-    }
-    /* publish, count, the last CTA combines */
-    membar(e);
-    bar_sync(e);
-    movi(e, t1, OMEGA_DATTN256_SM_FLAG);
-    isetp_ge_u32(e, tid, one);
-    {
-        Region r = region_skip_if_p0(e);
-        imadw(e, pb64, cy, 4u, pcnt);
-        atom_add(e, ep[0], pb64, one, udesc);
-        sts32(e, t1, R(ep[0]));
-        region_end(e, r);
-    }
-    bar_sync(e);
-    lds32(e, R(ep[0]), t1, 1);
-    isetp_ge_u32(e, ep[0], splitsm1);
-    const int bra_last = bra_if_p0_fwd(e);
-    exit_k(e);
-    patch_bra(e, bra_last, here(e));
-    /* combine: thread tid, outputs o = tid + 256 r (head r, dim tid), r = 0..5 */
-    int ho = V(e), oidx = V(e), ma = V64(e), la = V64(e), aa = V64(e), num = V(e), den = V(e), mx = V(e), s_i = V(e), rr = V(e);
-    if (e->err) return -1;
-    movrz(e, R(ho));
-    mov(e, R(oidx), R(tid));
-    movrz(e, R(rr));
-    movi(e, ccnt, H);
-    imadr(e, t2, cy, splits, NOREG);
-    imadi(e, R(t2), R(t2), PBYTES, NOREG);           /* byte offset of partials[cy][0] */
-    const int L_r = here(e);
-    loop_begin(e);
-    isetp_ge_u32(e, rr, ccnt);

The diff is longer than this page shows; the raw diff has all of it.