interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / docs / abi-qualification / INVENTORY.md

97 lines · 8676 bytes Raw Blame History Rendered
1# Omega and AIEN ABI qualification: inventory (2026-10-11)
2
3Scope: mission sections 4 to 10 (`~/handoffs/2026-10-11-abi-qualification-mission.md`).
4Sources read at: omega `6c6180cf` (omega.lock; ABI headers identical to omega main `82f31173`),
5physics `6d7cf0d4`, aienos `b84c0a67` (omega aienos.lock) and aienos main `3b2004b6`,
6sovereign-core main `bd438bcc`. Tags: **implemented** (true before this work), **fixed here**
7(defect or gap closed by the abi-qual PRs), **partial**, **missing**, **unnecessary**.
8`sc` = this repository, `om` = omega, `ao` = aienos.
9
10## Boundaries
11
12| Boundary | Producer | Consumer | Linked into production |
13|---|---|---|---|
14| rxc_host v2 (composition facade) | om `src/runtime/rxc_host_abi.h`, `.c`; archive `librx_compose.a` (`mk/rx_compose_lib.mk`) | sc `crates/aien-omega-compose` | yes (aien-runtime, aien-cli) |
15| omega GPU engine | om `src/omega_gpu_{matmul_api,session,serving,elementwise_api,attention_api}.h`; `libomega_gpu.a` | sc `crates/aien-omega-gpu`, used by `aien-inference-abi` | yes on the GB10 build |
16| AIENOS capability authority (C, 64-bit generation) | ao `native/capability/aienos_capability.h` | om `src/runtime/aienos_cap.h` (hand copy), merged into `librx_compose.a` | yes, through librx_compose.a |
17| AIENOS capability (Rust, 32-bit generation) | ao `crates/aienos-capability-ffi` | nothing in sc, om or ao links it (grep, 2026-10-11) | no |
18
19## Section 4: ABI compatibility (rxc_host and GPU)
20
21| Item | Before | Now | Evidence |
22|---|---|---|---|
23| 4.1 size and alignment | partial: rxc_host checks version + 4 sizes at open (om `rxc_host_abi.c:458-465`, sc `aien-omega-compose/src/lib.rs:238`); GPU none | fixed here | manifests `crates/*/abi/*.manifest` (`struct Name size align`), C probe `sizeof`/`_Alignof` in build.rs |
24| 4.2 offsets and order | missing (size only; an equal-size reorder passed) | fixed here | manifest `field` lines in order; header parse checks names and order; test `c_side.rs` equal-size reorder |
25| 4.3 widths and signedness | missing | fixed here | C11 `_Generic` kind per field and per constant; tests width + signedness |
26| 4.4 enum representation | unnecessary as a type: rxc_host enums are anonymous constant lists and every mirrored function takes and returns plain integers; the one typed enum (`OmegaGpuEwOp`, om `omega_gpu_elementwise_api.h:57-88`) appears only in functions Rust does not mirror | values checked as constants | `const` lines (RXC_HOST_E_*, OMEGA_GPU_RC_*) |
27| 4.5 bool representation | unnecessary: no `bool` field or parameter crosses; flags are u32 | guarded | kind check refuses bool vs u8 (test `bool_to_u8`) |
28| 4.6 function pointers, calling convention | partial: typed `extern "C"` only | fixed here | `fnptr` + `fn` signature lines from header prototypes; tests param + callback change |
29| 4.7 pointer validity, ownership | implemented: safe wrappers own buffers, check lengths before FFI | kept; GPU `pool` param drift fixed (`*const u8` vs `const void *`) | sc `aien-omega-gpu/src/ffi.rs`, found by the C check |
30| 4.8 buffer lengths, overflow | partial: GPU length checks multiplied `usize` unchecked (wraps in release) | fixed here | `prod()` sc `aien-omega-gpu/src/lib.rs:121`; test `overflowing_shapes_are_refused_before_ffi` (red on main: overflow panic at lib.rs:745) |
31| 4.9 callback lifetime, concurrency, cancellation | implemented: boxes live until `rxc_host_close` returns, close stops workers (sc lib.rs:480-485, om rxc_host_abi.c:448-452); slot table under `g_mu` (om :290) | tested here | `tests/callbacks.rs` 12 open/close cycles (> 4 slots), 3 concurrent homes |
32| 4.10 panic and error propagation | implemented: `catch_unwind` in both trampolines (sc lib.rs:218, 232); release `panic = "abort"` (sc Cargo.toml:64) so no unwind reaches C in either profile | strengthened: null `result`/`ctx` refused | `tests/callbacks.rs` panicking Skill and verifier |
33| runtime negotiation | rxc_host version + sizes before any other call | kept, unchanged | no new producer descriptor needed: the build-time C check covers layout fully |
34
35## Section 5: handwritten drift
36
37Implemented here: one checked-in manifest per boundary, checked from both sides
38(`crates/aien-abi-conformance`). Rust side: the `abi_struct!`/`abi_externs!`/`abi_fnptr!`/
39`abi_consts!` declarations render a manifest compared with the file in every `cargo test`
40(stub CI included). C side, in build.rs before linking: header parse, compiled layout probe,
41`nm` symbol list. No binding generator, no new external dependency (needs `cc` and `nm`,
42already required). Results on the Spark: compose 4 structs, 13 functions, 2 callback types,
4395 facts; GPU 6 structs, 31 functions, 108 facts; all match. Twelve synthetic drift tests
44(`crates/aien-abi-conformance/tests/c_side.rs`) cover reorder, width, signedness, bool,
45parameter, callback, version constant, removed field, missing symbol, truncated archive,
46missing struct.
47
48## Section 6: AIENOS capability
49
50Ruling: two separate implementations that exported the same 17 `aienos_cap_*` symbols with
51incompatible `AienosCapRef` layouts (C 16 bytes, 64-bit generation; Rust 8 bytes, 32-bit).
52Not linked together today, but interchangeable by link order. aienos `abi-qual/cap-width`
53renames the Rust exports to `aienos_cap32_*`, adds `aienos_cap32_abi_layout`, pins the C
54layout with `_Static_assert`, adds a symbol-isolation and negative-link script, and fixes a
55Rust restart defect (generation reuse after restart, already fixed in C by b1fa747).
56Generations were not widened. omega `abi-qual/aienos-cap-conformance` checks
57`src/runtime/aienos_cap.h` against the pinned aienos header (25 layout facts, 27
58declarations, 8 refused mutants). Stale ref, recycled slot, exhaustion, unauthorized use:
59C side implemented before (`ao native/capability/capability_test.c`); Rust side fixed there.
60
61## Section 7: native artifact identity
62
63| Item | Before | Now |
64|---|---|---|
65| omega.lock checkout check | implemented (compose build.rs, GPU build.rs) | kept |
66| prebuilt `*_LIB` | accepted with no digest | fixed: `*_LIB_SHA256` required and matched, every manifest function must be defined; identity `prebuilt`, never qualifies |
67| stub under `AIEN_REQUIRE_NATIVE_LIBS=1` | `AIEN_FORCE_CPU_STUB=1` silently won | fixed: refused |
68| expected vs actual digest | missing | fixed: `native-artifacts.lock` (archive, omega sha, target, cc version, sha256); mismatch fails the build, unlisted combination warns and does not qualify |
69| provenance in the binary | missing | fixed: `native_identity()` in both crates (link kind, ABI result, digest state, archive sha256, omega, aienos.lock, physics.lock, target, cc) |
70| sovereign-core commit, flags, tools | missing | `scripts/abi-qualify.sh` evidence.json |
71
72## Section 8: safe cross-language execution
73
74Implemented before and confirmed: no unwind across C (catch_unwind + release abort);
75callback contexts outlive close; `Compose` is `Send` not `Sync` (sc lib.rs:196);
76`ResidentTensor` is `Send` not `Sync` and held in a `Mutex` (sc aien-omega-gpu lib.rs:248-261,
77aien-inference-abi resident.rs:36); omega serializes GPU calls with the session lock
78(om `omega_gpu_session.c:28,67`). Fixed here: null result pointer in the Skill trampoline,
79usize overflow in length checks. Noted, not changed: `check_pool` checks only
80`pool.len() >= pool_bytes` and trusts omega for stride bounds (sc lib.rs:939);
81`rxc_host_set_wait_ms` returns `RX_ERR_ARG`, not `RXC_HOST_E_ARG` (om rxc_host_abi.c:338-339;
82both are -1 (om `rx_world.h:117`, `rxc_host_abi.h` RXC_HOST_E_ARG), so callers see the right code).
83
84## Sections 9 and 10: tests, CI, entry point
85
86Covered by tests: compatible pinned build, version mismatch, equal-size reorder, signature
87change, wrong prebuilt hash, wrong omega commit, missing symbol, truncated archive, callback
88failure and panic, invalid lengths and overflow, repeated init/destroy, concurrent
89callbacks, explicit stub, required-native with no library (`scripts/test-native-identity.sh`,
9016 cases, in the required CI job), CPU vs GPU path identity (`native_identity()`), GPU
91parity (existing chip suites, run by `scripts/abi-qualify.sh --chip`).
92Entry point: `scripts/abi-qualify.sh [--chip]`, exit 0 PASS, 1 FAIL, 2 INCOMPLETE.
93Registered in the local verification gates (ADR 0033): `tests/gates/sc-native-identity.gate`
94(step `native-identity` in `tests/gates/run.sh`), and `native-artifacts.lock` is an input of
95SC-TEST and SC-LINKED-COMPOSE. Partial: the GB10 part of `abi-qualify.sh --chip` stays an
96operator run with its own evidence.json (no GB10 gate class exists in the manifests yet).
97Not wired: the GPU C-side check on hosted CI (the GPU archive builds only on the Spark).