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
omega-mv / spec / discovery.md
| 1 | # Specification: Milestone 11 — Omega Library Discovery (`OMEGA_LIBRARY_DISCOVERY`) |
| 2 | |
| 3 | ```text |
| 4 | Document ID: SPEC-OMEGA-M11 |
| 5 | Milestone: Milestone 11 (OMEGA_LIBRARY_DISCOVERY) |
| 6 | Classification: Sovereign Machine Canonical Specification |
| 7 | Target Substrate: Autonomous Abstraction Discovery from Program Corpus with Verified Reuse |
| 8 | Status: SPECIFIED / IN PROGRESS (aien-spark/omega#17, aien-spark/aien-architecture#23) |
| 9 | Lineage: SILICON -> ATLAS (M1) -> PHYSICS (M2/M3) -> OMEGA (M4-M11) -> AIEN |
| 10 | ``` |
| 11 | |
| 12 | --- |
| 13 | |
| 14 | ## 1. Executive Summary & Doctrine |
| 15 | |
| 16 | Milestone 10 established the verified program library (`OMEGA_LIBRARY_V1`), enabling storage and retrieval of verified components. |
| 17 | Milestone 11 establishes **autonomous abstraction discovery** (`OMEGA_LIBRARY_DISCOVERY`): |
| 18 | |
| 19 | > **THE MACHINE MUST INVENT ITS OWN ABSTRACTIONS. IT EXTRACTS COMMON MEANINGS FROM PAST SOLUTIONS, PROVES THEM VALID, AND ADMITS THEM TO COMPRESS REASONING.** |
| 20 | |
| 21 | ### The Four M11 Invariants: |
| 22 | 1. **Corpus Compression**: Discovered abstraction compresses multiple verified programs across the corpus, reducing total description length ($\Delta \text{Cost} > 0$). |
| 23 | 2. **Semantic Preservation**: Factoring the abstraction into corpus programs preserves exact input-output behavior on all validation domains ($f_{factored}(x) == f_{original}(x)$). |
| 24 | 3. **Reused on Held-Out Tasks**: The discovered abstraction is successfully reused to solve previously unseen held-out synthesis tasks. |
| 25 | 4. **Search Cost Reduction**: The discovered abstraction reduces synthesis search depth and candidate exploration count compared to the primitive baseline. |
| 26 | |
| 27 | --- |
| 28 | |
| 29 | ## 2. Abstraction Discovery Architecture |
| 30 | |
| 31 | ### 2.1 Corpus Representation (`OmegaCorpus`) |
| 32 | A corpus contains verified programs $P_1, \dots, P_N$ generated by synthesis or manual specification to solve a collection of computational tasks. |
| 33 | |
| 34 | ### 2.2 Common Sub-Expression Mining |
| 35 | The discovery engine enumerates contiguous instruction sub-sequences and composition slices across the corpus programs. |
| 36 | Candidates occurring with frequency $\ge 2$ across distinct programs are extracted as candidate abstractions. |
| 37 | |
| 38 | ### 2.3 Non-Triviality & Utility Scoring |
| 39 | - **Non-triviality**: Must contain at least two operations (cannot be an existing primitive). |
| 40 | - **Utility / Compression Metric**: |
| 41 | $$\Delta \text{Cost}(A) = \sum_{P \in \text{Occurrences}(A)} (\text{Cost}(P) - \text{Cost}(P/A)) - \text{Cost}(A)$$ |
| 42 | where $\text{Cost}(P/A)$ is the cost of program $P$ refactored to call abstraction $A$ as a single component. |
| 43 | |
| 44 | ### 2.4 Verification Ladder & Admission |
| 45 | Every proposed abstraction is subjected to the full M7 verification engine: |
| 46 | - **$V_0$ Structural/Type**: Alignment, bounds, valid DAG, terminal `ret`. |
| 47 | - **$V_1$ Differential**: Exact parity against reference semantics across test domains. |
| 48 | - **$V_2$ Property**: Overflow wrapping, monotonic bounds. |
| 49 | Only abstractions passing all three stages are admitted into `OmegaLibrary`. |
| 50 | |
| 51 | --- |
| 52 | |
| 53 | ## 3. Qualification Gates |
| 54 | |
| 55 | 1. `OMEGA_DISCOVERY_CORPUS_MINING_PASS`: Extract recurring sub-programs from corpus. |
| 56 | 2. `OMEGA_DISCOVERY_NONTRIVIAL_PASS`: Reject trivial or single-op candidates. |
| 57 | 3. `OMEGA_DISCOVERY_COMPRESSION_PASS`: Verify positive description length reduction ($\Delta \text{Cost} > 0$). |
| 58 | 4. `OMEGA_DISCOVERY_SEMANTIC_PRESERVATION_PASS`: Behavioral equivalence preserved after refactoring. |
| 59 | 5. `OMEGA_DISCOVERY_V0_STRUCTURAL_PASS`: M7 V0 verification passes on discovered abstraction. |
| 60 | 6. `OMEGA_DISCOVERY_V1_DIFFERENTIAL_PASS`: M7 V1 differential verification passes on discovered abstraction. |
| 61 | 7. `OMEGA_DISCOVERY_V2_PROPERTY_PASS`: M7 V2 property verification passes on discovered abstraction. |
| 62 | 8. `OMEGA_DISCOVERY_LIBRARY_ADMISSION_PASS`: Discovered abstraction admitted to library catalog. |
| 63 | 9. `OMEGA_DISCOVERY_SEARCH_ACCELERATION_PASS`: Held-out task solved at lower depth / candidate count. |
| 64 | 10. `OMEGA_DISCOVERY_RECEIPT_PASS`: Master qualification receipt generated with full provenance. |