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/aien-sovereign-core-mv/patches/be6bb6d263bc4459 # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aien-sovereign-core-mv#375 (code only) closed derived `be6bb6d263bc4459` #375 Imported from GitHub aien-dev/aien-sovereign-core-mv#375 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `c6db48b42543bba95c529749804576a5c5006df9` · Head `b21df2300929757b208998c8c2989616370873ee` ### Apply it ``` git checkout -b patch-be6bb6d263bc4459 c6db48b42543bba95c529749804576a5c5006df9 curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/be6bb6d263bc4459.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aien-sovereign-core-mv 375 b21df2300929757b208998c8c2989616370873ee ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":375,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/375","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:59Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 65ffbd64..efbb9485 100644 --- a/.crumb +++ b/.crumb @@ -64,8 +64,8 @@ "generated": { "children": [ { - "digest": "3f8234691c53c0a0dc36cf6c7848a3006fbeb6b23fc71a77d7c9ad3c35d82323", - "last_commit": "885e42f", + "digest": "8f8e6711a2369bd507758796628aef121a2426011f68d13f58f5b414f0e19af3", + "last_commit": "9052fe3", "name": "scripts", "purpose": "" }, @@ -76,15 +76,15 @@ "purpose": "" } ], - "children_root": "sha256:6125449db449f5c3431e63c5bf8b20022665a7ea6c635c0f884c8f1e5c0e8ee2", - "compiled_at": "2026-10-10T03:33:50Z", + "children_root": "sha256:579fdac7b333de165168a61d3198f109b92dc0e2973a8d40ed615a07c56d7e1f", + "compiled_at": "2026-10-10T03:55:24Z", "compiler": "crumb-compile/1", - "digest": "sha256:efe464f0d5fa3f0771886b952d47abca6a9e3ad9ec8fc08f22f682bc5db90e06", + "digest": "sha256:38cb86c9f992536e9f5ccfd3b1fb40d825ecb375974e30ed81d056c06493c1d1", "evidence_files": 187, "evidence_root": "sha256:27ee0353cb4d4aae2b7dbce2bfe0d9f4ef2a94cd7a4555b84684d59372503280", - "files": 1849, - "generated_at_commit": "ce3eeefda945730991b3bbcac7e81934ddde7fa5", - "source_tree": "sha256:41f96f74bc9dcab6ac6c0972b346f673b01f1f4b1ed3eb2b404d9e6eb0e9db4e" + "files": 1851, + "generated_at_commit": "9052fe3fd075386dafa45cb5e06acd46c95b9d01", + "source_tree": "sha256:35b0206be0b5122cdf42b04c6bf158d0efd828c1a32dcb314a3ccfdcca6796ff" } }, "history": [], diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49a68b7e..1ca242e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,9 @@ jobs: - name: Release gate negative tests (pins, digests, model inputs, signatures) run: bash scripts/test-release-checks.sh + - name: Pin materializer self-test (scripts/pins.sh, offline) + run: bash scripts/test-pins.sh + - name: Verify Piped Installer Bootstrap run: bash scripts/test-install.sh diff --git a/crates/aien-omega-compose/build.rs b/crates/aien-omega-compose/build.rs index 45569c97..364bcabf 100644 --- a/crates/aien-omega-compose/build.rs +++ b/crates/aien-omega-compose/build.rs @@ -30,6 +30,7 @@ fn main() { "AIEN_OMEGA_COMPOSE_SHA", "AIEN_PHYSICS_DIR", "AIEN_AIENOS_LOCK_REPO", + "AIEN_REQUIRE_NATIVE_LIBS", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -71,6 +72,11 @@ fn main() { let Ok(dir) = std::env::var("AIEN_OMEGA_COMPOSE_DIR").or_else(|_| std::env::var("AIEN_OMEGA_DIR")) else { + // See aien-omega-gpu/build.rs: AIEN_REQUIRE_NATIVE_LIBS=1 refuses the stub. + assert!( + std::env::var("AIEN_REQUIRE_NATIVE_LIBS").as_deref() != Ok("1"), + "aien-omega-compose: AIEN_REQUIRE_NATIVE_LIBS=1 but no AIEN_OMEGA_COMPOSE_DIR, AIEN_OMEGA_DIR or AIEN_OMEGA_COMPOSE_LIB is set (run scripts/pins.sh and source target/pins/env.sh)" + ); println!("cargo:warning=aien-omega-compose: no AIEN_OMEGA_COMPOSE_DIR, AIEN_OMEGA_DIR or AIEN_OMEGA_COMPOSE_LIB, building the stub"); return; }; diff --git a/crates/aien-omega-gpu/build.rs b/crates/aien-omega-gpu/build.rs index 538f641c..325f8590 100644 --- a/crates/aien-omega-gpu/build.rs +++ b/crates/aien-omega-gpu/build.rs @@ -19,6 +19,7 @@ fn main() { "AIEN_OMEGA_GPU_LIB", "AIEN_OMEGA_DIR", "AIEN_PHYSICS_DIR", + "AIEN_REQUIRE_NATIVE_LIBS", ] { println!("cargo:rerun-if-env-changed={v}"); } @@ -48,6 +49,13 @@ fn main() { return; } let Ok(dir) = std::env::var("AIEN_OMEGA_DIR") else { + // AIEN_REQUIRE_NATIVE_LIBS=1 (set by scripts/pins.sh env.sh) turns the silent + // stub fallback into a build error: a release or receipt build must never + // discover at run time that it carries the CPU stub (sovereign-core #92). + assert!( + std::env::var("AIEN_REQUIRE_NATIVE_LIBS").as_deref() != Ok("1"), + "aien-omega-gpu: AIEN_REQUIRE_NATIVE_LIBS=1 but neither AIEN_OMEGA_DIR nor AIEN_OMEGA_GPU_LIB is set (run scripts/pins.sh --gpu and source target/pins/env.sh)" + ); println!("cargo:warning=aien-omega-gpu: no AIEN_OMEGA_DIR or AIEN_OMEGA_GPU_LIB, building the CPU stub"); return; }; diff --git a/docs/release/BUILD_RECIPE.md b/docs/release/BUILD_RECIPE.md index 6c4f9bf7..b723af04 100644 --- a/docs/release/BUILD_RECIPE.md +++ b/docs/release/BUILD_RECIPE.md @@ -5,6 +5,18 @@ checks all use the same commands. ## Build +One command materializes every pin a native build needs (sovereign-core #92, "clean checkout plus one command"): + +``` +scripts/pins.sh --gpu # omega at omega.lock, physics and aienos at omega's locks, under target/pins +. target/pins/env.sh # AIEN_OMEGA_DIR, AIEN_OMEGA_COMPOSE_DIR, AIEN_PHYSICS_DIR, AIEN_AIENOS_LOCK_REPO, AIEN_REQUIRE_NATIVE_LIBS=1 +``` + +Without `--gpu` only the composition library is linked (the CI gate shape). `scripts/pins.sh --check` verifies the +three checkouts are at their pins without touching the network. `AIEN_REQUIRE_NATIVE_LIBS=1` makes a build that +would silently fall back to a CPU stub fail instead; `scripts/golden_path.sh` sources `target/pins/env.sh` when +present. `scripts/test-pins.sh` is the offline self-test (throwaway repositories, no network). + `scripts/release-build.sh` (needs the pinned toolchain from `rust-toolchain.toml`, `cargo fetch --locked` into the CARGO_HOME in use, and for the native engine `AIEN_OMEGA_DIR` at `omega.lock` and `AIEN_PHYSICS_DIR` at omega's `physics.lock`; `AIEN_DEV_FALLBACK` and `AIEN_FORCE_CPU_STUB` unset, no mojo on PATH): diff --git a/scripts/.crumb b/scripts/.crumb index f5952761..81fb06bc 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -4,14 +4,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-10T01:38:15Z", + "compiled_at": "2026-10-10T03:55:24Z", "compiler": "crumb-compile/1", - "digest": "sha256:3f8234691c53c0a0dc36cf6c7848a3006fbeb6b23fc71a77d7c9ad3c35d82323", + "digest": "sha256:8f8e6711a2369bd507758796628aef121a2426011f68d13f58f5b414f0e19af3", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 25, - "generated_at_commit": "6ee431581c8eea3525d3d338ab9a897e334c843f", - "source_tree": "sha256:b28ab631314c8dc90343fb7e687cebec75edf3f3732f10858c3d7c70ea018fee" + "files": 27, + "generated_at_commit": "9052fe3fd075386dafa45cb5e06acd46c95b9d01", + "source_tree": "sha256:190fa8652d4640bd83fa4ebb44b292cd744557bc7717dc456290d53ef38f5a17" } }, "parent": { diff --git a/scripts/golden_path.sh b/scripts/golden_path.sh index f8611647..663945fe 100755 --- a/scripts/golden_path.sh +++ b/scripts/golden_path.sh @@ -1,4 +1,14 @@ -#!/usr/bin/env bash +if [ "$SKIP_BUILD" -eq 0 ] || [ ! -x "$BIN" ]; then + echo "== Building release binary ==" + # Step 1 of the gate is "clean checkout, one command": scripts/pins.sh --gpu writes + # target/pins/env.sh so the real omega libraries link (sovereign-core #92). Without it + # the build carries the CPU stubs and step 2 (GB10) cannot pass. + if [ -f "$REPO_ROOT/target/pins/env.sh" ]; then + # shellcheck disable=SC1091 + . "$REPO_ROOT/target/pins/env.sh" + else + echo "WARNING: no target/pins/env.sh (run scripts/pins.sh --gpu first); building with the CPU stubs" + fi#!/usr/bin/env bash # AIEN 0.1 Native Golden Path acceptance harness. # Executes the 10-step release gate from docs/NATIVE_GOLDEN_PATH.md against a # freshly booted daemon and prints one verdict line per step. diff --git a/scripts/pins.sh b/scripts/pins.sh new file mode 100755 index 00000000..a9e2c429 --- /dev/null +++ b/scripts/pins.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash +# pins.sh: materialize the three pinned checkouts a native (no CUDA) build needs, +# exactly as CI does (ci.yml "Linked composition tests"), so a clean clone plus one +# command yields the real omega libraries instead of the CPU stubs (sovereign-core #92). +# +# omega at omega.lock (this repository) +# physics at omega's physics.lock +# aienos at omega's aienos.lock (authority source for the composition library) +# +# Usage: scripts/pins.sh [--gpu] [--check] [DIR] +# DIR where the checkouts live (default target/pins). Existing clones are reused; +# the network is touched only when a clone is missing or not at its pin. +# --gpu env.sh also sets AIEN_OMEGA_DIR, which links the GB10 engine (aien-omega-gpu). +# Without it only the composition library (CPU) is linked, as the CI gate does. +# --check verify only: every clone present and at its pin, no network, no writes. +# Writes DIR/env.sh. Then: . target/pins/env.sh && cargo build --release +# Env: AIEN_PINS_REMOTE_BASE (default https://github.com/aien-dev; a local mirror directory +# works too), AIEN_PINS_ROOT (repository root override, used by scripts/test-pins.sh). +# Exit: 0 ok, 2 usage, 3 a checkout is not at its pin (or missing under --check), 4 git failed. +set -euo pipefail +ROOT="${AIEN_PINS_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)}" +BASE="${AIEN_PINS_REMOTE_BASE:-https://github.com/aien-dev}" +GPU=0; CHECK=0; DIR="" +for a in "$@"; do + case "$a" in + --gpu) GPU=1 ;; + --check) CHECK=1 ;; + -h|--help) sed -n '2,20p' "$0"; exit 0 ;; + -*) echo "pins.sh: unknown flag $a" >&2; exit 2 ;; + *) [ -z "$DIR" ] || { echo "pins.sh: one DIR only" >&2; exit 2; }; DIR="$a" ;; + esac +done +DIR="${DIR:-$ROOT/target/pins}" +mkdir -p "$DIR" 2>/dev/null || true; DIR="$(cd "$DIR" 2>/dev/null && pwd || echo "$DIR")" +die() { echo "pins.sh: $*" >&2; exit 3; } +sha_of() { tr -d '[:space:]' < "$1"; } +is_sha() { [[ "$1" =~ ^[0-9a-f]{40}$ ]]; } +head_of() { git -C "$1" rev-parse HEAD 2>/dev/null || true; } +# place NAME SHA: make DIR/NAME a clone at SHA (detached), fetching only when needed. +place() { + local name="$1" sha="$2" + local d="$DIR/$name" + is_sha "$sha" || die "$name pin is not a full 40-hex sha: '$sha'" + if [ "$(head_of "$d")" = "$sha" ]; then echo "pins: $name at $sha (present)"; return 0; fi + [ "$CHECK" -eq 0 ] || die "$name is not at $sha under --check (have '$(head_of "$d")', dir $d)" + mkdir -p "$DIR" + if [ ! -d "$d/.git" ]; then + echo "pins: cloning $name from $BASE" + git clone -q "$BASE/$name" "$d" || { echo "pins.sh: clone of $name failed" >&2; exit 4; } + fi + if ! git -C "$d" cat-file -e "$sha^{commit}" 2>/dev/null; then + git -C "$d" fetch -q origin "$sha" || git -C "$d" fetch -q origin || { echo "pins.sh: fetch of $name failed" >&2; exit 4; } + fi + git -C "$d" checkout -q --detach "$sha" || { echo "pins.sh: checkout of $name@$sha failed" >&2; exit 4; } + [ "$(head_of "$d")" = "$sha" ] || die "$name HEAD is not $sha after checkout" + echo "pins: $name at $sha" +} +[ -f "$ROOT/omega.lock" ] || die "no omega.lock under $ROOT" +place omega "$(sha_of "$ROOT/omega.lock")" +[ -f "$DIR/omega/physics.lock" ] || die "omega checkout has no physics.lock" +[ -f "$DIR/omega/aienos.lock" ] || die "omega checkout has no aienos.lock" +place physics "$(sha_of "$DIR/omega/physics.lock")" +place aienos "$(sha_of "$DIR/omega/aienos.lock")" +if [ "$CHECK" -eq 0 ]; then + { + echo "# written by scripts/pins.sh; source it before cargo build/test" + echo "export AIEN_OMEGA_COMPOSE_DIR='$DIR/omega'" + echo "export AIEN_PHYSICS_DIR='$DIR/physics'" + echo "export AIEN_AIENOS_LOCK_REPO='$DIR/aienos'" + if [ "$GPU" -eq 1 ]; then echo "export AIEN_OMEGA_DIR='$DIR/omega'"; else echo "unset AIEN_OMEGA_DIR"; fi + echo "unset AIEN_OMEGA_GPU_LIB AIEN_OMEGA_COMPOSE_LIB AIEN_OMEGA_COMPOSE_SHA AIEN_FORCE_CPU_STUB AIEN_DEV_FALLBACK" + echo "export AIEN_REQUIRE_NATIVE_LIBS=1" + } > "$DIR/env.sh" + echo "pins: wrote $DIR/env.sh ($([ "$GPU" -eq 1 ] && echo 'GPU engine + composition' || echo 'composition only, CPU'))" + echo "next: . '$DIR/env.sh' && cargo build --release" +fi diff --git a/scripts/test-pins.sh b/scripts/test-pins.sh new file mode 100755 index 00000000..2960e93b --- /dev/null +++ b/scripts/test-pins.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# test-pins.sh: offline self-test of scripts/pins.sh with throwaway git repositories +# (no network). Proves: correct pins pass (--check and a full run against a local mirror), +# a checkout off its pin is refused (exit 3), a malformed lock is refused (exit 3), and +# env.sh carries the three directories and the AIEN_OMEGA_DIR choice. +set -euo pipefail +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +T=$(mktemp -d); trap 'rm -rf "$T"' EXIT +fail=0 +chk() { if eval "$1"; then echo " ok $2"; else echo " FAIL $2"; fail=1; fi; } +mk() { # mk NAME [FILE CONTENT]...: a one-commit repo under $T/mirror/NAME, prints its sha + local d="$T/mirror/$1"; shift; mkdir -p "$d" + git -C "$d" init -q; while [ $# -ge 2 ]; do printf '%s\n' "$2" > "$d/$1"; shift 2; done + [ -n "$(ls -A "$d" | grep -v '^.git$')" ] || : > "$d/.keep" + git -C "$d" add -A; git -C "$d" -c user.name=t -c user.email=t@t commit -q -m pin; git -C "$d" rev-parse HEAD +} +P=$(mk physics); A=$(mk aienos); O=$(mk omega physics.lock "$P" aienos.lock "$A") +mkdir -p "$T/root"; printf '%s\n' "$O" > "$T/root/omega.lock" +run() { AIEN_PINS_ROOT="$T/root" AIEN_PINS_REMOTE_BASE="$T/mirror" bash "$ROOT/scripts/pins.sh" "$@"; } +echo "test-pins: full run against a local mirror" +chk 'run "$T/pins" >/dev/null' "pins.sh materializes omega, physics, aienos" +chk '[ "$(git -C "$T/pins/omega" rev-parse HEAD)" = "$O" ]' "omega at omega.lock" +chk '[ "$(git -C "$T/pins/physics" rev-parse HEAD)" = "$P" ]' "physics at omega physics.lock" +chk '[ "$(git -C "$T/pins/aienos" rev-parse HEAD)" = "$A" ]' "aienos at omega aienos.lock" +chk 'grep -q "AIEN_OMEGA_COMPOSE_DIR=.*pins/omega" "$T/pins/env.sh" && grep -q "unset AIEN_OMEGA_DIR" "$T/pins/env.sh"' "env.sh: composition only without --gpu" +chk 'run --gpu "$T/pins" >/dev/null && grep -q "export AIEN_OMEGA_DIR=.*pins/omega" "$T/pins/env.sh"' "env.sh: --gpu sets AIEN_OMEGA_DIR" +chk 'grep -q "AIEN_REQUIRE_NATIVE_LIBS=1" "$T/pins/env.sh"' "env.sh: stubs refused (AIEN_REQUIRE_NATIVE_LIBS=1)" +chk 'run --check "$T/pins" >/dev/null' "--check passes when every clone is at its pin" +echo "test-pins: refusals" +git -C "$T/pins/physics" -c user.name=t -c user.email=t@t commit -q --allow-empty -m drift +rc=0; run --check "$T/pins" >/dev/null 2>&1 || rc=$? +chk '[ "$rc" -eq 3 ]' "--check refuses a checkout off its pin (exit 3, got $rc)" +chk 'run "$T/pins" >/dev/null && [ "$(git -C "$T/pins/physics" rev-parse HEAD)" = "$P" ]' "a full run moves it back to the pin" +printf 'not-a-sha\n' > "$T/root/omega.lock" +rc=0; run "$T/pins" >/dev/null 2>&1 || rc=$? +chk '[ "$rc" -eq 3 ]' "malformed omega.lock refused (exit 3, got $rc)" +rc=0; run --bogus >/dev/null 2>&1 || rc=$? +chk '[ "$rc" -eq 2 ]' "unknown flag is a usage error (exit 2, got $rc)" +[ "$fail" -eq 0 ] && echo "test-pins: PASS" || { echo "test-pins: FAIL"; exit 1; } ```