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/omega-mv/blob/main/tools/r15_qualify.sh # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tools / r15_qualify.sh` 426 lines · 24441 bytes Raw Blame History 1 #!/bin/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 # r15_qualify.sh -- the R15 qualification run (spec/r15-performance-proof.md 18 # §9, §10, §12, §13, §16 C1 item 7). 19 # 20 # tools/r15_qualify.sh [--detach] [rounds=12] [l1_runs=5] [l2_runs=5] 21 # (env: AIENOS_LOCK_REPO or AIENOS_R7_DIR, PHYSICS_DIR repositories holding 22 # the pinned commits; CC; R15_OUT_BASE to write a dry run outside evidence/) 23 # 24 # Runs, in order: W-EPISODE trials (rounds x RES-4/RES-1/SEQ/RES-1-NODIGEST, 25 # balanced Latin square), Level 1 (A,C,D,E,G,W0,W1 for RES-1 and SEQ 26 # interleaved, B for RES-1), Level 2 (RES-1/SEQ interleaved). Every process 27 # writes its own raw file; a failed process is recorded and NEVER rerun (§10). 28 # The benchmark and reducer are rebuilt from verified Git archives in a private 29 # directory. Only digest-bound copies under the run directory are executed. 30 # Then SHA256SUMS and the reducer. Output: evidence/R15/raw//. 31 # 32 # --detach re-launches this script in its own session (setsid nohup), so an 33 # agent or terminal going away cannot stop a long run; progress is written in 34 # plain words to /progress.log. 35 # 36 # The only machine setting changed is kernel.perf_event_paranoid: 4 -> 1 for 37 # the run, restored to 4 on every exit path, and the run fails if it does not 38 # read back 4. No systemd. 39 set -u 40 set -o pipefail 41 42 if [ "${1:-}" = "--detach" ]; then 43 shift 44 setsid nohup "$0" "$@" /dev/null 2>&1 & 45 disown 46 echo "started in the background (pid $!)" 47 exit 0 48 fi 49 50 MODE=${1:?host or silicon} 51 ROUNDS=${2:-12} 52 L1RUNS=${3:-5} 53 L2RUNS=${4:-5} 54 case "$MODE" in host|silicon) ;; *) echo "mode must be host or silicon" >&2; exit 64;; esac 55 56 HERE=$(cd "$(dirname "$0")/.." && pwd) 57 cd "$HERE" || exit 1 58 export GIT_NO_REPLACE_OBJECTS=1 GIT_GRAFT_FILE=/nonexistent/r15-qualify-grafts 59 COMMIT=$(git rev-parse HEAD) || { echo "r15_qualify: cannot read candidate HEAD" >&2; exit 2; } 60 INITIAL_STATUS=$(git status --porcelain --untracked-files=no) || { echo "r15_qualify: cannot read initial tree state" >&2; exit 2; } 61 DIRTY=$([ -z "$INITIAL_STATUS" ] && echo false || echo true) 62 RUN_ID=$(date -u +%Y%m%dT%H%M%SZ)-${COMMIT:0:12}-$MODE 63 OUT_BASE=${R15_OUT_BASE:-$HERE/evidence/R15/raw} 64 mkdir -p "$OUT_BASE" || exit 1 65 OUT=$OUT_BASE/$RUN_ID 66 mkdir -m 0755 "$OUT" || { echo "r15_qualify: run directory already exists or cannot be created: $OUT" >&2; exit 1; } 67 LOG=$OUT/progress.log 68 say() { echo "$(date '+%H:%M:%S') $*" >> "$LOG"; } 69 jstr() { printf '"%s"' "$(printf '%s' "$1" | tr -d '"\\' | tr '\n' ' ')"; } 70 sha_file() { sha256sum "$1" | cut -d' ' -f1; } 71 full_commit() { [[ "$1" =~ ^[0-9a-f]{40}$ ]]; } 72 plain_path() { [[ "$1" =~ ^[A-Za-z0-9/._+-]+$ ]]; } 73 74 BUILD_LOG=$OUT/build.log 75 : > "$BUILD_LOG" 76 prepare_fail() { 77 say "PREPARATION FAILED: $*" 78 echo "r15_qualify: $*" >&2 79 exit 2 80 } 81 verify_commit() { #