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
aien-sovereign-core-mv / crates / aien-omega-gpu / tests / abi_manifest.rs
| 1 | // SPDX-License-Identifier: Apache-2.0 |
| 2 | // Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | |
| 16 | //! The Rust mirror of the omega GPU ABI (src/ffi.rs) must equal abi/omega_gpu.manifest, |
| 17 | //! field by field (offset, size, kind, order), constant by constant and signature by |
| 18 | //! signature. Runs in every build, the stub included. |
| 19 | |
| 20 | #[test] |
| 21 | fn rust_ffi_matches_the_manifest() { |
| 22 | let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("abi/omega_gpu.manifest"); |
| 23 | aien_abi_conformance::assert_manifest(&aien_omega_gpu::ffi::rust_abi(), &path); |
| 24 | } |
| 25 | |
| 26 | /// What this test binary linked, as `build.rs` recorded it. Prints one |
| 27 | /// `AIEN_NATIVE_IDENTITY {json}` line (scripts/abi-qualify.sh collects it). A linked build |
| 28 | /// must never report the stub, a stub build must never qualify, and with |
| 29 | /// `AIEN_ABI_QUALIFY=1` (the qualification run) the identity must qualify. |
| 30 | #[test] |
| 31 | fn native_identity_matches_the_link() { |
| 32 | let id = aien_omega_gpu::native_identity(); |
| 33 | println!("AIEN_NATIVE_IDENTITY {}", id.to_json()); |
| 34 | if cfg!(has_omega_gpu) { |
| 35 | assert_ne!(id.link, "stub", "{id:?}"); |
| 36 | assert!(id.digest != "none", "{id:?}"); |
| 37 | } else { |
| 38 | assert_eq!(id.link, "stub", "{id:?}"); |
| 39 | assert!(!id.qualifies()); |
| 40 | } |
| 41 | if std::env::var("AIEN_ABI_QUALIFY").as_deref() == Ok("1") { |
| 42 | assert!( |
| 43 | id.qualifies(), |
| 44 | "{} does not qualify: {:?}", |
| 45 | id.component, |
| 46 | id.gaps() |
| 47 | ); |
| 48 | } |
| 49 | } |