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 / benchmarks / data / headstart / patched-20261015-4c83e38 / toolchain / 13-diag-once.sh
| 1 | #!/usr/bin/env bash |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # One untimed diagnostic of the Headstart-ON incremental failure, run as |
| 18 | # `quietlock run -- 13-diag-once.sh inner` (refused, exit 75, while another |
| 19 | # job holds the quiet flag). Steps: prime an ON incremental check on a fresh |
| 20 | # target dir, apply the same body edit as the measured series (step 1), run |
| 21 | # ONE incremental ON check with -j 8 capturing full stderr, revert the edit. |
| 22 | set -euo pipefail |
| 23 | E=~/workspace/headstart-exp |
| 24 | H=$E/headstart |
| 25 | S=$E/aien-work/src |
| 26 | WT=~/aien-sovereign-core/.claude/worktrees/agent-adc52ad674d7b621a |
| 27 | D=$WT/benchmarks/data/headstart/patched-20261015-4c83e38/diag-once |
| 28 | if [ "${1:-}" != inner ]; then |
| 29 | exec quietlock run -- "$0" inner |
| 30 | fi |
| 31 | mkdir -p "$D" |
| 32 | CARGO=$H/cargo/target/release/cargo |
| 33 | export RUSTC=$H/rustc/build/host/stage1/bin/rustc |
| 34 | export CARGO_UNSTABLE_HEADSTART=true |
| 35 | export CARGO_TARGET_DIR=$E/aien-work/target-diag-once-ON |
| 36 | F=crates/cortex-rs/src/lib.rs |
| 37 | ANCHOR=' pub fn in_memory() -> Result<Self, String> {' |
| 38 | cd "$S" |
| 39 | trap 'git checkout -- "$F"' EXIT |
| 40 | git diff --quiet || { echo "worktree not clean" >&2; exit 1; } |
| 41 | rm -rf "$CARGO_TARGET_DIR" |
| 42 | "$CARGO" check --workspace --all-targets -j 8 > "$D/prime.stderr.log" 2>&1 |
| 43 | echo "prime rc=$?" > "$D/result.txt" |
| 44 | n=$(grep -nF -- "$ANCHOR" "$F" | cut -d: -f1) |
| 45 | sed -i "${n}a\\ let _headstart_m0_probe = std::hint::black_box(1u64);" "$F" |
| 46 | set +e |
| 47 | "$CARGO" check --workspace --all-targets -j 8 > "$D/incr-on.stderr.log" 2>&1 |
| 48 | rc=$? |
| 49 | set -e |
| 50 | echo "incremental ON check rc=$rc" >> "$D/result.txt" |
| 51 | git checkout -- "$F" |
| 52 | for f in rustc-ice-*.txt; do |
| 53 | [ -e "$f" ] || continue |
| 54 | awk '/^stack backtrace:/ { exit } NR > 12 { exit } { print }' "$f" > "$D/${f%.txt}.head.txt" |
| 55 | rm -f "$f" |
| 56 | done |
| 57 | rm -rf "$CARGO_TARGET_DIR" |
| 58 | cat "$D/result.txt" |