|
5 | 5 | <img alt="ECHO" src="https://github.com/user-attachments/assets/bef3fab9-cfc7-4601-b246-67ef7416ae75" /> |
6 | 6 | </p> |
7 | 7 |
|
8 | | ---- |
9 | | - |
10 | | -Echo is a **deterministic graph‑rewrite engine + tooling** for building simulations you can replay, verify, and synchronize without guessing. |
11 | | - |
12 | | -Instead of treating a game/simulation as a pile of mutable objects, Echo treats **state as a typed graph**. Each “tick” proposes a set of rewrites, executes them in a deterministic order, and emits **cryptographic hashes** of the resulting state and provenance so tools/peers can validate and converge. |
13 | | - |
14 | | -## Project Status |
| 8 | +<p align="center"> |
| 9 | + <strong>State is a graph. Time is a hash chain. Determinism isn't optional.</strong> |
| 10 | +</p> |
15 | 11 |
|
16 | | -**Status (2026-01):** Active R&D. The deterministic core (`warp-core`) and session/tooling pipeline are implemented. Higher-level layers (ECS storage, system scheduler, timeline tree) are specced but not yet built. See [`docs/architecture-outline.md`](docs/architecture-outline.md) for per-section implementation status. |
| 12 | +<p align="center"> |
| 13 | + <a href="docs/guide/start-here.md">Get Started</a> • |
| 14 | + <a href="docs/architecture-outline.md">Architecture</a> • |
| 15 | + <a href="docs/meta/docs-index.md">Docs</a> • |
| 16 | + <a href="https://github.com/flyingrobots/aion">AIΩN Framework</a> |
| 17 | +</p> |
17 | 18 |
|
18 | | -[I post weekly updates in Echo's GitHub Discussions](https://github.com/flyingrobots/echo/discussions/255) |
| 19 | +<p align="center"> |
| 20 | + <a href="https://github.com/flyingrobots/echo/actions/workflows/determinism.yml" ><img src="https://github.com/flyingrobots/echo/actions/workflows/determinism.yml/badge.svg" /></a> |
| 21 | + <a href="https://github.com/flyingrobots/echo/actions/workflows/ci.yml" ><img src="https://github.com/flyingrobots/echo/actions/workflows/ci.yml/badge.svg" /></a> |
| 22 | + <img src="https://img.shields.io/badge/platforms-Linux%20%7C%20macOS%20%7C%20Windows-blue" alt="Platforms" /> |
| 23 | +</p> |
19 | 24 |
|
20 | | -## Buckle Up |
| 25 | +--- |
21 | 26 |
|
22 | | -Start here: |
| 27 | +## What is Echo? |
23 | 28 |
|
24 | | -- Start Here: [`docs/guide/start-here.md`](docs/guide/start-here.md) |
25 | | -- Non-programmer on-ramp: [`docs/guide/eli5.md`](docs/guide/eli5.md) |
26 | | -- WARP primer: [`docs/guide/warp-primer.md`](docs/guide/warp-primer.md) |
27 | | -- Docs map: [`docs/meta/docs-index.md`](docs/meta/docs-index.md) |
28 | | -- AIΩN bridge doc: [`docs/aion-papers-bridge.md`](docs/aion-papers-bridge.md) |
29 | | -- Architecture outline: [`docs/architecture-outline.md`](docs/architecture-outline.md) |
30 | | -- Commit hashing spec: [`docs/spec-merkle-commit.md`](docs/spec-merkle-commit.md) |
| 29 | +Echo is a **deterministic state machine** where every transition is cryptographically verifiable. Run the same inputs on any machine, get the same hashes. Always. |
31 | 30 |
|
32 | | -## AIΩN Framework |
| 31 | +```text |
| 32 | +tick 0 ──hash──► tick 1 ──hash──► tick 2 ──hash──► ... |
| 33 | + │ │ │ |
| 34 | + ▼ ▼ ▼ |
| 35 | + provable provable provable |
| 36 | +``` |
33 | 37 |
|
34 | | -Echo is part of the **AIΩN Framework**: |
| 38 | +No floating-point drift. No unordered iteration surprises. No "it works on my machine." Just math you can trust. |
35 | 39 |
|
36 | | -- AIΩN repo: <https://github.com/flyingrobots/aion> |
| 40 | +**Prove it:** |
37 | 41 |
|
38 | | -Research lineage (AIΩN Foundations series): |
| 42 | +```text |
| 43 | +$ cargo xtask dind run |
| 44 | +[DIND] Running 50 seeds across 3 platforms... |
| 45 | +[DIND] linux-x64: 7f3a9c...d82e1a ✅ |
| 46 | +[DIND] macos-arm64: 7f3a9c...d82e1a ✅ |
| 47 | +[DIND] windows-x64: 7f3a9c...d82e1a ✅ |
39 | 48 |
|
40 | | -- Paper I — *WARP Graphs: A Worldline Algebra for Recursive Provenance* ([doi:10.5281/zenodo.17908005](https://doi.org/10.5281/zenodo.17908005)) |
41 | | -- Paper II — *WARP Graphs: Canonical State Evolution and Deterministic Worldlines* ([doi:10.5281/zenodo.17934512](https://doi.org/10.5281/zenodo.17934512)) |
42 | | -- Paper III — *WARP Graphs: Computational Holography & Provenance Payloads* ([doi:10.5281/zenodo.17963669](https://doi.org/10.5281/zenodo.17963669)) |
43 | | -- Paper IV — *WARP Graphs: Rulial Distance & Observer Geometry* ([doi:10.5281/zenodo.18038297](https://doi.org/10.5281/zenodo.18038297)) |
44 | | -- Paper V — *WARP Graphs: Ethics of Deterministic Replay & Provenance Sovereignty* (not yet published) |
45 | | -- Paper VI — *The AIΩN Computer: Architecture & Operating System* (not yet published) |
| 49 | +Hashes match. Determinism verified. |
| 50 | +``` |
46 | 51 |
|
47 | | ---- |
| 52 | +> **Naming:** Echo is the product. WARP is the underlying graph algebra. The `warp-*` and `echo-*` crates are internal modules—same project, different layers. |
48 | 53 |
|
49 | 54 | ## Why? |
50 | 55 |
|
51 | | -- **Determinism first:** same inputs → same ordered rewrites → same hashes. |
52 | | -- **Provenance you can trust:** snapshots and commits are content‑addressed. |
53 | | -- **Tooling as a first‑class citizen:** graphs stream over a canonical wire protocol; consumers verify hashes and detect desync early. |
54 | | - |
55 | | -If you’re building anything that benefits from “Git‑like” properties for state (replay, branching, inspection, synchronization), Echo is designed for that. |
| 56 | +| Problem | Echo's Answer | |
| 57 | +| -------------------------------------- | ------------------------------------------ | |
| 58 | +| "Replay diverged after 10,000 ticks" | Deterministic scheduler + fixed-point math | |
| 59 | +| "Which client has the correct state?" | Compare 32-byte tick hashes | |
| 60 | +| "We can't reproduce that bug" | Every tick is content-addressed and replayable | |
| 61 | +| "Syncing state is expensive" | Stream diffs, verify hashes, done | |
56 | 62 |
|
57 | | ---- |
| 63 | +If you've ever built a game, simulation, or distributed system and wished state had Git-like properties—branches, merges, provable history—that's what we're building. |
58 | 64 |
|
59 | | -## What It Does Right Now |
| 65 | +## Project Status |
60 | 66 |
|
61 | | -### Core engine + math |
| 67 | +> [!WARNING] |
| 68 | +> **Echo is early. Sharp edges.** |
| 69 | +> |
| 70 | +> - ✅ **Stable:** Core determinism, hashing, replay invariants |
| 71 | +> - ⚠️ **Changing:** Schema/IR, APIs, file formats, viewer protocol |
| 72 | +> - ❌ **Not yet:** Nice UX, polished docs, batteries-included examples |
| 73 | +> |
| 74 | +> If you need a plug-and-play game engine today, this isn't that (yet). |
| 75 | +> If you need deterministic, replayable state transitions you can prove, it is. |
62 | 76 |
|
63 | | -- `crates/warp-core` — deterministic rewrite engine spike: |
64 | | - - `Engine::{begin, apply, commit, snapshot}` |
65 | | - - deterministic scheduler (radix drain ordering + footprint independence checks) |
66 | | - - snapshot hashing (`state_root`) + commit hashing (`commit_id`) |
67 | | - - deterministic math + PRNG (`math::{Vec3, Mat4, Quat, Prng}`) |
68 | | - - WSC (Write-Streaming Columnar) snapshot format (`wsc::*`) for zero-copy mmap access |
69 | | - - materialization bus (`MaterializationBus`) for order-independent channel emissions |
70 | | -- `crates/warp-geom` — geometry primitives shared by engine/tools. |
| 77 | +See the [architecture outline](docs/architecture-outline.md) for what's implemented vs. planned. |
71 | 78 |
|
72 | | -### Session + streaming pipeline |
| 79 | +### Roadmap |
73 | 80 |
|
74 | | -- `crates/echo-graph` — canonical renderable graph (`RenderGraph`) + diff ops (`WarpOp`) + deterministic graph hashing. |
75 | | -- `crates/echo-session-proto` — deterministic JS‑ABI v1.0 framing + canonical CBOR + wire schema. |
76 | | -- `crates/echo-session-service` — headless Unix‑socket hub: |
77 | | - - handshake + monotonic `ts` |
78 | | - - subscriptions per `WarpId` |
79 | | - - gapless diff enforcement (snapshot resets; diffs must be consecutive epochs) |
80 | | -- `crates/echo-session-client` — client helpers + tool port abstraction (`tool::SessionPort`). |
81 | | -- `crates/echo-session-ws-gateway` — WebSocket ↔ Unix‑socket bridge for browser‑based tools. |
| 81 | +Echo is a high-performance graph rewriting engine written in Rust, designed to run everywhere. All upcoming milestones target Echo-in-the-browser so people can try it out with minimal friction. |
82 | 82 |
|
83 | | -### Tools + adapters |
| 83 | +1. **WARPSITE**—a website powered by WARP graph rewriting |
| 84 | +2. **Splash Guy**—a demo game designed to introduce Echo concepts |
| 85 | +3. **Tumble Tower**—a demo game designed to demonstrate Echo's physics determinism |
84 | 86 |
|
85 | | -- `crates/warp-viewer` — native WGPU viewer: |
86 | | - - subscribes to a WARP stream, |
87 | | - - applies snapshots/diffs, |
88 | | - - verifies `state_hash` per frame (declares desync on mismatch). |
89 | | -- `crates/echo-app-core` / `crates/echo-config-fs` — “tool hexagon” ports + filesystem config adapter. |
90 | | -- `crates/warp-ffi` / `crates/warp-wasm` — bindings around `warp-core`. |
91 | | -- `crates/warp-benches` — Criterion microbenchmarks (scheduler drain, snapshot hash, etc.). |
92 | | -- `crates/echo-dind-harness` — determinism drill runner (DIND suite; cross‑platform hash verification). |
93 | | -- `crates/echo-dind-tests` — stable test app used by the DIND harness. |
| 87 | +#### Time Travel Debugger + WARPSITE |
94 | 88 |
|
95 | | -### Living specs (teaching slice) |
| 89 | +True, deterministic **Time Travel Debugging** (TTD) is always available by default—not something you have to record or prepare for in advance. Made possible by [WARP graph](https://doi.org/10.5281/zenodo.17908005) [rewriting](https://doi.org/10.5281/zenodo.17963669), each tick's [computational hologram](https://doi.org/10.5281/zenodo.17963669) is captured in an immutable, append-only, tamper-evident ledger. Step backwards to any previous tick, then forward again. Exactly the same every time, bit-for-bit, cryptographically verified. Want to see what *could* have happened? Fork to a different worldline, try something different, then discard it and return to your original timeline. |
96 | 90 |
|
97 | | -- `specs/spec-000-rewrite` — Leptos + Trunk scaffold for “Spec‑000: Everything is a Rewrite”. |
98 | | -- `crates/echo-wasm-abi` — WASM‑friendly DTO schema for specs. |
99 | | -- `crates/echo-wasm-bindings` — demo kernel + rewrite history (teaching slice; not the production engine). |
| 91 | +- Time Travel Debugging (TTD) Part 1—Tick Inspector + Rewind/Jump to Previous Tick (In Progress) |
| 92 | +- WARPSITE (In Progress) |
| 93 | +- [Wesley](https://github.com/flyingrobots/wesley)—GraphQL-as-schema → Rust/TypeScript Compiler |
| 94 | +- TTD Part 2—Fork Worldlines |
100 | 95 |
|
101 | | -For a deeper tour, see [`docs/meta/docs-index.md`](docs/meta/docs-index.md). |
| 96 | +#### Then: Splash Guy Tutorial Demo |
102 | 97 |
|
103 | | ---- |
| 98 | +Navigate a grid-based maze and strategically place timed water balloons to clear obstacles and trap opponents in a chaotic bid to be the last one dry. A simple game demo designed to teach Echo concepts. |
104 | 99 |
|
105 | | -## Quickstart |
| 100 | +- Rhai Scripting API |
| 101 | +- Graphics |
| 102 | +- Input |
106 | 103 |
|
107 | | -### Requirements |
| 104 | +#### After: Tumble Tower Demo |
108 | 105 |
|
109 | | -- Rust toolchain pinned by `rust-toolchain.toml` (currently `1.90.0`). |
110 | | -- Node.js (for docs site). The docs toolchain uses `vitepress@1.6.4`; supported Node versions are pinned via `package.json` (currently `>=18 <25`). For best results, use an LTS (Node 18/20/22). |
| 106 | +Carefully extract load-bearing blocks from a precarious tower and place them at the summit without triggering a catastrophic collapse. A block-stacking game that demonstrates deterministic physics. |
111 | 107 |
|
112 | | -### Common commands |
| 108 | +- Physics Engine |
| 109 | +- Collision Resolution |
113 | 110 |
|
114 | | -Install repo hooks: |
| 111 | +## Quick Tour |
115 | 112 |
|
116 | 113 | ```bash |
| 114 | +# Install hooks (formats code, runs clippy, checks docs) |
117 | 115 | make hooks |
118 | | -``` |
119 | | - |
120 | | -Run the workspace tests: |
121 | 116 |
|
122 | | -```bash |
| 117 | +# Run the test suite |
123 | 118 | cargo test --workspace |
124 | | -``` |
125 | | - |
126 | | -Run clippy with the repo’s docs gate: |
127 | 119 |
|
128 | | -```bash |
129 | | -cargo clippy --all-targets -- -D warnings -D missing_docs |
130 | | -``` |
| 120 | +# Run determinism verification |
| 121 | +cargo xtask dind run |
131 | 122 |
|
132 | | -Run the docs site (VitePress): |
| 123 | +# Launch the viewer |
| 124 | +cargo run -p warp-viewer |
133 | 125 |
|
134 | | -```bash |
| 126 | +# Build the docs site |
135 | 127 | make docs |
136 | 128 | ``` |
137 | 129 |
|
138 | | -Directly (useful when debugging): |
139 | | - |
140 | | -```bash |
141 | | -pnpm install |
142 | | -pnpm docs:dev |
| 130 | +## The Stack |
| 131 | + |
| 132 | +```mermaid |
| 133 | +flowchart TB |
| 134 | + %% Authoring |
| 135 | + A["GraphQL Schema<br />(Types + Ops + Docs)"] -->|author + version| B["Wesley<br />(schema compiler)"] |
| 136 | +
|
| 137 | + %% Codegen outputs |
| 138 | + B --> C["Rust Types + Op IDs<br />(structs/enums, stable IDs)"] |
| 139 | + B --> D["ABI / Wire Layout<br />(canonical encoding)"] |
| 140 | + B --> E["Client Stubs<br/>(TS/Rust helpers)"] |
| 141 | + B --> F["Registry Metadata<br/>(introspection, docs index)"] |
| 142 | +
|
| 143 | + %% App layer |
| 144 | + C --> G["Game / App Code<br/>(rules + gameplay)"] |
| 145 | + D --> G |
| 146 | + F --> G |
| 147 | +
|
| 148 | + %% Runtime |
| 149 | + G --> H["Echo Core Runtime<br/>(deterministic tick loop)"] |
| 150 | + H --> I["WARP Graph Engine<br/>(rewrite + commit + hash)"] |
| 151 | + I --> J["WARP Graph Executable<br/>(content-addressed worldline)"] |
| 152 | +
|
| 153 | + %% Tooling |
| 154 | + F --> K["Devtools / Viewer<br/>(inspect ops, decode vars)"] |
| 155 | + I --> K |
| 156 | + J --> K |
143 | 157 | ``` |
144 | 158 |
|
145 | | -CI-style build (includes link checking): |
| 159 | +**Core** — `crates/warp-core` |
146 | 160 |
|
147 | | -```bash |
148 | | -pnpm docs:build |
149 | | -``` |
| 161 | +- Graph-rewrite engine with transactional commits |
| 162 | +- Deterministic math (fixed-point, PRNG, Vec3/Mat4/Quat) |
| 163 | +- **Materialization bus**—order-independent channel for outputs; emitters don't need to coordinate |
| 164 | +- **WSC** (Write-Streaming Columnar)—zero-copy snapshot format (mmap-friendly) for fast state reload + verification |
150 | 165 |
|
151 | | -Run the session hub: |
| 166 | +**Pipeline** — `crates/echo-session-*` |
152 | 167 |
|
153 | | -```bash |
154 | | -cargo run -p echo-session-service |
155 | | -``` |
| 168 | +- Unix socket hub with gapless diff streaming |
| 169 | +- WebSocket gateway for browser tools |
| 170 | +- Canonical CBOR wire format |
156 | 171 |
|
157 | | -Run the viewer: |
| 172 | +**Tools** — `crates/warp-viewer`, `crates/echo-dind-*` |
158 | 173 |
|
159 | | -```bash |
160 | | -cargo run -p warp-viewer |
161 | | -``` |
| 174 | +- Native GPU viewer with per-frame hash verification |
| 175 | +- **DIND** (Determinism-in-Determinism)—cross-platform test harness that proves hash convergence |
162 | 176 |
|
163 | | -Run Spec‑000 (WASM dev server; requires `trunk` installed): |
| 177 | +## Research Foundation |
164 | 178 |
|
165 | | -```bash |
166 | | -make spec-000-dev |
167 | | -``` |
| 179 | +Echo implements ideas from the **AIΩN Foundations** paper series: |
168 | 180 |
|
169 | | -Run DIND (cross-platform determinism verification): |
| 181 | +1. [WARP Graphs: A Worldline Algebra for Recursive Provenance](https://doi.org/10.5281/zenodo.17908005) |
| 182 | +2. [Canonical State Evolution and Deterministic Worldlines](https://doi.org/10.5281/zenodo.17934512) |
| 183 | +3. [Computational Holography & Provenance Payloads](https://doi.org/10.5281/zenodo.17963669) |
| 184 | +4. [Rulial Distance & Observer Geometry](https://doi.org/10.5281/zenodo.18038297) |
170 | 185 |
|
171 | | -```bash |
172 | | -cargo xtask dind run |
173 | | -``` |
| 186 | +Part of the [AIΩN Framework](https://github.com/flyingrobots/aion). |
174 | 187 |
|
175 | | ---- |
| 188 | +## Contributing |
176 | 189 |
|
177 | | -## Contributions |
| 190 | +Determinism is sacred. Before you change anything: |
178 | 191 |
|
179 | | -- Start with `CONTRIBUTING.md`. |
180 | | -- Echo is docs-driven: behavior changes should be reflected in specs and ADRs. |
181 | | -- Determinism is sacred: avoid wall‑clock time, uncontrolled randomness, and unspecified iteration order. |
| 192 | +1. Read [`CONTRIBUTING.md`](CONTRIBUTING.md) |
| 193 | +2. Run `make hooks` to install the guardrails |
| 194 | +3. Write tests. If it's not tested, it's not deterministic. |
182 | 195 |
|
183 | | -### Determinism guard scripts |
| 196 | +The codebase enforces: |
184 | 197 |
|
185 | | -Echo enforces determinism guardrails via scripts in `scripts/`: |
| 198 | +- No global state (`scripts/ban-globals.sh`) |
| 199 | +- No wall-clock time or uncontrolled randomness (`scripts/ban-nondeterminism.sh`) |
| 200 | +- No unordered iteration (`scripts/ban-unordered-abi.sh`) |
186 | 201 |
|
187 | | -- `scripts/ban-globals.sh` |
188 | | -- `scripts/ban-nondeterminism.sh` |
189 | | -- `scripts/ban-unordered-abi.sh` |
| 202 | +## Requirements |
190 | 203 |
|
191 | | -## Workflows |
| 204 | +- **Rust** — pinned in `rust-toolchain.toml` (currently 1.90.0) |
| 205 | +- **Node.js 18+** — for the docs site (VitePress) |
192 | 206 |
|
193 | | -Echo has a few “official workflows” (policy + blessed scripts/entrypoints), documented here: |
| 207 | +## License |
194 | 208 |
|
195 | | -- [`docs/workflows.md`](docs/workflows.md) — contributor playbook (PR policy, docs guard, `cargo xtask`, scheduled automations) |
196 | | -- [`docs/dependency-dags.md`](docs/dependency-dags.md) — issue + milestone dependency DAGs (DOT/SVG) and how to regenerate them |
| 209 | +Dual-licensed under Apache 2.0 and MIND-UCAL 1.0. See [`LEGAL.md`](LEGAL.md) for details. |
197 | 210 |
|
198 | 211 | --- |
199 | 212 |
|
200 | | -## License |
201 | | - |
202 | | -Echo is dual‑licensed. See `LICENSE`, `LICENSE-APACHE`, `LICENSE-MIND-UCAL`, and `LEGAL.md` for details. |
| 213 | +<p align="center"> |
| 214 | + <sub>Built by <a href="https://github.com/flyingrobots">FLYING•ROBOTS</a></sub> |
| 215 | +</p> |
0 commit comments