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/qualify_visor.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 / qualify_visor.sh` 470 lines ยท 26339 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 # qualify_visor.sh -- Omega Visor V1 qualification glue (lane 8). 18 # 19 # tools/qualify_visor.sh [--skip-regression] [--no-asan] [out-dir] (default out-dir: evidence/VISOR) 20 # tools/qualify_visor.sh --asan-probe-only (step 4's sanitizer dry run alone: prints 21 # ASAN_PROBE applies=<0|1> json=; tests/visor/test_qualify_asan_probe.sh) 22 # 23 # Runs the make targets and tests/visor/qualification/run_qualification.sh, collects 24 # their counts and writes ONE new receipt /.json. 25 # Every assertion lives in the C tests, the .omega-session goldens and the runner; this 26 # script only runs, counts and records. It never rewrites a tracked file: nothing under 27 # evidence/ is modified, only the new content-addressed receipt is added. A plain-text 28 # gate summary goes to stdout. 29 # 30 # Steps (all make / test runs wrapped in `flock $BENCH_LOCK`): 31 # 0. the Aienux capability library, rebuilt from `git archive` of the commit in 32 # aienos.lock (AIENOS_REPO, default ~/workspace/aienos-repo), as 33 # tools/effect_cap64_receipt.sh and CI do; its identity goes into the receipt 34 # 1. physics-free omega binary (build/q8r) + physics-free Visor suites and link checks 35 # 2. runtime-linked suites test-visor-world, test-visor-authority (pinned library) 36 # 3. CPU regression gates (build/q8reg); GPU/silicon targets are never run 37 # 4. the console campaign (runner) on the release binary, then on an ASan+UBSan build 38 # when the sanitizer flags reach the omega build (`make -n` shows -fsanitize=); 39 # omega built from OM-2 by seed/out/omc does not use CC, so then the receipt records 40 # the sanitizer pass as NOT_APPLICABLE with the OM-2 trap list, never as RUN; a dry run 41 # that itself fails (non-zero exit) is recorded as ERROR with its exit status, never as 42 # NOT_APPLICABLE (QUALIFY_VISOR_MAKE overrides the make of that dry run, for its test) 43 # 5. five gates -> verdict OMEGA_VISOR_V1_PASS / OMEGA_VISOR_V1_FAIL 44 # Verdict PASS needs all five gates PASS, a tree that did not change during the run 45 # (HEAD and each dirty file's sha256), the Aienux library built from aienos.lock and the 46 # physics checkout at physics.lock. The sanitizer pass is recorded but, as before, does not 47 # gate the verdict. Builds only into private OUT_DIRs; never touches build/ itself 48 # (except the pre-existing test-m5 QEMU path, see non_claims). 49 # Shell and coreutils only (git, sha256sum, grep, sed, awk, sort, tar, make, flock). 50 set -u 51 LC_ALL=C 52 export LC_ALL 53 54 HERE=$(cd "$(dirname "$0")/.." && pwd) 55 cd "$HERE" || exit 2 56 57 SKIP_REG=0 58 NO_ASAN=0 59 PROBE_ONLY=0 60 OUTDIR=evidence/VISOR 61 for a in "$@"; do 62 case "$a" in 63 --skip-regression) SKIP_REG=1 ;; 64 --no-asan) NO_ASAN=1 ;; 65 --asan-probe-only) PROBE_ONLY=1 ;; 66 -h|--help) sed -n '2,4p' "$0"; exit 0 ;; 67 -*) echo "usage: tools/qualify_visor.sh [--skip-regression] [--no-asan] [--asan-probe-only] [out-dir]" >&2; exit 2 ;; 68 *) OUTDIR=$a ;; 69 esac 70 done 71 72 AIENOS_REPO=${AIENOS_REPO:-$HOME/workspace/aienos-repo} 73 PHYSICS_DIR=${PHYSICS_DIR:-$HOME/workspace/physics-r13} 74 BENCH_LOCK=${BENCH_LOCK:-$HOME/workspace/.argus-bench.lock} 75 OUT=build/q8r 76 ASAN_OUT=build/q8asan 77 REG_OUT=build/q8reg 78 Q=build/q8q 79 LOGS=$Q/logs 80 REASONS=() 81 82 json_str() { # JSON string body: escape \ and ", tabs; drop other control bytes; join lines with \n 83 printf '%s' "$1" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/\t/\\t/g' | tr -d '\000-\010\013-\037' | 84 awk 'BEGIN{ORS=""} {if (NR>1) print "\\n"; print}' 85 } 86 87 tree_state() { # -> "" ; one element per `git status --short` line 88 local line st path sha out="" 89 while IFS= read -r line; do 90 [ -n "$line" ] || continue 91 st=$(printf '%s' "${line:0:2}" | tr -d ' ') 92 path=${line:3} 93 if [ -f "$path" ]; then sha="\"$(sha256sum "$path" | awk '{print $1}')\""; else sha=null; fi 94 out+="${out:+, }{\"status\": \"$(json_str "$st")\", \"path\": \"$(json_str "$path")\", \"sha256\": $sha}" 95 done < <(git status --short) 96 printf '%s' "$out" 97 } 98 99 PF=(PHYSICS_DIR=/nonexistent PHYSICS_LOCK_CHECK=0 AIENOS_R7_DIR="$HERE/$Q/aienos") 100 ASAN_CC="CC=cc -fsanitize=address,undefined -fno-omit-frame-pointer -g" 101 QV_MAKE=${QUALIFY_VISOR_MAKE:-make} 102 103 # Step 4's dry run: do the sanitizer flags reach the omega build? Sets asan_applies (1 only when 104 # `make -n` succeeds and shows -fsanitize=) and, when they do not, asan_json. A failed dry run 105 # is an ERROR record with its exit status: it proves nothing about the build. 106 # $1: file for the dry run's stderr. 107 asan_probe() { 108 local out rc 109 asan_applies=0 110 out=$("$QV_MAKE" -n OUT_DIR="$ASAN_OUT" "${PF[@]}" "$ASAN_CC" -B "$ASAN_OUT/omega" 2>"$1") 111 rc=$? 112 if [ "$rc" -ne 0 ]; then 113 asan_json="{\"status\": \"ERROR\", \"reason\": \"the sanitizer dry run (make -n of the omega build) exited $rc, so whether the sanitizer flags reach the omega build is unknown; no sanitizer run\", \"dry_run_exit\": $rc, \"stderr\": \"$(json_str "$(head -c 2000 "$1")")\"}" 114 elif printf '%s\n' "$out" | grep -q -e '-fsanitize='; then 115 asan_applies=1 116 else 117 asan_json='{"status": "NOT_APPLICABLE", "reason": "omega is built from OM-2 by seed/out/omc, which does not use CC, so no sanitizer build exists", "dry_run_exit": 0, "om2_traps": "out-of-range array get/put, signed overflow, divide by zero, out-of-range shift amounts, out-of-range conversions (docs/one_layer/OMEGESE.md 9.3); unsigned arithmetic wraps", "not_replaced": "alignment, use-after-free and leak checks"}' 118 fi 119 } 120 121 if [ "$PROBE_ONLY" -eq 1 ]; then 122 perr=$(mktemp) 123 asan_json='{"status": "NOT_RUN"}' 124 asan_probe "$perr" 125 rm -f "$perr" 126 [ "$asan_applies" -eq 1 ] && asan_json='{"status": "WOULD_RUN"}' 127 echo "ASAN_PROBE applies=$asan_applies json=$asan_json" 128 exit 0 129 fi 130 131 run_id=$(date -u +%Y%m%dT%H%M%SZ) 132 head0=$(git rev-parse HEAD) 133 tree0=$(git rev-parse 'HEAD^{tree}') 134 st0=$(git status --short) 135 files0=$(tree_state) 136 137 rm -rf "$Q" && mkdir -p "$LOGS" "$Q/aienos" 138 139 # ---- pins ------------------------------------------------------------------- 140 aienos_pin=$(awk 'NF && $1 !~ /^#/ {print $1; exit}' aienos.lock) 141 physics_pin=$(awk 'NF && $1 !~ /^#/ {print $1; exit}' physics.lock) 142 physics_head=$(git -C "$PHYSICS_DIR" rev-parse HEAD 2>/dev/null || echo missing) 143 [ "$physics_head" = "$physics_pin" ] || REASONS+=("physics checkout $PHYSICS_DIR at $physics_head != physics.lock $physics_pin") 144 145 aienos_src_tree=$(git -C "$AIENOS_REPO" rev-parse "$aienos_pin:native/capability" 2>/dev/null || echo missing) 146 if git -C "$AIENOS_REPO" archive "$aienos_pin" native/capability | tar -x -C "$Q/aienos" && 147 flock "$BENCH_LOCK" make -C "$Q/aienos/native/capability" > "$LOGS/aienos-lib.log" 2>&1; then 148 lib_ok=1 149 else 150 lib_ok=0 151 REASONS+=("AIENOS capability library did not build from aienos.lock $aienos_pin ($AIENOS_REPO)") 152 fi 153 LIB=$Q/aienos/native/capability/out/libaienos_capability.a 154 lib_sha=null; [ -f "$LIB" ] && lib_sha="\"$(sha256sum "$LIB" | awk '{print $1}')\"" 155 hdr_sha=null; [ -f "$Q/aienos/native/capability/aienos_capability.h" ] && 156 hdr_sha="\"$(sha256sum "$Q/aienos/native/capability/aienos_capability.h" | awk '{print $1}')\"" 157 158 # ---- suites ----------------------------------------------------------------- 159 RT=(PHYSICS_DIR="$PHYSICS_DIR" AIENOS_R7_DIR="$HERE/$Q/aienos" VISOR_AUTH_CAP_LIB="$HERE/$LIB") 160 FREE_SUITES=(test-visor-semantic test-language test-visor-verify test-visor-evidence 161 test-visor-machine test-visor-realization test-visor-console) 162 LINKED_SUITES=(test-visor-world test-visor-authority) 163 REGRESSION=(test test-m5 test-m6 test-m7 test-m8 test-m9 test-m10 test-m13 test-m14) 164 NEVER=("test-m12|GPU (living matvec)" "test-m15|accelerator/GPU" "test-m17|Blackwell GPU" 165 "test-m18|GPU" "test-m19|GPU") 166 167 declare -A STATUS RUN FAILED 168 SUITES_JSON="" 169 170 counts() { # "PASS n/m" / "FAIL n/m" lines + omegatool "TOTAL GATES: n | PASSED: n | FAILED: n" -> "run failed" 171 awk '/^(PASS|FAIL)[ \t]+[0-9]+\/[0-9]+[ \t]*$/ { split($2, x, "/"); r += x[2]; f += x[2] - x[1] } 172 { s = $0 173 while (match(s, /TOTAL GATES:[ \t]*[0-9]+[ \t]*\|[ \t]*PASSED:[ \t]*[0-9]+[ \t]*\|[ \t]*FAILED:[ \t]*[0-9]+/)) { 174 m = substr(s, RSTART, RLENGTH); s = substr(s, RSTART + RLENGTH) 175 split(m, p, "|"); t = p[1]; u = p[3]; gsub(/[^0-9]/, "", t); gsub(/[^0-9]/, "", u) 176 r += t; f += u } } 177 END { printf "%d %d\n", r, f }' "$1" 178 } 179 180 suite() { # suite 181 local name=$1 out=$2 log=$LOGS/$1.log rc n f status marker="" 182 shift 2 183 flock "$BENCH_LOCK" make OUT_DIR="$out" "$@" "$name" > "$log" 2>&1 184 rc=$? 185 case "$name" in 186 visor-authority-check) marker=OMEGA_VISOR_AUTHORITY_ISOLATION_PASS ;; 187 visor-physics-free-check) marker=OMEGA_VISOR_PHYSICS_FREE_BUILD_PASS ;; 188 esac 189 if [ -n "$marker" ]; then 190 n=1; f=1; { grep -aq "$marker" "$log" && [ "$rc" -eq 0 ]; } && f=0 191 else 192 read -r n f < <(counts "$log") 193 fi 194 status=FAIL 195 [ "$rc" -eq 0 ] && [ "$n" -gt 0 ] && [ "$f" -eq 0 ] && status=PASS 196 STATUS[$name]=$status; RUN[$name]=$n; FAILED[$name]=$f 197 SUITES_JSON+="${SUITES_JSON:+,} 198 {\"target\": \"$name\", \"rc\": $rc, \"tests_run\": $n, \"tests_failed\": $f, \"status\": \"$status\", \"log_sha256\": \"$(sha256sum "$log" | awk '{print $1}')\"}" 199 echo "suite $name: $status (rc=$rc run=$n failed=$f)" >&2 200 } 201 202 not_run() { # not_run 203 STATUS[$1]=NOT_RUN 204 SUITES_JSON+="${SUITES_JSON:+,} 205 {\"target\": \"$1\", \"status\": \"NOT_RUN\", \"reason\": \"$(json_str "$2")\"}" 206 } 207 208 # 1. physics-free omega binary + physics-free suites (fresh private OUT_DIR) 209 rm -rf "$OUT" 210 flock "$BENCH_LOCK" make OUT_DIR="$OUT" "${PF[@]}" "$OUT/omega" > "$LOGS/omega-build.log" 2>&1 211 binary_rc=$? 212 for t in "${FREE_SUITES[@]}" visor-authority-check visor-physics-free-check; do suite "$t" "$OUT" "${PF[@]}"; done 213 # 2. runtime-linked suites (Aienux capability library pinned by aienos.lock) 214 for t in "${LINKED_SUITES[@]}"; do suite "$t" "$OUT" "${RT[@]}"; done 215 # 3. regression (CPU gates only) 216 for t in "${REGRESSION[@]}"; do 217 if [ "$SKIP_REG" -eq 1 ]; then not_run "$t" "--skip-regression"; else suite "$t" "$REG_OUT" "${RT[@]}"; fi 218 done 219 for e in "${NEVER[@]}"; do not_run "${e%%|*}" "GPU/silicon target excluded by lane-8 brief: ${e#*|}"; done 220 not_run test-m11 "not in the lane-8 regression list" 221 222 # 4. console campaign (runner) on the release binary, then on an ASan+UBSan build 223 failed_cases() { # runner log -> "sectioncasedetail" for every QUAL ... FAIL line 224 awk '/^QUAL / { sec = $2; rest = substr($0, length("QUAL " sec " ") + 1) 225 fi = index(rest, " FAIL"); pi = index(rest, " PASS") 226 if (fi > 1 && (pi == 0 || fi < pi)) { 227 d = substr(rest, fi + 5); sub(/^ /, "", d) 228 printf "%s\t%s\t%s\n", sec, substr(rest, 1, fi - 1), d } }' "$1" 229 } 230 RLOG=$LOGS/runner.log 231 flock "$BENCH_LOCK" env QUAL_WORK="$OUT/qual-work" bash tests/visor/qualification/run_qualification.sh "$OUT/omega" > "$RLOG" 2>&1 232 runner_rc=$? 233 declare -A SEC_RUN SEC_FAILED 234 SECTIONS_JSON="" 235 while read -r _ sec r f; do 236 r=${r#run=}; f=${f#failed=} 237 SEC_RUN[$sec]=$r; SEC_FAILED[$sec]=$f 238 SECTIONS_JSON+="${SECTIONS_JSON:+, }\"$sec\": {\"run\": $r, \"failed\": $f}" 239 done < <(grep -aE '^QUAL_SECTION [^ ]+ run=[0-9]+ failed=[0-9]+$' "$RLOG") 240 hline=$(grep -aE '^QUAL_HOSTILE run=[0-9]+ failed_closed=[0-9]+ crashed=[0-9]+ noop=[0-9]+$' "$RLOG" | tail -n 1) 241 dline=$(grep -aE '^QUAL_DETERMINISM runs=[0-9]+ identical=[A-Za-z0-9_]+$' "$RLOG" | tail -n 1) 242 field() { printf '%s\n' "$1" | tr ' ' '\n' | awk -F= -v k="$2" '$1 == k {print $2; exit}'; } 243 if [ -n "$hline" ]; then 244 hostile_json="{\"run\": $(field "$hline" run), \"failed_closed\": $(field "$hline" failed_closed), \"crashed\": $(field "$hline" crashed), \"benign_noop\": $(field "$hline" noop), 245 \"note\": \"benign_noop = blank/whitespace/comment lines, a spec'd no-op (exit 0); the rest must exit 1 with an error line\"}" 246 else 247 hostile_json=null 248 fi 249 if [ -n "$dline" ]; then 250 det_ident=false; [ "$(field "$dline" identical)" = yes ] && det_ident=true 251 det_json="{\"runs\": $(field "$dline" runs), \"identical\": $det_ident, \"scope\": \"same host, fresh processes; text, --json and realization ids\"}" 252 else 253 det_json=null 254 fi 255 FAILED_CASES=$(failed_cases "$RLOG") 256 FAILED_JSON="" 257 while IFS=$'\t' read -r sec name detail; do 258 [ -n "$sec" ] || continue 259 FAILED_JSON+="${FAILED_JSON:+,} 260 {\"section\": \"$(json_str "$sec")\", \"case\": \"$(json_str "$name")\", \"detail\": \"$(json_str "$detail")\"}" 261 done <<< "$FAILED_CASES" 262 263 asan_json='{"status": "NOT_RUN"}' 264 # A sanitizer result is only recorded when the sanitizer flags actually reach the omega build. 265 # omega is built from OM-2 by seed/out/omc, which ignores CC; then there is no sanitizer run to 266 # report (NOT_APPLICABLE). A dry run that fails is recorded as ERROR (asan_probe). 267 asan_applies=0 268 [ "$NO_ASAN" -eq 0 ] && asan_probe "$LOGS/asan-probe.err" 269 if [ "$NO_ASAN" -eq 0 ] && [ "$asan_applies" -eq 1 ]; then 270 rm -rf "$ASAN_OUT" 271 flock "$BENCH_LOCK" make OUT_DIR="$ASAN_OUT" "${PF[@]}" \ 272 "$ASAN_CC" "$ASAN_OUT/omega" > "$LOGS/asan-build.log" 2>&1 273 asan_brc=$? 274 ALOG=$LOGS/runner-asan.log 275 flock "$BENCH_LOCK" env QUAL_WORK="$ASAN_OUT/qual-work" bash tests/visor/qualification/run_qualification.sh "$ASAN_OUT/omega" > "$ALOG" 2>&1 276 asan_st=RUN; [ "$asan_brc" -eq 0 ] || asan_st=BUILD_FAILED 277 san=PRESENT_OR_UNKNOWN 278 grep -aqE '^QUAL hostile no-sanitizer-reports-in-any-transcript PASS' "$ALOG" && san=none 279 ahl=$(grep -aE '^QUAL_HOSTILE run=[0-9]+ failed_closed=[0-9]+ crashed=[0-9]+' "$ALOG" | tail -n 1) 280 acr=null; [ -n "$ahl" ] && acr=$(field "$ahl" crashed) 281 same=false 282 [ "$(failed_cases "$ALOG" | cut -f2 | sort)" = "$(printf '%s' "$FAILED_CASES" | cut -f2 | sort)" ] && same=true 283 asan_json="{\"status\": \"$asan_st\", \"sanitizer_reports\": \"$san\", \"crashed\": $acr, \"same_case_failures_as_release\": $same}" 284 fi 285 286 files1=$(tree_state) 287 head1=$(git rev-parse HEAD) 288 stable=true 289 { [ "$head0" = "$head1" ] && [ "$files0" = "$files1" ]; } || stable=false 290 291 # 5. gates 292 GATE_NAMES=(OMEGA_VISOR_SEMANTIC_PASS OMEGA_VISOR_VERIFY_PASS OMEGA_VISOR_REALIZE_PASS 293 OMEGA_VISOR_AUTHORITY_ISOLATION_PASS OMEGA_VISOR_REGRESSION_PASS) 294 declare -A G_SUITES G_SECTIONS 295 G_SUITES[OMEGA_VISOR_SEMANTIC_PASS]="test-visor-semantic test-language" 296 G_SECTIONS[OMEGA_VISOR_SEMANTIC_PASS]="semantic determinism" 297 G_SUITES[OMEGA_VISOR_VERIFY_PASS]="test-visor-verify test-visor-evidence test-visor-world" 298 G_SECTIONS[OMEGA_VISOR_VERIFY_PASS]="usability" 299 G_SUITES[OMEGA_VISOR_REALIZE_PASS]="test-visor-machine test-visor-realization test-visor-console" 300 G_SECTIONS[OMEGA_VISOR_REALIZE_PASS]="realize scriptability" 301 G_SUITES[OMEGA_VISOR_AUTHORITY_ISOLATION_PASS]="visor-authority-check test-visor-authority" 302 G_SECTIONS[OMEGA_VISOR_AUTHORITY_ISOLATION_PASS]="hostile authority" 303 G_SUITES[OMEGA_VISOR_REGRESSION_PASS]="${REGRESSION[*]} visor-physics-free-check" 304 G_SECTIONS[OMEGA_VISOR_REGRESSION_PASS]="" 305 306 GATES_JSON="" 307 SUMMARY="" 308 all_pass=1 309 for g in "${GATE_NAMES[@]}"; do 310 run=0; failed=0; srcs=""; notrun="" 311 for t in ${G_SUITES[$g]}; do 312 s=${STATUS[$t]:-NOT_RUN} 313 if [ "$s" = NOT_RUN ]; then notrun+="${notrun:+, }\"$t\""; continue; fi 314 run=$((run + RUN[$t])); failed=$((failed + FAILED[$t])) 315 [ "$s" = FAIL ] && [ "${FAILED[$t]}" -eq 0 ] && failed=$((failed + 1)) 316 srcs+="${srcs:+, }\"make $t\"" 317 done 318 for sec in ${G_SECTIONS[$g]}; do 319 if [ -n "${SEC_RUN[$sec]+x}" ]; then 320 run=$((run + SEC_RUN[$sec])); failed=$((failed + SEC_FAILED[$sec])) 321 srcs+="${srcs:+, }\"run_qualification.sh:$sec\"" 322 else 323 notrun+="${notrun:+, }\"runner:$sec\"" 324 fi 325 done 326 if [ "$run" -eq 0 ]; then st=NOT_RUN 327 elif [ "$failed" -eq 0 ] && [ -z "$notrun" ]; then st=PASS 328 else st=FAIL; fi 329 GATES_JSON+="${GATES_JSON:+,} 330 \"$g\": {\"status\": \"$st\", \"tests_run\": $run, \"tests_failed\": $failed, \"sources\": [$srcs]${notrun:+, \"not_run\": [$notrun]}}" 331 SUMMARY+="$g=$st ($run run, $failed failed)"$'\n' 332 if [ "$st" != PASS ]; then 333 all_pass=0 334 REASONS+=("$g $st ($failed/$run failed${notrun:+; not run: $(printf '%s' "$notrun" | tr -d '"')})") 335 fi 336 done 337 while IFS=$'\t' read -r sec name detail; do 338 [ -n "$sec" ] && REASONS+=("runner $sec: $name FAIL ${detail:0:140}") 339 done <<< "$FAILED_CASES" 340 [ "$stable" = true ] || REASONS+=("tree changed during the run (HEAD or modified-file hashes differ): receipt INVALID") 341 342 verdict=OMEGA_VISOR_V1_PASS 343 { [ "$all_pass" -eq 1 ] && [ "$stable" = true ] && [ "$lib_ok" -eq 1 ] && 344 [ "$physics_head" = "$physics_pin" ]; } || verdict=OMEGA_VISOR_V1_FAIL 345 346 tree_dirty=false; [ -z "$st0" ] || tree_dirty=true 347 dirty_detail="see dirty_files" 348 if [ -n "$st0" ] && ! printf '%s\n' "$st0" | cut -c4- | 349 grep -qvE '^(tests/visor/qualification|tools/qualify_visor\.sh|evidence/VISOR)'; then 350 dirty_detail="only lane-8 files (untracked, not yet committed)" 351 fi 352 bin_json="\"built\": false, \"sha256\": null" 353 [ "$binary_rc" -eq 0 ] && [ -f "$OUT/omega" ] && 354 bin_json="\"built\": true, \"sha256\": \"$(sha256sum "$OUT/omega" | awk '{print $1}')\"" 355 scr_json=null 356 [ -n "${SEC_RUN[scriptability]+x}" ] && 357 scr_json="{\"run\": ${SEC_RUN[scriptability]}, \"failed\": ${SEC_FAILED[scriptability]}}" 358 reasons_json="" 359 for r in "${REASONS[@]}"; do reasons_json+="${reasons_json:+, 360 }\"$(json_str "$r")\""; done 361 product=$(cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null) 362 363 body=$(cat <` is described as 'explain where x came from' but only explains realizations; on a value it says `use realize x first`, and `realize x` then refuses a value, a dead end.", 403 "Errors raised before parsing, and unknown commands, are labelled `unknown` (`error: unknown: invalid UTF-8 at byte 4`, `error: unknown: unknown command or invalid source line: 'authorize'`).", 404 "`id` prints the same hash three times (id, canonical_sha256) plus canonical_len; the relation is not explained.", 405 "After `realize _`, `_` silently becomes the realization, so `inspect _`/`type _` now refer to a different object than one line earlier.", 406 "Every u64 ADD has the same realization id (`realized` = the ADD operation, not the apply), so `x + y` and `x + 1` share one realization id; correct per spec but surprising in `bindings`/`compare`.", 407 "`run _ a b` (exactly all operands) on a binary-apply realization runs the operation on the given numbers, not on the object's operands (7+11 -> `run _ 1 2` prints 3); allowed by design after the D2 fix, but the output does not say the object's own operands were replaced.", 408 "Machine/realization output uses hex profile codes (`profile 0x01 vs machine 0x01`), `physics flag=set seal=builder-constant placeholder`, and C function names (`omega_machine_estimate_latency(...)`, `omega_exec_native_f3`) as explanations; not readable without the C source.", 409 "`verify` row INVARIANTS reports 399 generic checks that are 'not object-specific'; a user may read the PASS as evidence about their object.", 410 "`evidence ` for a session object always says `no evidence`: receipts are repository files, not linked to session objects; 'what evidence supports this object' cannot be answered in V1.", 411 "Blank lines produce no JSON object while comment-only lines produce one (`kind: none`); a script driver counting lines must know this.", 412 "Commands after `quit` in --command/--script mode are silently dropped (exit 0).", 413 "`--script /dev/null` (a character device, not a regular file) is accepted as an empty script (exit 0), although the round-2 note says non-regular files exit 2; harmless, but the claim and behaviour differ." 414 ], 415 "defects": [ 416 { 417 "id": "D1", 418 "severity": "high; FIXED in `ec2ec0b` (found at `4fab549`)", 419 "what": "The ./omega shipped at commit `4fab549` (sha256 `543d874d`...d4d3) crashed on every realize/run path (exit 139 SIGSEGV in om_realization_show; 'stack smashing detected', exit 134). Cause: omega_main.d missing from VISOR_DEPS, so tools/omega.c was not rebuilt when src/visor/visor.h changed. `ec2ec0b` adds it; a clean-checkout build of `4fab549` was not tested." 420 }, 421 { 422 "id": "D2", 423 "severity": "medium; FIXED in `d7e8a4c` (open in receipt #1)", 424 "what": "`run` did not check arity: `run f` -> 1, `run f 5 6` -> 11, `run _ 1` -> 12, `run _ 1 2 3` -> 3, all exit 0. At `d7e8a4c`: 'program f takes 1 input; give it on the command line', 'program f takes 1 input; got 2', '_ takes 2 operands; got 1 (give none, or all 2)', '... got 3 ...'; exit 1." 425 }, 426 { 427 "id": "D3", 428 "severity": "low; FIXED in `d7e8a4c`", 429 "what": "`./omega --script /` exited 0; at `d7e8a4c` it prints 'error: --script: / is a directory' and exits 2." 430 }, 431 { 432 "id": "D4", 433 "severity": "cosmetic; FIXED in `d7e8a4c`", 434 "what": "Doubled 'alternatives:' prefix, `effects x` error without 'error:', help `graph [x]` and `let x = `, parser jargon for `authorize x`/`execute _`: all corrected (hostile.expected and usability.expected regenerated; the only other changed line is the `run ` message, now '... is not an APPLY; only pure binary u64 applies run in V1', still exit 1)." 435 } 436 ], 437 "non_claims": [ 438 "Host-only qualification on one DGX Spark (aarch64); no GPU, no silicon, no QEMU claim by the Visor.", 439 "No measured or qualified cost: the Visor fills only predicted (static) and estimated (assumed machine model) cost; measured/qualified are ABSENT by design.", 440 "Machine identity is the assumed canonical profile chosen from DMI, not an observed descriptor; the physics seal is a builder placeholder.", 441 "World is unattached in the omega binary: `world` observes nothing; the snapshot API is covered only by the runtime-linked test-visor-world.", 442 "Language V0 scope only: explicit-width unsigned integers, bool, let, + - * / & |, fn chains (x op c)...; realize/run cover u64 binary ADD/SUB/MUL/AND/OR only.", 443 "Effects: the language cannot build an EFFECT object, so `run` on an effect is not reachable from the console; effect-request refusal is covered only by the C hostile suite (test-visor-authority) and the link check.", 444 "GPU targets test-m12, test-m15, test-m17, test-m18, test-m19 and all Blackwell paths were not run (lane-8 brief); test-m11 was not in the list.", 445 "The pre-existing test-m5 gate launches QEMU and writes build/qemu_omega_runner.bin under the shared build/ directory (hard-coded path in omegatool).", 446 "The e2e session golden (tests/visor/sessions/e2e.expected) is compared host-independently only after `ec2ec0b`; the lane-8 goldens mask the machine block, machine name/id and estimated cycles.", 447 "Determinism is shown across fresh processes on this host only, not across hosts, compilers or ABIs (golden bytes are pinned to LP64/aarch64).", 448 "Visor V1 is not claimed safe against a hostile local user with write access to the binary or the evidence directory." 449 ] 450 EOF 451 ) 452 body+=$(cat < "$tmp" 462 digest=$(sha256sum "$tmp" | awk '{print $1}') 463 final=$OUTDIR/$digest.json 464 if [ -e "$final" ]; then rm -f "$tmp"; else mv "$tmp" "$final"; fi 465 chmod 0644 "$final" 466 printf '%s' "$SUMMARY" 467 [ ${#REASONS[@]} -eq 0 ] || printf 'reason: %s\n' "${REASONS[@]}" 468 echo "RECEIPT $final" 469 echo "VERDICT $verdict" 470 [ "$verdict" = OMEGA_VISOR_V1_PASS ]