Architecture
IRIS is a four-layer stack. Each layer operates on a single canonical representation: the SemanticGraph.
L0 Evolution -- population search (NSGA-II + lexicase + novelty)
L1 Semantics -- SemanticGraph (20 node kinds, BLAKE3 content-addressed)
L2 Verification -- LCF proof kernel (20 inference rules, zero unsafe Rust)
L3 Hardware -- bootstrap evaluator + effect dispatch / CLCU (AVX-512)
SemanticGraph (L1)
The SemanticGraph is the canonical program representation. Every IRIS program – whether written by hand, compiled from .iris files, or bred by evolution – is a typed DAG with 20 node kinds.
Node Kinds
| Tag | Kind | Purpose |
|---|---|---|
0x00 |
Prim | Primitive operation (~50 opcodes) |
0x01 |
Apply | Function application |
0x02 |
Lambda | Abstraction (closure) |
0x03 |
Let | Local binding |
0x04 |
Match | Pattern matching |
0x05 |
Lit | Literal value |
0x06 |
Ref | Cross-fragment call |
0x07 |
Neural | Neural computation layer |
0x08 |
Fold | Structural recursion (catamorphism) |
0x09 |
Unfold | Corecursion (anamorphism) |
0x0A |
Effect | Side effect descriptor |
0x0B |
Tuple | Product constructor |
0x0C |
Inject | Sum constructor |
0x0D |
Project | Product elimination |
0x0E |
TypeAbst | Type abstraction |
0x0F |
TypeApp | Type application |
0x10 |
LetRec | Recursive binding (guarded) |
0x11 |
Guard | Runtime guard (conditional) |
0x12 |
Rewrite | Verified rewrite |
0x13 |
Extern | External function |
Each node carries a NodeId (64-bit BLAKE3 truncated), a type reference, a cost term, an arity, and operation-specific payload. Nodes are content-addressed – identical subgraphs share the same ID.
Evolution (L0)
IRIS evolves programs through genetic search. The evolution system itself is written in IRIS.
Mutation Operators
16 mutation operators (all .iris programs), tracked by the improvement system:
| ID | Operator | Description |
|---|---|---|
| 0 | insert_node |
Add a new node to the graph |
| 1 | delete_node |
Remove a node |
| 2 | rewire_edge |
Rewire edges between nodes |
| 3 | replace_kind |
Change a node’s kind tag |
| 4 | replace_prim |
Change a node’s opcode |
| 5 | mutate_literal |
Modify a literal value |
| 6 | duplicate_subgraph |
Clone a subgraph |
| 7 | wrap_in_guard |
Add a conditional guard |
| 8 | annotate_cost |
Add cost annotation |
| 9 | wrap_in_map |
Wrap in map operation |
| 10 | wrap_in_filter |
Wrap in filter operation |
| 11 | compose_stages |
Compose pipeline stages |
| 12 | insert_zip |
Add zip operation |
| 13 | swap_fold_op |
Change fold accumulator |
| 14 | add_guard_condition |
Add guard predicate |
| 15 | extract_to_ref |
Extract to cross-fragment ref |
Selection Strategies
- Tournament selection – binary tournament on fitness
- Lexicase selection – sequential filtering on individual test cases
- NSGA-II – multi-objective Pareto optimization
- Novelty search – reward behavioral novelty over raw fitness
Population Management
- Pareto ranking – assign non-dominated rank
- Crowding distance – maintain population diversity
- Elitism – preserve top individuals across generations
- Death culling – remove unfit individuals
Crossover
The Graph-Embedding Codec (GIN-VAE) enables crossover by:
- Encoding parent graphs into embedding vectors
- Interpolating in embedding space
- Decoding back to valid graphs
- Running a 10-phase structural repair pipeline
The GIN-VAE is trained on a 1,045-program corpus (all .iris programs, evolution Pareto fronts, self-write mutation programs, bootstrap interpreter, and seed generators). The LearnedCodec achieves 0.012 reconstruction loss.
Improvement Tracking (PT3)
The evolution system tracks improvement dynamics for each component:
- Improvement rate – linear regression over sliding-window latency measurements
- Acceleration – second derivative of latency; negative acceleration means improvements are compounding
- Causal operator attribution – per-operator statistics tracking success rate, times used, and average fitness delta across 16 mutation operators
- Adaptive weighting – mutation operator selection weights adjusted proportional to observed success rate and improvement magnitude
When the tracker detects compounding improvements (acceleration < 0), the daemon increases investment in that component’s evolution. When deceleration is detected, it recognizes a plateau and redirects resources.
Verification (L2)
The proof kernel is the trusted core of IRIS. It implements CaCIC (Cost-aware Calculus of Inductive Constructions) with 20 inference rules.
See the Verification page for a deep dive into the proof kernel, refinement types, the checker, and the Lean formalization.
Properties
- Zero unsafe Rust – the kernel contains no
unsafeblocks - LCF-style – proofs can only be constructed through the kernel’s API; no external code can forge a
Theoremvalue - Refinement types – predicates on types checked via kernel rules
refine_introandrefine_elim - Cost annotations – type signatures carry computational cost metadata (
[cost: Linear(n)]), used as evolution fitness objectives. Cost subsumption rules exist in the kernel but are not yet wired into proof construction. - Lean 4 formalization – a separate Lean 4 codebase (
lean/IrisKernel/) mirrors the 20 rules as inductive types and proves consistency properties of the type theory. This is a formalization of the design, not a verification of the Rust implementation. The proof kernel (kernel.rs) is the trusted core. It represents the Lob’s theorem ceiling – the only code that IRIS cannot replace with IRIS-evolved equivalents.
What “verified” means here: The kernel provides a sound verification framework – programs can carry machine-checked proofs, and the LCF architecture prevents proof forgery. Program verification is optional; most programs today carry no proofs. The kernel itself is not verified against the Lean spec (it’s small and auditable, but not extraction-based).
Verification Tiers
| Tier | Description | Test Cases |
|---|---|---|
| Tier A (Cheap) | Tree-walker only | 10 |
| Tier B (Full) | Interpreter + hardware counters | 50–200 |
| Tier C (JIT) | JIT compilation, full profiling | 200+ |
Execution (L3)
Programs run through the bootstrap evaluator with optional effect dispatch:
Bootstrap Evaluator
The bootstrap evaluator handles all 20 node kinds directly. It dispatches primitive operations (50+ opcodes), manages closures, and evaluates fold/unfold recursion. The meta-circular interpreter (full_interpreter.iris) can also dispatch on node kind tags via graph introspection.
Effect Dispatch: Opcode 0xA1 (perform_effect) dispatches all 44 effect tags through an EffectHandler. The RuntimeEffectHandler implements real I/O (files, TCP, environment, time, random). The CapabilityGuardHandler wraps any handler and enforces capability restrictions before each effect call.
Performance: ~0.2 microseconds per step.
CLCU (AVX-512)
Cache-Line Compute Units – 64-byte containers designed for 16-lane SIMD execution. Includes adaptive prefetch and branch predictor hints.
Self-Improvement Daemon
The daemon runs continuously, improving IRIS’s own internal components – specifically mutation operators and seed generators (e.g., mutation_insert_node, seed_arithmetic). It breeds IRIS program replacements for these Rust-implemented functions:
- Profiles registered components via sliding-window latency tracking
- When a component exceeds the latency threshold, spawns evolution
- Tests replacements through the performance gate (100% correctness, ≤2x slowdown)
- Atomically hot-swaps if the replacement passes
- Feeds results to the improvement tracker for causal attribution and adaptive weighting
- Detects stagnation after N consecutive failures
- Detects compounding improvements and increases evolution investment
- Maintains a BLAKE3 Merkle audit chain for tamper-evident history
- Persists state to disk; resumes after restart
Bootstrap Chain
Rust bootstrap evaluator (~1,150 LOC)
→ loads IRIS meta-circular interpreter (full_interpreter.iris)
→ evaluates all other IRIS programs
→ evolves replacement components in IRIS
The goal: IRIS replaces all Rust except the proof kernel and the OS interface.
Crate Map
| Crate | Purpose |
|---|---|
iris-types |
Graph, types, values, wire format |
iris-bootstrap |
Bootstrap evaluator + syntax pipeline + LCF proof kernel |
iris-exec |
Execution shim: capabilities, effect runtime, service |
iris-evolve |
NSGA-II, evolution engine, self-improvement daemon |
iris-clcu-sys |
FFI bindings to C CLCU |