interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / docs / milestone-7-spec.md

87 lines · 5258 bytes Raw Blame History Rendered
1# Specification: Milestone 7 — Omega Trusted Verification Engine (`OMEGA_VERIFY`)
2
3```text
4Document ID: SPEC-OMEGA-M7
5Milestone: Milestone 7 (OMEGA_VERIFY)
6Classification: Sovereign Machine Canonical Specification
7Target Substrate: Multi-Tier Trusted Verification Ladder (V0, V1, V2)
8Status: SPECIFIED / IN PROGRESS (aien-spark/aien-architecture#19)
9Lineage: SILICON -> ATLAS (M1) -> PHYSICS (M2/M3) -> OMEGA (M4/M5/M6/M7) -> AIEN
10```
11
12---
13
14## 1. Executive Summary & Foundational Invariants
15
16Milestone 6 (`OMEGA_SELF_HOST`) established a closed-loop reproduction check of a fixed realization emitter. Correction 2026-09-30: that check holds by self-copy, not by compilation, and is not evidence of a self-hosting compiler (see `doctrine/ROADMAP.md` §3, M6 correction note).
17Milestone 7 establishes the **sovereign verification authority** of OMEGA:
18
19> **AIEN MAY PROPOSE. OMEGA MUST VERIFY. PHYSICS MUST AUTHORIZE. EVIDENCE DECIDES WHAT SURVIVES.**
20
21OMEGA requires a trusted, deterministic verification engine to gate candidate programs, realization binaries, and transformations before increasingly complex generated code is admitted into the ecosystem.
22
23The fundamental trust asymmetry is inviolable:
24
25```text
26GENERATOR = UNTRUSTED (Search, AIEN, Heuristics, Lowering)
27VERIFIER = TRUSTED (OMEGA Formal Ladder: V0, V1, V2)
28```
29
30No code, program, or transformation survives without passing the required verification tier.
31
32---
33
34## 2. The Verification Ladder
35
36The OMEGA verification engine implements a hierarchical ladder of increasing epistemic rigor:
37
38```text
39V5 — PROOF-CARRYING (Machine-checked proofs) [Future]
40V4 — SYMBOLIC / FORMAL (SMT, Equivalence proofs) [Future]
41V3 — ADVERSARIAL (Fuzzing, Fault injection, Boundary sweeps) [Future]
42V2 — PROPERTY / INVARIANT (Algebraic laws, Bounds, Contracts) [M7 MANDATORY]
43V1 — DIFFERENTIAL (Reference Semantic Eval vs Native Realization) [M7 MANDATORY]
44V0 — STRUCTURAL (Types, DAG validity, Memory bounds, Opcode decoding) [M7 MANDATORY]
45```
46
47### V0: Structural Verification
48Guarantees physical and syntactic safety before execution:
491. **Semantic Type Safety**: Operand types, bit-widths, and arities match operation specifications.
502. **DAG Integrity**: Semantic graph contains no cycles and no dangling object references.
513. **Target Profile Compliance**: Realization targets valid, admitted profile (`AARCH64_PROFILE_V8A_BAREMETAL`).
524. **Code Buffer Bounds**: $4 \le \text{code\_len} \le 4096$, strictly divisible by 4 bytes.
535. **Instruction Validity**: Every machine word decodes to a valid, permitted AArch64 instruction via the independent bitmask decoder (`aarch64_decoder`).
546. **Bounded Control Flow**: Function terminates strictly with `RET`; branches do not escape code bounds.
55
56### V1: Differential Verification
57Verifies semantic preservation between abstract evaluation and physical execution:
581. Drives an exhaustive or bounded test corpus $I = \{x_1, x_2, \dots, x_N\}$ across:
59 $$\text{Eval}_{\text{semantic}}(G, x_i) \quad \text{vs} \quad \text{Exec}_{\text{native}}(R, x_i)$$
602. Requires bit-for-bit identity across all test vectors:
61 $$\forall x_i \in I, \quad \text{Eval}(G, x_i) == \text{Exec}(R, x_i)$$
623. Refuses realization immediately upon any observed divergence.
63
64### V2: Property and Invariant Verification
65Validates that computation obeys declared semantic contracts and mathematical laws:
661. **Algebraic Laws**:
67 - Commutativity: $\forall a, b: op(a, b) == op(b, a)$ (e.g. `OP_ADD`, `OP_MUL`, `OP_AND`, `OP_OR`).
68 - Identity Elements: $\forall a: op(a, e) == a$ (e.g. $a + 0 = a$, $a \times 1 = a$, $a \land \text{0xFF...} = a$).
69 - Associativity: $\forall a, b, c: op(op(a, b), c) == op(a, op(b, c))$.
702. **Range and Bounds Safety**: Output values strictly reside within declared domain ranges $[V_{\min}, V_{\max}]$.
713. **Declared Overflow Policies**: Verifies wrapping on 64-bit boundary when `OVERFLOW_WRAP` is declared.
724. **Pre/Postconditions**: Explicit predicate constraints attached to semantic operations must hold over all admissible inputs.
73
74---
75
76## 3. Qualification Gates for M7
77
781. `OMEGA_VERIFY_V0_TYPE_PASS`: V0 structural verifier accepts well-typed graphs and rejects ill-typed graphs.
792. `OMEGA_VERIFY_V0_DAG_PASS`: V0 structural verifier rejects cyclic or dangling graphs.
803. `OMEGA_VERIFY_V0_CODE_BOUNDS_PASS`: V0 verifies code length, 4-byte alignment, and buffer boundaries.
814. `OMEGA_VERIFY_V0_INSN_DECODE_PASS`: V0 validates every instruction word and refuses corrupt/unallocated opcodes.
825. `OMEGA_VERIFY_V0_TERMINAL_RET_PASS`: V0 enforces strictly bounded control flow terminating in `RET`.
836. `OMEGA_VERIFY_V1_DIFFERENTIAL_PASS`: V1 confirms bit-for-bit output identity between semantic evaluation and native AArch64 execution across test corpus.
847. `OMEGA_VERIFY_V1_DIVERGENCE_REFUSAL_PASS`: V1 immediately detects and refuses mutant realization causing output mismatch.
858. `OMEGA_VERIFY_V2_COMMUTATIVITY_PASS`: V2 property verifier proves commutativity over declared commutative operations.
869. `OMEGA_VERIFY_V2_IDENTITY_PASS`: V2 property verifier proves identity element preservation.
8710. `OMEGA_VERIFY_V2_OVERFLOW_PASS`: V2 property verifier validates declared overflow wrapping semantics.