interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / research / atemporal / at1 / oracle / README.md

157 lines · 10504 bytes Raw Blame History Rendered
1# AT-1 reference oracle (Rust, standard library only)
2
3Independent reference for the AT-1 interacting Page-Wootters qualification. Given an
4`AT1_CASE_V1` file it validates the case in contract order, decides the kernel of
5`H_total = H_C (x) I + I (x) H_S + V` exactly level by level, computes every written quantity
6by two routes (a literal matrix route and the closed form; they share only the exact level
7decisions and eigenvectors of `src/at1/model.rs`, the exact phase reduction `cis_turns`, the
8compensated sum and the Pauli bound formula), judges the twelve checks in exact arithmetic and writes one
9`AT1_RESULT_V1` oracle record. A PASS here means conformance with the frozen contracts and
10AT1_SPEC; it says nothing about physics. Reproducing the hand tables is a calibration
11result, not a discovery.
12
13Owner: Agent 2 (`AT1_CHARTER.md` section 7, `aien-dev/omega#371`). Everything lives in this
14directory. Nothing here is the candidate engine and nothing here is used by it; no source is
15imported from `research/atemporal/at0/` (two leaf files, `sha256.rs` and `complex.rs`, were
16copied from the AT-0 oracle as a starting point, as charter section 4 allows).
17
18## Contracts and readings this code follows
19
20- Contracts: `AT1_CASE_V1` (sha256 `e62018d8deec97fffca5cacaf6452d8fc45c395596517665cd73eb0c777a3e8f`)
21 and `AT1_RESULT_V1` (`3e6efd7e641a89bf0e425267525afabc51fe7a5497d3d539cdeaf09ddb6fa92d`),
22 frozen at `aien-architecture` `cbe4c8ed88d28bb96d5209327ecd30aa9cddaf7a`, the
23 `contract_commit` every record writes (`CONTRACT_COMMIT` in `src/at1/case.rs`).
24 `AT0_RESULT_V2` sections 2, 4, 5 and 7 are normative through `AT1_RESULT_V1`.
25- Mathematics: `AT1_SPEC.md`, merged as `81047f52850f4bd14c2fc5772ec2ac833ac694b9`
26 (`SPEC_COMMIT` in `src/at1/mod.rs`). Every section 13 table is a fixture and a test.
27- Charter readings (`AT1_CHARTER.md` at `ea91d7c`): (b) shape before range, non-canonical
28 decided after the whole shape pass; (c) the record carries all four `reference_*`
29 families in values-block order; (d) the first token of a version line is its key, so an
30 `OMEGA-AT0-CASE` header is `CASE_PARSE_ERROR` and a wrong version value is
31 `CASE_UNSUPPORTED_VERSION`; (e) index tokens are compared by parsed value, `01` is
32 `CASE_NONCANONICAL`, a non-integer or wrong value is `CASE_PARSE_ERROR`.
33- Declared token readings (same as the qualified AT-0 C engine, not stated in the frozen
34 text; listed so a reviewer can object): integers are `-?[0-9]+` (so `+4` is
35 `CASE_PARSE_ERROR`); a fixed-arity list with the wrong arity (`system_hamiltonian_pauli` 4,
36 `interaction_pauli` 3, `reference_system_state` 2) and a count mismatch of
37 `clock_energies`, `interaction_pauli` or `clock_label` lines are `CASE_PARSE_ERROR`; a
38 rational with denominator below 1 and a negative part of a scaled token are
39 `CASE_NONCANONICAL`; a rational over the token limit and a scaled exponent above 40 are
40 `CASE_INVALID_PARAMETER`; a `clock_dim` value that differs from the number of
41 `clock_energies` entries is a count-line mismatch (`CASE_PARSE_ERROR`), while `none` is the
42 empty list (AT1_CASE_V1 section 2), so `clock_dim 0` with `clock_energies none` and no
43 `interaction_pauli` line meets the count rule and the range rule `2 <= N <= 64` refuses it
44 with `CASE_INVALID_PARAMETER` (Agent 0 ruling, omega#371, row X7). The values-block parser the judge uses takes
45 `physical_state_kernel_dim` only as a canonical decimal (`0` or `[1-9][0-9]*`).
46- Phase sign frozen in `AT1_CASE_V1` section 3: `chi_k = sum_j exp(+2 pi i E_j (k - r) tau) u_j`.
47
48## What the record contains
49
50- The record's own values (`physical_state_kernel_dim`, `constraint_residual`,
51 `povm_residual`, `label`, `clock_probability`, `pauli`) come from the literal matrix route
52 (`src/at1/matrix.rs`): dense `H_total`, the orthogonal projector onto its kernel built
53 from the exact kernel pairs (never from a numerical eigen-decomposition, AT1_SPEC section
54 8.4 item 3), `Psi = P_0 (|t_r> (x) psi_0)`, `phi_k` by the literal bra `<t_k|`, `rho_k`
55 and `Tr(rho_k Pi)`.
56- `reference_clock_probability` and `reference_interacting` come from the closed form of
57 AT1_SPEC Theorem 3 (`src/at1/closed.rs`), from the exact `u_j` and `S`.
58- `reference_ideal` comes from a right-handed Bloch rotation of `psi_0` about `h / |h|` by
59 `2 pi * 2 |h| (k - r) tau` (no `V`, no kernel).
60- The oracle's own verdict judges the matrix route against the two reference routes, so on
61 every section 13 case it reproduces the expected outcome and codes.
62- Marking (`AT1_RESULT_V1` section 1): `build_cc` begins with `oracle `, `engine_sha256`
63 equals `oracle_sha256`; the writer refuses anything else. A refused case prints exactly
64 `AT1_CASE_REFUSED <code>` on stderr and exits 2.
65
66## Layout
67
68```
69build.sh exact rustc invocation (build | test | lib), POSIX sh
70isolation.sh symbol-isolation gate for the compute crate (source rule + nm -u + mutant)
71src/main.rs the only file that touches files, git, the process table or the wall clock
72src/tests.rs the test suite
73src/at1/mod.rs compute crate root; SPEC_COMMIT
74src/at1/big.rs arbitrary-precision naturals, integers, rationals, Gaussian rationals
75src/at1/sha256.rs SHA-256 (case_id, acceptance_id, verdict_id, evidence_digest, case_file_sha256)
76src/at1/complex.rs complex numbers and dense complex matrices
77src/at1/case.rs AT1_CASE_V1 parser and validator in contract order; case builder
78src/at1/model.rs exact level decisions, kernel pairs, u_j, S; exact phase reduction
79src/at1/matrix.rs literal matrix route (the record's own values)
80src/at1/closed.rs closed form (Theorem 3) and Bloch rotation (the reference families)
81src/at1/result.rs values block, values parser, exact judge, verdict block, record writer
82src/at1/fixtures.rs AT1_SPEC section 13 cases with their exact hand tables
83fixtures/ <name>.case, <name>.values, CALIBRATION.md (generated, deterministic)
84NUMERICAL_ERROR.md accounting, stated bounds, measured errors, limits
85```
86
87## Build and run (no network, no Cargo, no crates)
88
89```
90./build.sh build # target/at1-oracle
91./build.sh test # target/at1-oracle-test, runs the suite
92./isolation.sh # isolation gate, prints ISOLATION PASS
93./target/at1-oracle emit <case-file> [-o <out-file>]
94./target/at1-oracle check <case-file> # prints case_id, acceptance_id, case_file_sha256
95./target/at1-oracle fixtures fixtures # regenerates fixtures/ byte for byte
96```
97
98The build is one command:
99
100```
101rustc --edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C panic=abort -D warnings \
102 --crate-name at1_oracle src/main.rs -o target/at1-oracle
103```
104
105The test build uses the same flags without `-C panic=abort`, plus `--test`. `build.sh`
106records in the binary `rustc -V`, the host triple and the flag string (the source of
107`build_cc` and `build_flags`), and the source state at build time: `git rev-parse HEAD` and
108whether `git status --porcelain -- .` was empty in this directory (the source of
109`source_commit`, `oracle_commit` and `source_tree_clean`). A binary built without `build.sh`
110falls back to the checkout it runs from, one built by `build.sh` outside a git checkout
111writes all-zero commits, and both always write `source_tree_clean NO`. `host` is
112the host name, then `sw_vers` product name and version when present (macOS), then
113`uname -srm`, so a replication record names the machine and the OS. Every digest is computed in Rust; no script calls
114`sha256sum` or `shasum`. No Makefile and no toolchain pin file are shipped, so `rustup`
115never tries to download anything.
116
117MacBook (macOS arm64, rustc 1.97.1): the same three commands. `isolation.sh` accepts the
118leading underscore BSD `nm` puts on C symbols, and the host name falls back to `uname -n`
119when `/etc/hostname` is missing. No script needs GNU make, `sha256sum` or `shasum`.
120Verified here with rustc 1.97.1 and 1.98.1 on
121`aarch64-unknown-linux-gnu`: both build with `-D warnings`, both pass the suite, and their
122fixtures are byte-identical. It has not been run on macOS by this agent.
123
124## Results (rustc 1.98.1, aarch64-unknown-linux-gnu)
125
126- Worked example `at1-kat-rotated-level-n4` reproduces `case_file_sha256 76e282fe...9ba4`,
127 `case_id 890980a4...25f1`, `acceptance_id d63246c3...4d8f`, kernel dimension 2 and
128 `p = 5/28, 1/4, 9/28, 1/4`; its oracle record has
129 `verdict_id a918558b4b1e99e4015813eaefaab18973861b7b7d797ef89bddc9f41637eabb`.
130- Test suite: 26 tests pass on rustc 1.98.1 and on rustc 1.97.1 (22 suite tests, 4 unit
131 tests of the arithmetic, SHA-256 and complex layers).
132- Section 13 tables covered: 13.2 P1 (a, b), P1c, P2, P3, P3b, P4, P5, P6; 13.3 deviation
133 classes through N1 to N1f; 13.4 N1 to N1f, N2, N3, N4a, N4b, N5, N6; 13.5 R0 to R14 and
134 all 42 inherited AT-0 refusal rows re-expressed on P2. 1577 values compared with the exact
135 tables, largest deviation `6.7e-16`, no value outside its written bound, largest bound
136 `1.1e-13` (see `fixtures/CALIBRATION.md`). Every case meets its expectation.
137- Review cases (second-model review, see the PR): a field `h_z = 1048573/15` cancelling
138 couplings `v_z = -1048567/15` (constraint residual `6.8e-17`, bound `1.8e-14`, PASS), and
139 the largest clocks the contract allows, `N = M = 64` and `N = 64, M = 256, w = 1/4`
140 (constraint and POVM residuals `0`, POVM bound `1.7e-13`, PASS).
141- AT1_SPEC section 9: T1, T3 (P1c under IDEAL), T4, T5, T6, T7 and T9 are tests; mutants
142 M1 (drop `V`, including the blind P1c case and the N1 route to
143 `ORACLE_DISAGREEMENT`), M3 and M4 are judge tests; a status mismatch fails check 12.
144- Isolation gate: PASS (source rule, `nm -u` object rule, both catch the `std::time` mutant).
145
146## Declared limits
147
148- Bounds are ESTIMATED, not enclosures; RIGOROUS is never claimed (N5 fails by design).
149 `NUMERICAL_ERROR.md` gives the accounting and its limits, including the small-`p(k)` case
150 where the oracle's own verdict can turn INDETERMINATE.
151- Not tested here: T2 against the AT-0 tables beyond the P1 table they share, T8 (label
152 order reversed), T10 (cross-platform; gate G7 belongs to Agent 7), mutant M2 (a flipped `V`
153 on P2 has an irrational spectrum, so it is not a valid case; it stays with Agent 4's
154 engine mutants), M5 to M7.
155- One thread, binary64, platform `cos`/`sin`. Not run on macOS by this agent.
156- `source_tree_clean` covers this directory only (the only source the build reads); a
157 change elsewhere in the clone does not mark the record dirty.