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-8-spec.md

89 lines · 3832 bytes Raw Blame History Rendered
1# Specification: Milestone 8 — Omega Program Core (`OMEGA_PROGRAM_CORE`)
2
3```text
4Document ID: SPEC-OMEGA-M8
5Milestone: Milestone 8 (OMEGA_PROGRAM_CORE)
6Classification: Sovereign Machine Canonical Specification
7Target Substrate: Explicit Program Objects, Contracts, Cost Accounting, and Composition
8Status: SPECIFIED / IN PROGRESS (aien-spark/aien-architecture#20)
9Lineage: SILICON -> ATLAS (M1) -> PHYSICS (M2/M3) -> OMEGA (M4-M8) -> AIEN
10```
11
12---
13
14## 1. Executive Summary & Core Invariants
15
16Milestone 7 established the trusted verification engine (`OMEGA_VERIFY`).
17Milestone 8 formalizes programs from isolated semantic graph operations into first-class sovereign objects:
18
19> **A PROGRAM IS NOT MERELY A SEQUENCE OF INSTRUCTIONS; IT IS A BOUNDED SEMANTIC CONTRACT WITH DECLARED TYPES, COSTS, COMPOSITION LAWS, AND EVIDENCE OF VERIFICATION.**
20
21The `OMEGA_PROGRAM` substrate establishes:
221. **Explicit Program Objects**: Typed boundaries separating inputs, outputs, preconditions, postconditions, and resource costs.
232. **Deterministic Composition**: Algebraic composition $C = A \circ B$ where $C(x) = B(A(x))$ with automated intermediate type unification.
243. **Additive Cost Accounting**: Formally modeled costs (instruction count, register pressure, memory overhead) that compose strictly and monotonically.
254. **Verification-Coupled Realization**: Programs compile to native AArch64 machine code and must pass the M7 verification ladder ($V_0, V_1, V_2$).
26
27---
28
29## 2. Program Data Model & Interface
30
31```c
32typedef struct {
33 uint32_t insn_count;
34 uint32_t reg_pressure;
35 uint32_t memory_bytes;
36 uint32_t latency_cycles;
37} OmegaCost;
38
39typedef struct {
40 TypeTag input_type;
41 uint16_t input_width;
42 TypeTag output_type;
43 uint16_t output_width;
44 char precondition[64];
45 char postcondition[64];
46} OmegaContract;
47
48typedef struct {
49 SemanticId program_id;
50 char name[64];
51 OmegaContract contract;
52 OmegaCost cost;
53 OmegaGraph *graph;
54 RealizationObject realization;
55 bool is_realized;
56 bool is_verified;
57} OmegaProgram;
58
59typedef struct {
60 SemanticId task_id;
61 char description[128];
62 OmegaContract target_contract;
63 OmegaCost cost_budget;
64 size_t example_count;
65 uint64_t inputs[16];
66 uint64_t expected_outputs[16];
67} SynthesisTask;
68```
69
70### Composition Invariant:
71Given $A: X \to Y$ and $B: Y \to Z$:
72- Requires: $\text{Type}(A_{\text{out}}) == \text{Type}(B_{\text{in}})$
73- Derived Contract: $C: X \to Z$, with $\text{Pre}(C) = \text{Pre}(A)$, $\text{Post}(C) = \text{Post}(B) \circ \text{Post}(A)$
74- Derived Cost: $\text{Cost}(C) = \text{Cost}(A) + \text{Cost}(B)$
75
76---
77
78## 3. Qualification Gates for M8
79
801. `OMEGA_PROGRAM_OBJECT_PASS`: `OMEGA_PROGRAM` instantiated with explicit contracts and cost models.
812. `OMEGA_PROGRAM_CONTRACT_VALIDATION_PASS`: Type checking enforces input/output contract validity.
823. `OMEGA_PROGRAM_COMPOSITION_PASS`: Programs $A$ and $B$ composed into $C = A \circ B$ with intermediate type unification.
834. `OMEGA_PROGRAM_TYPE_MISMATCH_REFUSAL_PASS`: Incompatible composition ($A_{\text{out}} \ne B_{\text{in}}$) refused fail-closed.
845. `OMEGA_PROGRAM_COST_ACCOUNTING_PASS`: Composite cost $\text{Cost}(C) = \text{Cost}(A) + \text{Cost}(B)$ strictly verified.
856. `OMEGA_PROGRAM_REALIZATION_PASS`: Composite program lowered to native AArch64 machine instructions.
867. `OMEGA_PROGRAM_V0_STRUCTURAL_PASS`: Composite program passes M7 V0 structural verification.
878. `OMEGA_PROGRAM_V1_DIFFERENTIAL_PASS`: Composite program passes M7 V1 differential evaluation vs native execution.
889. `OMEGA_PROGRAM_V2_PROPERTY_PASS`: Composite program passes M7 V2 property/invariant verification.
8910. `OMEGA_PROGRAM_SYNTHESIS_TASK_PASS`: `SYNTHESIS_TASK` schema verified with input-output test harness ready for M9 search.