From 5010afbdd50423976d7d803969bca464bb9fe07b Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Mon, 5 Oct 2026 07:57:56 -0500 Subject: [PATCH 1/4] R16 G6: per-item protected-surface checks (presence, operation, negative controls) tools/r16_qualify.sh section 7 now evaluates the twelve G6 items: symbol defined (MISSING_IMPLEMENTATION if not) and every exercising test ran and passed in the same invocation (skipped or unexercised is NOT_RUN, failure is FAIL). Per-item results go to the receipt (g6_items) and stdout. Thresholds and scope unchanged. Dry-mode self-test gains negative controls: symbol removed, commented out, prototype only, failing and skipped tests. Co-Authored-By: Claude Opus 5.5 --- tests/r16_qualify/run.sh | 97 ++++++++++++++++++++++++++++++++- tools/r16_qualify.sh | 112 +++++++++++++++++++++++++++++++-------- 2 files changed, 185 insertions(+), 24 deletions(-) diff --git a/tests/r16_qualify/run.sh b/tests/r16_qualify/run.sh index 3ab5c4114..3e1e082f8 100755 --- a/tests/r16_qualify/run.sh +++ b/tests/r16_qualify/run.sh @@ -17,6 +17,8 @@ check() { if eval "$2"; then echo "ok $1"; else echo "FAIL $1"; FAILS=$((FAILS W=$SCR/w mkdir -p "$W/tools" cp "$HERE/tools/r16_qualify.sh" "$W/tools/" +G6FILES="src/omega_accelerator_world.c src/runtime/rx_generation.c src/omega_world_gates.c tools/omegatool.c src/runtime/rx_native_bind.c src/omega_evidence.c src/omega_verify.c src/runtime/rx_resident_gpu.c src/runtime/rx_seq_reference.c" +for p in $G6FILES; do mkdir -p "$W/$(dirname "$p")"; cp "$HERE/$p" "$W/$p"; done printf 'build/\n' > "$W/.gitignore" g() { git -C "$W" -c user.name=r16 -c user.email=r16@invalid -c commit.gpgsign=false "$@"; } g init -q && g add -A && g commit -qm fixture || exit 2 @@ -47,7 +49,7 @@ check "output under evidence/: exit 2" '[ $rc = 2 ]' out=$(Q R16_RUN_ID=none 2>&1); rc=$? R=$W/build/r16-raw/none/DRY-RUN-receipt.json check "no fixtures: exit 3 (nothing ran)" '[ $rc = 3 ]' -check "no fixtures: G6 prints NOT_RUN" 'echo "$out" | grep -q "R16-G6: NOT_RUN"' +check "no fixtures: G6 prints NOT_RUN (sources present, no test ran)" 'echo "$out" | grep -q "G6=NOT_RUN (items missing: 0)"' check "no fixtures: summary all NOT_RUN" 'echo "$out" | grep -q "^Gates: G1=NOT_RUN G2=NOT_RUN G3=NOT_RUN G4=NOT_RUN G5=NOT_RUN G6=NOT_RUN G7=NOT_RUN G8=NOT_RUN$"' check "no fixtures: receipt gate NOT_RUN" 'grep -q "\"gate\": \"NOT_RUN\"" "$R"' check "no fixtures: receipt has no PASS value" '! grep -q "\"PASS\"" "$R"' @@ -77,7 +79,7 @@ check "bad exit status with pass line: G5 FAIL, exit 1" '[ $rc = 1 ] && echo "$o echo 0 > "$F/r16_surface.log.rc" out=$(Q R16_RUN_ID=fx 2>&1); rc=$? check "good G4/G5 fixtures: those gates PASS" 'echo "$out" | grep -q "G4=PASS" && echo "$out" | grep -q "G5=PASS"' -check "all-good G4/G5 still exit 3 (G6 has no check)" '[ $rc = 3 ] && echo "$out" | grep -q "G6=NOT_RUN"' +check "all-good G4/G5 still exit 3 (G6 tests did not run)" '[ $rc = 3 ] && echo "$out" | grep -q "G6=NOT_RUN"' # 6b. R11 that skipped its living run (load > 2) exits 0 with "failures 0": NOT_RUN, never PASS printf 'checks 400 failures 0\n' > "$F/r11_aien.log"; echo 0 > "$F/r11_aien.log.rc" @@ -200,6 +202,97 @@ r15_bad "candidate_bound false" "$(r15_receipt candidate_bound=false)" r15_bad "tree_dirty true" "$(r15_receipt tree_dirty=true)" r15_bad "silicon_observed false" "$(r15_receipt silicon_observed=false)" +# 8b. G6 protected things kept. Presence (symbol defined) and operation (test ran and +# passed in this run) are separate. All good first, then one control at a time. +G=$W/build/r16-raw/g6 +mkdir -p "$G" +# g6log [rc]: fixture log + exit status for one exercising test +g6log() { printf '%s\n' "$2" > "$G/$1"; echo "${3:-0}" > "$G/$1.rc"; } +g6_good_logs() { + g6log m19_world.log "STAGE 1 / PERSISTENT WORLD QUALIFICATION: 18 / 18 M19 GATES PASSED" + g6log r9_barrier.log "generation barrier kept a single coherent generation through every injected stop" + g6log r10_omega.log "checks 40 failures 0" + g6log r7_native.log "native authority matched the linux oracle" + g6log r12_host.log "checks 40 failures 0" + g6log r12_silicon.log "checks 40 failures 0 silicon 1" + g6log r13_host.log "R13 gate: R13_LIVING_SYSTEM=HOST_PASS_NON_SILICON" + g6log r14_host.log "R14 gate: R14_LIVING_RECOVERY=HOST_PASS_NON_SILICON" + g6log r14_silicon.log "R14 gate: R14_LIVING_RECOVERY=PASS" + g6log r15_parity_host.log "SEQ_SEMANTIC_PARITY=PASS" + g6log r15_parity_silicon.log "SEQ_SEMANTIC_PARITY=PASS" + g6log r15_receipt.log "r15 receipt test: 0 failure(s)" +} +G6Q() { Q R16_RUN_ID=g6 2>&1; } +R=$G/DRY-RUN-receipt.json +g6_item() { sed -n 's/^.*"item": "'"$1"'", "status": "\([A-Z_]*\)".*$/\1/p' "$R"; } +g6_good_logs +out=$(G6Q); rc=$? +check "G6 all good: G6=PASS" 'echo "$out" | grep -q "G6=PASS"' +check "G6 all good: all twelve items PASS in the receipt" '[ "$(grep -c "\"item\": \"[a-z0-9_]*\", \"status\": \"PASS\"" "$R")" = 12 ]' +check "G6 all good: protected_surfaces_kept six presence flags true" '[ "$(grep -c "_present\": true" "$R")" = 6 ]' +check "G6 all good: no FAIL anywhere and G6 alone does not make the run pass (exit 3)" '[ $rc = 3 ] && ! echo "$out" | grep -q "G6=FAIL"' +check "G6 all good: receipt names file and symbol per item" 'grep -q "\"file\": \"src/runtime/rx_generation.c\", \"symbol\": \"rx_gen_recover\", \"defined\": true" "$R"' +check "G6 operated checks cite the test and its status" 'grep -q "{\"name\": \"R9\", \"target\": \"test-r9\", \"status\": \"PASS\"}" "$R"' + +# presence without operation: symbols all defined, tests never ran -> NOT_RUN, never PASS +rm -f "$G"/*.log "$G"/*.rc +out=$(G6Q) +check "G6 presence alone (no test ran): NOT_RUN, not PASS" 'echo "$out" | grep -q "G6=NOT_RUN" && [ "$(g6_item recovery_path_present)" = NOT_RUN ]' +g6_good_logs + +# symbol removed / commented out / reduced to a prototype -> MISSING_IMPLEMENTATION +RG=$W/src/runtime/rx_generation.c +g6_mut() { # g6_mut