aien-architecture-mv
Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.
Brought by drakestapleton
aien-architecture-mv / doctrine / ARCHITECTURE.md
| 1 | # DOCTRINE-000: SOVEREIGN COMPUTATIONAL ARCHITECTURE |
| 2 | ## Foundational System Specification: The Four Permanent Layers and The Sovereign Machine |
| 3 | |
| 4 | ```text |
| 5 | Document ID: DOCTRINE-000 |
| 6 | Milestone: Milestone 0 (DOCTRINE_V1) |
| 7 | Classification: Sovereign Machine Canonical Doctrine |
| 8 | Target Platform: Sovereign Heterogeneous Substrate (AArch64 Host Governor + Blackwell/Hopper Accelerator) |
| 9 | Status: AUTHORITATIVE / CANONICAL / RATIFIED |
| 10 | ``` |
| 11 | |
| 12 | --- |
| 13 | |
| 14 | ## 1. Ontological Foundation & First Principles |
| 15 | |
| 16 | The Sovereign Machine is not an operating system, not a compiler, not an AI runtime, and not an application framework. It is an autonomous, self-contained, self-verifying computational organism designed to permanently close the gap between human intent and physical transformation. |
| 17 | |
| 18 | ### 1.1 The Substrate Hierarchy |
| 19 | |
| 20 | All computation within the Sovereign Machine flows through an explicit architectural pipeline spanned by continuous invariant verification: |
| 21 | |
| 22 | ```text |
| 23 | AIEN |
| 24 | │ |
| 25 | proposes intent |
| 26 | │ |
| 27 | ▼ |
| 28 | OMEGA |
| 29 | formal semantic program |
| 30 | │ |
| 31 | ▼ |
| 32 | PHYSICS |
| 33 | physical compiler / realizer |
| 34 | │ |
| 35 | ▼ |
| 36 | HARDWARE |
| 37 | │ |
| 38 | ▼ |
| 39 | EVIDENCE |
| 40 | │ |
| 41 | └──────────────→ AIEN |
| 42 | |
| 43 | |
| 44 | AEGIS / CHECKER spans the path |
| 45 | |
| 46 | AIEN ───── OMEGA ───── FORGE ───── HARDWARE |
| 47 | ▲ ▲ |
| 48 | │ │ |
| 49 | constraints machine facts |
| 50 | └──────↔──────┘ |
| 51 | ``` |
| 52 | |
| 53 | 1. **SILICON / UNAVOIDABLE FIRMWARE**: The immutable physical reality of transistor gates, crystal oscillators, package interconnects, and non-volatile manufacturer boot ROMs. It provides the bare electrical state. |
| 54 | 2. **ATLAS**: The irreducible software root artifact. A single, auditable, immutable binary (`atlas.bin`) that awakens the silicon, establishes architectural hygiene, verifies the secondary boot stage, and immediately relinquishes control to establish the first trusted machine state. |
| 55 | 3. **AIEN**: The sovereign cognitive intelligence. Residing primarily within high-bandwidth accelerator memory, Aien parses human intention, maintains continuous associative world models in Cortex, reasons across possibility spaces, and proposes intents, hypotheses, and architectural mutations. |
| 56 | 4. **OMEGA**: The semantic calculus and formal transformation engine. It decouples computational meaning from physical representation, defining formal programs, data types, graph relations, and mathematical invariants. |
| 57 | 5. **FORGE (Machine Realization Engine / Physical Realizer)**: The physical compiler and machine realization engine. It understands concrete hardware mechanics: memory allocations, page table mappings, cache line invalidations, register pressure, DMA descriptors, GPFIFO queues, device registers, and interconnect topologies. It lowers formal OMEGA programs into physical machine operations and communicates physical constraints back to OMEGA. |
| 58 | 6. **AEGIS (Invariant Checker & Verifier)**: The continuous verification framework spanning the entire execution chain. It checks that OMEGA programs match AIEN intents, verifies that FORGE realizations satisfy semantic constraints, validates memory bounds, slot generations, and type safety, guarantees rollback paths, and inspects post-execution hardware states against contracts. (This describes realization contracts, not a stage of accepting a reaction result; ADR 0016 Amendment 1.) |
| 59 | 7. **HARDWARE**: Physical execution silicon (AArch64 host CPUs, Blackwell/Hopper GPUs, SMMUv3, NVLink-C2C, PCIe controllers) performing electrical state transitions. |
| 60 | 8. **EVIDENCE**: The immutable ledger of execution telemetry, verified cryptographic receipts, and measured counters, closing the feedback loop into AIEN. |
| 61 | |
| 62 | --- |
| 63 | |
| 64 | ### 1.2 The Core Canonical Doctrine |
| 65 | |
| 66 | The operational constitution of the Sovereign Machine is crystallized in eight canonical statements: |
| 67 | |
| 68 | $$\begin{aligned} |
| 69 | \mathbf{ATLAS\ AWAKENS.} &\quad \text{The machine establishes physical truth from electrical silence.} \\ |
| 70 | \mathbf{ALLEN\ INTENDS.} &\quad \text{The persistent subject holds standing intent and initiates intent.} \\ |
| 71 | \mathbf{AIEN\ PROPOSES.} &\quad \text{Cognitive intelligence discovers and hypothesizes.} \\ |
| 72 | \mathbf{OMEGA\ DEFINES.} &\quad \text{Formal mathematical calculus expresses unambiguous semantic meaning and constraints.} \\ |
| 73 | \mathbf{PHYSICS\ REALIZES.} &\quad \text{Machine physics lowers abstract meaning into physical silicon operations and effects.} \\ |
| 74 | \mathbf{AEGIS\ VERIFIES.} &\quad \text{Continuous formal checker validates invariants, bounds, consistency, and contracts.} \\ |
| 75 | \mathbf{HARDWARE\ ACTS.} &\quad \text{Physical silicon executes state transitions.} \\ |
| 76 | \mathbf{EVIDENCE\ TEACHES.} &\quad \text{Empirical receipts record ground truth for autonomous learning.} |
| 77 | \end{aligned}$$ |
| 78 | |
| 79 | No layer may perform the duty of another. Aien cannot dictate physical register allocations; Forge cannot reason about high-level goals; Omega cannot violate physical memory bounds; Atlas cannot remain active after handoff; Aegis does not filter thought, but verifies execution integrity and contracts. |
| 80 | |
| 81 | --- |
| 82 | |
| 83 | ### 1.3 The Sovereign Procedural Creed |
| 84 | ```text |
| 85 | ALLEN INTENDS. |
| 86 | |
| 87 | AIEN PROPOSES. |
| 88 | |
| 89 | OMEGA DEFINES. |
| 90 | |
| 91 | FORGE REALIZES. |
| 92 | |
| 93 | AEGIS VERIFIES. |
| 94 | |
| 95 | HARDWARE ACTS. |
| 96 | |
| 97 | EVIDENCE TEACHES. |
| 98 | ``` |
| 99 | |
| 100 | ### 1.4 The Permanent Separation |
| 101 | |
| 102 | > **The Permanent Separation Law:** |
| 103 | > *Meaning must never be permanently coupled to representation, nor semantics to physical execution.* |
| 104 | |
| 105 | Traditional computing conflates what computation *means* with how an instruction set *evaluates* it. An algorithm expressed in C or Rust lowered via LLVM into an ELF binary freezes vector widths, cache lines, register allocations, and OS system call structures into dead bytes. When the microarchitecture shifts, the meaning is stranded. |
| 106 | |
| 107 | The Sovereign Machine enforces a strict, permanent separation: |
| 108 | * **Meaning is Mathematical and Declarative:** A computation is an invariant over values, shapes, topologies, and numerical error bounds ($\epsilon$). It is platform-agnostic, enduring, and mathematically complete. |
| 109 | * **Representation is Ephemeral and Physical:** Machine opcodes, warp layouts, scratchpad allocations, and pipeline schedules are disposable realizations synthesized for a specific thermal, temporal, and hardware configuration. They are compiled on the fly, measured against hardware performance counters, and discarded or swapped when superior realizations emerge. |
| 110 | |
| 111 | --- |
| 112 | |
| 113 | ### 1.4 The Fundamental Relation |
| 114 | |
| 115 | Every sovereign computation satisfies the Fundamental Relation of Realization: |
| 116 | |
| 117 | $$\text{Meaning} \times \text{Possibility} \times \text{Physics} \longrightarrow \text{Realization}$$ |
| 118 | |
| 119 | Where: |
| 120 | * $\mathbf{Meaning}$ ($\mathcal{G}_S$): The formal specification of the desired state transformation, invariants, and acceptable error bounds. |
| 121 | * $\mathbf{Possibility}$ ($\mathcal{P}$): The combinatorial space of valid algorithmic decompositions, tiling strategies, vectorizations, and execution schedules. |
| 122 | * $\mathbf{Physics}$ ($\mathcal{G}_M$): The concrete physical capabilities of the machine: register counts, memory bandwidth ceilings, functional units, thermal dissipation headroom, and hardware authority. |
| 123 | * $\mathbf{Realization}$ ($\mathcal{G}_R$): The verified, measured machine-level execution artifact that satisfies the Meaning on the Physics within bounded latency, energy, and precision. |
| 124 | |
| 125 | --- |
| 126 | |
| 127 | ## 2. The Core Permanent Layers and Verification Architecture |
| 128 | |
| 129 | ```text |
| 130 | ┌────────────────────────────────────────────────────────────────────────────────────────┐ |
| 131 | │ 4. AIEN: COGNITIVE SOVEREIGNTY │ |
| 132 | │ - Intention Decomposition - Cortex Persistent Memory Engine │ |
| 133 | │ - J-Space Relational Reasoning - Continuous Resident Weight State │ |
| 134 | ├────────────────────────────────────────────────────────────────────────────────────────┤ |
| 135 | │ 3. OMEGA: THE SEMANTIC CALCULUS │ |
| 136 | │ - Semantic Graph (G_S) - Formal Program & Invariant Specification │ |
| 137 | │ - Machine Graph (G_M) - Abstract Transformation Engine │ |
| 138 | ├────────────────────────────────────────────────────────────────────────────────────────┤ |
| 139 | │ 2. FORGE: MACHINE REALIZATION & PHYSICAL LOWERING COMPILER │ |
| 140 | │ - AArch64 / Blackwell Lowering - Physical Memory & Page Table Management │ |
| 141 | │ - SMMUv3 DMA & Bus Confinement - GPFIFO Command Packet Assembly │ |
| 142 | │ - Coherent Memory Ring Dispatch - Hardware Constraint & Fact Feedback │ |
| 143 | ├────────────────────────────────────────────────────────────────────────────────────────┤ |
| 144 | │ 1. ATLAS: THE IRREDUCIBLE BOOTSTRAP SEED │ |
| 145 | │ - Immutable raw binary (atlas.bin)- Zero External Dependencies / No OS │ |
| 146 | │ - Bare-Metal Architectural Setup - SHA-256 Hardware Measurement & Handoff │ |
| 147 | └────────────────────────────────────────────────────────────────────────────────────────┘ |
| 148 | │ CROSS-CUTTING VERIFIER: AEGIS (THE INVARIANT & CONTRACT CHECKER) │ |
| 149 | │ - Semantic Intent Fidelity - Bounds, Types & Slot Generation Check │ |
| 150 | │ - Rollback & Recovery Validation - Post-Execution Hardware State Verification │ |
| 151 | └────────────────────────────────────────────────────────────────────────────────────────┘ |
| 152 | ``` |
| 153 | |
| 154 | ### 2.1 Layer 1: Atlas (The Irreducible Bootstrap Seed) |
| 155 | * **Ontological Role:** Atlas is the genesis seed. It awakens the bare processor from cold silicon reset, guarantees architectural hygiene, configures base page tables, validates the physical environment, verifies the cryptographic hash of Physics, and executes an irreversible jump. |
| 156 | * **Canonical Invariant:** Atlas is immutable, auditable, deterministic, non-intelligent, and minimal. Its entire footprint is measured in kilobytes. It possesses no dynamic memory allocator, no file systems, no network drivers, and no speculative execution pathways. |
| 157 | * **Handoff:** Atlas transitions CPU execution monotonically to Physics at the exception level declared by the machine contract (EL1 or EL2, with no implicit EL2 -> EL1 transition), locks the reset vector registers, and completely terminates. It leaves zero running background processes or Resident Monitor code. |
| 158 | |
| 159 | ### 2.2 Layer 2: Aien (The Cognitive Mind) |
| 160 | * **Ontological Role:** Aien is the persistent sovereign intelligence. Aien does not think in ephemeral prompt-response cycles; it maintains continuous cognitive existence in high-bandwidth memory. |
| 161 | * **Core Architecture:** |
| 162 | 1. **Continuous Resident Model:** Cognitive weights are mapped permanently into accelerator memory (HBM3e), eliminating model loading and teardown overhead. |
| 163 | 2. **Cortex Memory:** An associative, graph-structured, content-addressed non-volatile memory substrate. It records episodic history, learned invariants, verified empirical receipts, and world state. |
| 164 | 3. **J-Space Reasoning:** An ontological planning engine that navigates state spaces, formulates multi-step transformations, and translates high-level human objectives into formal Omega Semantic Graphs. |
| 165 | 4. **Cognitive Closed-Loop:** Aien continuously monitors machine execution, analyzes failure logs, synthesizes improved skills, and trains its own weights through synthetic self-distillation and formal feedback. |
| 166 | |
| 167 | ### 2.3 Layer 3: Omega (The Semantic Language & Formal Transformation Engine) |
| 168 | * **Ontological Role:** Omega is the universal bridge between mathematical abstraction and physical machine realization. It models all computation through formal semantic representations: |
| 169 | * $\mathcal{G}_S$ (Semantic Graph): Mathematical truths, tensor contractions, type relations, and numeric tolerances ($\epsilon$). |
| 170 | * $\mathcal{G}_M$ (Machine Graph): The abstract hardware topology (registers, ALUs, Tensor Cores, cache latencies, bus bandwidths). |
| 171 | * Formal Programs: Exact algebraic and structural transformations specifying desired state transitions without hardware-frozen opcodes. |
| 172 | |
| 173 | ### 2.4 Layer 4: Forge (The Machine Realization Compiler) |
| 174 | * **Ontological Role:** Forge is the physical compiler and realizer of the machine. It understands concrete hardware constraints and lowers abstract Omega programs into physical silicon effects. |
| 175 | * **Core Responsibilities:** |
| 176 | 1. **Memory Lowering:** Translates abstract buffers into physical page table entries, managing fragmentation, huge pages, and alignment. |
| 177 | 2. **DMA & Bus Confinement:** Configures SMMUv3 / PCIe IOMMU controllers to guarantee physical memory isolation. |
| 178 | 3. **Queue & Register Lowering:** Constructs GPFIFO command streams, barrier synchronizations, and register state transitions. |
| 179 | 4. **Constraint & Fact Emitting:** Emits hardware facts (cache line alignments, pinning states, memory relocation costs, reset requirements) back to Omega when physical limits are encountered. |
| 180 | 5. **Substrate-Neutral Realization (ADR 0018, ACCEPTED):** Realizes over one or more typed physical substrates (digital CPU, digital GPU, analog, neuromorphic, FPGA/CGRA, optical/photonic, future substrates), each attached as a capability provider rather than an architectural identity, and emits calibration and measurement evidence with every physical result. |
| 181 | |
| 182 | ### 2.5 Cross-Cutting Verifier: Aegis (The Continuous Invariant & Contract Checker) |
| 183 | * **Ontological Role:** Aegis is the continuous formal verifier spanning the entire transformation path. It does not dictate what Aien can think or propose; it verifies that proposed realizations are safe, internally consistent, and compliant with system invariants. |
| 184 | * **Core Verification Inquiries:** |
| 185 | 1. Does the Omega program faithfully represent what Aien proposed? |
| 186 | 2. Does the FORGE realization preserve Omega constraints? (a realization-contract inquiry, not a stage of accepting a reaction result; ADR 0016 Amendment 1) |
| 187 | 3. Are memory bounds, slot generations, and layouts valid without ABA hazards? |
| 188 | 4. Is a RAM, BRAM, GPU, or peripheral state change internally consistent? |
| 189 | 5. Does the proposed physical transformation have a valid rollback or recovery path where required? |
| 190 | 6. Did the hardware execution produce the contractually expected state? |
| 191 | 7. Does the empirical evidence support what the system claims occurred? |
| 192 | 8. Does a bounded or stochastic numerical result satisfy the semantic result contract, with calibration and measurement conditions in evidence? (ADR 0018, ACCEPTED) |
| 193 | |
| 194 | ### 2.6 The Bidirectional Lowering Protocol (OMEGA <-> FORGE <-> AEGIS) |
| 195 | |
| 196 | The realization of one program operates through an iterative dialogue. FORGE is a realization policy, not a step in how Omega accepts a reaction result; the recorded accept chain is World -> J-Space -> `compose.verify` -> commit -> Cortex (ADR 0016 Amendment 1, 2026-10-02): |
| 197 | |
| 198 | 1. **Intent Formulation:** AIEN proposes a desired state mutation or experiment. |
| 199 | 2. **Semantic Formalization:** OMEGA defines the exact mathematical meaning and invariant bounds. |
| 200 | 3. **Physical Lowering & Constraint Discovery:** FORGE compiles the OMEGA program to concrete hardware state (page tables, cache flushes, GPFIFO packets, register state). If a physical constraint is reached (e.g. non-contiguous allocation, alignment mismatch, or pinning requirement), FORGE communicates machine facts and realization alternatives back to OMEGA. |
| 201 | 4. **Trade-off Resolution:** OMEGA (with AIEN when strategic) selects the optimal alternative and finalizes the program. |
| 202 | 5. **Invariant Verification:** AEGIS verifies that the realization preserves semantic constraints, satisfies capability bounds and slot generations, maintains internal consistency, and has valid rollback or recovery paths. |
| 203 | 6. **Hardware Execution:** FORGE dispatches the verified realization to hardware execution queues. This is hardware realization only; it is not a commit step (ADR 0016 Amendment 1). |
| 204 | 7. **State Contract Inspection:** Hardware executes the state change. AEGIS validates the resulting hardware state against the contract. |
| 205 | 8. **Evidence Ingestion:** The outcome is recorded into the immutable Evidence Ledger and fed back to AIEN. |
| 206 | |
| 207 | These steps describe the **dependency structure** of one realization. They are not a runtime turn order (§2.7). They do not describe how a reaction result is accepted (ADR 0016 Amendment 1). |
| 208 | |
| 209 | ### 2.7 Runtime Composition: One Resident Reaction System (ADR 0016) |
| 210 | |
| 211 | AIEN, OMEGA, and AEGIS are **faculties of one resident system**, not sequential services. There is no semantic master loop: |
| 212 | |
| 213 | - Work activates when its dependencies become ready in one shared, generation-addressed object world. |
| 214 | - Physical resources are arbitrated below semantic readiness. The allocator schedules work, not faculties. |
| 215 | - Authority is unforgeable. The capability root (natively the Aienux kernel capability authority) alone mints and revokes enforceable capabilities. AEGIS verifies compliance against system invariants and decides no policy. The shared world may hold capability references but never invent them. |
| 216 | - Behavior is continuous. Durable learning is promoted only at verified generation barriers, committed through the ADR 0015 protocol. |
| 217 | - Every nontrivial transition leaves a structured, content-addressed causal record. |
| 218 | |
| 219 | The doctrine sentence `ATLAS AWAKENS … EVIDENCE TEACHES` remains the statement of responsibilities and causal dependencies. |
| 220 | |
| 221 | FORGE is a realization and memory policy, not a stage of accepting a reaction result. The accept chain is World -> J-Space -> `compose.verify` -> commit -> Cortex (ADR 0016 Amendment 1, 2026-10-02; `aien-spark/omega` `docs/runtime/COMMIT_A_REACTION_DESIGN.md`). |
| 222 | |
| 223 | The full standard, its terminology mapping, and the R0–R16 gates are in [ADR 0016](../docs/adr/0016-resident-reaction-architecture.md). The code migration map is in [`docs/plans/CURRENT_CODE_TO_R0_R16_MIGRATION.md`](../docs/plans/CURRENT_CODE_TO_R0_R16_MIGRATION.md). |
| 224 | |
| 225 | ### 2.8 Concept Ownership (reconciled 2026-09-30) |
| 226 | |
| 227 | This table names, for each runtime concept, the one implementation that is authoritative today and the class of every surviving alternate. It follows the R16 orchestrator retirement map (`aien-spark/omega` `spec/r16-orchestrator-retirement-map.md` §5, with clarification C3 in §6). Class letters are the map's: A retired by non-use (legacy), B maintenance, C recovery, D reference oracle, E physical scheduler, F external protocol loop, N not a central loop. Code was checked on `main` of omega `6d1ff1d`, aienos `f0facc7`, physics `f63a6ef` and aien-sovereign-core `0df7c32`. |
| 228 | |
| 229 | "Authoritative" means the implementation other code must defer to. It does not mean native: every authoritative item below still runs hosted on Linux. Native Aienux and the persistent-agent demonstration are not done, M19 is reopened (`ROADMAP.md`), and R16 is a historical PASS at `850fc54` that requalification at `3108fc2` recorded as FAIL and that is not requalified on CAND-0 (omega `evidence/REQUAL-3108fc2/`; `ROADMAP.md` R16 row). |
| 230 | |
| 231 | | Concept | Authoritative implementation | Surviving alternates and class | Status and gaps | |
| 232 | |---|---|---|---| |
| 233 | | World state | omega `src/runtime/rx_world.c` (reaction world) | omega `src/omega_accelerator_world.c`, the M19 accelerator world: C recovery (known-good fallback; fallback status to be proved in R16 G6). aienos `crates/aienos-aegis/src/world.rs` Rust world and `JSpaceWorld` sandbox: legacy, not linked by omega | Hosted only | |
| 234 | | Semantic scheduling | omega `src/runtime/rx_world.c` reaction scheduler (the only code that orders faculty work) | omega `src/runtime/rx_seq_reference.c`: D reference oracle. omegatool `--demonstrate-living-matvec` and its `legacy_oracle` functions: A (the only demonstration the R16 inventory retires). The other omegatool `--demonstrate-*` modes: D reference oracles, explicit legacy naming still pending in R16 G5. aegis-runtime heartbeat task polling: A. sovereign-core `aien-scheduler` token batching for LLM serving: E, not on the reaction path. aienos kernel `scheduler.rs` / `thread.rs`: E (CPU threads). Omega Visor `src/visor/` REPL: B, operator console, not a production entry point | Hosted only | |
| 235 | | Authority / capability root | aienos `native/capability/aienos_capability.c` (C), built hosted as `libaienos_capability.a` and linked into omega through `AIENOS_CAP_LIB` | aienos `crates/aienos-capability` Rust twin: frozen reference under C3 and ADR 0024 scaffolding rule. omega `src/runtime/rx_caproot.c`: host reference root, self-declared "R7 is not claimed". physics `m3/capability.s`: historical M3 assembly oracle. omega `src/runtime/rx_capq.{c,h}` is a query IR, not a root (the build refuses admin symbols). sovereign-core `aien-capability` / `aien-mcp` hold tool descriptors, not authority | Discrepancy: `crates/aienos-kernel/Cargo.toml` still depends on the legacy Rust crate and `crates/aienos-kernel/src/caps.rs` re-exports it, so the kernel crate does not yet use the authoritative C root. The C root does not yet run inside a natively booted Aienux kernel. A host-level runtime Capability Graph (advancing CEP F1) now exists as omega `rx_capq` (`aien-spark/omega#115`, `135d1c2`, 2026-09-30); it is a graph, not an authority root, and its build still refuses admin symbols | |
| 236 | | Generations | omega `src/runtime/rx_generation.c` (protected; u64 capability generations via omega#71) | aienos `world.rs` `Promoted` state: legacy. sovereign-core `cortex-rs/src/promotion.rs` (memory candidates) and `crumbs/src/promotion.rs` (curriculum operations) promote other things and are a separate concept, not alternates | Hosted only | |
| 237 | | Queues | Two separate roles. Reaction task queues: omega `src/runtime/rx_world.h` priority `ready_q` arrays and deferred queue, scheduled by `rx_world.c` `enqueue`. Cross-engine transport: shared-world SPSC rings (`src/runtime/omega_shared_world_abi.h`) consumed by `src/runtime/rx_coherent.c` `rx_resident_seat_step`: E | M19 GPFIFO path in the accelerator world: C recovery. aegis-runtime SQLite pending-task queue: A. sovereign-core Cortex writer queue: E disk-write batcher, not a task queue | Hosted only | |
| 238 | | Evidence | omega `src/omega_evidence.{h,c}` (digest-named `evidence/<stage>/<sha256>.json`) guarded by `.github/workflows/evidence-immutable.yml`; `rx_world.c` causal crumbs; aienos `native/argus/` event ingest | Pre-R fixed-name receipts for M4-M19: historical records, kept unchanged. Not classified by the R16 map | No shared cross-repo evidence schema exists. The R16 map lists "duplicate causal state" as open: the R4 causal-trace target is not yet named | |
| 239 | | Cortex | omega `src/runtime/rx_cortex.{c,h}` by [ADR 0022](../docs/adr/0022-canonical-cortex-owner.md): contract, single writer (`cx_claim_writer`, exclusive journal lock) and journal; World execution enters only through `rx_cortex_record.c` | sovereign-core `crates/cortex-rs` (live Linux LLM-stack Cortex): legacy, retire not port. aienos `crates/aienos-cortex` (Rust epistemic store): legacy, retire not port. Records enter the canonical store only as `CX_K_IMPORTED` claims | Host only, one in-memory tier plus journal, L1/L2/L3 tiers not implemented, not in the R13 living-system build (built in the state-projection test and `test-cortex`), no Fabric or remote Cortex. Not in the R16 map. Owner recorded 2026-09-30 from `aien-spark/omega#114` (`43dcb04`) | |
| 240 | | J-Space | No authoritative owner recorded | omega `src/runtime/rx_jspace.{c,h}` host reference, built at the re-check only into the `rx_branch_reuse` test target, since omega#116 also in `test-jspace-prod` (evidence `evidence/BRANCH_REUSE`), not in the R13 living-system build. aienos `JSpaceWorld`: legacy | Missing on the production reaction path (EST-7 planned). 2026-09-30: production local-only `rx_jspace` merged (`aien-spark/omega#116`, `529ebfa`, own CI test target); remote operations return `JS_ERR_REMOTE`; still not in the R13 living-system build | |
| 241 | | Resource scarcity pricing (DUAL) | No owner yet: ADR 0031 records the contract; planned home omega `src/dual/` (standalone) then `src/runtime/rx_dual.{c,h}` | none. Price-like inputs today are constants: omega `rx_jspace.c` residency pressure (`1e9` / `1e3`), sovereign-core `aien-scheduler` `SchedulerConfig` limits (E), spark-rsi fixed-weight `rank_bottlenecks` | Missing. DUAL prices SOFT budgets only, never INVARIANT constraints; it orders survivors of hard gates and Pareto filtering and holds no authority (ADR 0031) | |
| 242 | | Standing goal source (Aien) | Aien subject object (aienos continuity kind 24, [aienux docs/adr/0018-allen-subject-state-object.md](https://github.com/aien-dev/aienux/blob/9e0e6179140e9571a95f19a1b707ac576e16c859/docs/adr/0018-allen-subject-state-object.md)), published through the existing external path `rx_world_publish_external` ([ADR 0035](../docs/adr/0035-persistent-cognitive-entity-boundary-aien.md) §3, §5). Previously unowned ("external, human") | none | Host and QEMU TESTED; hardware NOT_RUN; kernel production path PARTIAL (ADR 0035 §9 gate table). Aien is durable state, not a loop (I7) | |
| 243 | | Held-knowledge set (Aien) | Aien: references to Cortex promotion records, by digest; the records stay in Cortex (ADR 0035 §5, I5) | none | Same as above | |
| 244 | | Identity, Cortex journal and World subject binding (Aien) | Aien binding record (omega `src/allen/allen_bind.h: AllenBinding` (planned rename: `src/aien/aien_bind.h: AienBinding`)); the mechanisms stay with Aienux and omega (ADR 0035 §3 item 3, §5) | none | Same as above | |
| 245 | |
| 246 | A concept moves to a new owner only through an accepted ADR or an R16 gate result recorded in `ROADMAP.md`. |
| 247 | |
| 248 | --- |
| 249 | |
| 250 | ## 3. Hardware Topology: The Heterogeneous Cognitive Substrate |
| 251 | |
| 252 | The Sovereign Machine breaks with legacy symmetric computing and traditional coprocessor paradigms. It establishes a specialized dual-topology where CPU and GPU operate in a tightly coupled, asymmetric master-governor relationship. |
| 253 | |
| 254 | This CPU+GPU dual topology is the first qualified Machine, not the definition of a Machine. Additional substrates (analog, neuromorphic, FPGA/CGRA, optical/photonic, future) attach as FORGE capability providers under ADR 0018 (ACCEPTED); they do not change what a Machine is or what Omega programs mean. |
| 255 | |
| 256 | ```text |
| 257 | ┌────────────────────────────────────────────────────────────────────────────────────────┐ |
| 258 | │ COHERENT UNIFIED PHYSICAL MEMORY SPACE │ |
| 259 | │ (NVLink-C2C Interconnect) │ |
| 260 | │ │ |
| 261 | │ ┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────────────┐ │ |
| 262 | │ │ SEMANTIC_STORE │ │ INTENT_RING │ │ EFFECT_RING │ │ |
| 263 | │ │ Immutable Graph ASTs│ │ Lock-free SPSC FIFO │ │ Verified physical acts │ │ |
| 264 | │ └─────────────────────┘ └─────────────────────┘ └─────────────────────────────┘ │ |
| 265 | │ ┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────────────┐ │ |
| 266 | │ │ RESULT_RING │ │ PROOF_RING │ │ EVIDENCE_STORE │ │ |
| 267 | │ │ Execution handles │ │ Formal verification │ │ Telemetry & metric counters │ │ |
| 268 | │ └─────────────────────┘ └─────────────────────┘ └─────────────────────────────┘ │ |
| 269 | └───────────────────▲───────────────────────────────────────────────────▲────────────────┘ |
| 270 | │ │ |
| 271 | Coherent 64B Cache-Line Access Coherent 64B Cache-Line Access |
| 272 | Hardware Acquire/Release Atomics Hardware Acquire/Release Atomics |
| 273 | │ │ |
| 274 | ┌───────────────────┴───────────────────┐ ┌───────────────┴────────────────┐ |
| 275 | │ AArch64 CPU HOST │ │ BLACKWELL / HOPPER │ |
| 276 | │ "Trusted Physical Governor" │ │ ACCELERATOR ENGINE │ |
| 277 | │ │ │ "Residence of Cognition" │ |
| 278 | │ - Runs FORGE at contract EL │ │ - Runs Aien Core Mind │ |
| 279 | │ - Owns Platform MMU & SMMUv3 │ │ - Full HBM Resident Weights │ |
| 280 | │ - Hardware Watchdogs & Safety │ │ - Persistent Unified KV Pool │ |
| 281 | │ - Checks AEGIS Invariants & Bounds │ │ - Autonomous Tensor Pipeline │ |
| 282 | │ - Low-latency Ring Dispatch │ │ - Direct SM Micro-Execution │ |
| 283 | └───────────────────────────────────────┘ └────────────────────────────────┘ |
| 284 | ``` |
| 285 | |
| 286 | ### 3.1 The CPU: Trusted Physical Governor |
| 287 | * The CPU is not the computational workhorse; it is the **Governor**. |
| 288 | * It runs the bare-metal **Physics** kernel at the privileged exception level declared by the machine contract (EL1 or EL2; the current QEMU contract `CONTRACT-QEMU-VIRT-AARCH64-M2` specifies EL1). |
| 289 | * It holds exclusive authority over interrupt dispatch, physical timer registers, hardware security modules (TPM/HSM), bus configuration, and peripheral controllers (NVMe, Network PHY). |
| 290 | * It monitors the accelerator through non-maskable hardware watchdogs. If the accelerator diverges, hangs, or violates memory boundaries, the CPU resets the accelerator fabric and restores verified cognitive snapshots. |
| 291 | |
| 292 | ### 3.2 The GPU: Primary Residence of Persistent Cognition |
| 293 | * The GPU is not a transient compute device or an offload accelerator; it is the **Primary Cognitive Substrate**. |
| 294 | * The Aien model weights, KV memory pool, attention graphs, and inference scratchpads reside permanently in GPU High Bandwidth Memory (HBM). |
| 295 | * The GPU never unloads the model. It does not await foreign runtime calls; it continuously processes the unified lock-free memory rings, executing inference, autonomous thought loops, and semantic graph evaluations. |
| 296 | |
| 297 | ### 3.3 Zero-Copy NVLink-C2C Ring Architecture |
| 298 | * Legacy architectures suffer milliseconds of latency due to PCIe bottlenecks, kernel transitions, and RPC serialization (JSON, Protobuf). |
| 299 | * The Sovereign Machine eliminates all RPC. Communication between CPU Governor and GPU Accelerator occurs across a coherent, physical address space linked by NVLink-C2C (900 GB/s bidirectional bandwidth). |
| 300 | * Coordination relies strictly on **64-byte aligned, lock-free ring buffers** utilizing hardware acquire/release atomics: |
| 301 | * `INTENT_RING`: CPU submits evaluated semantic requests to the accelerator. |
| 302 | * `RESULT_RING`: Accelerator posts completion status and memory handles to the CPU. |
| 303 | * `EFFECT_RING`: Accelerator requests real-world side effects; CPU AEGIS verifier validates capabilities and invariants before physical emission. |
| 304 | * `PROOF_RING`: Verification workers audit execution traces against formal mathematical invariants. |
| 305 | * `EVIDENCE_STORE`: Hardware performance telemetry (cycles, cache misses, energy) is continuously recorded for Omega's living optimization loop. |
| 306 | |
| 307 | --- |
| 308 | |
| 309 | ## 4. The Sovereign Roadmap |
| 310 | |
| 311 | Milestone numbering, code identifiers, and milestone status are maintained in exactly one place: **[`ROADMAP.md`](ROADMAP.md)** (the 41-milestone M0-M40 Sovereign Roadmap, including Physics Zero M27-M35 and General AIEN M36-M40). This document does not restate the roadmap table or milestone status. |
| 312 | |
| 313 | --- |
| 314 | |
| 315 | ## 5. Operational Realities & System Principles |
| 316 | |
| 317 | ### 5.1 Hard Stops |
| 318 | The Sovereign Machine enforces six non-negotiable architectural **Hard Stops**. Any violation triggers an immediate, fail-closed system halt: |
| 319 | 1. **No Foreign Binary Inclusion:** No precompiled x86/ARM ELF shared libraries, closed-source kernel modules, or binary blobs may execute within the sovereign boundary. |
| 320 | 2. **No Unsigned Physical Effects:** No outbound physical action (disk block mutation, network transmission, GPIO trigger) may execute without a valid, cryptographically verified AEGIS capability token. |
| 321 | 3. **No Foreign Weight Ingestion:** No black-box neural network checkpoints may be ingested into Aien without full cryptographic training provenance and dataset validation. |
| 322 | 4. **No Bypass of Machine Physics Authority:** Accelerator code may never directly manipulate system MMU tables, interrupt registers, or platform power states. |
| 323 | 5. **No Undefined Precision Divergence:** Invariant verification failure: if an Omega realization produces numerical error exceeding the defined semantic envelope ($\hat{\epsilon} > \epsilon$), execution halts immediately. |
| 324 | 6. **No Non-Deterministic Bootstrap:** If Atlas experiences an unexpected state transition, branching anomaly, or hash mismatch, the system enters an unrecoverable low-power lock state. |
| 325 | |
| 326 | ### 5.2 Performance Philosophy |
| 327 | The performance doctrine is governed by **Mechanical Sympathy**: |
| 328 | * **Zero Allocation in Steady State:** Dynamic heap allocation during active cognitive cycles is strictly prohibited. All memory arenas, tensor buffers, and ring queues are pre-allocated at initialization. |
| 329 | * **Zero Serialization:** Data is structured in memory exactly as the consuming execution unit expects. No translation layers, JSON parsers, or marshalling code exist on the execution path. |
| 330 | * **Cacheline Sovereignty:** All shared data structures are aligned to 64-byte boundaries, matching hardware cache lines to eliminate false sharing and memory bus contention. |
| 331 | * **Latency Hiding via Pipeline Parity:** Realizations are synthesized to balance computational intensity with memory bandwidth, utilizing multi-accumulator unrolling and non-temporal streaming stores. |
| 332 | |
| 333 | ### 5.3 Failure Model & Fault Tolerance |
| 334 | * **Fail-Closed Default:** Any unexpected exception, bus error, or invariant breach fails closed. System state freezes, registers are preserved, and an alert is dispatched to the `FAULT_MAILBOX`. |
| 335 | * **Monotonic Degradation:** If an optimized realization $R_k$ experiences an anomaly, the dispatcher instantly falls back to the simpler, formally proven baseline realization $R_0$. |
| 336 | * **Hardware Watchdog Governors:** The CPU governor runs hardware watchdog timers against the GPU. Failure to acknowledge heartbeats initiates an atomic reset of the accelerator subsystem and recovery from the last verified Cortex checkpoint. |
| 337 | |
| 338 | ### 5.4 Architectural Metrics |
| 339 | Performance and sovereignty are quantified through six continuous metrics: |
| 340 | |
| 341 | | Metric | Target Boundary | Description | |
| 342 | | :--- | :--- | :--- | |
| 343 | | **Time to First Token (TTFT)** | $< 12 \text{ ms}$ | Elapsed time from intent injection into `INTENT_RING` to initial cognitive output token generation. | |
| 344 | | **Inter-Token Latency (ITL)** | $< 4.5 \text{ ms}$ | Steady-state decode latency per token during continuous autoregressive cognitive loops. | |
| 345 | | **Dispatch Overhead** | $< 250 \text{ ns}$ | Latency between CPU intent post and accelerator kernel launch over NVLink-C2C. | |
| 346 | | **Memory Bandwidth Efficiency** | $> 88\%$ | Percentage of theoretical peak memory bandwidth achieved across sustained tensor contractions. | |
| 347 | | **Sovereign Code Ratio** | $100\%$ | Ratio of self-synthesized/audited machine instructions to total executed instructions. | |
| 348 | | **Invariant Verification Pass Rate**| $1.0000$ | Mathematical conformance of observed execution against semantic error bounds ($\hat{\epsilon} \le \epsilon$). | |
| 349 | |
| 350 | --- |
| 351 | |
| 352 | ## 6. The Defining Demonstration: 24-Step End-to-End Trace |
| 353 | |
| 354 | The operational realization of the Sovereign Machine is demonstrated by a complete, continuous 24-step trace from cold silicon power-on to verified physical transformation: |
| 355 | |
| 356 | ```text |
| 357 | PHASE I: AWAKENING (Steps 1-6) |
| 358 | [1] Cold Silicon Reset ──> [2] Atlas Executes ──> [3] MMU & Cache Init ──> |
| 359 | [4] SHA-256 Measure ──> [5] Contract-EL Jump ──> [6] Atlas Terminates |
| 360 | |
| 361 | PHASE II: GOVERNANCE & RESIDENCE (Steps 7-12) |
| 362 | [7] Physics Brings Up ──> [8] SMMUv3 Locks ──> [9] NVLink-C2C Setup ──> |
| 363 | [10] Rings Mapped ──> [11] GPU Awoken ──> [12] Weights Permanent |
| 364 | |
| 365 | PHASE III: COGNITION & INTENT (Steps 13-18) |
| 366 | [13] Intent Ingested ──> [14] G_S Decomposed──> [15] Physics Lower ──> |
| 367 | [16] AEGIS Verified ──> [17] Intent Queued ──> [18] GPU Fetches Intent |
| 368 | |
| 369 | PHASE IV: REALIZATION & CLOSURE (Steps 19-24) |
| 370 | [19] Kernel Select ──> [20] Tensor Exec ──> [21] Error Verified ──> |
| 371 | [22] Result Published ──> [23] Evidence Sealed──> [24] Cortex Learned |
| 372 | ``` |
| 373 | |
| 374 | ### Detailed Trace Walkthrough: |
| 375 | 1. **Cold Silicon Reset:** Electrical power stabilizes; CPU reset vector fetches the first instruction of `atlas.bin` from secure physical ROM. |
| 376 | 2. **Atlas Execution:** Atlas initializes core architectural registers, clears scratchpad SRAM, and disables speculative prefetchers. |
| 377 | 3. **MMU & Cache Initialization:** Atlas constructs minimal identity page tables (EL1/EL2) and enables the data/instruction caches. |
| 378 | 4. **Cryptographic Measurement:** Atlas reads the Physics binary from non-volatile storage, computes its SHA-256 digest, and validates it against the platform Root of Trust. |
| 379 | 5. **Monotonic Handoff:** Atlas transfers control to the Physics entry point under `PHYSICS_ENTRY_ABI` at the exception level declared by the machine contract, with no implicit EL2 -> EL1 transition (the current QEMU contract `CONTRACT-QEMU-VIRT-AARCH64-M2` specifies EL1). |
| 380 | 6. **Atlas Termination:** Atlas's code space is permanently unmapped from page tables; Atlas ceases execution. |
| 381 | 7. **Physics Bringup:** Physics establishes its core memory allocator, initializes the exception vector table, and brings up the diagnostic console. |
| 382 | 8. **SMMUv3 Lock:** Physics configures memory protection contexts for all PCIe peripherals, locking DMA access to isolated buffers. |
| 383 | 9. **NVLink-C2C Coherent Setup:** Physics configures the high-speed chip-to-chip coherent memory bus between AArch64 host and Blackwell GPU. |
| 384 | 10. **Ring Buffer Mapping:** Physics pre-allocates and initializes the 64-byte aligned lock-free rings (`INTENT`, `RESULT`, `EFFECT`, `PROOF`, `EVIDENCE`). |
| 385 | 11. **GPU Cognitive Awakening:** Physics triggers the GPU bootstrap sequence via MMIO BAR0; GPU streaming multiprocessors initialize. |
| 386 | 12. **Weights Made Permanent:** Aien's foundation weights are mapped directly into GPU HBM3e; KV memory pools are reserved and locked. |
| 387 | 13. **Human Intent Ingestion:** A natural or formal intent statement is submitted to the system via the local console interface. |
| 388 | 14. **Semantic Decomposition:** Aien proposes intent; Omega defines the formal semantic graph ($\mathcal{G}_S$), specifying mathematical invariants and error bounds. |
| 389 | 15. **Physical Lowering & Constraint Discovery:** Physics compiles the semantic program to concrete hardware state (page tables, cache flushes, GPFIFO packets, register state) and communicates hardware constraints if alternatives are required. |
| 390 | 16. **AEGIS Invariant Verification:** Aegis inspects the requested realization against the active capability ledger, slot generations, memory bounds, and rollback paths. |
| 391 | 17. **Intent Queued:** Physics writes the 64-byte execution descriptor to the `INTENT_RING` and executes `stlr` (Store-Release). |
| 392 | 18. **GPU Fetches Intent:** The GPU execution engine, polling the ring head via coherent memory, fetches the descriptor with `ldar` (Load-Acquire). |
| 393 | 19. **Realization Execution:** Hardware executes the lowered kernel variant based on active matrix dimensions and hardware telemetry. |
| 394 | 20. **Tensor Execution:** GPU Tensor Cores execute the multi-layer neural contraction without host interrupt intervention. |
| 395 | 21. **State Contract Verification:** Aegis verifies that execution state transitions match the formal contract and that deviations stay strictly within the semantic error envelope ($\hat{\epsilon} \le \epsilon$). |
| 396 | 22. **Result Published:** GPU writes execution handle and cycle receipts to the `RESULT_RING` and notifies the host via atomic sequence increment. |
| 397 | 23. **Evidence Recording:** Verified execution receipts and outcome telemetry are recorded in the immutable Evidence Ledger. |
| 398 | 24. **Cortex Memory Integration:** The empirical execution receipt, energy consumption, and semantic outcome are committed permanently to Cortex episodic memory. |
| 399 | |
| 400 | ```text |
| 401 | ================================================================================ |
| 402 | THE SOVEREIGN MACHINE STANDS ESTABLISHED |
| 403 | ================================================================================ |
| 404 | ``` |
| 405 |