Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-bridge/blob/main/AUDIT_SCOPE.md # omega-bridge Omega-first language interoperability: checked conversion backends and native language bindings Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-bridge / AUDIT_SCOPE.md` 226 lines · 15065 bytes Raw Blame History Source # Audit scope Written for an outside, independent security audit. Revision described: `2954d46866f9867dea6d62853f68273773f01805`, which is `main` at `4ad48c45` plus the conformance change that keeps the CPU run off the GPU, 2026-11-05. Everything below is taken from the repository's own files at that revision. Every command under "Run every test" was run from a clean clone of that revision on 2026-11-05; the logs, the exit-code table and the tool versions are in `evidence/audit/2026-11-05-2954d46/`. Items marked NOT_RUN were not executed. ## What this repository is Omega Bridge is a compiler written in Omega that emits executable C (GNU C11, POSIX) and Python 3 from a checked, bounded subset of Omega (ABI v0). `src/native.om` generates C bindings so C, C++, Python, Rust, Zig and Go can call machine code produced by the seeded Omega compiler (native call ABI v1 for OM-1 units and ABI v2 for OM-2 units, `docs/NATIVE-ABI.md`). `tools/native --freestanding` emits an AArch64 object with no hosted runtime for pure integer-scalar OM-1 units and, since #45, for OM-2 units without host effects (outputs `freest` and `fapic`). `tools/native --target x86linux` emits hosted x86-64 SysV Linux bindings from a separately pinned x86 compiler; that path is EXERCISED under emulation only (`evidence/native-x86-be8c5130.json`) and native x86-64 execution is NOT_RUN. `src/gpu_adapter.om` is an opt-in GPU adapter that negotiates and admits artifacts; it opens no device and converts no host program. `max-cpu/` runs an Omega kernel as a Modular MAX 26.7.0 CPU custom op (status EXERCISED on a host CPU; `evidence/MAX-CPU/README.md`). The default target is Linux AArch64. There is no C or Python input frontend. The Python under `tests/` and `conformance/` is test infrastructure and does not ship. Status: local differential tests and caller demos; independent review required before release. ## What to review, in priority order - `src/toc.om`. Lexer, type and name tables, typed expression nodes, and the C and Python emitters. Check that every runtime check in the source language (array bounds, signed overflow trap 1, division trap 2, shift trap 7, loop guards, 128-active-call limit) is emitted in both targets, that capacity exhaustion refuses with error 13, 14, 23 or 24 and writes no partial output, and that refused features (`docs/CAPABILITIES.md`) are refused. - `tools/bridge`. The shell entry point snapshots the input once, runs the pinned seed's whole-unit check, then generates from the same bytes, and refuses to run if `build/compiler.sha256` no longer matches. Check the snapshot cannot be swapped (time of check to time of use) and that output reaches stdout only after success. - `src/native.om` and `docs/NATIVE-ABI.md`. Generated C bindings for foreign callers: argument and length marshalling, aliasing of inputs and results, stack size requirement (eight MiB), BTI on C callers. - `src/gpu_adapter.om` and `docs/GPU-ADAPTER.md`. A `key=value` wire protocol on stdin/stdout. Check that unknown, duplicate or out-of-order keys are refused, that `REFUSE` is final, and that the adapter never returns a device pointer, address or handle. - `tools/bootstrap.sh`, `tools/build.sh`, `tools/build-gpu-adapter.sh`. Supply chain: fetch of the pinned Omega commit, seed growth, fixpoint check, and sha256 enforcement of `OMEGA_SEED`. - `tools/run-device-window.sh` and `conformance/`. Device-run wrapper (AGENTS.md: never resets the GPU, changes the driver or touches a serving process) and the Omega versus Modular MAX conformance test suite. - Test integrity: `tools/test.sh`, `tests/differential.py`, `tests/refusals.py`, `tests/attachments.py`, `tests/controls.py`, `tests/robustness.py`, `tests/native/run.sh`, `tests/native/v2/run.sh` (ABI v2 and freestanding), `tests/native/kinds.sh` (f32 and ushort array kinds), `tests/native/test_freestanding.py`, `tests/native/x86/run.sh` (x86linux, EMULATED), `tests/native/test_build_failures.sh`, `tests/gpu/test_gpu_adapter.py`, `max-cpu/run.sh` and `max-cpu/test_run_evidence.py`. `.github/workflows/ci.yml` (added by the audit-readiness change) replays the compiler from source with `tools/bootstrap.sh` and runs `sh tools/test.sh` on a GitHub-hosted arm64 runner; `tests/gpu` stays NOT_RUN there. A second job publishes an SPDX SBOM artifact. Every action is pinned by commit sha and the token is read-only. ## Trust boundaries - Untrusted input: the `.om` source given to `tools/bridge` (size limit in `docs/CAPABILITIES.md`), requests on the GPU adapter's stdin, and arguments passed by foreign callers to generated bindings. - Trusted: the pinned seed compiler (sha256 enforced) and the Omega source commit it grows from; the C compiler and Python interpreter that consume generated output. - The README tells users to inspect generated output before linking or importing it. Conversion writes isolated temporary build files and never installs or replaces an application. - Isolated: the GPU adapter has no daemon, no environment hook, no network, no telemetry and no install path. ## Threat model summary - Assets: the safety properties of the Omega source (bounds, overflow, loop guards) carried into generated C and Python; the integrity of the compiler chain; callers' memory. - Attackers considered: a hostile or malformed `.om` input; a hostile GPU adapter request; a substituted seed compiler; byte-prefix truncations and capacity-exhausting sources (225 cases in `tests/robustness.py` per `evidence/README.md`). - Defended: whole-unit validation before either backend; refusal instead of partial output; pinned compiler digests; checked bounds in generated code; differential testing of native vs C (UBSan) vs Python, with AddressSanitizer on bounds mutants. - Not defended / explicitly out of scope (from the repository's own text): no independent checker2 receipt, independent compiler audit, diverse double compilation, cross-architecture verification, installer or public-release qualification; the bootstrap fixpoint is not DDC; native and generated stack exhaustion thresholds differ; Python uses its host heap; no speedup claim; GPU hardware execution NOT_RUN. ## Build from source at a pin Needs Linux AArch64, `git`, `sh`, `file`, `sha256sum`, `gcc` and `python3`. The bootstrap uses no C compiler, assembler or linker. - Omega source commit (`docs/PROVENANCE.md`): `29b12760f4c962606411d6bf25032aedef063301`. - Bootstrap seed `build/bootstrap/omc` sha256: `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. - Seeded compiler for native call tests (`OMEGA_NATIVE_OMC`, omega-mv `seed/out/omc`) sha256: `734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61`. ``` sh tools/bootstrap.sh # ends with: bootstrap fixpoint RC=0 tools/build.sh # builds build/bridge from src/toc.om ``` `OMEGA_SOURCE` may point at an existing Omega checkout (read only); otherwise the bootstrap needs network access to the upstream repository. On a shared build host the README prefixes commands with `quiet-build`; without it, run the scripts directly. ## Run every test Each command below lists every environment variable it reads; the values CI uses are in `.github/workflows/portable.yml`. `OMC` is omega-mv `seed/out/omc` (sha256 `734f0a39…`, the `PIN` line of `tools/native`), `OMC2` is omega-mv `hoist/865-main` @ `7286d61d` (`07820046…`), `HOST_OMC2` is #1008 @ `2992a68b` (`c000ec02…`), `XOMC` is the x86 compiler (the `X86_PIN` line, `be8c5130…`), and `SOMC` is the seeded compiler for `tests/seeded*.py` and `tests/freest.py` (omega-mv `e5b32567`, `2c824805…`). The three native-v2 compiler roles are digest-checked. `DEVICE_OMC2` is the context-format compiler (`6d1b1cf5…`); `DEVICE_SOURCE` is its `seed/omc/omc.om`, checked by rebuilding the fingerprint. Exact pins and seed-only rebuilds: AArch64 qualification . On the shared Spark, run every command below inside `bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10`. ``` tools/test.sh python3 tests/attachments.py OMEGA_NATIVE_OMC=$OMC sh tests/native/run.sh OMEGA_NATIVE_OMC=$OMC OMEGA_NATIVE_OMC2=$OMC2 OMEGA_NATIVE_HOST_OMC2=$HOST_OMC2 OMEGA_NATIVE_DEVICE_OMC2=$DEVICE_OMC2 OMEGA_NATIVE_OMC2_SOURCE=$DEVICE_SOURCE sh tests/native/v2/run.sh python3 tests/native/v2/test_verdict.py OMEGA_NATIVE_OMC=$OMC sh tests/native/kinds.sh OMEGA_NATIVE_OMC=$OMC sh tests/native/g1/run.sh OMEGA_NATIVE_OMC=$OMC OMEGA_NATIVE_X86_OMC=$XOMC QEMU_X86_64=/path/to/qemu-10.0.14/qemu-x86_64 \ OMEGA_NATIVE_X86_PYTHON=/path/to/x86/python3.12 OMEGA_NATIVE_X86_LIBPATH=/path/to/x86/python/lib \ sh tests/native/x86/run.sh OMEGA_NATIVE_OMC=$OMC ZIG=/path/to/zig GO=/path/to/go sh tests/native/test_build_failures.sh OMEGA_NATIVE_X86_BAD_QEMU=/path/to/qemu-8.2.2/qemu-x86_64 \ python3 tests/native/x86/test_build_failures.py OMEGA_SEEDED_OMC=$SOMC OMEGA_SEED=build/bootstrap/omc python3 tests/seeded.py OMEGA_SEEDED_OMC=$SOMC python3 tests/seeded_float.py OMEGA_SEEDED_OMC=$SOMC OMEGA_SEED=build/bootstrap/omc FREEST_CUDAPP_ROOT=/path/to/CUDApp \ python3 tests/freest.py CC=x86_64-linux-gnu-gcc FREEST_RUNNER='qemu-x86_64 -L /usr/x86_64-linux-gnu' \ python3 tests/freest.py OMEGA_SEEDED_OMC=$SOMC OMEGA_SEED=build/bootstrap/omc python3 tests/freest_views.py OMEGA_SEED=build/bootstrap/omc sh tools/build-gpu-adapter.sh python3 tests/gpu/test_gpu_adapter.py MAXPY=/path/to/venv/bin/python conformance/run.sh # needs ../../cudapp built: make all python3 max-cpu/test_run_evidence.py MAXPY=/path/to/venv/bin/python OMEGA_REPO=/path/to/omega-mv max-cpu/run.sh conformance/run.sh --device tools/run-device-window.sh --ledger ``` - `tests/native/run.sh` prints `NATIVE-CALL PASS` only after all seven required callers build and run; a missing toolchain prints NOT_RUN and exits nonzero. - `tests/native/v2/run.sh` covers ABI v2 (OM-2) bindings and the `--freestanding` objects (`tests/native/test_freestanding_om2.py`, step 10b) and host-word gating (section 11). Without any required compiler role it exits 2. All three roles are required; the current paired-compiler PASS is in `evidence/native-v2-compiler-profile/`; the older audit receipt predates these gates. - `tests/native/x86/run.sh` and its controls are EMULATED only; physical x86-64 is NOT_RUN. The suite refuses a QEMU that fails its `/proc/self/maps` and signal-frame probes; Ubuntu's QEMU 8.2.2 is the known-bad oracle used by the refusal control. - `conformance/run.sh` without `--device` runs the CPU fixtures with `CUDA_VISIBLE_DEVICES=` and `conformance/max_runner.py` refuses (exit 2) a CPU run that can see an accelerator. Before `2954d46` the CPU run used whatever GPU was visible. `conformance/build.sh` exits 1 with `CUDApp library missing` unless the sibling CUDApp (`CUDAPP`, default `../../cudapp`) is built. - `max-cpu/run.sh` needs `OMEGA_REPO`, an omega-mv clone containing `55f9b0af` and `ec07d25d`. `max-cpu/mogg-cache-repro.sh` is an observation script, not a test. - `conformance/run.sh --device` and `tools/run-device-window.sh` need the NVIDIA GB10 on a DGX Spark inside an authorized window. Results from a clean clone of `2954d46` on 2026-11-05 (Linux AArch64 host, rustc 1.98.1, Go 1.27.3, Zig 0.13.0, GCC 13.3.0, MAX 26.7.0; `evidence/audit/2026-11-05-2954d46/`): Command Exit Final line `tools/test.sh` 0 `ALL SUITES RC=0` (113 + 50 + 2 + 7 + 225 = 397 cases, 0 failures) `tests/attachments.py` 0 `attachment cases=2 failures=0 RC=0` `tests/native/run.sh` 0 `NATIVE-CALL PASS (not run: none)` `tests/native/v2/run.sh` 0 `NATIVE-V2 PASS (not run: none)` `tests/native/v2/test_verdict.py` 0 5 tests OK `tests/native/kinds.sh` 0 `NATIVE-KINDS PASS` `tests/native/g1/run.sh` 0 `G1-CALC PASS (not run: none)` `tests/native/x86/run.sh` 0 `NATIVE-X86 EMULATED PASS`; native x86 NOT_RUN `tests/native/test_build_failures.sh` 0 `PASS native callers: Zig and Go built and executed` `tests/native/x86/test_build_failures.py` 0 `NATIVE-X86 CONTROLS PASS (EMULATED; native x86 NOT_RUN)` `tests/seeded.py` 0 `SEEDED CONVERTER differential C/Python/native/x86 and pin/arithmetic/ABI controls PASS; device NOT_RUN` `tests/seeded_float.py` 0 `PASS seeded binary32 byte differential; …` `tests/freest.py`, AArch64 and x86 user-mode 0, 0 `PASS direct structural converter refusals …` `tools/build-gpu-adapter.sh`, `tests/gpu/test_gpu_adapter.py` 0, 0 `{"checks": 47, "fail": 0}` `conformance/run.sh` 0 `CONFORMANCE HARNESS PASS`; device runs NOT_RUN `max-cpu/test_run_evidence.py`, `max-cpu/run.sh` 0, 0 `OMEGA MAX CPU: PASS (controls green, negatives red as expected)` `conformance/run.sh --device`, `tools/run-device-window.sh` — NOT_RUN (GPU window not authorized for this refresh) ## Known limitations and NOT_RUN - Capacity limits: 32 functions, four parameters, eight globals (texts included), 32,768 decoded text bytes, eight-character names, 4,194,304 bytes of output, 32 KiB local arrays per function. - Read-only text constants convert in the baseline `tools/bridge` only (`tests/text.py`); inline text literals, floats, heap, concurrency, external calls and other targets are refused. - Native differential tests share the seed's checker; they are not independent frontends (`docs/PROVENANCE.md`). - Intermediate red logs in `evidence/` are development traces; the final qualification is the final manifest plus final gate output. - GPU hardware load and execution: NOT_RUN (`docs/GPU-SUPPORT-MATRIX.md`). ## Dependencies and provenance - No lockfile. No compiler binary is committed; the bootstrap rebuilds it from source. - `src/toc.om` was recovered from omega `seed/toc/toc.om` at the pinned commit; original digest in `docs/RECOVERY.json`. Inherited fixtures come from omega `seed/rung4/tests/` at the same commit. - Test oracles: GCC with UBSan and ASan, Python 3, Modular MAX for conformance and `max-cpu/`, the Rust, Zig, Go and C++ caller toolchains, `x86_64-linux-gnu-gcc`, the QEMU 10.0.14 x86 user-mode oracle and the sibling CUDApp build. They do not ship. - External services: GitHub fetch of the pinned Omega commit at bootstrap; Python package index for the MAX venv, if built. ## Evidence Raw logs and manifests live in `evidence/` (numbered red and green logs, `manifest.json`, `differential-results.json`, `control-results.json`, `files.sha256`, `native-call-v1/`, `MAX-INTEROP/`, and the clean-clone runs of this document in `audit/2026-11-05-2954d46/`). AGENTS.md: keep the failing log beside the passing one, and never rewrite an existing evidence log. Cross-repository receipts, where filed, belong under `aien-dev/aien-receipts` `omega-bridge//`; whether any exist is unknown from the repository. Receipts are append-only and never edited.