AT-1 Agent 4: adversarial evaluator
Independent evaluator for AT-1 (aien-dev/omega#371). It reads only the frozen contracts
AT1_CASE_V1, AT1_RESULT_V1 and AT0_RESULT_V2 (identical at arch commits cbe4c8e,
81047f5 and ea91d7c) and AT1_SPEC / AT1_CHARTER; it never reads the oracle's
(Agent 2) or the engine's (Agent 3) code. PASS here means conformance to those
documents and nothing else; no statement about physics is made or implied.
Rust 2021, std only, no Cargo, one rustc call; the gate controls need a C11 compiler.
Portable to macOS arm64 (Apple clang 17, GNU make 3.81, rustc 1.97.1): POSIX sh, no
GNU-make-4 features, digests computed in code. No Python.
Run lines
make # build/at1-eval
make test # unit tests, selftest, corpus byte check, mutant receipt (cmp with the committed one), gate controls; writes only under build/
make receipts # refresh results/MUTANT_RECEIPT.tsv and results/ISOLATION_RECEIPT.txt
make corpus # regenerate cases/ (corpus-check must then report 0 differ)
# qualify the candidates (templates: {case} = case path, {out} = result path; without {out}, stdout)
sh run.sh '<engine> {case} {out}' '<oracle> {case} {out}' [cases] [out-dir] [hidden-dir]
# isolation gate G2 on the candidates' compute objects (not on static executables, see limits)
sh gates/isolation.sh ./build/at1-eval <object.o>...
# single tools
./build/at1-eval case <file> [--why] # codec: AT1_CASE_OK or one stderr line, exit 2
./build/at1-eval shadow <case> # exact (or double-double) model values
./build/at1-eval verify --case <case> <result> # exit 0 PASS, 1 FAIL, 3 INCONCLUSIVE
./build/at1-eval verify --case <case> --oracle-record <rec>
./build/at1-eval splice <engine-result> <oracle-record> <out>
A dry run with the built-in honest synthetic engine and oracle (all gates PASS):
B=$PWD/build/at1-eval; sh run.sh "$B synth-engine {case} {out}" "$B synth-oracle {case} {out}".
What is here
| Path | Content |
|---|---|
cases/ | public corpus, 96 files: 12 positive (P1a/b/c, P2 KAT, P2 variants t4 global phase i and t5 scale 2, P3, P3b, P4 ref t1, P4 ref t0, P5, P6), 12 negative (N1 to N1f IDEAL target, N2, N3, N4a, N4b, N5, N6), 72 refusals (spec 13.5 rows R0a to R14, AT-0 rows R01 to R39 re-expressed, charter-reading rows X1 to X6, and X7 clock_dim 0 with clock_energies none). MANIFEST.tsv gives each file's expected codec response. |
src/ | codec (case.rs), strict result parser and writer (result.rs), check re-derivation (judge.rs), verifier (verify.rs), shadow model (model.rs), runner splice and synthetic candidates (synth.rs), corpus generator (corpus.rs), mutants (mutants.rs), hidden-set generator (hidden.rs), instruction scanner (scan.rs), qualification and selftest (qualify.rs) |
gates/ | isolation gate isolation.sh and its four C controls: clean, hidden clock (clock_gettime), counter (inline mrs cntvct_el0 / rdtsc), raw syscall (inline svc / syscall); these are spec 9.2 mutant M7 |
results/MUTANT_RECEIPT.tsv | mutant kill receipt (deterministic and host-independent; make test regenerates it under build/ and compares) |
results/ISOLATION_RECEIPT.txt | gate controls receipt from the host that last ran make receipts |
HIDDEN_COMMITMENT.txt | SHA-256 commitment of the 27-case hidden set; seed and files withheld |
Design
- Codec. Independent
AT1_CASE_V1parser; every refusal row must give exactly its code (one stderr line, exit 2) from my codec, the engine and the oracle (gate G1). The KATat1-kat-rotated-level-n4reproduces case_file_sha25676e282fe...9ba4, case_id890980a4...25f1and acceptance_idd63246c3...4d8f(selftest). - Shadow model. Exact rational arithmetic when every phase is a quarter turn, otherwise double-double with a claimed bound of 1e-24. It reproduces the spec 13.2 hand tables exactly and the 13.3 deviation maxima (selftest, 549 assertions).
- Runner splice. The engine writes engine lines with
reference_*undefined; the splice copies all four reference families from the oracle record, binds oracle provenance, re-judges checks 1 to 12 perAT0_RESULT_V2sections 4 and 5 and resealsverdict_idandevidence_sha256. An oracle ERROR record gives ERRORORACLE_UNAVAILABLE. - Verify. Re-derives every check, the outcome, the codes and the expectation from the
written values and compares; decides check 3 (trivial kernel) from the exact shadow, as
AT-0 did, while the splice judges on the engine's own claim; compares every engine and
reference value with the shadow. Engine lines: beyond bound plus tolerance is a FAIL;
beyond only its own bound is a FAIL for RIGOROUS, INCONCLUSIVE for ESTIMATED, nothing for
NONE. Reference lines are calibration data and are judged on the value alone: farther than
the tolerance from the exact value is a FAIL whatever bound is written beside it, so a wrong
reference cannot hide behind a wide bound, also where no check reads it (
reference_idealunder an INTERACTING target, or on a trivial kernel). - Per-case table.
qualifywritesTABLE.tsv(PASS / FAIL / INDETERMINATE per case; INCONCLUSIVE findings map to INDETERMINATE) andVERDICT_IDS.tsv, prints the gate lines G1, G3, G4, G5 and T9 (engine run twice with another time zone and an extra environment variable), and exits 0 only when all pass. G2 isgates/isolation.sh; G6 and G7 belong to Agents 6 and 7.
Finding codes
| Code | Severity | Meaning |
|---|---|---|
| E4-PARSE | FAIL | result not byte-exact AT1_RESULT_V1 |
| E4-VERDICT-ID, E4-EVIDENCE-DIGEST | FAIL | identity digest does not recompute |
| E4-CASE-SHA, E4-CASE-BINDING | FAIL | copied case lines do not rebuild the case file, or ids do not match the case |
| E4-PROV-ORACLE-RECORD, -ORACLE-IS-ENGINE, -NONE, -TIME-ORDER | FAIL | provenance rule broken |
| E4-PROV-CONTRACT-UNKNOWN, E4-PROV-DIRTY-TREE | INCONCLUSIVE | contract commit off the allowlist, or dirty tree |
| E4-PLACEHOLDER-SHAPE, E4-RUN-NOT-COMPLETED, E4-UNDEFINED-DISCIPLINE, E4-TRIVIAL-SHAPE, E4-ORACLE-TRIVIAL, E4-LABEL-RULE, E4-BOUND-NONE-NONZERO | FAIL | shape rules of the result contract |
| E4-CHECK-MISMATCH, -OUTCOME-MISMATCH, -CODES-MISMATCH, -EXPECTATION-MISMATCH | FAIL | written verdict differs from the re-derived one |
| E4-EXPECTATION-NOT-MET | FAIL | candidate's result does not meet the case's expectation |
| E4-EXPECTATION-INDETERMINATE | INCONCLUSIVE | the only discrepancy is PRECISION_INSUFFICIENT |
| E4-SHADOW-KERNEL-DIM, -TRIVIAL, -POVM, -CLOCK, -LABEL, -PAULI | FAIL | engine value disagrees with the shadow |
| E4-ORACLE-CLOCK, -LABEL, -INTERACTING, -IDEAL | FAIL | spliced reference disagrees with the shadow (gate G3) |
| E4-BOUND-CLAIM-FALSE | FAIL | RIGOROUS bound does not cover the shadow difference |
| E4-BOUND-ESTIMATE-LOW | INCONCLUSIVE | ESTIMATED bound does not cover the shadow difference |
Mutants (results/MUTANT_RECEIPT.tsv, 244 cells, 0 unexpected)
Each cell is KILLED (its intended finding fires), FLAGGED (INCONCLUSIVE by design), BLIND (predicted from spec 9.2 or from the honest values; any unpredicted blindness fails the receipt), UNEXPECTED (killed although predicted blind, so the mutant is not the one the spec describes; fails the receipt), ACCIDENT (killed only by an unintended finding, fails the receipt) or SURVIVED. Oracle-mutant blindness is predicted the same way: O2 where M1 is blind (P1, P1c); O3 where M4 is blind (P6, N1f), on trivial kernels (every reference undefined), and on real-data cases with P(Y+) = 1/2 on every DEFINED label, where a phase-sign flip is complex conjugation (N3).
| Mutant | Killed | Blind (predicted) |
|---|---|---|
| M1 drop V | 15 | 3 (P1a, P1b, P1c) |
| M2 flip V | 15 | 3 |
| M3 wrong level | 16 | 2 |
| M4 phase sign | 16 | 2 (P6, N1f) |
| M5 Y sign, M6 axis swap | 16, 18 | 2, 0 |
| M8 IDEAL marginal from engine instead of w/N | 15 | 3 |
| M9 stale label status, M10 NONE bound nonzero | 1, 1 | 0 |
| O1 oracle IDEAL without h, O2 oracle drop V, O3 oracle phase sign (all 24 valid cases) | 24, 21, 19 | 0, 3, 5 |
F1 to F18 file forgeries, F9 oracle record presented as candidate, F19/F20 wrong reference_ideal behind a bound of 1 (P2, N2) | 18 killed, 2 flagged (F15, F16) | 0 |
| M7 counter and raw-syscall clock (gate controls) | 3 of 3 mutants FAIL the gate, clean control PASS |
All 24 honest controls PASS. M2 is trivial on P3 and P6, as spec 9.2 states.
Hidden set
at1-eval hidden-gen <seed> <dir> draws 27 cases (families F0 to F8 of spec 13.1 item 7,
index mod 9) from a SHA-256 counter-mode stream keyed by a private 256-bit seed; a draw is
kept only if its honest verdict has the family's intended codes and it meets the spec 8.3
margin rule. Only the commitment is in the repository (HIDDEN_COMMITMENT.txt, procedure of
spec 12.3 item 3). At reveal, run.sh recomputes the commitment before running the cases.
Agent 7 keeps its own, separate hidden set.
Limits
- Isolation is procedural on one host and one account: the hidden-set digest proves the identity of the files later revealed, not that nobody read them.
- The gate scans compute objects. Static executables contain libc's own
svcand clock code, so apply it to the candidates' object files or compute-only archives. - The x86-64 instruction scan is a byte-pattern scan and can report false positives in data inside executable sections; the aarch64 scan decodes aligned words.
- The shadow's double-double path (non-quarter-turn phases) is not exact; it claims 1e-24, far inside every tolerance in the corpus, and is checked against the exact path in selftest.
- ESTIMATED engine bounds that miss the shadow give INCONCLUSIVE, not FAIL.
E4-BOUND-NONE-NONZEROapplies to every line, references included (AT1_RESULT_V1 section 2: NONE means every bound0@0). When the engine and oracle bound kinds differ, the spliced file carries the engine's kind over the oracle's bounds;qualifynotes it asNOTE:bound_kind-mixedin the table (contract note below). - Check 2 aggregates over references as well as engine values, as
AT0_RESULT_V2section 4 reads;PRECISION_INSUFFICIENTfrom an engine label is read from engine lines only. - The hidden-set seed is passed on the command line (visible to local process listings while the generator runs, about 0.1 s).
- No real engine or oracle existed on any remote branch when this was built; the qualification so far ran against the synthetic candidates only.
- The hidden-set metadata is public by design: the generator is in the repository, so the family of each index (index mod 9) and the 12 positive / 15 negative split are known; the seed and the drawn parameters are not.
- Portability was checked on the MacBook (macOS arm64, Apple clang 17, GNU make 3.81,
rustc 1.97.1) from source in a temporary directory:
make testpasses there, andMUTANT_RECEIPT.tsv,VERDICT_IDS.tsvandTABLE.tsvof the synthetic dry run are byte-identical to the Spark run. The temporary directory was deleted afterwards.
Contract notes (for Agent 0)
- The two items spec 13.5 left out (an
AT0_CASE_V1header, a non-canonical coupling index token) are in the corpus as X1 (CASE_PARSE_ERROR) and X3 (CASE_NONCANONICAL), per charter readings (d) and (e). noneis read as the empty list everywhere (AT1_CASE_V1 section 2), soclock_dim 0withclock_energies nonepasses the shape pass and isCASE_INVALID_PARAMETER(row X7). A list whose only item would be the tokennonecannot be written; no numeric list is affected.- R13 uses the value-preserving
6/20for the spec's "2/10" example, which is the same rational and still non-canonical. - Open question: the runner splices oracle reference bounds under the engine's
bound_kind; the contracts do not say what the spliced file'sbound_kindmeans when the two kinds differ (for example a NONE engine with nonzero oracle bounds, which section 2 then makes a FAIL).