You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Echo is a recursive metagraph (RMG) simulation engine that treats _everything_–code, data, and time itself—as one big living graph.
19
+
> It’s built so every change can branch, merge, and replay perfectly.
18
20
19
-
> _Echo is a recursive metagraph (RMG) simulation engine that executes and rewrites typed graphs deterministically across branching timelines and merges them through confluence._
**Echo is an ambitious, mind-bending, radically different computational model for game engines and other interactive simulations.** The RMG is a powerful mathematical tool that brings the full weight of textbook category theory to interactive computational experiences.
24
26
25
27
Most game engines are object-oriented state machines. Unity, Unreal, Godot all maintain mutable object hierarchies that update every frame. Echo says: "No, everything is a graph, and the engine rewrites that graph deterministically using typed transformation rules."
26
28
27
-
## Snapshot Hashes
28
-
29
-
Echo records two hashes during a commit:
30
-
-`state_root`: deterministic hash of the reachable graph state under the current root.
31
-
-`commit hash` (commit_id): hash of a canonical header including `state_root`, parents, and deterministic digests for plan/decisions/rewrites.
32
-
33
-
See `docs/spec-merkle-commit.md` for the precise encoding and invariants.
34
-
35
29
Echo is fundamentally **built different**.
36
30
37
-
RMG provides atomic, in-place edits of recursive meta-graphs with deterministic local scheduling and snapshot isolation.
31
+
RMG provides atomic, in-place edits of recursive meta-graphs with deterministic local scheduling and snapshot isolation. It’s the core of the Echo engine: runtime, assets, networking, and tools all operate on the same living graph of graphs.
38
32
39
-
It’s the core of the Echo engine: runtime, assets, networking, and tools all operate on the same living graph of graphs.
33
+
Echo is a mathematically rigorous game engine that replaces traditional OOP with deterministic graph rewriting, enabling time-travel debugging, perfect replay, and Git-like branching for game states.
40
34
41
35
## Developer: Running Benchmarks
42
36
@@ -62,20 +56,13 @@ It’s the core of the Echo engine: runtime, assets, networking, and tools all o
62
56
63
57
---
64
58
65
-
##**tl;dr:**
59
+
### What's Echo?
66
60
67
-
> ECHO is a game engine that treats _everything_—code, data, and time itself—as one big living graph.
68
-
> It’s built so every change can branch, merge, and replay perfectly.
69
-
70
-
---
71
-
72
-
### The short pitch
73
-
74
-
ECHO runs on something called an **RMG (Recursive Meta-Graph)**. Think of it as a graph-based operating system. Everything in the engine (worlds, entities, physics, shaders, even the tools) lives inside that graph.
61
+
Echo runs on something called an **RMG (Recursive Meta-Graph)**. Think of it as a graph-based operating system. Everything in the engine (worlds, entities, physics, shaders, even the tools) lives inside that graph.
75
62
76
63
Echo doesn’t “update objects.” It _rewrites_ parts of the graph using a set of deterministic rules. That’s what “graph rewriting” means.
77
64
78
-
### Why this is cool
65
+
### Why Echo's Cool
79
66
80
67
-**Deterministic:** same inputs = same world every time.
81
68
-**Branching:** you can fork reality, change it, and merge it back without chaos.
@@ -92,7 +79,7 @@ You can pause time, fork a copy of reality, try out a new idea, and merge the ti
92
79
93
80
## Advantages
94
81
95
-
> *"Things are only impossible until they're not."* — Jean-Luc Picard
82
+
> _"Things are only impossible until they're not." — Jean-Luc Picard_
96
83
97
84
Can your game engine do...
98
85
@@ -107,7 +94,7 @@ Same input graph + same rules = same output, always. This is huge for:
107
94
108
95
### Branching Timelines
109
96
110
-
> “All we have to decide is what to do with the time that is given to us.” — _Gandalf, The Lord of the Rings_
97
+
> _“All we have to decide is what to do with the time that is given to us.” — Gandalf, The Lord of the Rings_
111
98
112
99
The Git metaphor is accurate. Fork reality, try something, merge back. This enables:
113
100
@@ -134,61 +121,176 @@ Rules are graphs. Systems are graphs. The whole runtime is a graph. This gives y
134
121
135
122
---
136
123
137
-
## Current Status
124
+
| Principle | Vision | Implementation |
125
+
| :--- | :--- | :--- |
126
+
|**Determinism (The "Replay")**| Same input graph + same rules = same output graph. Always. This is huge for networked multiplayer (no desync), perfect replays, and reproducible bug testing. | Achieved via an $O(n)$ deterministic scheduler. Pending graph rewrites are sorted using a stable radix sort (not a comparison-based sort) based on their scope, rule ID, and nonce. Combined with a deterministic math module (Vec3, Quat, PRNG), this ensures identical inputs always produce identical execution order and final state. |
127
+
|**Branching & Confluence (The "Time Travel")**| Fork reality, try something, and merge it back like a Git branch. Independent, non-conflicting changes converge to the same canonical state, guaranteed. | The engine's Timeline Tree (modeling Chronos, Kairos, and Aion) allows for branching realities. The engine's core transaction model (begin, apply, commit) and footprint-based independence checks (MWMR) allow for safe, parallel execution and deterministic, conflict-free merges. |
128
+
|**Snapshot Isolation (The "Commit")**| Snapshots are emitted from the live graph; append-only history is optional. This enables save/load, time-travel debugging, and collaborative editing. | Each commit produces two Merkle hashes derived from 256-bit BLAKE3: <ul><li><code>state_root</code>: deterministic hash of the reachable graph state under the current root.</li><li><code>commit hash</code> (commit_id): hash of a canonical header including <code>state_root</code>, parents, and deterministic digests for plan/decisions/rewrites.</li></ul> See <code>docs/spec-merkle-commit.md</code> for the precise encoding and invariants. |
129
+
|**Everything-is-a-Graph (The "Substrate")**| Nodes, edges, systems, assets, and even rewrite rules are all graphs. Graphs can contain subgraphs recursively. | The engine operates on typed, directed graphs. All identifiers (NodeId, TypeId, EdgeId) are domain-separated BLAKE3 hashes. Rewrite Rules are defined with a matcher, executor, and compute_footprint function, allowing the engine to deterministically transform the graph. |
130
+
|**Hexagonal Architecture (The "Ports")**| A core engine that is pure logic, completely decoupled from the outside world (rendering, input, networking). | Echo uses a Ports & Adapters design. The core engine (rmg-core) knows nothing of pixels, sockets, or key presses. It exposes narrow interfaces ("Ports") that external crates ("Adapters") implement. This allows swapping renderers (e.g., WebGPU, SDL) or physics engines without changing the core simulation logic. |
138
131
139
-
Echo is in **active development**. We're currently:
132
+
---
140
133
141
-
- ✅ Formal proofs of confluence (tick-level determinism proven)
142
-
- ✅ [C implementation](http://github.com/meta-graph/core) of independence checks and footprint calculus
> _“Roads? Where we’re going, we don’t need roads.” — Doc Brown, Back to the Future_
137
+
138
+
Echo is a Rust workspace organized into a multi-crate setup. The core engine is pure, dependency-free Rust (#![no_std] capable) with I/O isolated to adapter crates.
├── docs/ (Comprehensive specifications and diagrams)
150
+
└── scripts/ (Build automation, benchmarking)
151
+
```
152
152
153
-
The mathematical properties of RMGs offer:
153
+
### Core Architectural Layers
154
154
155
-
-**Folds (catamorphisms)**: there is a guaranteed, one-true way to “walk” the graph.
156
-
- That’s how rendering, physics, and serialization all stay consistent: they’re just different folds over the same data.
157
-
-**Double-Pushout (DPO) rewriting**: a safe, proven way to modify graphs.
158
-
- Instead of ad-hoc mutation, every change is a rewrite rule with an explicit match and replacement, so the engine can reason about merges, rollbacks, and conflicts.
159
-
-**Confluence** – when two people or two threads make compatible edits, they deterministically converge to the same state.
160
-
- That’s the key to multiplayer sync, time-travel debugging, and collaborative editing.
155
+
1. ECS (Entity-Component-System): Type-safe components with archetype-based storage
156
+
2. Scheduler: Deterministic DAG ordering via O(n) radix sort
157
+
3. Event Bus: Command buffering for deterministic event handling
158
+
4. Timeline Tree: Branching/merging with temporal mechanics (Chronos, Kairos, Aion)
0 commit comments