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 / realize_synth.md
| 1 | # Specification: Milestone 14 — Omega Realization Synthesis (`OMEGA_REALIZATION_SYNTHESIS`) |
| 2 | |
| 3 | ```text |
| 4 | Document ID: SPEC-OMEGA-M14 |
| 5 | Milestone: Milestone 14 (OMEGA_REALIZATION_SYNTHESIS) |
| 6 | Classification: Sovereign Machine Canonical Specification |
| 7 | Target Substrate: Automated $G_S \times G_M \to G_R$ Synthesis Targeting Declared Hardware Capabilities |
| 8 | Status: SPECIFIED / IN PROGRESS (aien-spark/omega#19, aien-spark/aien-architecture#25) |
| 9 | Lineage: SILICON -> ATLAS (M1) -> PHYSICS (M2/M3) -> OMEGA (M4-M14) -> AIEN |
| 10 | ``` |
| 11 | |
| 12 | --- |
| 13 | |
| 14 | ## 1. Executive Summary & Doctrine |
| 15 | |
| 16 | Milestone 14 establishes **automated machine-aware realization synthesis**: |
| 17 | |
| 18 | > **LOWERING IS NOT A HARDCODED COMPILER BACKEND. REALIZATION IS SYNTHESIS: $G_S \times G_M \to G_R$. THE MACHINE DISCOVERS HOW BEST TO EXECUTE A GIVEN SEMANTIC GRAPH ON PHYSICAL SILICON.** |
| 19 | |
| 20 | In the sovereign hierarchy: |
| 21 | - $G_S$ defines what computation means. |
| 22 | - $G_M$ defines the physical hardware topology (issue width, units, latencies, memory hierarchy), certified by Physics. |
| 23 | - $G_R$ is the synthesized native realization, bound to BOTH $G_S$ and $G_M$ via a cryptographic triple binding: |
| 24 | $$\text{REALIZATION\_ID} = \text{SHA256}(\text{OMG0} \mid \text{SEMANTIC\_ID} \mid \text{MACHINE\_ID} \mid \text{code\_bytes})$$ |
| 25 | |
| 26 | --- |
| 27 | |
| 28 | ## 2. Core Invariants |
| 29 | |
| 30 | 1. **Triple Identity Binding**: $REALIZATION_ID$ deterministically incorporates $SEMANTIC_ID$ ($G_S$), $MACHINE_ID$ ($G_M$), and machine code bytes. |
| 31 | 2. **Machine-Aware Scheduling**: Synthesis evaluates candidate instruction schedules and registers to exploit $G_M$'s issue width (e.g., 4-wide dispatch on DGX Spark Neoverse V2 vs 2-wide on QEMU virt) and functional unit concurrency. |
| 32 | 3. **Strict Semantic Preservation**: Executing $G_R$ natively produces outputs bit-for-bit identical to semantic evaluation of $G_S$. |
| 33 | 4. **Zero Foreign Toolchain**: Direct machine byte generation without LLVM, Clang, GCC assembler, or GNU `as`. |
| 34 | 5. **Mandatory M7 Verification**: Every synthesized realization passes $V_0$ structural, $V_1$ differential, and $V_2$ property verification before admission. |
| 35 | |
| 36 | --- |
| 37 | |
| 38 | ## 3. Data Structures & Declarations |
| 39 | |
| 40 | ```c |
| 41 | typedef struct { |
| 42 | const OmegaProgram *program; |
| 43 | const OmegaMachineGraph *machine; |
| 44 | bool optimize_latency; |
| 45 | uint32_t max_unroll_factor; |
| 46 | } RealizationSynthesisTask; |
| 47 | |
| 48 | typedef struct { |
| 49 | bool solved; |
| 50 | RealizationObject realization; |
| 51 | SemanticId realization_id; |
| 52 | uint32_t estimated_cycles; |
| 53 | uint32_t code_bytes_len; |
| 54 | VerifyReport verify_report; |
| 55 | } RealizationSynthesisResult; |
| 56 | |
| 57 | int omega_synthesize_realization(const RealizationSynthesisTask *task, |
| 58 | RealizationSynthesisResult *result); |
| 59 | ``` |
| 60 | |
| 61 | --- |
| 62 | |
| 63 | ## 4. Qualification Gates |
| 64 | |
| 65 | 1. `OMEGA_REAL_SYNTH_INIT_PASS`: Synthesis task initialized with valid $G_S$ and $G_M$. |
| 66 | 2. `OMEGA_REAL_SYNTH_TRIPLE_ID_PASS`: `REALIZATION_ID` deterministically incorporates $SEMANTIC_ID$ and $MACHINE_ID$. |
| 67 | 3. `OMEGA_REAL_SYNTH_SCHEDULE_OPT_PASS`: Machine-aware schedule optimization generates valid AArch64 machine words. |
| 68 | 4. `OMEGA_REAL_SYNTH_DGX_SPARK_PASS`: Realization specialized for 4-wide DGX Spark Grace V2 pipeline. |
| 69 | 5. `OMEGA_REAL_SYNTH_QEMU_VIRT_PASS`: Realization specialized for 2-wide QEMU virt pipeline. |
| 70 | 6. `OMEGA_REAL_SYNTH_SEMANTIC_PARITY_PASS`: Native execution matches semantic evaluation on test inputs. |
| 71 | 7. `OMEGA_REAL_SYNTH_V0_STRUCTURAL_PASS`: Synthesized realization passes M7 V0 structural verification. |
| 72 | 8. `OMEGA_REAL_SYNTH_V1_DIFFERENTIAL_PASS`: Synthesized realization passes M7 V1 differential evaluation. |
| 73 | 9. `OMEGA_REAL_SYNTH_V2_PROPERTY_PASS`: Synthesized realization passes M7 V2 property verification. |
| 74 | 10. `OMEGA_REAL_SYNTH_RECEIPT_PASS`: Master qualification receipt generated binding $G_S$, $G_M$, and $G_R$. |
| 75 | |
| 76 | --- |
| 77 | |
| 78 | ## 5. Amendment: program-driven realization |
| 79 | |
| 80 | Until `spec/program-realization.md`, `omega_synthesize_realization` emitted the fixed |
| 81 | `f(x) = 3x - 2` schedule for every program and checked it against hard-coded `3x - 2` values. |
| 82 | It now compiles the task's program body (schedule chosen from $G_M$, meaning never) and |
| 83 | verifies native execution against the independent semantic evaluator. The ten gates above |
| 84 | still pass; for the 3x-2 program the DGX Spark (preload) and QEMU virt (sequential) bytes are |
| 85 | unchanged. |