omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / docs / REPRODUCE.md
| 1 | # Reproduce the verified host results |
| 2 | |
| 3 | All commands are run from a checkout on Linux AArch64. No step requires the GPU |
| 4 | unless marked **window**. The three branches are: |
| 5 | |
| 6 | | Repo | Branch | |
| 7 | |---|---| |
| 8 | | `aien-dev/omega-mv` | `feat/max-interop-contracts` | |
| 9 | | `aien-dev/CUDApp` | `feat/max-artifact-export` | |
| 10 | | `aien-dev/omega-bridge` | `feat/gpu-interop` | |
| 11 | |
| 12 | Paths below assume sibling checkouts: `omega/`, `cudapp/`, `bridge/`. |
| 13 | |
| 14 | ## 0. Tools |
| 15 | |
| 16 | - `gcc`, `make`, `sha256sum`, `file`, `python3` (stdlib only for the oracle and |
| 17 | receipt tests). |
| 18 | - Omega seed compiler, checked by fingerprint |
| 19 | `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. Provide |
| 20 | it as `OMEGA_SEED=/path/to/omc`; the bridge worktree also uses `build/omc`. |
| 21 | - Optional independent readers: `nvdisasm`, `cuobjdump` (CUDA 13). |
| 22 | - MAX tests: a venv with `modular==26.7.0` (`MAXPY=/path/to/venv/bin/python`). |
| 23 | |
| 24 | ## 1. Contracts and oracle (no GPU) |
| 25 | |
| 26 | ```sh |
| 27 | cd omega |
| 28 | sh tools/max-interop/build.sh |
| 29 | python3 tests/max-interop/test_contracts.py |
| 30 | # 26/26; contract ids 647116fc… and 003696e4… |
| 31 | ``` |
| 32 | |
| 33 | Expected contract ids: |
| 34 | `matmul-bf16-v1` = `647116fc1ba1e1394982fc8ba181ce565293f160a6b56afc0f02b2128a675704`, |
| 35 | `gqa-causal-v1` = `003696e422bba7274877ba9e01a61076ea0f862f32760cbaa06c60f85a115359`. |
| 36 | |
| 37 | ## 2. Native artifact + cubin (no GPU) |
| 38 | |
| 39 | ```sh |
| 40 | cd cudapp |
| 41 | make -j8 test-native-artifact |
| 42 | ./tools/artifact_smoke.sh evidence/MAX-INTEROP/68 |
| 43 | ``` |
| 44 | |
| 45 | This builds `build/artifact-export`, exports the frozen matmul and attention |
| 46 | artifacts, and validates them with `nvdisasm`/`cuobjdump`. To recreate the |
| 47 | committed evidence: |
| 48 | |
| 49 | ```sh |
| 50 | ./build/artifact-export matmul --m 16 --k 16 --n 8 \ |
| 51 | --contract-id 647116fc1ba1e1394982fc8ba181ce565293f160a6b56afc0f02b2128a675704 \ |
| 52 | --out evidence/MAX-INTEROP/68/matmul-16x16x8 --commit <40-hex-source-commit> |
| 53 | ./build/artifact-export attention --q-heads 8 --kv-heads 1 \ |
| 54 | --contract-id 003696e422bba7274877ba9e01a61076ea0f862f32760cbaa06c60f85a115359 \ |
| 55 | --out evidence/MAX-INTEROP/68/attention-hd128-gqa8 --commit <40-hex-source-commit> |
| 56 | ``` |
| 57 | |
| 58 | ## 3. Envelope + C2 receipt (no GPU) |
| 59 | |
| 60 | ```sh |
| 61 | cd omega |
| 62 | sh tests/max-interop/build_receipt.sh |
| 63 | python3 tests/max-interop/test_envelope.py \ |
| 64 | --artifact ../../cudapp/evidence/MAX-INTEROP/68/matmul-16x16x8 \ |
| 65 | --fixture tests/max-interop/fixtures/matmul-v1.json |
| 66 | # 26/26; envelope 4b17c821…, receipt f13b1bff… |
| 67 | ``` |
| 68 | |
| 69 | The receipt uses the existing TEST key through `src/checker2/c2_receipt.c`; it |
| 70 | attests provenance only. `execution=NOT_RUN` is deliberate. |
| 71 | |
| 72 | ## 4. Bridge adapter (no GPU) |
| 73 | |
| 74 | ```sh |
| 75 | cd bridge |
| 76 | sh tools/build-gpu-adapter.sh |
| 77 | python3 tests/gpu/test_gpu_adapter.py \ |
| 78 | --artifact ../../cudapp/evidence/MAX-INTEROP/68/matmul-16x16x8 |
| 79 | # 49/49, ACCEPT/REFUSE coverage |
| 80 | ``` |
| 81 | |
| 82 | ## 5. Conformance harness (CPU smoke) |
| 83 | |
| 84 | ```sh |
| 85 | cd bridge |
| 86 | MAXPY=/path/to/venv/bin/python sh conformance/run.sh |
| 87 | # CONFORMANCE HARNESS PASS; device runs NOT_RUN |
| 88 | ``` |
| 89 | |
| 90 | ## 6. Authorized GPU window (not executed here) |
| 91 | |
| 92 | The coordinator holds `~/.local/state/aien-coordinator/CHIP-RESERVED`, so |
| 93 | `spark-window open` refuses. When a window is granted: |
| 94 | |
| 95 | ```sh |
| 96 | # 1. Load/run the exported cubin through the vendor loader. |
| 97 | cd cudapp |
| 98 | spark-window open maxinterop-cubin --ledger L679 --gb10 shared --quiet none --lease 10 |
| 99 | spark-window run ./build/cubin_probe evidence/MAX-INTEROP/68/matmul-16x16x8.cubin \ |
| 100 | omega_matmul_bf16 16 16 8 |
| 101 | spark-window close |
| 102 | |
| 103 | # 2. Stage A: Omega native, then MAX, in separate processes. |
| 104 | cd ../bridge |
| 105 | spark-window open maxinterop-stageA --ledger L679 --gb10 shared --quiet none --lease 10 |
| 106 | SPARK_WINDOW=$SPARK_WINDOW sh conformance/run.sh --device |
| 107 | spark-window close |
| 108 | ``` |
| 109 | |
| 110 | A GPU run must record its `SPARK_WINDOW` id; `verify.py` refuses a GPU result |
| 111 | without one. Do not use `--quiet none` for a reported speed; use the quiet lock |
| 112 | for measurements and keep all runs, including failures. |