Skip to content

Commit 839f69a

Browse files
committed
Merge remote-tracking branch 'origin/graph-boaw' into graph-boaw
# Conflicts: # README.md
2 parents c347fe6 + e5de97d commit 839f69a

8 files changed

Lines changed: 1255 additions & 1212 deletions

.ban-nondeterminism-allowlist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ crates/warp-wasm/src/lib.rs
55
# This is intentional - WSC is for native tooling, not WASM determinism
66
crates/warp-core/src/wsc/mod.rs
77
crates/warp-core/src/wsc/view.rs
8+
# BOAW exec uses std::env for feature-gated stride fallback (ECHO_PARALLEL_STRIDE)
9+
# This is a build-time debug toggle, not runtime non-determinism
10+
crates/warp-core/src/boaw/exec.rs

.markdownlint.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"MD013": false,
33
"MD033": {
4-
"allowed_elements": ["u8", "br", "p", "img"]
4+
"allowed_elements": ["u8", "br", "p", "img", "a", "strong", "sub"]
55
},
66
"MD041": false,
7+
"MD045": false,
78
"MD046": {
89
"style": "fenced"
9-
}
10+
},
11+
"MD060": false
1012
}

README.md

Lines changed: 143 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -3,117 +3,123 @@
33

44
<p align="center">
55
<img alt="ECHO" src="https://github.com/user-attachments/assets/bef3fab9-cfc7-4601-b246-67ef7416ae75" />
6-
76
</p>
87

9-
---
10-
11-
Echo is a **deterministic graph‑rewrite engine + tooling** for building simulations you can replay, verify, and synchronize without guessing.
12-
13-
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.
8+
<p align="center">
9+
<strong>State is a graph. Time is a hash chain. Determinism isn't optional.</strong>
10+
</p>
1411

15-
## Project 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>
1618

17-
**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.
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>
1824

19-
## Buckle Up
25+
---
2026

21-
Start here:
27+
## What is Echo?
2228

23-
- Start Here: [`docs/guide/start-here.md`](docs/guide/start-here.md)
24-
- Non-programmer on-ramp: [`docs/guide/eli5.md`](docs/guide/eli5.md)
25-
- WARP primer: [`docs/guide/warp-primer.md`](docs/guide/warp-primer.md)
26-
- Docs map: [`docs/meta/docs-index.md`](docs/meta/docs-index.md)
27-
- AIΩN bridge doc: [`docs/aion-papers-bridge.md`](docs/aion-papers-bridge.md)
28-
- Architecture outline: [`docs/architecture-outline.md`](docs/architecture-outline.md)
29-
- 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.
3030

31-
## AIΩN Framework
31+
```text
32+
tick 0 ──hash──► tick 1 ──hash──► tick 2 ──hash──► ...
33+
│ │ │
34+
▼ ▼ ▼
35+
provable provable provable
36+
```
3237

33-
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.
3439

35-
- AIΩN repo: <https://github.com/flyingrobots/aion>
40+
**Prove it:**
3641

37-
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 ✅
3848
39-
- Paper I — *WARP Graphs: A Worldline Algebra for Recursive Provenance* ([doi:10.5281/zenodo.17908005](https://doi.org/10.5281/zenodo.17908005))
40-
- Paper II — *WARP Graphs: Canonical State Evolution and Deterministic Worldlines* ([doi:10.5281/zenodo.17934512](https://doi.org/10.5281/zenodo.17934512))
41-
- Paper III — *WARP Graphs: Computational Holography & Provenance Payloads* ([doi:10.5281/zenodo.17963669](https://doi.org/10.5281/zenodo.17963669))
42-
- Paper IV — *WARP Graphs: Rulial Distance & Observer Geometry* ([doi:10.5281/zenodo.18038297](https://doi.org/10.5281/zenodo.18038297))
43-
- Paper V — *WARP Graphs: Ethics of Deterministic Replay & Provenance Sovereignty* (not yet published)
44-
- Paper VI — *The AIΩN Computer: Architecture & Operating System* (not yet published)
49+
Hashes match. Determinism verified.
50+
```
4551

46-
---
52+
> **Naming:** Echo is the product. WARP is the underlying graph algebra. The `warp-*` and `echo-*` crates are internal modules—same project, different layers.
4753
4854
## Why?
4955

50-
- **Determinism first:** same inputs → same ordered rewrites → same hashes.
51-
- **Provenance you can trust:** snapshots and commits are content‑addressed.
52-
- **Tooling as a first‑class citizen:** graphs stream over a canonical wire protocol; consumers verify hashes and detect desync early.
53-
54-
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 |
5562

56-
---
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.
5764

58-
## What It Does Right Now
65+
## Project Status
5966

60-
### 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.
6176
6277
- `crates/warp-core` — deterministic rewrite engine: canonical scheduling, parallel execution with deterministic results independent of CPU count, snapshot and commit hashing. See [`docs/architecture-outline.md`](docs/architecture-outline.md) for detailed API documentation.
6378
- `crates/warp-geom` — geometry primitives (currently isolated).
6479

65-
### Session + streaming pipeline
80+
### Roadmap
6681

67-
- `crates/echo-graph` — canonical renderable graph (`RenderGraph`) + diff ops (`WarpOp`) + deterministic graph hashing.
68-
- `crates/echo-session-proto` — deterministic JS‑ABI v1.0 framing + canonical CBOR + wire schema.
69-
- `crates/echo-session-service` — headless Unix‑socket hub:
70-
- handshake + monotonic `ts`
71-
- subscriptions per `WarpId`
72-
- gapless diff enforcement (snapshot resets; diffs must be consecutive epochs)
73-
- `crates/echo-session-client` — client helpers + tool port abstraction (`tool::SessionPort`).
74-
- `crates/echo-session-ws-gateway` — WebSocket ↔ Unix‑socket bridge for browser‑based tools.
82+
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.
7583

76-
### Tools + adapters
84+
1. **WARPSITE**—a website powered by WARP graph rewriting
85+
2. **Splash Guy**—a demo game designed to introduce Echo concepts
86+
3. **Tumble Tower**—a demo game designed to demonstrate Echo's physics determinism
7787

78-
- `crates/warp-viewer` — native WGPU viewer:
79-
- subscribes to a WARP stream,
80-
- applies snapshots/diffs,
81-
- verifies `state_hash` per frame (declares desync on mismatch).
82-
- `crates/echo-app-core` / `crates/echo-config-fs` — “tool hexagon” ports + filesystem config adapter.
83-
- `crates/warp-ffi` / `crates/warp-wasm` — bindings around `warp-core`.
84-
- `crates/warp-benches` — Criterion microbenchmarks (scheduler drain, snapshot hash, etc.).
85-
- `crates/echo-dind-harness` — determinism drill runner (DIND suite; cross‑platform hash verification).
86-
- `crates/echo-dind-tests` — stable test app used by the DIND harness.
88+
#### Time Travel Debugger + WARPSITE
8789

88-
### Living specs (teaching slice)
90+
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.
8991

90-
- `specs/spec-000-rewrite` — Leptos + Trunk scaffold for “Spec‑000: Everything is a Rewrite”.
91-
- `crates/echo-wasm-abi` — WASM‑friendly DTO schema for specs.
92-
- `crates/echo-wasm-bindings` — demo kernel + rewrite history (teaching slice; not the production engine).
92+
- Time Travel Debugging (TTD) Part 1—Tick Inspector + Rewind/Jump to Previous Tick (In Progress)
93+
- WARPSITE (In Progress)
94+
- [Wesley](https://github.com/flyingrobots/wesley)—GraphQL-as-schema → Rust/TypeScript Compiler
95+
- TTD Part 2—Fork Worldlines
9396

94-
For a deeper tour, see [`docs/meta/docs-index.md`](docs/meta/docs-index.md).
97+
#### Then: Splash Guy Tutorial Demo
9598

96-
---
99+
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.
97100

98-
## Quickstart
101+
- Rhai Scripting API
102+
- Graphics
103+
- Input
99104

100-
### Requirements
105+
#### After: Tumble Tower Demo
101106

102-
- Rust toolchain pinned by `rust-toolchain.toml` (currently `1.90.0`).
103-
- 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).
107+
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.
104108

105-
### Common commands
109+
- Physics Engine
110+
- Collision Resolution
106111

107-
Install repo hooks:
112+
## Quick Tour
108113

109114
```bash
115+
# Install hooks (formats code, runs clippy, checks docs)
110116
make hooks
111-
```
112-
113-
Run the workspace tests:
114117

115-
```bash
118+
# Run the test suite
116119
cargo test --workspace
120+
121+
# Run determinism verification
122+
cargo xtask dind run
117123
```
118124

119125
Run `warp-core` with extra delta validation enabled:
@@ -122,80 +128,97 @@ Run `warp-core` with extra delta validation enabled:
122128
cargo test -p warp-core --features delta_validate
123129
```
124130

125-
Run clippy with the repo’s docs gate:
126-
127131
```bash
128-
cargo clippy --all-targets -- -D warnings -D missing_docs
129-
```
130-
131-
Run the docs site (VitePress):
132+
# Launch the viewer
133+
cargo run -p warp-viewer
132134

133-
```bash
135+
# Build the docs site
134136
make docs
135137
```
136138

137-
Directly (useful when debugging):
138-
139-
```bash
140-
pnpm install
141-
pnpm docs:dev
139+
## The Stack
140+
141+
```mermaid
142+
flowchart TB
143+
%% Authoring
144+
A["GraphQL Schema<br />(Types + Ops + Docs)"] -->|author + version| B["Wesley<br />(schema compiler)"]
145+
146+
%% Codegen outputs
147+
B --> C["Rust Types + Op IDs<br />(structs/enums, stable IDs)"]
148+
B --> D["ABI / Wire Layout<br />(canonical encoding)"]
149+
B --> E["Client Stubs<br/>(TS/Rust helpers)"]
150+
B --> F["Registry Metadata<br/>(introspection, docs index)"]
151+
152+
%% App layer
153+
C --> G["Game / App Code<br/>(rules + gameplay)"]
154+
D --> G
155+
F --> G
156+
157+
%% Runtime
158+
G --> H["Echo Core Runtime<br/>(deterministic tick loop)"]
159+
H --> I["WARP Graph Engine<br/>(rewrite + commit + hash)"]
160+
I --> J["WARP Graph Executable<br/>(content-addressed worldline)"]
161+
162+
%% Tooling
163+
F --> K["Devtools / Viewer<br/>(inspect ops, decode vars)"]
164+
I --> K
165+
J --> K
142166
```
143167

144-
CI-style build (includes link checking):
168+
**Core**`crates/warp-core`
145169

146-
```bash
147-
pnpm docs:build
148-
```
170+
- Graph-rewrite engine with transactional commits
171+
- Deterministic math (fixed-point, PRNG, Vec3/Mat4/Quat)
172+
- **Materialization bus**—order-independent channel for outputs; emitters don't need to coordinate
173+
- **WSC** (Write-Streaming Columnar)—zero-copy snapshot format (mmap-friendly) for fast state reload + verification
149174

150-
Run the session hub:
175+
**Pipeline**`crates/echo-session-*`
151176

152-
```bash
153-
cargo run -p echo-session-service
154-
```
177+
- Unix socket hub with gapless diff streaming
178+
- WebSocket gateway for browser tools
179+
- Canonical CBOR wire format
155180

156-
Run the viewer:
181+
**Tools**`crates/warp-viewer`, `crates/echo-dind-*`
157182

158-
```bash
159-
cargo run -p warp-viewer
160-
```
183+
- Native GPU viewer with per-frame hash verification
184+
- **DIND** (Determinism-in-Determinism)—cross-platform test harness that proves hash convergence
161185

162-
Run Spec‑000 (WASM dev server; requires `trunk` installed):
186+
## Research Foundation
163187

164-
```bash
165-
make spec-000-dev
166-
```
188+
Echo implements ideas from the **AIΩN Foundations** paper series:
167189

168-
Run DIND (cross-platform determinism verification):
190+
1. [WARP Graphs: A Worldline Algebra for Recursive Provenance](https://doi.org/10.5281/zenodo.17908005)
191+
2. [Canonical State Evolution and Deterministic Worldlines](https://doi.org/10.5281/zenodo.17934512)
192+
3. [Computational Holography & Provenance Payloads](https://doi.org/10.5281/zenodo.17963669)
193+
4. [Rulial Distance & Observer Geometry](https://doi.org/10.5281/zenodo.18038297)
169194

170-
```bash
171-
cargo xtask dind run
172-
```
195+
Part of the [AIΩN Framework](https://github.com/flyingrobots/aion).
173196

174-
---
197+
## Contributing
175198

176-
## Contributions
199+
Determinism is sacred. Before you change anything:
177200

178-
- Start with `CONTRIBUTING.md`.
179-
- Echo is docs-driven: behavior changes should be reflected in specs and ADRs.
180-
- Determinism is sacred: avoid wall‑clock time, uncontrolled randomness, and unspecified iteration order.
201+
1. Read [`CONTRIBUTING.md`](CONTRIBUTING.md)
202+
2. Run `make hooks` to install the guardrails
203+
3. Write tests. If it's not tested, it's not deterministic.
181204

182-
### Determinism guard scripts
205+
The codebase enforces:
183206

184-
Echo enforces determinism guardrails via scripts in `scripts/`:
207+
- No global state (`scripts/ban-globals.sh`)
208+
- No wall-clock time or uncontrolled randomness (`scripts/ban-nondeterminism.sh`)
209+
- No unordered iteration (`scripts/ban-unordered-abi.sh`)
185210

186-
- `scripts/ban-globals.sh`
187-
- `scripts/ban-nondeterminism.sh`
188-
- `scripts/ban-unordered-abi.sh`
211+
## Requirements
189212

190-
## Workflows
213+
- **Rust** — pinned in `rust-toolchain.toml` (currently 1.90.0)
214+
- **Node.js 18+** — for the docs site (VitePress)
191215

192-
Echo has a few “official workflows” (policy + blessed scripts/entrypoints), documented here:
216+
## License
193217

194-
- [`docs/workflows.md`](docs/workflows.md) — contributor playbook (PR policy, docs guard, `cargo xtask`, scheduled automations)
195-
- [`docs/dependency-dags.md`](docs/dependency-dags.md) — issue + milestone dependency DAGs (DOT/SVG) and how to regenerate them
218+
Dual-licensed under Apache 2.0 and MIND-UCAL 1.0. See [`LEGAL.md`](LEGAL.md) for details.
196219

197220
---
198221

199-
## License
200-
201-
Echo is dual‑licensed. See `LICENSE`, `LICENSE-APACHE`, `LICENSE-MIND-UCAL`, and `LEGAL.md` for details.
222+
<p align="center">
223+
<sub>Built by <a href="https://github.com/flyingrobots">FLYING•ROBOTS</a></sub>
224+
</p>

crates/echo-dind-harness/tests/coverage.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ fn run_suite(manifest_path: PathBuf) -> Result<()> {
4242
let manifest: Vec<ManifestEntry> = serde_json::from_reader(BufReader::new(f))?;
4343

4444
let base_dir = manifest_path.parent().unwrap();
45+
let update_golden = std::env::var("DIND_UPDATE_GOLDEN").is_ok();
4546

4647
for entry in manifest {
4748
let scenario_path = base_dir.join(&entry.path);
@@ -54,7 +55,21 @@ fn run_suite(manifest_path: PathBuf) -> Result<()> {
5455

5556
// Check if there is a golden file to verify against
5657
let golden_path = base_dir.join(entry.path.replace(".eintlog", ".hashes.json"));
57-
if golden_path.exists() {
58+
59+
if update_golden {
60+
// Update mode: write new golden file
61+
let golden = echo_dind_harness::dind::Golden {
62+
elog_version: 1,
63+
schema_hash_hex: "0427e9fd236e92dfc8c0765f7bd429fc233bfbfab3cb67c9d03b22a0f31e7f8a"
64+
.to_string(),
65+
hash_domain: "DIND_STATE_HASH_V2".to_string(),
66+
hash_alg: "BLAKE3".to_string(),
67+
hashes_hex: hashes.clone(),
68+
};
69+
let f_out = std::fs::File::create(&golden_path)?;
70+
serde_json::to_writer_pretty(f_out, &golden)?;
71+
println!("Updated: {:?}", golden_path);
72+
} else if golden_path.exists() {
5873
let f_golden = File::open(&golden_path)?;
5974
let expected: echo_dind_harness::dind::Golden =
6075
serde_json::from_reader(BufReader::new(f_golden))?;

0 commit comments

Comments
 (0)