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#954 (code only)
Apply it
git checkout -b patch-46bfa4a8d606152b 62d1d0d668f897386a0e311374f8dbcc5c32dde8 curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/46bfa4a8d606152b.patch | git am
Provenance
github-import 1
aien-dev/omega-mv
954
8c14fc8a82424f7a8d6198f695d0e9d7518e1f4d
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":954,"url":"https://github.com/aien-dev/omega-mv/pull/954","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:39:28Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index f3e51fe46..f3e773dc0 100644 --- a/.crumb +++ b/.crumb @@ -47,8 +47,8 @@ "purpose": "Directory calibration. Purpose not yet described by a human." }, { - "digest": "7ef7796693f23ad68d9a5bcaaee0f635018f4371139a040ba202d4ce7083ede8", - "last_commit": "dd39bf71f", + "digest": "2c3f33e778bc09e789b1b1c5338af4c205cf6428d066199ae4dc15c42f6c2166", + "last_commit": "7ecdfed08", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -59,8 +59,8 @@ "purpose": "Directory doctrine. Purpose not yet described by a human." }, { - "digest": "8f0e5cb325040247440527f6b54b65cf72c47ff5adca75b4f32a1ddf2b2d6ade", - "last_commit": "1f320caad", + "digest": "3be956a1d3236716ff19cb4dca8d4f655c0d17e56646b6314acb7db44b60166c", + "last_commit": "9cd78c842", "name": "mk", "purpose": "Directory mk. Purpose not yet described by a human." }, @@ -72,38 +72,38 @@ }, { "digest": "f765ad87fdddd9b47f690b07298c951a0f7e7675dc5de4ffe44e33a0c14b1986", - "last_commit": "a8a6a3d3c", + "last_commit": "62d1d0d66", "name": "spec", "purpose": "Directory spec. Purpose not yet described by a human." }, { "digest": "aaf5acb82fd4c720cd60c85fd6087f636c72a98e2f3740c9295dcfa525dc64d7", - "last_commit": "bf54b19fa", + "last_commit": "089e5b053", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { "digest": "5395ff8ff9afceebe8e453788f80a3064b831513cc4cb92fd55869115e06b874", - "last_commit": "a8a6a3d3c", + "last_commit": "62d1d0d66", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, { - "digest": "308db0e6cf45c0a48f01f5f5f228450f191389de68006915b9ecf9c65b9a2e29", - "last_commit": "a8a6a3d3c", + "digest": "cf1d5c429bc92b7a811bfcf76449c68dbf7b64e69caca54bc14a0fd00a93df66", + "last_commit": "9cd78c842", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:07bf1706dcffbad66c0353871ff67a6749055da03cee8d8ebdf9a4c91e36bddc", - "compiled_at": "2026-10-30T12:31:50Z", + "children_root": "sha256:20e4443bbf928ba042a7a73eaf8223ed0d426021b8b41e12baaba33757b2a875", + "compiled_at": "2026-10-30T14:50:03Z", "compiler": "crumb-compile/1", - "digest": "sha256:904fca8c0e0cf3e3a5e5adb73393e01c7018b920bb542d289904240f70e400d6", - "evidence_files": 12622, - "evidence_root": "sha256:b1a08e2ce56e6feada0d8a31f06fbd7adee57adc1c1ad8dec220293ee5d439f9", - "files": 17849, - "generated_at_commit": "52a82f392fa513ebbc2d9d719a0f14c385289b06", - "source_tree": "sha256:75458da6553a0ee5ea2af95f46afb658e8a3f6e53cca6e3b4b9874035f78c2ed" + "digest": "sha256:31cb7295c2a4736b5f0012ff31cba6eb8c2cefcb67a8268bd2c2f7de6b9adaa5", + "evidence_files": 12637, + "evidence_root": "sha256:0bf356054390b602e0b4997aeb3677ca83e805047a63984a0f23ce64c635d8dd", + "files": 17869, + "generated_at_commit": "7ecdfed0860dea3f781d92ee5da46f0f2ee0a668", + "source_tree": "sha256:5301189e37a8400b8b024c7650c4326d19db849255fb805a3cbb8264cb9fbe06" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index 433100df5..d2aef4120 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -124,14 +124,14 @@ } ], "children_root": "sha256:c81d43c0c392dfec2b6ed5b38ba95ea7c592782b283950e32b777e7b9cfd9d61", - "compiled_at": "2026-10-30T02:47:38Z", + "compiled_at": "2026-10-30T14:50:03Z", "compiler": "crumb-compile/1", - "digest": "sha256:7ef7796693f23ad68d9a5bcaaee0f635018f4371139a040ba202d4ce7083ede8", + "digest": "sha256:2c3f33e778bc09e789b1b1c5338af4c205cf6428d066199ae4dc15c42f6c2166", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", - "files": 138, - "generated_at_commit": "e615e9ff47d03199514580f655d7670e61ab7e2f", - "source_tree": "sha256:ba44cf86b50127e2ec3824c2e913e032178628d69910a85ca9125cc1ed960bb5" + "files": 140, + "generated_at_commit": "7ecdfed0860dea3f781d92ee5da46f0f2ee0a668", + "source_tree": "sha256:361a83473b0b85cb5b8aa2dd149efad81edf861c0308d6dc9357affc986b6e10" }, "owner_lane": "", "provenance": { diff --git a/docs/runtime/PORTABILITY.md b/docs/runtime/PORTABILITY.md new file mode 100644 index 000000000..6780806ef --- /dev/null +++ b/docs/runtime/PORTABILITY.md @@ -0,0 +1,154 @@ +# Omega portability: what is tied to the chip, what is not + +Slice R3 of the runtime roadmap (omega-mv#596, tracking #593). Written for a developer who has never seen this +repository and wants to know how much of Omega they would have to change to run it on another GPU, another operating +system, or no operating system. Every claim names the file it comes from. Where a source is missing the claim is marked +UNVERIFIED. Nothing here was run on a GPU; this slice is read-only analysis plus a host-side check. + +Companion documents, not repeated here: `docs/numeric/OMEGA_GPU_NATIVE_BOUNDARY.md` (which driver call each part makes +today and which cut removes it) and `docs/numeric/OMEGA_GPU_ENGINE.md` (the engine contract). + +## 1. Two separate questions + +Porting Omega means answering two questions that are easy to mix up: + +1. **Chip.** Does this file know something about the GB10 (Grace Blackwell, compute capability sm_121)? Machine-code + words, launch-descriptor fields, class numbers, cache behaviour. +2. **Operating system and driver.** Does this file need Linux, the NVIDIA open driver, or a C library? + +The table `docs/runtime/portability_table.tsv` answers both, one row per `src/omega_gpu_*`, `src/omega_blackwell_*` and +`src/omega_bw_*` file (123 rows): + +| Column | Values | Meaning | +|---|---|---| +| `class` | `CHIP_SPECIFIC`, `PORTABLE` | `CHIP_SPECIFIC`: the file carries knowledge of the GB10 or of the driver interface that exposes it, so a different GPU or driver means reviewing or replacing it. `PORTABLE`: it carries neither. | +| `reason` | text | Why, with the evidence (an include list, a constant, a make target). | +| `os_binding` | `FREESTANDING_PROVEN`, `NO_HOSTED_INCLUDE`, `HOSTED_LIBC`, `LINUX_DRIVER` | `FREESTANDING_PROVEN`: a `.c` file in `GPU_FS_SRCS` (`mk/omega-gpu-engine.mk`), built by `make gpu-engine-freestanding` with no hosted headers. `NO_HOSTED_INCLUDE`: no hosted header by include scan only (a header, or a `.c` outside that build). `HOSTED_LIBC`: includes stdio, stdlib, time, errno, math or pthread. `LINUX_DRIVER`: includes `nvrm.h`, `m16_native.h` or `omega_gpu_platform_linux.h`. | + +Totals over the source tree based on omega-mv main 62d1d0d6 (the 102 rows reviewed on a8ffd2b9 plus 21 rows for the +files that landed on main after it): 113 files are `CHIP_SPECIFIC` and 10 are `PORTABLE`. By `os_binding`: 13 +`FREESTANDING_PROVEN`, 92 `NO_HOSTED_INCLUDE`, 15 `HOSTED_LIBC`, 3 `LINUX_DRIVER`. The small `PORTABLE` count is the honest +result: almost everything in `src/omega_gpu_*` launches a Blackwell kernel. Command to recount: section 7. + +`make test-runtime-portability` (host only, no compiler, no GPU) checks the table against the tree: every file has a row, +every row names a real file, a `PORTABLE` row's file includes no Linux or NVRM header and no Blackwell header, and the +`os_binding` column agrees with the includes and with the freestanding file list. It proves rows and includes agree. It +does not prove a reason is right; the reasons are human claims and each cites what to check. The include scan reads +direct `#include` lines only, and skips lines inside `#ifndef OMEGA_GPU_NO_POSIX` (the hosted-only branch) and +`#ifdef OMEGA_ATTN_DEBUG` (a debug trace). + +## 2. What is tied to the chip + +| Piece | Where | What is chip-specific about it | +|---|---|---| +| Machine-code encoder | `src/omega_blackwell_encoder.c`, `.h` | Packs instructions into 16-byte words (`OMEGA_BW_INSTRUCTION_BYTES`). A different instruction set needs a new encoder. | +| Kernel generators | `src/omega_blackwell_codegen*.c`, `src/omega_bw_*.h` | Every kernel (vector add, matmul, FP8 GEMV, attention, router, tensor-core GEMM, ternary GEMV) is generated as sm_121 instructions with scheduling rules proven on the chip (`src/omega_bw_em.h`). Some ops are patched in after encoding because the shared encoder lacks them (`src/omega_blackwell_codegen_qmma.h`, values from an nvcc sm_121 oracle). | +| Launch descriptor (QMD) | `src/omega_blackwell_qmd.h`, `.c` | A 96-word, 384-byte structure the GPU reads to start a kernel (`OMEGA_BW_QMD_BYTES`). Each field has an evidence tier: documented in NVIDIA's `clcdc0qmd.h`, observed on silicon, or reverse engineered. | +| Class numbers and setup words | `src/omega_gpu_session.c` (`SETUP_WORDS`), `src/omega_gpu_cmdlist.c`, `src/omega_blackwell_engine.c`, `src/omega_blackwell_submit.c` and seven more files | The pushbuffer words that select compute class `0xcec0` (Blackwell compute B) and set up the engine. The same 18-word block is copied into 11 files under `src/` (`grep -l 0x0000cec0 src/*.c src/runtime/*.c`). Method numbers such as `WAIT_FOR_IDLE 0x0110` and `SEND_PCAS_A 0x02b4` are in `src/omega_gpu_cmdlist.c`. The channel and user-mode classes (`clc96f.h`, `clc661.h`) are used by `physics/nvrm/nvrm.c`, outside this repository. | +| Cache rules | `src/omega_gpu_platform.c` (check at the cache-policy refusal), `src/omega_gpu_mem_cached.h`, `src/omega_gpu_cmdlist.h`, `src/omega_gpu_prefill.h` | Anything the CPU polls for a GPU write must be GPU-uncached, because GPU-cacheable system memory "will not be coherent with direct CPU mappings" (nvidia-open 580.173.02 `nvos.h`, quoted in `src/omega_gpu_platform.h`). Read-only weights may be GPU-cached only if the CPU wrote them once and never reads them. A command list ends with an L2 flush and a second marker on an uncached page. A chip with coherent memory could relax these rules. | +| Code buffer tail | `src/omega_gpu_code_alloc.h` | Code buffers stay mapped for 2 KB after the last instruction (`OMEGA_GPU_CODE_PREFETCH_TAIL`) because the instruction cache prefetches past it. The rule comes from Mesa NVK; that it was the cause of the GB10 fault in omega#323 is INFERRED until the chip confirms, per the header. | +| Target facts | `src/omega_bw_target.h` on branch `rig/gb20x` | Compute class, QMD version, shared-memory configuration, SM count and cache sizes in one table row per chip. Only the GB10 row is chip-proven. | + +**A finding that corrects a simple reading of the architecture.** The session (`src/omega_gpu_session.c`), the command +list, and the matmul and attention APIs are free of the operating system: the first, the matmul and the attention API are +in the freestanding build. They are not free of the chip. They embed `SETUP_WORDS`, method numbers, QMD use and sm_121 +stall counts. The platform contract hides the *driver*; it does not hide the *GPU*. The table marks those files +`CHIP_SPECIFIC` with `os_binding` `FREESTANDING_PROVEN` for that reason. + +## 3. What is portable + +| Piece | Where | Why it is portable | +|---|---|---| +| Platform validation implementation | `src/omega_gpu_platform.c` | Reusable capability negotiation and handle-table checks, included in `make gpu-engine-freestanding`. This does not make the header contract chip-neutral: `omega_gpu_platform.h` specifies NVIDIA cache policy and GPFIFO queue semantics and is classified separately as `CHIP_SPECIFIC`. | +| Engine state machine | `src/omega_gpu_engine.c`, `.h` | Open, validate, submit, verify, close, with a named failing step. Talks to a backend through a function table (`OmegaGpuBackend`). No chip knowledge. | +| Bounded wait | `src/omega_gpu_wait.c` | Clock and hooks come from the caller; the freestanding build has no default clock. | +| Text and host math | `src/omega_gpu_fmt.c`, `src/omega_gpu_hostmath.c` | A bounded formatter and libm-free log, exp, pow. | +| Scan host reference | `src/omega_gpu_scan_ref.c` | The frozen reduction and prefix-sum order depends only on n and the element index (`docs/numeric/E1_REDUCTION_CONTRACT.md`); plain C additions on the CPU. Its header `omega_gpu_scan.h` is `CHIP_SPECIFIC` and pulls in `omega_blackwell_codegen.h`, so reuse elsewhere needs the reference declarations split out. | + +Plain C signatures are not evidence of a chip-neutral contract. The matmul header exposes Blackwell tile macros (16/8/16), the MoE header defines tile-major packing and column alignment, and the session header exposes QMD fields/defaults and the two-marker/L2-flush launch protocol. All three are `CHIP_SPECIFIC`. The platform header also requires review for another chip because its queue contract names GPFIFO and its host-polled rights require the NVIDIA GPU-uncached visibility rule. The serving header describes the GB10 reservation/cache contract; `omega_gpu_serving.c` calls those matmul/attention reservation APIs rather than implementing generic allocation accounting. Both serving files are therefore `CHIP_SPECIFIC`, even though the implementation builds without hosted headers. + +A hardware name in an example or historical comment alone is not a machine dependency. The classifications above are based on exposed layout, tile, visibility, queue or backend-call semantics. The remaining portable engine/math/formatter/wait helpers do not prove that their consumer or a complete backend supports another GPU. + +What the freestanding build proves, and what it does not, is in `docs/numeric/OMEGA_GPU_NATIVE_BOUNDARY.md` section 1 and +section 4: the listed files link with only `memcpy`, `memmove`, `memset`, `memcmp`, `strlen` and `strcmp` undefined, and +nothing there opens a device. The table adds the other direction: which files are outside that build and why. + +Open regression at 62d1d0d6: `make gpu-engine-freestanding` compiles every listed file with `-ffreestanding` but the +closure link fails with `freestanding GPU link still needs: abort mmap mprotect munmap pthread_key_create pthread_once +pthread_setspecific`. All seven come from `src/omega_om_units.c`, the omega-bridge binding that replaced `src/sha256.c` +in `GPU_FS_SRCS` at the OM-2 cutover (`450bbefd`, #747): it runs Omega code on its own `mmap`ed stack with a +`pthread` key and calls `abort`. The encoder, codegen, matmul, realize and attention objects need `sha256_*` from it. +Until the binding has a freestanding form (a caller-supplied stack, no `abort`; repair in progress on branch +`w3/gpu-fs-freestanding-units`, not merged), `FREESTANDING_PROVEN` means "in `GPU_FS_SRCS` and compiled freestanding per +file", not "the closure links". + +## 4. Three ways to reach the GPU + +| | Linux open driver | WSL2 under Windows (`/dev/dxg`) | Native AIENOS | +|---|---|---|---| +| Status | Runs on the DGX Spark (GB10). The only backend with chip evidence. | Host-tested only. Nothing has touched a real `/dev/dxg` or an RTX 5070 (`docs/rig/dxg-backend.md` on `rig/gb20x`, section 5, status line). | Not built. The boot image that looks for the GPU has not been booted on hardware (aienos `docs/GB10_NATIVE_STATUS.md`). NOT_RUN. | +| How it talks | `/dev/nvidiactl`, `/dev/nvidia0`, `/dev/nvidia-uvm` through `physics/nvrm` and `physics/m16`. Omega rings the GPU itself through a channel it owns. | D3DKMT ioctls on `/dev/dxg` (Microsoft's `dxgkrnl`), which forwards to the Windows NVIDIA driver. No doorbell ioctl exists; each submit is an ioctl (`docs/WINDOWS-GPU-PATH.md` section 1, aien-rig branch `app/v0`). | AIENOS drives PCI, SMMU, firmware load, queues and doorbells itself. | +| Platform contract | `src/omega_gpu_platform_linux.c` implements it (reference only, hosted only). The vector executor `src/omega_blackwell_submit.c` and engine backend `src/omega_blackwell_engine.c` still call `m16_native_*` directly. | **Does not use it.** The branch defines its own interface, `OmegaSubmitOps` in `src/omega_gpu_submit_iface.h`, with an nvrm and a dxg implementation. No `OmegaGpuBackend` sits on it yet (`dxg-backend.md` section 5). | Designed around it: the contract's native owners per driver responsibility are listed in the boundary doc section 2. No native implementation exists (boundary doc section 6, "C, remaining"). | +| Biggest open question | none for the GB10 | NVIDIA's private driver data blobs and whether the Windows driver accepts Omega's own Blackwell method stream at all (`dxg-backend.md` section 4: "the largest open question"). `docs/WINDOWS-GPU-PATH.md` section 3 found no public project doing raw NVIDIA submission over `/dev/dxg`. | Everything the Linux driver does today: GSP firmware, memory, page tables, queues, interrupts, reset (boundary doc section 2, all rows NOT_RUN). | +| Chip code reused | all | The same encoder and QMD; the target table lists the RTX 5070 as sm_120, "THEORETICAL: built from public sources only, never run on the chip" (`src/omega_bw_target.h` on `rig/gb20x`). | The encoder and QMD builder are plain C with no Linux dependency (aienos `docs/GB10_NATIVE_DEPENDENCY_MAP.md`, plain-English summary, item 1); the freestanding build checks that for the files in `GPU_FS_SRCS`. | + +Two caveats a reader should keep: + +- The aienos dependency map is pinned to an older Omega commit (`2ae8677c`, its "Pins" table). Where it disagrees with the + boundary doc, which tracks `omega_gpu_session.c` moving onto the platform contract, the boundary doc is newer. +- The `rig/gb20x` interface and the platform contract describe the same job (open a device, allocate, queue, submit, + wait) with different shapes. The branch's own text does not mention the platform contract + (`grep -i platform docs/rig/dxg-backend.md` finds nothing). Whether the two should be merged is a design question for + the lane that owns that branch (ledger L024); this note does not decide it and did not edit the branch. + +## 5. What a new GPU needs + +For a GPU in the same family (another Blackwell part such as the RTX 5070, sm_120), the work is mostly *measuring*. For a +different family it is *rewriting*. In order: + +1. **Identify the chip.** Add a target row: PCI ids, architecture and implementation ids, SM version as the driver + reports it, compute and channel and user-mode class numbers, QMD version and shared-memory fields, SM count, L2 size, + memory model (unified like GB10 or discrete VRAM), host barrier. The shape of this row is `OmegaBwTarget` in + `src/omega_bw_target.h` on `rig/gb20x`; each field there carries an evidence grade, and fields nobody has published are + `UNKNOWN` until measured on the card. +2. **Machine code.** Same family: check whether `src/omega_blackwell_encoder.c` output is valid on the new chip. For + sm_120 versus sm_121 the branch records "no sm_120 vs sm_121 encoding split is public" (`omega_bw_target.c`, field + `isa`, evidence INFERRED). Different family: a new encoder, new generators for every `omega_blackwell_codegen_*.c` kernel + you need, and new emitter helpers (the whole `CHIP_SPECIFIC` block of the table). +3. **Launch descriptor.** Confirm or replace the QMD builder (`src/omega_blackwell_qmd.c`) and the constant-bank layout. +4. **Class numbers and setup words.** Replace the `0xcec0` setup block. It lives in 11 files; today a change means 11 + edits (`grep -l 0x0000cec0 src/*.c src/runtime/*.c`). Folding the copies into one is a cleanup this slice records but + does not make. +5. **Cache and coherence rules.** Decide for the new memory model which buffers may be GPU-cached, which must be + uncached, and what flush ends a command list. The contract refuses a cached host-polled buffer + (`OMEGA_GPU_PLAT_REFUSED_CACHE_POLICY`); a chip with coherent memory would change that rule in one place + (`src/omega_gpu_platform.c`) and in the cache notes of `mem_cached`, `cmdlist`, `prefill`. +6. **Code buffer tail.** Check whether the new chip also prefetches past the last instruction (`src/omega_gpu_code_alloc.h`). +7. **A platform implementation.** Provide the services in `OMEGA_GPU_SVC_REQUIRED_V1` (time, wait, lock, MMIO, DMA, sync, + completion) and `OMEGA_GPU_SVC_REQUIRED_SESSION` (device, queue, clock, host memory), at ABI 1.2, and pass + `omega_gpu_platform_check_for`. `tests/test_omega_gpu_platform.c` reaches every refusal; use it as the starting test. + The Linux reference (`src/omega_gpu_platform_linux.c`) is the worked example. +8. **A backend.** Either the vector backend (`OmegaGpuBackend`, example `src/omega_blackwell_engine.c`) or the session path. +9. **Qualification on the chip.** The M17 and M18 gates (`src/omega_blackwell_gates.c`) and the poison-word vector add are + the first correctness check; nothing is claimed for a chip until they pass there. +10. **Update the table.** `make test-runtime-portability` refuses a new `omega_gpu_*`, `omega_blackwell_*` or `omega_bw_*` + file that has no row. + +## 6. Limits of this note + +- It reads source. No GPU, WSL2 machine or native boot was used; every "works" in the table of section 4 is a claim of the + source it cites, and the WSL2 and native columns have no chip evidence at all. +- `class` is a judgement per file. The mechanical parts (includes, the freestanding list) are checked; whether a reason is + right is not. +- The dxg and native documents live on other branches and repositories and can change. They were read from + `origin/rig/gb20x` (`12e17891`), aien-rig `origin/app/v0`, and aienos `origin/main` on 2026-10-19. + +## 7. Reproduce + +``` +make test-runtime-portability # the check plus the negative controls; host only +awk -F'\t' '!/^#/ && $1!="file" {n[$2]++} END {for (c in n) print c, n[c]}' docs/runtime/portability_table.tsv +``` + +Evidence of the controls and of the freestanding build on a8ffd2b9 is in `evidence/RUNTIME-R3-PORT/`; the rerun on +62d1d0d6 is in `evidence/RUNTIME-R3-PORT-62d1d0d6/`. diff --git a/docs/runtime/portability_table.tsv b/docs/runtime/portability_table.tsv new file mode 100644 index 000000000..718d7c433 --- /dev/null +++ b/docs/runtime/portability_table.tsv @@ -0,0 +1,128 @@ +# Omega portability table (omega-mv#596, slice R3). Checked by: make test-runtime-portability (tools/runtime_portability_check.sh). +# Columns, tab separated: file, class, reason, os_binding. Explained in docs/runtime/PORTABILITY.md. +# class: CHIP_SPECIFIC carries knowledge of the GB10 / Blackwell chip or of the driver interface that exposes it; PORTABLE carries neither. +# os_binding: FREESTANDING_PROVEN (a .c file in GPU_FS_SRCS, mk/omega-gpu-engine.mk, built by make gpu-engine-freestanding), NO_HOSTED_INCLUDE (no hosted header by include scan only; not linked freestanding), HOSTED_LIBC (includes stdio, stdlib, time, errno, math or pthread), LINUX_DRIVER (includes nvrm.h, m16_native.h or omega_gpu_platform_linux.h). +file class reason os_binding +src/omega_blackwell_codegen.c CHIP_SPECIFIC Instruction generators for the sm_121 kernels (vector add, matmul, the Qwen decode set); emits Blackwell machine code through the encoder. In the freestanding closure; the allocating generators and the printing self-test are hosted-only (docs/numeric/OMEGA_GPU_NATIVE_BOUNDARY.md section 3). FREESTANDING_PROVEN +src/omega_blackwell_codegen.h CHIP_SPECIFIC Blackwell IR opcodes and kernel-generator API; includes omega_blackwell_matmul.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_attn.c CHIP_SPECIFIC Generates the single-launch decode attention kernel (sm_121 machine code, 8 query heads per KV head, head_dim 128). NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_attn.h CHIP_SPECIFIC Interface of the decode attention kernel generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_attn256.c CHIP_SPECIFIC Generates the one-launch decode attention kernel for head_dim 256 (Qwen3.8-27B: 24 query heads over 4 KV heads, KV append inside the kernel) as sm_121 machine code; reuses the emitter helpers of omega_blackwell_codegen_attn.c. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_attn256.h CHIP_SPECIFIC Interface of the head_dim 256 decode attention generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_bf16.c CHIP_SPECIFIC Generates the bf16 streaming GEMV (lm_head) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_bf16.h CHIP_SPECIFIC Interface of the bf16 GEMV generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_dec.c CHIP_SPECIFIC Generates the decode glue kernels (residual add, RMSNorm, SwiGLU, expert combine, argmax) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_dec.h CHIP_SPECIFIC Interface of the decode glue kernel generators; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_gdn.c CHIP_SPECIFIC Generates the one-launch Gated DeltaNet decode step as sm_121 machine code (control words, read barriers, held-scoreboard prefetch of omega_bw_em.h). NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_gdn.h CHIP_SPECIFIC Interface of the Gated DeltaNet generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_gemm.c CHIP_SPECIFIC Generates the FP8 block-scaled grouped GEMM for prefill as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_gemm.h CHIP_SPECIFIC Interface of the FP8 prefill GEMM generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_moe.c CHIP_SPECIFIC Generates the FP8 GEMV kernel family (MoE) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_moe.h CHIP_SPECIFIC Interface of the FP8 GEMV generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_moe2.c CHIP_SPECIFIC Generates FP8 GEMV variant 2 (row-pipelined) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_moe2.h CHIP_SPECIFIC Interface of FP8 GEMV variant 2; includes omega_blackwell_codegen_moe.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_pattn.c CHIP_SPECIFIC Generates the causal prefill attention kernel on tensor cores (HMMA, SHFL) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_pattn.h CHIP_SPECIFIC Interface of the prefill attention generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_pattn256.c CHIP_SPECIFIC Generates the head_dim 256 causal prefill attention attend kernel on tensor cores (HMMA spacing, SHFL.BFLY / F2FP placeholders) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_pattn256.h CHIP_SPECIFIC Interface of the head_dim 256 prefill attention generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_pf.c CHIP_SPECIFIC Generates the small device-resident prefill kernels (copy and friends) as sm_121 machine code through the omega_bw_em.h emitters. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_pf.h CHIP_SPECIFIC Interface of the prefill helper kernels; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_pfhost.c CHIP_SPECIFIC Generates the on-chip router-logits and MoE-combine kernels as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_pfhost.h CHIP_SPECIFIC Interface of the on-chip router and combine generators; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_qg.c CHIP_SPECIFIC Generates the native FP8 prefill kernels (activation quantiser, QMMA GEMM) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_qg.h CHIP_SPECIFIC Interface of the native FP8 prefill generators; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_qmma.c CHIP_SPECIFIC Encodes the FP8 tensor-core op QMMA.16832, patched in after the shared encoder (which lacks it); values come from an nvcc sm_121 oracle. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_qmma.h CHIP_SPECIFIC Describes the QMMA.16832.F32.E4M3.E4M3 encoding for sm_121. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_router.c CHIP_SPECIFIC Generates the MoE router kernel (RMSNorm, logits, softmax, top-8) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_router.h CHIP_SPECIFIC Interface of the router kernel generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_tc2.c CHIP_SPECIFIC Generates the tensor-core grouped FP8 GEMM v2 as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_tc2.h CHIP_SPECIFIC Interface of the tensor-core GEMM v2 generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_tc.c CHIP_SPECIFIC Generates tensor-core kernels (HMMA.16816 fragment layout) as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_tc.h CHIP_SPECIFIC Interface of the tensor-core kernel generators; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_tern.c CHIP_SPECIFIC Generates the ternary W2A8 GEMV as sm_121 machine code. NO_HOSTED_INCLUDE +src/omega_blackwell_codegen_tern.h CHIP_SPECIFIC Interface of the ternary GEMV generator; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_blackwell_encoder.c CHIP_SPECIFIC The sm_121 machine-code encoder: packs instructions into 16-byte words. OS-free (in the freestanding closure) but the words it writes are Blackwell's. FREESTANDING_PROVEN +src/omega_blackwell_encoder.h CHIP_SPECIFIC Encoder interface; OMEGA_BW_INSTRUCTION_BYTES is 16, the Blackwell instruction size. NO_HOSTED_INCLUDE +src/omega_blackwell_engine.c CHIP_SPECIFIC The Linux backend of OmegaGpuBackend: calls m16_native_* and carries the GB10 compute-class setup words (class 0xcec0). LINUX_DRIVER +src/omega_blackwell_engine.h CHIP_SPECIFIC Declares the Blackwell GB10 backend function table for the engine core. NO_HOSTED_INCLUDE +src/omega_blackwell_gates.c CHIP_SPECIFIC Milestone 17 and 18 qualification gates and a silicon vector-add demonstration on GB10; host tooling. HOSTED_LIBC +src/omega_blackwell_gates.h CHIP_SPECIFIC Entry points of the M17 and M18 GB10 qualification gates. NO_HOSTED_INCLUDE +src/omega_blackwell_matmul.c CHIP_SPECIFIC Plans the Blackwell matmul kernels; in the freestanding closure, but the kernel shapes are sm_121 tensor-core shapes. FREESTANDING_PROVEN +src/omega_blackwell_matmul.h CHIP_SPECIFIC Types of the Blackwell matmul kernel (OmegaBlackwellKernel) and its size limits. NO_HOSTED_INCLUDE +src/omega_blackwell_qmd.c CHIP_SPECIFIC Builds the 384-byte QMD launch descriptor (96 words) for Blackwell compute class 0xcec0. In the freestanding closure. FREESTANDING_PROVEN +src/omega_blackwell_qmd.h CHIP_SPECIFIC QMD layout: OMEGA_BW_QMD_BYTES 384, field evidence tiers (documented, observed, reverse engineered), shared-memory field per clcec0qmd.h. NO_HOSTED_INCLUDE +src/omega_blackwell_realize.c CHIP_SPECIFIC Turns an Omega vector program into Blackwell code plus QMD plus constant bank. In the freestanding closure. FREESTANDING_PROVEN +src/omega_blackwell_realize.h CHIP_SPECIFIC Realization interface; includes omega_blackwell_qmd.h and omega_blackwell_encoder.h. NO_HOSTED_INCLUDE +src/omega_blackwell_submit.c CHIP_SPECIFIC The vector executor: allocates and submits through m16_native_* on the Linux driver; its setup words and launch methods are GB10's. Pinned by the M17 and M18 gates. LINUX_DRIVER +src/omega_blackwell_submit.h CHIP_SPECIFIC Launch constants and executor interface for GB10; includes the realize and matmul headers. NO_HOSTED_INCLUDE +src/omega_bw_em.h CHIP_SPECIFIC Private IR emitter helpers for the sm_121 tensor-core generators (scheduling rules proven on the chip). NO_HOSTED_INCLUDE +src/omega_bw_em_q.h CHIP_SPECIFIC Private emitters for the FP8 QMMA placeholders (sm_121). NO_HOSTED_INCLUDE +src/omega_bw_reconv.h CHIP_SPECIFIC Warp reconvergence regions (BSSY, BSYNC) for the Blackwell IR emitters. NO_HOSTED_INCLUDE +src/omega_gpu_attention_api.c CHIP_SPECIFIC Builds and launches its own sm_121 attention kernels (stall counts as nvcc writes them for sm_121) through the session. In the freestanding closure. FREESTANDING_PROVEN +src/omega_gpu_attention_api.h CHIP_SPECIFIC Attention API; its kernel type OmegaBlackwellKernel comes from omega_blackwell_matmul.h. NO_HOSTED_INCLUDE +src/omega_gpu_bf16_gemv_api.c CHIP_SPECIFIC Launches the bf16 GEMV through a command list; uses the Blackwell bf16 generator. NO_HOSTED_INCLUDE +src/omega_gpu_bf16_gemv_api.h CHIP_SPECIFIC bf16 GEMV API; includes omega_blackwell_codegen_bf16.h. NO_HOSTED_INCLUDE +src/omega_gpu_cmdlist.c CHIP_SPECIFIC Records launches into one method stream using clcec0 method numbers (WAIT_FOR_IDLE 0x0110, SEND_PCAS_A 0x02b4), the compute-class setup words, and the completion tail with an L2 flush. NO_HOSTED_INCLUDE +src/omega_gpu_cmdlist.h CHIP_SPECIFIC Command-list interface; documents the uncached marker page and the L2_FLUSH_DIRTY tail. NO_HOSTED_INCLUDE +src/omega_gpu_code_alloc.h CHIP_SPECIFIC Code buffers keep a 2 KB tail after the last instruction because the SM instruction cache prefetches past it (omega#323; the cause on GB10 is INFERRED). NO_HOSTED_INCLUDE +src/omega_gpu_decode_attn256_api.c CHIP_SPECIFIC Resident KV cache, RoPE table and launch of the head_dim 256 decode attention kernel on the session and command list. NO_HOSTED_INCLUDE +src/omega_gpu_decode_attn256_api.h CHIP_SPECIFIC head_dim 256 decode attention API; includes omega_blackwell_codegen_attn256.h. NO_HOSTED_INCLUDE +src/omega_gpu_decode_attn_api.c CHIP_SPECIFIC Launches the decode attention kernel from the Blackwell generator through a command list. NO_HOSTED_INCLUDE +src/omega_gpu_decode_attn_api.h CHIP_SPECIFIC Decode attention API; includes omega_blackwell_codegen_attn.h. NO_HOSTED_INCLUDE +src/omega_gpu_decode_graph.c CHIP_SPECIFIC Chains a whole decode token into one command list from Blackwell kernels. HOSTED_LIBC +src/omega_gpu_decode_graph.h CHIP_SPECIFIC Decode graph interface over the FP8, router, attention and bf16 GEMV APIs. NO_HOSTED_INCLUDE +src/omega_gpu_elementwise_api.c CHIP_SPECIFIC Generates and launches its own elementwise sm_121 kernels; still hosted (stdio, stdlib, time), outside the freestanding closure (boundary doc section 6). HOSTED_LIBC +src/omega_gpu_elementwise_api.h CHIP_SPECIFIC Elementwise API; kernel type OmegaBlackwellKernel comes from omega_blackwell_matmul.h. NO_HOSTED_INCLUDE +src/omega_gpu_engine.c PORTABLE The engine state machine (open, validate, submit, verify, close, named failure steps). Builds in make gpu-engine-freestanding; errno and the default clock exist only in the hosted build. FREESTANDING_PROVEN +src/omega_gpu_engine.h PORTABLE Engine contract and OmegaGpuBackend function table; includes only stddef.h and stdint.h. NO_HOSTED_INCLUDE +src/omega_gpu_fmt.c PORTABLE Bounded text formatter that replaces snprintf in the session. Builds in make gpu-engine-freestanding. FREESTANDING_PROVEN +src/omega_gpu_fmt.h PORTABLE Formatter interface; includes only stddef.h. NO_HOSTED_INCLUDE +src/omega_gpu_fp8_api.c CHIP_SPECIFIC Launches the FP8 GEMV through Blackwell generators and command lists, with GPU-cached weight buffers. HOSTED_LIBC +src/omega_gpu_fp8_api.h CHIP_SPECIFIC FP8 GEMV API; includes omega_blackwell_codegen_moe.h. NO_HOSTED_INCLUDE +src/omega_gpu_fp8gemm_api.c CHIP_SPECIFIC Launches the FP8 prefill GEMM through the session. HOSTED_LIBC +src/omega_gpu_fp8gemm_api.h CHIP_SPECIFIC FP8 GEMM API; includes omega_blackwell_codegen_gemm.h. NO_HOSTED_INCLUDE +src/omega_gpu_fp8_pack.c CHIP_SPECIFIC Packs FP8 weights into the layout the sm_121 GEMV kernels read; host side. HOSTED_LIBC +src/omega_gpu_gdn_api.c CHIP_SPECIFIC Resident Gated DeltaNet parameters, GPU-cached tails and states (omega_gpu_mem_cached.h) and the one-launch decode step from the Blackwell generator. HOSTED_LIBC +src/omega_gpu_gdn_api.h CHIP_SPECIFIC Gated DeltaNet API; includes omega_blackwell_codegen_gdn.h. NO_HOSTED_INCLUDE +src/omega_gpu_gemm.c CHIP_SPECIFIC Matrix multiply of any shape on the GB10 tensor cores (HMMA.16816 BF16, QMMA.16832 E4M3) through the omega_bw_em emitters. HOSTED_LIBC +src/omega_gpu_gemm.h CHIP_SPECIFIC GEMM API whose arithmetic order is fixed by the GB10 tensor-core step shapes; includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_gpu_hostmath.c PORTABLE libm-free double-precision log, exp and pow for host-side tables; plain arithmetic, no chip or OS call. NO_HOSTED_INCLUDE +src/omega_gpu_hostmath.h PORTABLE Interface of the libm-free host math; no includes. NO_HOSTED_INCLUDE +src/omega_gpu_matmul_api.c CHIP_SPECIFIC Builds Blackwell matmul kernels, fills the QMD and launches; reports target_chip GB10. In the freestanding closure. FREESTANDING_PROVEN +src/omega_gpu_matmul_api.h CHIP_SPECIFIC Public contract exposes Blackwell tile macros TILE_M=16, TILE_N=8, TILE_K=16, chip CTA envelope and GPU-uncached resident storage; plain C types do not make these semantics chip-neutral. NO_HOSTED_INCLUDE +src/omega_gpu_mem_cached.c CHIP_SPECIFIC Allocates GPU-cached weight buffers; relies on the GB10 rule that a write-once buffer the CPU never reads cannot hold a stale L2 line. NO_HOSTED_INCLUDE +src/omega_gpu_mem_cached.h CHIP_SPECIFIC Documents the GPU-cached read-only weight invariant (nvos.h GPU_CACHEABLE: not coherent with CPU mappings). NO_HOSTED_INCLUDE +src/omega_gpu_moe_api.c CHIP_SPECIFIC Launches MoE matmul kernels from the Blackwell generators and the QMD builder. NO_HOSTED_INCLUDE +src/omega_gpu_moe_api.h CHIP_SPECIFIC Public packing contract is Blackwell tile-major B with col0 modulo 8 alignment and OMEGA_BW_MATMUL_MAX limits; includes omega_gpu_matmul_api.h. NO_HOSTED_INCLUDE +src/omega_gpu_pfgemm.c CHIP_SPECIFIC Prefill GEMM driver over the Blackwell tensor-core generators. HOSTED_LIBC +src/omega_gpu_pfhost.c CHIP_SPECIFIC Prefill router and combine launcher over the Blackwell pfhost generators. NO_HOSTED_INCLUDE +src/omega_gpu_pfhost.h CHIP_SPECIFIC Prefill router and combine API; documents bit-exact sm_121 kernel semantics. NO_HOSTED_INCLUDE +src/omega_gpu_platform.c PORTABLE Platform contract checks, negotiation and handle table. Builds in make gpu-engine-freestanding. FREESTANDING_PROVEN +src/omega_gpu_platform.h CHIP_SPECIFIC ABI 1.2 has reusable typed handles but its current queue_submit contract specifies one GPFIFO entry and its HOST_POLLED rights require the NVIDIA GPU-uncached visibility policy. Device ordinal 0 is documented as the GB10; review this contract on another chip. NO_HOSTED_INCLUDE +src/omega_gpu_platform_linux.c CHIP_SPECIFIC The Linux reference platform: nvrm_open and m16_native_create_channel on the NVIDIA open driver. Hosted only, outside the freestanding closure. LINUX_DRIVER +src/omega_gpu_platform_linux.h CHIP_SPECIFIC Declares the Linux driver platform; the implementation behind it is the Linux binding. NO_HOSTED_INCLUDE +src/omega_gpu_prefill_attn256_api.c CHIP_SPECIFIC Launches the two head_dim 256 prefill attention kernels and patches the tensor-core placeholders of omega_blackwell_codegen_tc.h. NO_HOSTED_INCLUDE +src/omega_gpu_prefill_attn256_api.h CHIP_SPECIFIC head_dim 256 prefill attention API; includes omega_blackwell_codegen_pattn256.h. NO_HOSTED_INCLUDE +src/omega_gpu_prefill_attn_api.c CHIP_SPECIFIC Launches the prefill attention kernel from the Blackwell generator on the session. NO_HOSTED_INCLUDE +src/omega_gpu_prefill_attn_api.h CHIP_SPECIFIC Prefill attention API; includes omega_blackwell_codegen_pattn.h. NO_HOSTED_INCLUDE +src/omega_gpu_prefill.c CHIP_SPECIFIC Device-resident prefill: GPU-cached device buffers and a copy kernel, with the stale-L2 rules for GB10. NO_HOSTED_INCLUDE +src/omega_gpu_prefill.h CHIP_SPECIFIC Documents the prefill memory policy: GPU-cached device-private buffers and L2_FLUSH_DIRTY. NO_HOSTED_INCLUDE +src/omega_gpu_q36_graph.c CHIP_SPECIFIC One Qwen3.6-35B-A3B decode token as one command list of Blackwell kernels with GPU-cached intermediates (omega_gpu_mem_cached.h). HOSTED_LIBC +src/omega_gpu_q36_graph.h CHIP_SPECIFIC Qwen3.6-35B-A3B decode graph interface over the decode graph, hd256 attention, GDN and router APIs. NO_HOSTED_INCLUDE +src/omega_gpu_q38_graph.c CHIP_SPECIFIC One Qwen3.8-27B decode token as one command list of Blackwell kernels with GPU-cached intermediates (omega_gpu_mem_cached.h). HOSTED_LIBC +src/omega_gpu_q38_graph.h CHIP_SPECIFIC Qwen3.8-27B decode graph interface over the decode graph, hd256 attention and GDN APIs. NO_HOSTED_INCLUDE +src/omega_gpu_router_api.c CHIP_SPECIFIC Launches the router kernel through a command list. NO_HOSTED_INCLUDE +src/omega_gpu_router_api.h CHIP_SPECIFIC Router API; includes omega_blackwell_codegen_router.h. NO_HOSTED_INCLUDE +src/omega_gpu_scan.c CHIP_SPECIFIC Reduction and prefix-sum kernels from the omega_bw_em emitters (SHFL.DOWN warp trees) and the chip launch driver. HOSTED_LIBC +src/omega_gpu_scan.h CHIP_SPECIFIC Reduction and prefix-sum API; the chip calls take Blackwell kernels and the header includes omega_blackwell_codegen.h. NO_HOSTED_INCLUDE +src/omega_gpu_scan_ref.c PORTABLE Host references of the frozen reduction and prefix-sum order, which depends only on n and the element index (docs/numeric/E1_REDUCTION_CONTRACT.md); plain C additions, no chip or OS call. Its own header omega_gpu_scan.h still pulls in omega_blackwell_codegen.h, so reusing it off this tree needs the declarations split out. HOSTED_LIBC +src/omega_gpu_serving.c CHIP_SPECIFIC Thin wrapper calls omega_gpu_matmul_reserve and the current attention reservation APIs with their chip-specific contracts; it does not implement an independent generic accounting layer. OS-free in make gpu-engine-freestanding. FREESTANDING_PROVEN +src/omega_gpu_serving.h CHIP_SPECIFIC Current GB10 serving contract delegates to chip-specific matmul/attention reservations and documents at-most-16-row handling and fixed kernel-cache defaults/limits; absence of hosted includes is not a chip-neutral contract. NO_HOSTED_INCLUDE +src/omega_gpu_session.c CHIP_SPECIFIC The persistent session over OmegaGpuPlatform. OS-free (in the freestanding closure) but carries GB10 constants: the compute-class setup words (class 0xcec0), the cache-invalidate method 0x021c, launch constants from omega_blackwell_submit.h. FREESTANDING_PROVEN +src/omega_gpu_session.h CHIP_SPECIFIC Session exposes QMD scratch, register-count rules and QMD shared-memory default 1024, plus the GB10 two-marker/L2 flush launch protocol; platform handles remove OS types, not chip assumptions. NO_HOSTED_INCLUDE +src/omega_gpu_tcgemm_api.c CHIP_SPECIFIC Launches the tensor-core GEMM through the session. HOSTED_LIBC +src/omega_gpu_tcgemm_api.h CHIP_SPECIFIC Tensor-core GEMM API; includes omega_blackwell_codegen_tc.h. NO_HOSTED_INCLUDE +src/omega_gpu_tern_api.c CHIP_SPECIFIC Launches the ternary GEMV with GPU-cached weights through a command list. HOSTED_LIBC +src/omega_gpu_tern_api.h CHIP_SPECIFIC Ternary GEMV API; includes omega_blackwell_codegen_tern.h. NO_HOSTED_INCLUDE +src/omega_gpu_wait.c PORTABLE Bounded wait with a caller-supplied clock and hooks; no default clock in the freestanding build. Builds in make gpu-engine-freestanding. FREESTANDING_PROVEN +src/omega_gpu_wait.h PORTABLE Bounded wait interface; includes only stdbool.h and stdint.h. NO_HOSTED_INCLUDE diff --git a/evidence/RUNTIME-R3-PORT-62d1d0d6/README.md b/evidence/RUNTIME-R3-PORT-62d1d0d6/README.md new file mode 100644 index 000000000..5495f4dd3 --- /dev/null +++ b/evidence/RUNTIME-R3-PORT-62d1d0d6/README.md @@ -0,0 +1,15 @@ +# R3 portability table rerun on omega-mv main 62d1d0d6 (#596) + +Branch `w2/596-runtime-portability`: the recovered R3 candidate `qualification/runtime-r3-L636@0dbed9c1` +(original `runtime/r3-portability@92cd9145`) cherry-picked onto main `62d1d0d668f897386a0e311374f8dbcc5c32dde8`. +Host only (aarch64 Linux), no GPU. + +| File | Command | Result | +|---|---|---| +| `red-old-table-on-main.log` | `sh tools/runtime_portability_check.sh . <0dbed9c1 table> mk/omega-gpu-engine.mk` | exit 1: 21 files that landed on main after a8ffd2b9 have no row (the check refuses main drift) | +| `test-runtime-portability.log` | `make test-runtime-portability` with the 123-row table | exit 0: check PASS (123 rows) and all 8 controls behaved | +| `review-claims-green.json` | `python3 evidence/RUNTIME-R3-RECOVERY-L636/check-review-claims.py` | exit 0: the six L637 review corrections still hold on main sources | +| `gpu-engine-freestanding.log` | `make -B gpu-engine-freestanding` | exit 2: every file compiles freestanding; the closure link refuses `abort mmap mprotect munmap pthread_*` from `src/omega_om_units.c` (OM-2 cutover 450bbefd, #747). Not caused by this branch. | + +The 21 new rows are a source-reading judgement (20 CHIP_SPECIFIC, `src/omega_gpu_scan_ref.c` PORTABLE); the check proves +coverage and include agreement, not that each reason is right. diff --git a/evidence/RUNTIME-R3-PORT-62d1d0d6/gpu-engine-freestanding.log b/evidence/RUNTIME-R3-PORT-62d1d0d6/gpu-engine-freestanding.log new file mode 100644 index 000000000..0da083aa1 --- /dev/null +++ b/evidence/RUNTIME-R3-PORT-62d1d0d6/gpu-engine-freestanding.log @@ -0,0 +1,18 @@ +# make gpu-engine-freestanding on main 62d1d0d6 tree (2026-10-30T14:48:47Z, aarch64 host): every file compiles -ffreestanding; the closure link fails (see docs/runtime/PORTABILITY.md section 3) +gcc -r -nostdlib -o build/gpu_fs/omega_gpu_freestanding.o build/gpu_fs/omega_gpu_engine.o build/gpu_fs/omega_gpu_platform.o build/gpu_fs/omega_blackwell_encoder.o build/gpu_fs/omega_blackwell_codegen.o build/gpu_fs/omega_blackwell_matmul.o build/gpu_fs/omega_blackwell_qmd.o build/gpu_fs/omega_blackwell_realize.o build/gpu_fs/omega_om_units.o build/gpu_fs/omega_gpu_session.o build/gpu_fs/omega_gpu_fmt.o build/gpu_fs/omega_gpu_matmul_api.o build/gpu_fs/omega_gpu_attention_api.o build/gpu_fs/omega_gpu_serving.o build/gpu_fs/omega_gpu_wait.o +freestanding GPU link still needs: abort +mmap +mprotect +munmap +pthread_key_create +pthread_once +pthread_setspecific +make: *** [mk/omega-gpu-engine.mk:137: build/gpu_fs/omega_gpu_freestanding.o] Error 1 +exit=2 +# where the refused symbols come from, and who needs sha256_* from that object: +undefined in build/gpu_fs/omega_blackwell_codegen.o: sha256_hash +undefined in build/gpu_fs/omega_blackwell_encoder.o: sha256_final sha256_init sha256_update +undefined in build/gpu_fs/omega_blackwell_matmul.o: sha256_hash +undefined in build/gpu_fs/omega_blackwell_realize.o: sha256_final sha256_init sha256_update +undefined in build/gpu_fs/omega_gpu_attention_api.o: sha256_hash +undefined in build/gpu_fs/omega_om_units.o: abort mmap mprotect munmap pthread_key_create pthread_once pthread_setspecific diff --git a/evidence/RUNTIME-R3-PORT-62d1d0d6/red-old-table-on-main.log b/evidence/RUNTIME-R3-PORT-62d1d0d6/red-old-table-on-main.log new file mode 100644 index 000000000..37610aa58 --- /dev/null +++ b/evidence/RUNTIME-R3-PORT-62d1d0d6/red-old-table-on-main.log @@ -0,0 +1,25 @@ +# red: the recovered 102-row table (0dbed9c1) against main 62d1d0d6 +$ sh tools/runtime_portability_check.sh . <table at 0dbed9c1> mk/omega-gpu-engine.mk +FAIL: no row in the table for src/omega_gpu_decode_attn256_api.c +FAIL: no row in the table for src/omega_gpu_decode_attn256_api.h +FAIL: no row in the table for src/omega_gpu_gdn_api.c +FAIL: no row in the table for src/omega_gpu_gdn_api.h +FAIL: no row in the table for src/omega_gpu_gemm.c +FAIL: no row in the table for src/omega_gpu_gemm.h +FAIL: no row in the table for src/omega_gpu_prefill_attn256_api.c +FAIL: no row in the table for src/omega_gpu_prefill_attn256_api.h +FAIL: no row in the table for src/omega_gpu_q36_graph.c +FAIL: no row in the table for src/omega_gpu_q36_graph.h +FAIL: no row in the table for src/omega_gpu_q38_graph.c +FAIL: no row in the table for src/omega_gpu_q38_graph.h +FAIL: no row in the table for src/omega_gpu_scan.c +FAIL: no row in the table for src/omega_gpu_scan.h +FAIL: no row in the table for src/omega_gpu_scan_ref.c +FAIL: no row in the table for src/omega_blackwell_codegen_attn256.c +FAIL: no row in the table for src/omega_blackwell_codegen_attn256.h +FAIL: no row in the table for src/omega_blackwell_codegen_gdn.c +FAIL: no row in the table for src/omega_blackwell_codegen_gdn.h +FAIL: no row in the table for src/omega_blackwell_codegen_pattn256.c +FAIL: no row in the table for src/omega_blackwell_codegen_pattn256.h +FAIL: portability table does not match the tree +exit=1 diff --git a/evidence/RUNTIME-R3-PORT-62d1d0d6/review-claims-green.json b/evidence/RUNTIME-R3-PORT-62d1d0d6/review-claims-green.json new file mode 100644 index 000000000..f2e48dbf2 --- /dev/null +++ b/evidence/RUNTIME-R3-PORT-62d1d0d6/review-claims-green.json @@ -0,0 +1,50 @@ +[ + { + "file": "src/omega_gpu_matmul_api.h", + "source_anchor": "OMEGA_GPU_MATMUL_TILE_M 16", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "tile", + "pass_check": true + }, + { + "file": "src/omega_gpu_moe_api.h", + "source_anchor": "col0 % 8 == 0", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "packing", + "pass_check": true + }, + { + "file": "src/omega_gpu_platform.h", + "source_anchor": "one GPFIFO entry", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "GPFIFO", + "pass_check": true + }, + { + "file": "src/omega_gpu_session.h", + "source_anchor": "QMD default (1024)", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "QMD", + "pass_check": true + }, + { + "file": "src/omega_gpu_serving.h", + "source_anchor": "GB10 serving buffers", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "GB10", + "pass_check": true + }, + { + "file": "src/omega_gpu_serving.c", + "source_anchor": "omega_gpu_matmul_reserve", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "omega_gpu_matmul_reserve", + "pass_check": true + } +] diff --git a/evidence/RUNTIME-R3-PORT-62d1d0d6/test-runtime-portability.log b/evidence/RUNTIME-R3-PORT-62d1d0d6/test-runtime-portability.log new file mode 100644 index 000000000..97109dc75 --- /dev/null +++ b/evidence/RUNTIME-R3-PORT-62d1d0d6/test-runtime-portability.log @@ -0,0 +1,20 @@ +# green: make test-runtime-portability on w2/596 (base main 62d1d0d6), 2026-10-30T14:47:50Z, aarch64 host, no GPU +sh tools/runtime_portability_check.sh . docs/runtime/portability_table.tsv mk/omega-gpu-engine.mk +PASS: 123 rows, every omega_gpu_* / omega_blackwell_* / omega_bw_* file in src/ has one and the rows agree with the includes +sh tools/runtime_portability_controls.sh build/runtime_r3_controls docs/runtime/portability_table.tsv mk/omega-gpu-engine.mk +CONTROL unchanged: PASS as required (scratch copy of the real tree and table) +CONTROL new-file-no-row: FAIL as required (a new omega_gpu_ file with no row) + FAIL: no row in the table for src/omega_gpu_zz_dummy.c +CONTROL row-missing-file: FAIL as required (a row for a file that does not exist) + FAIL: row names a missing file: src/omega_gpu_zz_ghost.c +CONTROL portable-includes-nvrm: FAIL as required (a PORTABLE file that includes nvrm.h) + FAIL: src/omega_gpu_wait.c: PORTABLE but includes a Linux/NVRM header: nvrm.h +CONTROL portable-row-on-linux-file: FAIL as required (the real Linux backend relabelled PORTABLE) + FAIL: src/omega_gpu_platform_linux.c: PORTABLE but includes a Linux/NVRM header: omega_gpu_platform_linux.h m16_native.h nvrm.h pthread.h +CONTROL portable-row-on-chip-file: FAIL as required (a file that includes Blackwell headers relabelled PORTABLE) + FAIL: src/omega_gpu_attention_api.c: PORTABLE but includes a Blackwell chip header: omega_blackwell_codegen.h omega_bw_reconv.h omega_blackwell_qmd.h omega_blackwell_submit.h +CONTROL guarded-include: PASS as required (an nvrm.h include inside #ifndef OMEGA_GPU_NO_POSIX is the hosted-only build and must not count) +CONTROL freestanding-claim-broken: FAIL as required (a freestanding-closure file that gained stdlib.h) + FAIL: src/omega_gpu_fmt.c: is in GPU_FS_SRCS but the include scan finds stdlib.h +ALL CONTROLS BEHAVED AS REQUIRED +exit=0 diff --git a/evidence/RUNTIME-R3-PORT/gpu-engine-freestanding.log b/evidence/RUNTIME-R3-PORT/gpu-engine-freestanding.log new file mode 100644 index 000000000..427ff7f0b --- /dev/null +++ b/evidence/RUNTIME-R3-PORT/gpu-engine-freestanding.log @@ -0,0 +1,17 @@ +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_gpu_engine.o src/omega_gpu_engine.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_gpu_platform.o src/omega_gpu_platform.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_blackwell_encoder.o src/omega_blackwell_encoder.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_blackwell_codegen.o src/omega_blackwell_codegen.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_blackwell_matmul.o src/omega_blackwell_matmul.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_blackwell_qmd.o src/omega_blackwell_qmd.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_blackwell_realize.o src/omega_blackwell_realize.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/sha256.o src/sha256.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_gpu_session.o src/omega_gpu_session.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_gpu_fmt.o src/omega_gpu_fmt.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_gpu_matmul_api.o src/omega_gpu_matmul_api.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_gpu_attention_api.o src/omega_gpu_attention_api.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_gpu_serving.o src/omega_gpu_serving.c +gcc -std=gnu11 -O2 -Wall -Wextra -Werror -ffreestanding -fno-builtin -fno-stack-protector -U_FORTIFY_SOURCE -DOMEGA_GPU_NO_POSIX -DOMEGA_NUMERIC_CPU_ONLY -Isrc -c -o build/gpu_fs/omega_gpu_wait.o src/omega_gpu_wait.c +gcc -r -nostdlib -o build/gpu_fs/omega_gpu_freestanding.o build/gpu_fs/omega_gpu_engine.o build/gpu_fs/omega_gpu_platform.o build/gpu_fs/omega_blackwell_encoder.o build/gpu_fs/omega_blackwell_codegen.o build/gpu_fs/omega_blackwell_matmul.o build/gpu_fs/omega_blackwell_qmd.o build/gpu_fs/omega_blackwell_realize.o build/gpu_fs/sha256.o build/gpu_fs/omega_gpu_session.o build/gpu_fs/omega_gpu_fmt.o build/gpu_fs/omega_gpu_matmul_api.o build/gpu_fs/omega_gpu_attention_api.o build/gpu_fs/omega_gpu_serving.o build/gpu_fs/omega_gpu_wait.o +freestanding GPU link (14 files): only memcpy memset strcmp strlen undefined +exit 0 diff --git a/evidence/RUNTIME-R3-PORT/real-tree-dummy-control.log b/evidence/RUNTIME-R3-PORT/real-tree-dummy-control.log new file mode 100644 index 000000000..d2041272b --- /dev/null +++ b/evidence/RUNTIME-R3-PORT/real-tree-dummy-control.log @@ -0,0 +1,10 @@ +# real-tree negative control: a dummy src/omega_gpu_zz_dummy.c with no row +sh tools/runtime_portability_check.sh . docs/runtime/portability_table.tsv mk/omega-gpu-engine.mk +FAIL: no row in the table for src/omega_gpu_zz_dummy.c +FAIL: portability table does not match the tree +make: *** [mk/runtime-r3.mk:11: test-runtime-portability-check] Error 1 +make exit 2 +# dummy removed; check again +sh tools/runtime_portability_check.sh . docs/runtime/portability_table.tsv mk/omega-gpu-engine.mk +PASS: 102 rows, every omega_gpu_* / omega_blackwell_* / omega_bw_* file in src/ has one and the rows agree with the includes +make exit 0 diff --git a/evidence/RUNTIME-R3-PORT/test-runtime-portability.log b/evidence/RUNTIME-R3-PORT/test-runtime-portability.log new file mode 100644 index 000000000..f01d40d36 --- /dev/null +++ b/evidence/RUNTIME-R3-PORT/test-runtime-portability.log @@ -0,0 +1,19 @@ +sh tools/runtime_portability_check.sh . docs/runtime/portability_table.tsv mk/omega-gpu-engine.mk +PASS: 102 rows, every omega_gpu_* / omega_blackwell_* / omega_bw_* file in src/ has one and the rows agree with the includes +sh tools/runtime_portability_controls.sh build/runtime_r3_controls docs/runtime/portability_table.tsv mk/omega-gpu-engine.mk +CONTROL unchanged: PASS as required (scratch copy of the real tree and table) +CONTROL new-file-no-row: FAIL as required (a new omega_gpu_ file with no row) + FAIL: no row in the table for src/omega_gpu_zz_dummy.c +CONTROL row-missing-file: FAIL as required (a row for a file that does not exist) + FAIL: row names a missing file: src/omega_gpu_zz_ghost.c +CONTROL portable-includes-nvrm: FAIL as required (a PORTABLE file that includes nvrm.h) + FAIL: src/omega_gpu_wait.c: PORTABLE but includes a Linux/NVRM header: nvrm.h +CONTROL portable-row-on-linux-file: FAIL as required (the real Linux backend relabelled PORTABLE) + FAIL: src/omega_gpu_platform_linux.c: PORTABLE but includes a Linux/NVRM header: omega_gpu_platform_linux.h m16_native.h nvrm.h pthread.h +CONTROL portable-row-on-chip-file: FAIL as required (a file that includes Blackwell headers relabelled PORTABLE) + FAIL: src/omega_gpu_attention_api.c: PORTABLE but includes a Blackwell chip header: omega_blackwell_codegen.h omega_bw_reconv.h omega_blackwell_qmd.h omega_blackwell_submit.h +CONTROL guarded-include: PASS as required (an nvrm.h include inside #ifndef OMEGA_GPU_NO_POSIX is the hosted-only build and must not count) +CONTROL freestanding-claim-broken: FAIL as required (a freestanding-closure file that gained stdlib.h) + FAIL: src/omega_gpu_fmt.c: is in GPU_FS_SRCS but the include scan finds stdlib.h +ALL CONTROLS BEHAVED AS REQUIRED +make exit 0 diff --git a/evidence/RUNTIME-R3-RECOVERY-L636/README.md b/evidence/RUNTIME-R3-RECOVERY-L636/README.md new file mode 100644 index 000000000..e6ff405d2 --- /dev/null +++ b/evidence/RUNTIME-R3-RECOVERY-L636/README.md @@ -0,0 +1,28 @@ +# Recovered R3 portability qualification (L636, omega issue596) + +The original author delivered `runtime/r3-portability` at `92cd9145766ef9ef93baa15ad4e7a044b7865f67` (L091). It was not in the authoritative local READY queue and had no matching PR. This branch reuses that work; no second runtime/compiler/checker implementation was built. Original `evidence/RUNTIME-R3-PORT` receipts are untouched. + +## Fresh host replay + +On an ARM64 Mac running macOS26.6.2, `TMPDIR=$HOME/.hermes/cache/scratch make test-runtime-portability` exited0. `host-test.log.gz` and `manifest.json` pin the original source and raw-log hash. These are row/include checks, not GPU qualification. + +## Independent finding and parent correction + +L637 (`deleg_a3c13f6f`) independently read the issue, source, portability reasons and controls. It counted the original15 PORTABLE rows, replayed the102-row check and the eight controls, and found an acceptance-blocking overclaim: several headers expose chip assumptions despite PORTABLE labels. Its transcript was checked by the parent. No independent final re-review is claimed. + +The parent read the actual headers rather than treating hardware names alone as proof. Stronger evidence supports correction: + +- matmul header: Blackwell16/8/16 tile macros, CTA envelope and GPU-uncached resident memory; +- MoE header: tile-major packing, column-modulo8 alignment and Blackwell shape limits; +- platform header: GPFIFO queue semantics and NVIDIA host-polled cache policy, not only its ordinal example; +- session header: QMD fields/default1024 and two-marker/L2-flush launch protocol; +- serving header: GB10-specific reservation/cache contract; +- sibling serving implementation: calls the chip-specific matmul/attention reserve APIs, not an independent generic accounting layer. + +All six table rows and their reasons were corrected, and section3/counts were updated at `160ee31803d68e3ef9bfb819bfa1235b365ea0f8`. Counts computed from the table are now93 CHIP_SPECIFIC and9 PORTABLE. OS-binding labels and production source are unchanged. Mere chip names in historical examples do not make the remaining generic engine/wait/math helpers chip-specific; their portability is not a whole-backend support claim. + +`check-review-claims.py` is a named external documentary oracle, not runtime or a replacement checker. It verifies real source anchors against the corrected row/reason claims. Before edits it exited1 (`classification-red.json`); after edits it exited0 (`classification-green.json`). The complete original canonical host target was rerun on the corrected table and all controls behaved (`corrected-host-test.log.gz`). Source-review remains necessary: neither this case-specific oracle nor the include scanner can mechanically prove all future prose correct. + +## Scope and delivery + +No runtime/compiler/driver/gate implementation was changed, no GPU/model was loaded and no performance result is claimed. Shell/awk are the original checker; Python here is only an external documentary test oracle. WSL/native/other-GPU readiness remains unqualified. Required pinned crumb preparation, exact local queue ACK, Renda PR/judge/merge and issue closure are separate steps; an author receipt or README READY line is not remote acceptance. diff --git a/evidence/RUNTIME-R3-RECOVERY-L636/check-review-claims.py b/evidence/RUNTIME-R3-RECOVERY-L636/check-review-claims.py new file mode 100644 index 000000000..c71899189 --- /dev/null +++ b/evidence/RUNTIME-R3-RECOVERY-L636/check-review-claims.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +"""External documentary oracle for L637 findings; not production runtime.""" +from pathlib import Path +import csv, json, sys +root=Path(__file__).resolve().parents[2] +rows={r['file']:r for r in csv.DictReader((l for l in (root/'docs/runtime/portability_table.tsv').read_text().splitlines() if not l.startswith('#')),delimiter='\t')} +cases={ + 'src/omega_gpu_matmul_api.h':('OMEGA_GPU_MATMUL_TILE_M 16','tile'), + 'src/omega_gpu_moe_api.h':('col0 % 8 == 0','packing'), + 'src/omega_gpu_platform.h':('one GPFIFO entry','GPFIFO'), + 'src/omega_gpu_session.h':('QMD default (1024)','QMD'), + 'src/omega_gpu_serving.h':('GB10 serving buffers','GB10'), + 'src/omega_gpu_serving.c':('omega_gpu_matmul_reserve','omega_gpu_matmul_reserve'), +} +results=[] +for file,(source_anchor,reason_anchor) in cases.items(): + assert source_anchor in (root/file).read_text(),f'source evidence changed: {file}' + r=rows[file] + ok=r['class']=='CHIP_SPECIFIC' and reason_anchor.lower() in r['reason'].lower() + results.append(dict(file=file,source_anchor=source_anchor,expected_class='CHIP_SPECIFIC',actual_class=r['class'],reason_anchor=reason_anchor,pass_check=ok)) +print(json.dumps(results,indent=2)) +sys.exit(0 if all(r['pass_check'] for r in results) else 1) diff --git a/evidence/RUNTIME-R3-RECOVERY-L636/classification-green.json b/evidence/RUNTIME-R3-RECOVERY-L636/classification-green.json new file mode 100644 index 000000000..f2e48dbf2 --- /dev/null +++ b/evidence/RUNTIME-R3-RECOVERY-L636/classification-green.json @@ -0,0 +1,50 @@ +[ + { + "file": "src/omega_gpu_matmul_api.h", + "source_anchor": "OMEGA_GPU_MATMUL_TILE_M 16", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "tile", + "pass_check": true + }, + { + "file": "src/omega_gpu_moe_api.h", + "source_anchor": "col0 % 8 == 0", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "packing", + "pass_check": true + }, + { + "file": "src/omega_gpu_platform.h", + "source_anchor": "one GPFIFO entry", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "GPFIFO", + "pass_check": true + }, + { + "file": "src/omega_gpu_session.h", + "source_anchor": "QMD default (1024)", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "QMD", + "pass_check": true + }, + { + "file": "src/omega_gpu_serving.h", + "source_anchor": "GB10 serving buffers", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "GB10", + "pass_check": true + }, + { + "file": "src/omega_gpu_serving.c", + "source_anchor": "omega_gpu_matmul_reserve", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "CHIP_SPECIFIC", + "reason_anchor": "omega_gpu_matmul_reserve", + "pass_check": true + } +] diff --git a/evidence/RUNTIME-R3-RECOVERY-L636/classification-red.json b/evidence/RUNTIME-R3-RECOVERY-L636/classification-red.json new file mode 100644 index 000000000..f30e2307b --- /dev/null +++ b/evidence/RUNTIME-R3-RECOVERY-L636/classification-red.json @@ -0,0 +1,50 @@ +[ + { + "file": "src/omega_gpu_matmul_api.h", + "source_anchor": "OMEGA_GPU_MATMUL_TILE_M 16", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "PORTABLE", + "reason_anchor": "tile", + "pass_check": false + }, + { + "file": "src/omega_gpu_moe_api.h", + "source_anchor": "col0 % 8 == 0", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "PORTABLE", + "reason_anchor": "packing", + "pass_check": false + }, + { + "file": "src/omega_gpu_platform.h", + "source_anchor": "one GPFIFO entry", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "PORTABLE", + "reason_anchor": "GPFIFO", + "pass_check": false + }, + { + "file": "src/omega_gpu_session.h", + "source_anchor": "QMD default (1024)", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "PORTABLE", + "reason_anchor": "QMD", + "pass_check": false + }, + { + "file": "src/omega_gpu_serving.h", + "source_anchor": "GB10 serving buffers", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "PORTABLE", + "reason_anchor": "GB10", + "pass_check": false + }, + { + "file": "src/omega_gpu_serving.c", + "source_anchor": "omega_gpu_matmul_reserve", + "expected_class": "CHIP_SPECIFIC", + "actual_class": "PORTABLE", + "reason_anchor": "omega_gpu_matmul_reserve", + "pass_check": false + } +] diff --git a/evidence/RUNTIME-R3-RECOVERY-L636/corrected-host-test.log.gz b/evidence/RUNTIME-R3-RECOVERY-L636/corrected-host-test.log.gz new file mode 100644 index 000000000..fcccb40e8 Binary files /dev/null and b/evidence/RUNTIME-R3-RECOVERY-L636/corrected-host-test.log.gz differ diff --git a/evidence/RUNTIME-R3-RECOVERY-L636/host-test.log.gz b/evidence/RUNTIME-R3-RECOVERY-L636/host-test.log.gz new file mode 100644 index 000000000..fcccb40e8 Binary files /dev/null and b/evidence/RUNTIME-R3-RECOVERY-L636/host-test.log.gz differ diff --git a/evidence/RUNTIME-R3-RECOVERY-L636/manifest.json b/evidence/RUNTIME-R3-RECOVERY-L636/manifest.json new file mode 100644 index 000000000..9b0334e21 --- /dev/null +++ b/evidence/RUNTIME-R3-RECOVERY-L636/manifest.json @@ -0,0 +1,21 @@ +{ + "source_commit": "92cd9145766ef9ef93baa15ad4e7a044b7865f67", + "platform": "macOS-26.6.2-arm64-arm-64bit", + "command": "TMPDIR=$HOME/.hermes/cache/scratch make test-runtime-portability", + "exit": 0, + "log_raw_sha256": "f53b478c2f9e352c5bc0b271d245c15713b3c5bf13c6453efac03255dbf9d57b", + "table_rows": 102, + "classes": { + "CHIP_SPECIFIC": 87, + "PORTABLE": 15 + }, + "hashes": { + "docs/runtime/PORTABILITY.md": "f1681b29d01e921e4b18808c347793c4d4091c257db4c24254e96f679cc90f88", + "docs/runtime/portability_table.tsv": "0c74bb82e94ac8526a5bba861c00fcc1c2e5f65263e0df7d4a9f69d5c579c5fc", + "tools/runtime_portability_check.sh": "30c2b2a7a93ea18afc40d6d1141d73dd5e1cab15c6e74d952ffb6366d1391179", + "tools/runtime_portability_controls.sh": "5ceed96d86daff90aab951cc156ceb4040622da7e602e1418ff2897f81b008f5", + "mk/runtime-r3.mk": "dc5236b8c221f3e2caeec11e89248ae41e6ea8e1997e73172d548046a83b08a9", + "mk/omega-gpu-engine.mk": "3bde57c53befb3454ea6876170eceff055c8815c96d317ed671713c115fe8b27" + }, + "scope": "Host source-table consistency and refusal controls, no compiler/GPU/timing/WSL/native qualification" +} diff --git a/mk/.crumb b/mk/.crumb index e38efa48f..f6f8ea39a 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-30T14:44:29Z", "compiler": "crumb-compile/1", - "digest": "sha256:8f0e5cb325040247440527f6b54b65cf72c47ff5adca75b4f32a1ddf2b2d6ade", + "digest": "sha256:3be956a1d3236716ff19cb4dca8d4f655c0d17e56646b6314acb7db44b60166c", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 75, - "generated_at_commit": "79b8c1f9c24195c53ac8dad111d35175a4431506", - "source_tree": "sha256:b8302c1e15664dfe98c550a03830f5d4cf75c5451a6c75eed5042e623dea5d10" + "files": 76, + "generated_at_commit": "dceacc4bc1042b891dcad4252d96a86b8cb461c7", + "source_tree": "sha256:f5d9da1df69e07ee61bd42cf507e671a211299b60a31c444e9d94da3049c839d" }, "owner_lane": "", "provenance": { diff --git a/mk/runtime-r3.mk b/mk/runtime-r3.mk new file mode 100644 index 000000000..9c541fbb2 --- /dev/null +++ b/mk/runtime-r3.mk @@ -0,0 +1,14 @@ +# Omega runtime R3 (omega-mv#596): the portability table (docs/runtime/portability_table.tsv) must match src/. +# Picked up by `-include mk/*.mk`. Host only: no compiler, no device, no physics headers. +# test-runtime-portability-check every src/omega_gpu_*, omega_blackwell_*, omega_bw_* file has a row, every row names a +# file, a PORTABLE row's file includes no Linux/NVRM or Blackwell header, and the +# os_binding column agrees with the include scan and the freestanding file list +# test-runtime-portability-controls breaks one thing at a time in scratch copies; the check must FAIL each (and PASS the +# guarded-include control) +# test-runtime-portability both +.PHONY: test-runtime-portability test-runtime-portability-check test-runtime-portability-controls +test-runtime-portability-check: + sh tools/runtime_portability_check.sh . docs/runtime/portability_table.tsv mk/omega-gpu-engine.mk +test-runtime-portability-controls: + sh tools/runtime_portability_controls.sh build/runtime_r3_controls docs/runtime/portability_table.tsv mk/omega-gpu-engine.mk +test-runtime-portability: test-runtime-portability-check test-runtime-portability-controls diff --git a/tools/.crumb b/tools/.crumb index e9e4932b5..3b108d4d6 100644 --- a/tools/.crumb +++ b/tools/.crumb @@ -62,14 +62,14 @@ } ], "children_root": "sha256:8d3d3b952374b3b72e667521f07bf028c4c02bcefff772ad1a71cfff3e5266f2", - "compiled_at": "2026-10-30T11:28:28Z", + "compiled_at": "2026-10-30T14:44:29Z", "compiler": "crumb-compile/1", - "digest": "sha256:308db0e6cf45c0a48f01f5f5f228450f191389de68006915b9ecf9c65b9a2e29", + "digest": "sha256:cf1d5c429bc92b7a811bfcf76449c68dbf7b64e69caca54bc14a0fd00a93df66", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 298, - "generated_at_commit": "a8a6a3d3c47ce797430f045edc5eae11594ba36d", - "source_tree": "sha256:acd1f1b0080968db950791b4eb2dce39bb0289dc0c2e8794bfc7449023446105" + "files": 300, + "generated_at_commit": "dceacc4bc1042b891dcad4252d96a86b8cb461c7", + "source_tree": "sha256:e38ca316a805577dc33070363f6d72e57c1ec84abed789bc11be4a9fee2de50c" }, "owner_lane": "", "provenance": { diff --git a/tools/runtime_portability_check.sh b/tools/runtime_portability_check.sh new file mode 100755 index 000000000..208f7c52a --- /dev/null +++ b/tools/runtime_portability_check.sh @@ -0,0 +1,93 @@ +#!/bin/sh +# Omega runtime R3 (omega-mv#596): the portability table must match the source tree. +# usage: runtime_portability_check.sh <root> <table.tsv> <engine.mk> +# Host only, no compiler, no device. POSIX sh + awk. +# +# Fails (exit 1, one line per problem) when: +# 1. a src/omega_gpu_*, src/omega_blackwell_* or src/omega_bw_* file has no row in the table +# 2. a row names a file that does not exist, or is duplicated, or has a bad class / binding / empty reason +# 3. a PORTABLE row's file includes a Linux or NVRM header (nvrm.h, m16_native.h, omega_gpu_platform_linux.h, +# pthread.h, unistd.h, fcntl.h, sys/*, linux/*) or a Blackwell chip header (omega_blackwell_*, omega_bw_*) +# 4. the os_binding column disagrees with what the include scan finds, or a .c file in GPU_FS_SRCS +# (engine.mk, the make gpu-engine-freestanding list) is not FREESTANDING_PROVEN +# It proves every file has a row and that the rows agree with the includes. It does not prove that +# a row's reason is right. +# +# Include scan: direct #include lines only. Lines inside "#ifdef OMEGA_ATTN_DEBUG" (a debug trace, off by default) and "#ifndef OMEGA_GPU_NO_POSIX" (or the #else +# of "#ifdef OMEGA_GPU_NO_POSIX") are the hosted-only build and are not counted, because the +# freestanding build never sees them. +root=$1; table=$2; mk=$3 +[ -d "$root/src" ] && [ -f "$table" ] && [ -f "$mk" ] || { echo "usage: $0 <root> <table.tsv> <engine.mk>"; exit 2; } + +fail=0 +bad() { echo "FAIL: $*"; fail=1; } + +# unguarded includes of one file, one per line, as written between <> or "" +includes() { + awk ' + function hosted( i) { for (i = 1; i <= d; i++) if (h[i]) return 1; return 0 } + /^[ \t]*#[ \t]*ifdef[ \t]+OMEGA_ATTN_DEBUG/ { d++; h[d] = 1; isdef[d] = 0; next } + /^[ \t]*#[ \t]*if/ && !/^[ \t]*#[ \t]*(ifdef|ifndef)[ \t]+OMEGA_GPU_NO_POSIX/ { + d++; h[d] = 0; isdef[d] = 0 + if ($0 ~ /^[ \t]*#[ \t]*if[ \t]+!defined[ \t]*\(?[ \t]*OMEGA_GPU_NO_POSIX/) h[d] = 1 + next } + /^[ \t]*#[ \t]*ifndef[ \t]+OMEGA_GPU_NO_POSIX/ { d++; h[d] = 1; isdef[d] = 0; next } + /^[ \t]*#[ \t]*ifdef[ \t]+OMEGA_GPU_NO_POSIX/ { d++; h[d] = 0; isdef[d] = 1; next } + /^[ \t]*#[ \t]*(else|elif)/ { if (d > 0 && isdef[d]) h[d] = 1; next } + /^[ \t]*#[ \t]*endif/ { if (d > 0) d--; next } + /^[ \t]*#[ \t]*include/ { + if (hosted()) next + s = $0; sub(/^[ \t]*#[ \t]*include[ \t]*[<"]/, "", s); sub(/[>"].*$/, "", s); print s } + ' "$1" +} + +# --- row syntax and file existence ----------------------------------------------------------- +rows=$(grep -v '^#' "$table" | grep -v '^file ' || true) +tmp_rows=$(mktemp); printf '%s\n' "$rows" | grep -v '^$' > "$tmp_rows" +fs_srcs=$(awk '/^GPU_FS_SRCS[ \t]*=/ {on=1} on {print} on && !/\\$/ {exit}' "$mk" | tr -d '\\' | tr ' \t' '\n\n' | grep '^src/.*\.c$' || true) +[ -n "$fs_srcs" ] || bad "no GPU_FS_SRCS list found in $mk" + +dups=$(cut -f1 "$tmp_rows" | sort | uniq -d) +[ -z "$dups" ] || bad "duplicate rows: $(echo $dups)" + +while IFS=' ' read -r f class reason bind extra; do + [ -n "$f" ] || continue + [ -f "$root/$f" ] || { bad "row names a missing file: $f"; continue; } + case "$class" in CHIP_SPECIFIC|PORTABLE) ;; *) bad "$f: class '$class' is not CHIP_SPECIFIC or PORTABLE" ;; esac + case "$bind" in FREESTANDING_PROVEN|NO_HOSTED_INCLUDE|HOSTED_LIBC|LINUX_DRIVER) ;; *) bad "$f: os_binding '$bind' is not one of FREESTANDING_PROVEN NO_HOSTED_INCLUDE HOSTED_LIBC LINUX_DRIVER" ;; esac + [ -n "$reason" ] || bad "$f: empty reason" + [ -z "$extra" ] || bad "$f: more than four columns" + + inc=$(includes "$root/$f") + linux=$(printf '%s\n' "$inc" | grep -E '^(nvrm\.h|m16_native\.h|omega_gpu_platform_linux\.h|pthread\.h|unistd\.h|fcntl\.h|sys/.*|linux/.*)$' || true) + driver=$(printf '%s\n' "$linux" | grep -E '^(nvrm\.h|m16_native\.h|omega_gpu_platform_linux\.h|sys/.*|linux/.*)$' || true) + hosted=$(printf '%s\n' "$inc" | grep -E '^(stdio\.h|stdlib\.h|time\.h|errno\.h|math\.h|pthread\.h|unistd\.h|fcntl\.h|assert\.h|inttypes\.h|signal\.h|ctype\.h|sys/.*|linux/.*)$' || true) + chip=$(printf '%s\n' "$inc" | grep -E '^omega_(blackwell_|bw_)' || true) + + # derived binding + if [ -n "$driver" ]; then want=LINUX_DRIVER + elif [ -n "$hosted" ]; then want=HOSTED_LIBC + else want=NO_HOSTED_INCLUDE; fi + if printf '%s\n' "$fs_srcs" | grep -qx "$f"; then + [ "$want" = NO_HOSTED_INCLUDE ] || bad "$f: is in GPU_FS_SRCS but the include scan finds $(echo $driver $hosted)" + want=FREESTANDING_PROVEN + fi + [ "$bind" = "$want" ] || bad "$f: os_binding is $bind, the include scan and GPU_FS_SRCS say $want" + + if [ "$class" = PORTABLE ]; then + [ -z "$linux" ] || bad "$f: PORTABLE but includes a Linux/NVRM header: $(echo $linux)" + [ -z "$chip" ] || bad "$f: PORTABLE but includes a Blackwell chip header: $(echo $chip)" + fi +done < "$tmp_rows" + +# --- every file has a row ---------------------------------------------------------------------- +for p in "$root"/src/omega_gpu_* "$root"/src/omega_blackwell_* "$root"/src/omega_bw_*; do + [ -f "$p" ] || continue + f=src/$(basename "$p") + cut -f1 "$tmp_rows" | grep -qx "$f" || bad "no row in the table for $f" +done + +n=$(wc -l < "$tmp_rows" | tr -d ' ') +rm -f "$tmp_rows" +if [ "$fail" = 0 ]; then echo "PASS: $n rows, every omega_gpu_* / omega_blackwell_* / omega_bw_* file in src/ has one and the rows agree with the includes"; exit 0; fi +echo "FAIL: portability table does not match the tree"; exit 1 diff --git a/tools/runtime_portability_controls.sh b/tools/runtime_portability_controls.sh new file mode 100755 index 000000000..49c03c39f --- /dev/null +++ b/tools/runtime_portability_controls.sh @@ -0,0 +1,67 @@ +#!/bin/sh +# Negative and positive controls for tools/runtime_portability_check.sh (omega-mv#596, slice R3). +# usage: runtime_portability_controls.sh <scratch-dir> <table.tsv> <engine.mk> +# Each control builds a scratch copy of the GPU source files, breaks one thing, and requires the +# checker to FAIL with the expected message (or, for the positive control, to still PASS). +# A check that cannot fail proves nothing. Exit 0 only when every control behaves as required. +scratch=$1; table=$2; mk=$3 +here=$(cd "$(dirname "$0")" && pwd) +chk="$here/runtime_portability_check.sh" +[ -n "$scratch" ] && [ -f "$table" ] && [ -f "$mk" ] || { echo "usage: $0 <scratch-dir> <table.tsv> <engine.mk>"; exit 2; } +ok=0 + +fresh() { # fresh <name>: scratch root with a copy of the GPU files and the table + r="$scratch/$1"; rm -rf "$r"; mkdir -p "$r/src" + cp src/omega_gpu_* src/omega_blackwell_* src/omega_bw_* "$r/src/" + cp "$table" "$r/table.tsv" +} +expect_fail() { # expect_fail <name> <pattern> <what was broken> + out=$("$chk" "$scratch/$1" "$scratch/$1/table.tsv" "$mk" 2>&1); rc=$? + if [ $rc -eq 1 ] && printf '%s\n' "$out" | grep -q "$2"; then + echo "CONTROL $1: FAIL as required ($3)"; printf '%s\n' "$out" | grep "$2" | head -2 | sed 's/^/ /' + else + echo "CONTROL $1: WRONG, the checker exit was $rc and did not report '$2' ($3)"; printf '%s\n' "$out" | head -5 | sed 's/^/ /'; ok=1 + fi +} +expect_pass() { + out=$("$chk" "$scratch/$1" "$scratch/$1/table.tsv" "$mk" 2>&1); rc=$? + if [ $rc -eq 0 ]; then echo "CONTROL $1: PASS as required ($2)" + else echo "CONTROL $1: WRONG, the checker failed ($2)"; printf '%s\n' "$out" | head -5 | sed 's/^/ /'; ok=1; fi +} +setclass() { # setclass <name> <src/file> <class> + awk -F'\t' -v f="$2" -v c="$3" 'BEGIN{OFS="\t"} $1==f{$2=c} {print}' "$scratch/$1/table.tsv" > "$scratch/$1/t.new" && mv "$scratch/$1/t.new" "$scratch/$1/table.tsv" +} + +fresh unchanged; expect_pass unchanged "scratch copy of the real tree and table" + +fresh new-file-no-row +printf 'int omega_gpu_zz_dummy(void) { return 0; }\n' > "$scratch/new-file-no-row/src/omega_gpu_zz_dummy.c" +expect_fail new-file-no-row "no row in the table for src/omega_gpu_zz_dummy.c" "a new omega_gpu_ file with no row" + +fresh row-missing-file +printf 'src/omega_gpu_zz_ghost.c\tPORTABLE\tghost\tNO_HOSTED_INCLUDE\n' >> "$scratch/row-missing-file/table.tsv" +expect_fail row-missing-file "row names a missing file: src/omega_gpu_zz_ghost.c" "a row for a file that does not exist" + +fresh portable-includes-nvrm +printf '#include "nvrm.h"\n' | cat - "$scratch/portable-includes-nvrm/src/omega_gpu_wait.c" > "$scratch/p.c" && mv "$scratch/p.c" "$scratch/portable-includes-nvrm/src/omega_gpu_wait.c" +expect_fail portable-includes-nvrm "omega_gpu_wait.c: PORTABLE but includes a Linux/NVRM header: nvrm.h" "a PORTABLE file that includes nvrm.h" + +fresh portable-row-on-linux-file +setclass portable-row-on-linux-file src/omega_gpu_platform_linux.c PORTABLE +expect_fail portable-row-on-linux-file "omega_gpu_platform_linux.c: PORTABLE but includes a Linux/NVRM header" "the real Linux backend relabelled PORTABLE" + +fresh portable-row-on-chip-file +setclass portable-row-on-chip-file src/omega_blackwell_qmd.h PORTABLE +setclass portable-row-on-chip-file src/omega_gpu_attention_api.c PORTABLE +expect_fail portable-row-on-chip-file "omega_gpu_attention_api.c: PORTABLE but includes a Blackwell chip header" "a file that includes Blackwell headers relabelled PORTABLE" + +fresh guarded-include +{ printf '#ifndef OMEGA_GPU_NO_POSIX\n#include "nvrm.h"\n#include <pthread.h>\n#endif\n'; cat "$scratch/guarded-include/src/omega_gpu_engine.c"; } > "$scratch/g.c" && mv "$scratch/g.c" "$scratch/guarded-include/src/omega_gpu_engine.c" +expect_pass guarded-include "an nvrm.h include inside #ifndef OMEGA_GPU_NO_POSIX is the hosted-only build and must not count" + +fresh freestanding-claim-broken +printf '#include <stdlib.h>\n' | cat - "$scratch/freestanding-claim-broken/src/omega_gpu_fmt.c" > "$scratch/g.c" && mv "$scratch/g.c" "$scratch/freestanding-claim-broken/src/omega_gpu_fmt.c" +expect_fail freestanding-claim-broken "omega_gpu_fmt.c: is in GPU_FS_SRCS but the include scan finds stdlib.h" "a freestanding-closure file that gained stdlib.h" + +[ $ok -eq 0 ] && echo "ALL CONTROLS BEHAVED AS REQUIRED" || echo "A CONTROL DID NOT BEHAVE: the check is not trustworthy" +exit $ok