A game engine where AI agents aren't scripted — they plan, learn, and adapt. Rust. Deterministic ECS. Designed and built entirely through human-AI collaboration. MIT licensed.
Rust
6
1,409 commits
updated Sep 26, 2026
An AI-native game engine with deterministic ECS architecture where AI agents are first‑class citizens.
Built in Rust, designed for massive-scale intelligent worlds.
📚 Documentation • 📊 Benchmarks • 🗺️ Roadmap• 🧪 Coverage • 🕸️ Workspace Map • ⚡ Interactive Dashboard • 🌐 Github Pages
✅ MIRI + KANI FORMAL VERIFICATION COMPLETE — Miri Report | Coverage Report | Behavioral Audit | Architecture Map v0.7.2
🏆 Production-Grade Quality: AstraWeave has ~39,000+ test annotations across ~51 production crates (130 workspace members via cargo metadata) with 57.35% whole-workspace line coverage (cargo llvm-cov --workspace, measured 2026-06-29; well-covered core crates such as ECS, Physics, and Nav exceed 85%). The full 130-member workspace compiles with zero errors (cargo check --workspace, verified 2026-06-10). All unsafe code is Miri-validated and Kani-verified. The editor has undergone a 37-fix behavioral correctness audit with a unified rendering pipeline now protected by a bit-identical editor↔engine parity harness.
| Metric | Status | Details |
|---|---|---|
| Build Health | ✅ 0 errors, 130/130 members | cargo check --workspace clean (2026-06-10); former known-build-issue crates (rhai authoring, egui demos, astraweave-llm) all compile |
| Coverage | ✅ 57.35% whole-workspace line | cargo llvm-cov --workspace across 130 members (measured 2026-06-29, Path-B.2 — supersedes the prior 29-crate-subset 59.3%) |
| Tests | ✅ ~39,000+ annotations | Core: 959, ECS: 728, Editor: 9,425 annotations, Render: 4,272+, Physics: 1,884, Net trio: 104 (all green 2026-06-10) |
| Memory Safety | ✅ Miri-Validated | 1,059 tests, 0 undefined behavior across 4 crates |
| Formal Verification | ✅ Kani-Verified | 71+ proof harnesses across safety-critical crates |
| Behavioral Correctness | ✅ 37 fixes applied | 8-phase audit: visual math, data pipeline, undo system, silent failures |
| Mutation Testing | ✅ ~2,928 tests, 4 waves | Wave 1: 767 manual + Wave 2: 1,261 automated + Wave 3: 489 targeted + Wave 4: 411 fluids; 100% kill rate on prompts (792 mutants) |
| Determinism | ✅ 100% bit-identical | Replay validation, 5-run consistency |
| Rendering | ✅ Unified Pipeline + WYSIWYG parity | Disney BRDF + multi-scatter, 4-cascade CSM, IBL cubemaps, ACES/AgX/Reinhard tonemapping; bit-identical editor↔engine parity harness |
| Network Security | ✅ HMAC-SHA256 enforced | Matchmaking trio input signing canonical end-to-end, verify-first, kick-by-default; 104 regression tests (Net-Trio-Remediation, 2026-06-10) |
| Architecture Traces | ✅ 13 subsystems traced | Forensic file map / conflict map / decision log / invariants / open questions per trace |
| Health Grade | ✅ A- | Upgraded from B+ after audit remediation + unified pipeline |
What changed (June 2026)? Five campaigns closed and one advanced since the May snapshot. Net-Trio-Remediation (Jun 9–10) fixed the long-standing matchmaking-trio signature defect: canonical HMAC-SHA256 sign/verify in
aw-net-proto(XORsign16stub deleted), client and server share the same surface, the server verifies before any state mutation and kicks by default (SignatureFailurePolicy::Kick, WebSocket Close 1008), with TLS-path coverage — 104 trio regression tests, all green. Unified Camera C.0–C.9 (closed Jun 1) consolidated 8 divergent camera codepaths into the newastraweave-cameracrate (RenderViewas the sole upload payload; dual renderer upload paths and 3 parallel cinematics keyframe systems retired, net −1,549 LoC in C.6 alone). Editor-Engine Render Parity P.1–P.7 (closed May 17) established a bit-identical (SHA-256) editor↔engine WYSIWYG contract with a public regression harness — five seams structurally protected. Editor Multi-Tool Architecture Sub-phases 3 and 4 closed (May 14 / Jun 6); Sub-phase 5 is in flight (5.A/5.B landed Jun 6). Terrain Asset Quality (closed Jun 2) baselined terrain texture VRAM at 80 MiB per active pack (31% of the 256 MB soft budget) and flagged the BC7/KTX2 cook path as non-functional (runtime uploads uncompressed RGBA8). A live build audit (Jun 10) confirmed all 130 workspace members compile clean — every entry on the former known-build-issues list (rhai authoring crates, egui demos, astraweave-llm) now passescargo check.
What changed (May 2026)? The architecture trace campaign completed 13 per-subsystem traces under
docs/architecture/(terrain materials, render pipeline, physics, persistence-ECS, networking ×2, input, fluids, ECS/math/core/SDK foundation, audio, animation, AI pipeline, aw_editor). The Architecture Map was reconciled to v0.7.0 against those traces, and the Interactive Workspace Map was deployed. Specific documentation hazards were surfaced and corrected: Fluids reclassified as research surface (no production game-loop dep), the runtime LLM default drift from Qwen tophi3:mediumwas identified and later replaced withqwen3.5:4b, dualWorldcoexistence (legacycore::World+ ECS substrate) documented, four parallel animation type families catalogued, and the §7.7 wrapped-component resource identity trap promoted to a workspace-wide structural axiom.Why 57.35%? The whole-workspace measurement (
cargo llvm-cov --workspace) counts all ~51 production + bin/tool crate source — including large GPU-only and async code paths (rendering, terrain, audio) that are hard to exercise in headless mode. It supersedes the earlier 59.3%, which measured only a 29-crate curated subset (a higher number because it excluded the lower-coverage crates — a denominator change, not a regression). See MASTER_COVERAGE_REPORT for full analysis.What changed (April 2026)? The editor underwent a comprehensive Behavioral Correctness Audit: 37 fixes across 48 commits addressing shader math (GGX NDF, Fresnel energy conservation, multi-scatter compensation), undo system completion (all 9 operations now undoable), silent failure resolution (60 patterns identified, critical ones fixed), and a 7-phase architectural refactor that eliminated the dual rendering pipeline (-4,669 LOC). Health grade upgraded from B+ to A- reflecting the correctness improvements.
Miri Validated: astraweave-ecs (419 tests), astraweave-math (109 tests), astraweave-core (503 tests), astraweave-sdk (28 tests) = 1,059 — ZERO undefined behavior | MIRI_VALIDATION_REPORT
Unsafe Code Validated: BlobVec, SparseSet, EntityAllocator, SIMD intrinsics (SSE2), C ABI FFI functions — all memory-safe ✅
git clone https://github.com/lazyxeon/AstraWeave.git
cd AstraWeave
# Build core engine
cargo build --release -p astraweave-core
# Run the flagship AI companion demo (7 planning modes, feature-gated)
cargo run -p hello_companion --release
# Run the visual editor (fetch the asset packs first: cargo xtask fetch-assets)
cargo editor
Note: Editor (aw_editor) has 9,425 test annotations. See workflow tests in tools/aw_editor/tests.
Key Documentation:
AstraWeave's architecture is documented through a forensic trace campaign covering 13 subsystems under docs/architecture/. Each trace is evidence-grounded, version-controlled, and explicitly separates load-bearing code from in-design surface. Trace docs are part of the production contract: when subsystem code changes, the trace updates in the same commit (see CLAUDE.md).
The campaign produced three artifacts that together form the engine's navigational surface:
The methodology — applying forensic auditing as a counterweight to AI-generated documentation drift — is part of the Genesis Code Protocol (GCP) approach to AI-augmented development. Cross-cutting structural rules surfaced by the campaign (the §7.7 wrapped-component resource identity trap, the no-second-implementation Fix-27 lesson, the "wired beats tested" axiom, the silent-failure policy) are documented in ARCHITECTURE_MAP.md §4 and applied across the workspace.
Traditional game engines bolt AI onto simulation. AstraWeave weaves AI into the core.
In AstraWeave, the "Game Loop" is an Intelligence Loop:
This architecture enables 12,700+ intelligent agents running at 60 FPS with complex reasoning on reference hardware (HP Pavilion Gaming Laptop — benchmarks), not just simple state machines.
The diagram below is the high-level Intelligence Loop abstraction; the actual ECS scheduler runs an 8-stage canonical pipeline described below the diagram. See ARCHITECTURE_MAP.md §3 for the full data flow.
flowchart TB
A[Perception] --> B[Reasoning]
B --> C[Planning]
C --> D[Action]
D --> E[Validation]
E --> F[Simulation]
F --> A
style A fill:#4a90e2
style B fill:#7b68ee
style C fill:#50c878
style D fill:#ffa500
style E fill:#ff6b6b
style F fill:#45b7d1
8-Stage Deterministic ECS Pipeline (executed in canonical order, single-threaded per tick):
PRE_SIMULATION → 2. PERCEPTION → 3. SIMULATION → 4. SYNC (ECS ↔ legacy core::World) → 5. AI_PLANNING → 6. PHYSICS → 7. POST_SIMULATION → 8. PRESENTATIONSystems within a stage execute in registration order; stages execute in the order above. ParallelSchedule was removed 2026-04-18 (see docs/audits/parallel_schedule_removal_2026-04-18.md); parallelism lives at the subsystem level (rayon for terrain meshing; tokio for I/O and LLM inference; GPU compute for rendering).
Multi-Modal Intelligence: 6 validated AI modes (GOAP, Behavior Trees, LLM, Hybrid ensembles). Local LLM via Ollama — model configurable via OLLAMA_MODEL and defaults to Qwen (qwen3.5:4b) for active examples and probes.
Massive Scale: Orchestrates 12,700+ agents @ 60 FPS on reference hardware (HP Pavilion Gaming Laptop — see benchmark hardware spec).
LLM Integration: Streaming API, batch executor, response caching, and tool-sandbox validation are production-wired. The broader production-hardening surface (rate limiting, circuit breakers, A/B routing, 4-tier fallback — ~15K LoC) ships as research surface and is currently bypassed by the runtime arbiter path. Q4 in ARCHITECTURE_MAP.md §14.
Dynamic Terrain: ✅ Production AI-orchestrated terrain generation with LLM integration.
Scripting: Active/Alpha Rhai-based scripting system for behavior logic (astraweave-scripting).
Generative AI: Experimental Asset generation pipeline (astraweave-ai-gen).
Deterministic ECS: Single-threaded archetype scheduler with 100% bit-identical replay validation and Miri-validated memory safety. Systems execute in a fixed stage order on one thread per tick; parallelism lives at the subsystem level, not inside the schedule. See docs/audits/parallel_schedule_removal_2026-04-18.md for the rationale behind the single-threaded-ECS choice.
Subsystem parallelism: rayon drives terrain chunk meshing (astraweave-terrain); tokio drives async asset streaming, LLM inference, and network I/O. GPU compute handles rendering and shader work. Where the engine spends multi-core budget today is these subsystems — not the ECS tick loop. (The former SPH fluid simulation that also used rayon was removed in the W.1 water-successor deprecation, 2026-06-20.)
Memory Safety: All unsafe code validated with Miri (1,059 tests, 0 UB).
Sequential throughput: at 1000 entities on the reference profiling_demo workload, sequential ECS median ~1 760 FPS with fast-alloc (mimalloc), ~1 200 FPS on the platform default allocator — measured with allocation-counter instrumentation active, across three runs each, per docs/audits/schedule_stage_fix_2026-04-18.md §4. Scaling is approximately inverse to entity count (200e ≈ 10 k FPS, 2000e ≈ 940 FPS, 4000e ≈ 449 FPS). These numbers are measurement baselines, not shipping numbers.
Performance: Fixed 60Hz simulation, SIMD acceleration (glam), cache-friendly archetype storage.
Networking: Client-server architecture with delta encoding and state synchronization.
Persistence: ECS world save/load with version migration.
AAA Pipeline: Disney BRDF with multi-scatter energy compensation (Turquin 2019), IBL via prefiltered cubemaps, and clustered forward lighting (100k+ lights).
Advanced Effects: VXGI, Volumetric Fog, SSAO, SSR, Bloom, DOF, Motion Blur, 4-cascade CSM shadows with frustum fitting + texel-snap stabilization.
Optimization: Nanite-inspired virtualized geometry, GPU occlusion culling, 3-channel DFG LUT (GGX + cloth sheen).
Materials: Advanced shaders (Clearcoat, Sheen/Charlie, SSS, Anisotropy). Tonemapping: ACES (default), AgX, Reinhard — one shared post pipeline for engine and editor.
Unified Editor Pipeline: Editor viewport renders through the engine — single source of truth for PBR, shadows, IBL, and post-processing, enforced by a bit-identical (SHA-256) editor↔engine parity harness (Render Parity P.1–P.7, May 2026). See Architecture Map.
Rapier3D Integration: Rigid bodies, character controllers, and spatial queries.
Navigation: Navmesh generation (Delaunay) + A* pathfinding (142k queries/sec).
Terrain: Voxel-based terrain with AI-orchestrated dynamic modification.
Audio: Spatial audio with occlusion and dialogue runtime.
Overall Status: Active research-grade engine under solo development for the Veilweaver game project. Phase 8 (Game Engine Readiness). Active campaign: Editor Multi-Tool Architecture Sub-phase 5 (Phase 8.8 Physics Robustness paused — no physics commits since Feb 2026). Engine ships when Veilweaver ships (12–18 month horizon as of May 2026). Status icons below: ✅ production-wired · 🔧 active, mid-campaign · 🔬 research surface (in-design, not currently runtime-wired) · 🧪 experimental.
| Component | Status | Notes |
|---|---|---|
| Core ECS | ✅ Production Ready | 728 tests (331 lib + 397 integration), 96.39% coverage, Miri + Kani validated. Deterministic single-threaded scheduler. |
| Rendering | ✅ Production Ready | 4,272+ tests, Disney BRDF + multi-scatter, 4-cascade CSM, IBL cubemaps, ACES/AgX/Reinhard tonemapping. Editor↔engine bit-identical parity harness (Render Parity P.1–P.7, closed 2026-05-17). |
| Camera | ✅ Production Ready | New astraweave-camera crate (Unified Camera C.0–C.9, closed 2026-06-01): canonical RenderView upload contract, two producers (FreeFly, Orbit), hardened cinematics keyframe path. 8 codepaths consolidated; 25 crate tests + 8 renderer contract tests + parity-harness matrix fixtures (all green 2026-06-10). |
| Physics/Nav | ✅ Production Ready | 2,380 tests (1,884 physics + 496 nav), Rapier3D wrapper. SpatialHash module dormant (1,038 LoC, doc-comment drift — Q19). Phase 8.8 robustness campaign paused since Feb 2026. |
| AI Orchestration | ✅ Production Ready | 921 tests (514 lib + 407 integration), validated at 12,700+ agents. Canonical GOAP + Behavior Trees + LLM hybrid arbiter. |
| Terrain | ✅ Production Ready | Climate field, Whittaker biome lookup, 32-layer material pipeline (21 named + 11 reserved materials), regional archetype variation. Texture VRAM budget-verified: 80 MiB/active pack (31% of 256 MB soft budget); BC7/KTX2 cook path currently non-functional (runtime uploads uncompressed RGBA8) — see Terrain Asset Quality outcome. |
| Editor | 🔧 Active, Mid-Campaign | 9,425 test annotations, unified engine pipeline with public parity harness. Multi-Tool Architecture campaign: Sub-phases 3 + 4 complete (2026-05-14 / 2026-06-06); Sub-phase 5 in flight (5.A/5.B landed 2026-06-06; 5.C closeout, Mediator Removal, and Sub-phase 6 pending). Behavioral Correctness post-remediation items open per aw_editor.md §1/§11. |
| Networking | 🔧 Two Coexisting Subsystems | Snapshot-based (astraweave-net, JSON/WebSocket) and ECS Plugin (astraweave-net-ecs) with disjoint data models. Standalone matchmaking trio (aw-net-{proto,client,server}): HMAC-SHA256 input signing canonical and enforced end-to-end — server verifies first and kicks by default (SignatureFailurePolicy::Kick); XOR sign16 stub deleted (Net-Trio-Remediation, 2026-06-10; 104 tests). Deliberate boundaries: no replay protection; server→client unsigned (asymmetric-trust design). See net_ecs.md. |
| Prompts | ✅ Production Ready | 1,375 tests (556 lib + 819 integration), 100% mutation kill rate (792 mutants). |
Scripting (astraweave-scripting) | ⚠️ Alpha | 128 tests (45 lib + 83 integration), functional Rhai integration. Authoring tooling layer (astraweave-author, rhai_authoring) now compiles clean (former Rhai Sync trait errors resolved — verified 2026-06-10). |
| UI Framework | ✅ Production Ready | 751 tests (320 lib + 431 integration), functional coverage. |
| LLM Support | ✅ Production Ready (core) / 🔬 Hardening Layer | 16,776 lines. Core inference pipeline + tool sandbox is production-wired. The ~15K LoC production-hardening surface (rate limiting, circuit breakers, A/B routing, 4-tier fallback) is dormant — Q4 in §14. |
| Fluids | 🔬 Research Surface (deprecated sim) | 738 test markers . W.1 (2026-06-20) removed the SPH/voxel solver (−58.8K LoC); the crate is now ~24.2K LoC — the deprecated PBD remnant plus the retained F.4 GPU-particle accent substrate (FluidSystem + WaterEffectsManager; PcisphSystem/UnifiedSolver deleted). Only examples/ consume it; no production game-loop crate depends on astraweave-fluids. The live water system is the view-side successor — astraweave-water facade + astraweave-render/src/water.rs, see water.md. Q12 in §14. See fluids.md. |
| Memory / Coordination / RAG | 🔬 Research Surface | Memory pipeline ~11K, Coordination ~5.3K, RAG composite ~12.3K. Zero in-engine production consumers; HNSW vector index is currently a linear scan. Q11 in §14. |
| AI Generation | 🧪 Orphan Source | astraweave-ai-gen/ holds 4 loose source files with no Cargo.toml and no crate root — not a workspace member, cannot build as-is. See the dormant-code taxonomy in ARCHITECTURE_MAP.md §5. |
cargo check --workspace clean — 130/130 members, 0 errors (verified 2026-06-10)cargo llvm-cov --workspace (130 members; measured 2026-06-29, supersedes the prior 29-crate-subset 59.3%)#[test]/#[tokio::test] markers; cargo metadata 130 members)docs/architecture/ (forensic file map / conflict map / decision log / invariants / open questions per trace)AstraWeave is a modular workspace of ~51 production crates organized into 7 functional domains, plus 12 tools and 59 example crates (130 workspace members via cargo metadata --no-deps, verified 2026-06-10). Each crate is designed for composability, testability, and production deployment.
astraweave-core: Foundation framework with WorldSnapshot, PlanIntent schemas, and tool registry systemastraweave-ecs: AI-native archetype-based ECS with deterministic scheduling and event systemsastraweave-math: SIMD-accelerated math operations (1.7-2.5× speedup, SSE2/AVX2/NEON support)astraweave-profiling: Zero-cost Tracy integration with GPU/memory/lock tracingastraweave-input: Action-based input binding system with multi-device supportastraweave-sdk: C ABI interface for embedding AstraWeave in external enginesastraweave-observability: Production telemetry, logging, and crash reportingastraweave-optimization: LLM performance optimization (batching, caching, token compression)astraweave-alloc: Opt-in mimalloc global-allocator shim (fast-alloc feature; +43% FPS on the profiling-demo workload, default-on in profiling_demo, hello_companion, and the editor)astraweave-ai: Core loop orchestration with GOAP planner and async LLM executorastraweave-llm: Production LLM integration (Qwen via Ollama, prompt caching, circuit breaker; Phi-3/Hermes clients retained only as legacy comparison modules)astraweave-llm-eval: Automated LLM evaluation with multi-metric scoringastraweave-behavior: Behavior trees, HTN planning, GOAP with LRU plan cachingastraweave-context: Conversation history with token-aware sliding windows and summarizationastraweave-embeddings: Vector embeddings with linear-scan similarity search (cosine default; Euclidean/Manhattan/dot-product configurable). HNSW is advertised in doc-comments but not implemented — VectorStore::search is a brute-force scan (see the Memory / Coordination / RAG research-surface row above)astraweave-rag: Retrieval-augmented generation pipeline with memory consolidationastraweave-prompts: Handlebars templating with persona integration and A/B testingastraweave-persona: NPC personality system with zip-based persona packsastraweave-memory: Hierarchical memory (sensory/working/episodic/semantic) with SQLite persistenceastraweave-coordination: Multi-agent coordination framework (Experimental)astraweave-director: Boss director with LLM orchestration and dynamic difficultyastraweave-npc: NPC runtime with sensing, behavior execution, and profile managementastraweave-dialogue: Branching dialogue graph system with validationastraweave-render: AAA rendering pipeline (PBR, clustered lighting, VXGI, MegaLights, Nanite virtualized geometry)astraweave-camera: Canonical camera types (Projection, RenderView, CameraProducer trait, FreeFly controller) — sole upload contract for the renderer (Unified Camera campaign, 2026-06)astraweave-materials: Material graph system with PBR-E advanced shading (clearcoat, anisotropy, transmission)astraweave-asset: Asset management with Nanite preprocessing and World Partition cell loadingastraweave-asset-pipeline: Texture and mesh optimization pipeline. BC7/ASTC cook path present but currently non-functional (placeholder encoder; runtime uploads uncompressed RGBA8 — Terrain Asset Quality outcome, 2026-06)astraweave-physics: Rapier3D integration with spatial hash, projectiles, gravity zones, and ragdollastraweave-nav: Navigation mesh with pathfinding and geometric utilitiesastraweave-terrain: Procedural terrain with erosion, biomes, LOD, and async streamingastraweave-fluids: Deprecated PBD/accent remnant — W.1 (2026-06-20) removed the SPH/voxel sim (−58.8K LoC); retains in-crate caustics/foam + the F.4 GPU-particle accent substrate. Live water is the view-side successor (astraweave-water + astraweave-render/src/water.rs)astraweave-scene: Scene management with world partitioning and GPU resource streamingastraweave-gameplay: Core gameplay framework (biomes, combat, crafting, quests, cutscenes)astraweave-quests: Quest system with authorable steps and LLM-powered generationastraweave-weaving: Emergent behavior layer with anchor system and echo currency (VeilWeaver mechanics)astraweave-cinematics: Cinematic timeline system for cutscenes and scripted sequencesastraweave-pcg: Procedural content generation with deterministic seed-based RNGastraweave-net: Snapshot-based networking with delta compression and interest managementastraweave-net-ecs: ECS networking plugin with client prediction and server reconciliationastraweave-persistence-ecs: ECS save/load integration with replay recordingastraweave-ipc: Inter-process communication for AI orchestration via WebSocketastraweave-audio: Spatial audio engine with dialogue integration and TTS adapterastraweave-ui: UI framework with HUD (quest tracker, minimap), menus, and accessibilityastraweave-scripting: Rhai-based scripting for game logic and AI behaviorastraweave-author: Rhai authoring for map design and encounter configurationastraweave-security: Security framework with sandboxing and input validationastraweave-secrets: Secrets management with keyring backendastraweave-steam: Steamworks SDK integration (achievements, cloud saves, statistics)astraweave-stress-test: Comprehensive stress testing and benchmarking frameworkaw_editor (active mid-campaign, 9,425 test annotations), aw_asset_cli, aw_texture_gen, aw_save_cli, and ~8 other build/debugging utilities (12 tool crates total)hello_companion (7 AI modes, feature-gated), biome_showcase, adaptive_boss, and physics/fluids demosAstraWeave is an experimental project being built solo through AI-augmented development under the Genesis Code Protocol (GCP) — a methodology that pairs AI code generation with forensic auditing (the architecture trace campaign) as a counterweight to AI-generated documentation drift. The project's mandate is zero human-written code; the audit campaign is how that mandate stays honest.
Current Development Status:
docs/architecture/ + the Architecture Map (v0.7.2) + the Interactive Workspace MapSee CONTRIBUTING.md, CLAUDE.md, and docs/masters/MASTER_ROADMAP.md for detailed roadmap and contribution guidelines.
Building the future of AI‑native gaming.
If this experiment interests you, please ⭐ the repo.
Rust
93.9%
HTML
2.9%
WGSL
1.4%
A game engine where AI agents aren't scripted — they plan, learn, and adapt. Rust. Deterministic ECS. Designed and built entirely through human-AI collaboration. MIT licensed.
Rust
6
1,409 commits
updated Sep 26, 2026
An AI-native game engine with deterministic ECS architecture where AI agents are first‑class citizens.
Built in Rust, designed for massive-scale intelligent worlds.
📚 Documentation • 📊 Benchmarks • 🗺️ Roadmap• 🧪 Coverage • 🕸️ Workspace Map • ⚡ Interactive Dashboard • 🌐 Github Pages
✅ MIRI + KANI FORMAL VERIFICATION COMPLETE — Miri Report | Coverage Report | Behavioral Audit | Architecture Map v0.7.2
🏆 Production-Grade Quality: AstraWeave has ~39,000+ test annotations across ~51 production crates (130 workspace members via cargo metadata) with 57.35% whole-workspace line coverage (cargo llvm-cov --workspace, measured 2026-06-29; well-covered core crates such as ECS, Physics, and Nav exceed 85%). The full 130-member workspace compiles with zero errors (cargo check --workspace, verified 2026-06-10). All unsafe code is Miri-validated and Kani-verified. The editor has undergone a 37-fix behavioral correctness audit with a unified rendering pipeline now protected by a bit-identical editor↔engine parity harness.
| Metric | Status | Details |
|---|---|---|
| Build Health | ✅ 0 errors, 130/130 members | cargo check --workspace clean (2026-06-10); former known-build-issue crates (rhai authoring, egui demos, astraweave-llm) all compile |
| Coverage | ✅ 57.35% whole-workspace line | cargo llvm-cov --workspace across 130 members (measured 2026-06-29, Path-B.2 — supersedes the prior 29-crate-subset 59.3%) |
| Tests | ✅ ~39,000+ annotations | Core: 959, ECS: 728, Editor: 9,425 annotations, Render: 4,272+, Physics: 1,884, Net trio: 104 (all green 2026-06-10) |
| Memory Safety | ✅ Miri-Validated | 1,059 tests, 0 undefined behavior across 4 crates |
| Formal Verification | ✅ Kani-Verified | 71+ proof harnesses across safety-critical crates |
| Behavioral Correctness | ✅ 37 fixes applied | 8-phase audit: visual math, data pipeline, undo system, silent failures |
| Mutation Testing | ✅ ~2,928 tests, 4 waves | Wave 1: 767 manual + Wave 2: 1,261 automated + Wave 3: 489 targeted + Wave 4: 411 fluids; 100% kill rate on prompts (792 mutants) |
| Determinism | ✅ 100% bit-identical | Replay validation, 5-run consistency |
| Rendering | ✅ Unified Pipeline + WYSIWYG parity | Disney BRDF + multi-scatter, 4-cascade CSM, IBL cubemaps, ACES/AgX/Reinhard tonemapping; bit-identical editor↔engine parity harness |
| Network Security | ✅ HMAC-SHA256 enforced | Matchmaking trio input signing canonical end-to-end, verify-first, kick-by-default; 104 regression tests (Net-Trio-Remediation, 2026-06-10) |
| Architecture Traces | ✅ 13 subsystems traced | Forensic file map / conflict map / decision log / invariants / open questions per trace |
| Health Grade | ✅ A- | Upgraded from B+ after audit remediation + unified pipeline |
What changed (June 2026)? Five campaigns closed and one advanced since the May snapshot. Net-Trio-Remediation (Jun 9–10) fixed the long-standing matchmaking-trio signature defect: canonical HMAC-SHA256 sign/verify in
aw-net-proto(XORsign16stub deleted), client and server share the same surface, the server verifies before any state mutation and kicks by default (SignatureFailurePolicy::Kick, WebSocket Close 1008), with TLS-path coverage — 104 trio regression tests, all green. Unified Camera C.0–C.9 (closed Jun 1) consolidated 8 divergent camera codepaths into the newastraweave-cameracrate (RenderViewas the sole upload payload; dual renderer upload paths and 3 parallel cinematics keyframe systems retired, net −1,549 LoC in C.6 alone). Editor-Engine Render Parity P.1–P.7 (closed May 17) established a bit-identical (SHA-256) editor↔engine WYSIWYG contract with a public regression harness — five seams structurally protected. Editor Multi-Tool Architecture Sub-phases 3 and 4 closed (May 14 / Jun 6); Sub-phase 5 is in flight (5.A/5.B landed Jun 6). Terrain Asset Quality (closed Jun 2) baselined terrain texture VRAM at 80 MiB per active pack (31% of the 256 MB soft budget) and flagged the BC7/KTX2 cook path as non-functional (runtime uploads uncompressed RGBA8). A live build audit (Jun 10) confirmed all 130 workspace members compile clean — every entry on the former known-build-issues list (rhai authoring crates, egui demos, astraweave-llm) now passescargo check.
What changed (May 2026)? The architecture trace campaign completed 13 per-subsystem traces under
docs/architecture/(terrain materials, render pipeline, physics, persistence-ECS, networking ×2, input, fluids, ECS/math/core/SDK foundation, audio, animation, AI pipeline, aw_editor). The Architecture Map was reconciled to v0.7.0 against those traces, and the Interactive Workspace Map was deployed. Specific documentation hazards were surfaced and corrected: Fluids reclassified as research surface (no production game-loop dep), the runtime LLM default drift from Qwen tophi3:mediumwas identified and later replaced withqwen3.5:4b, dualWorldcoexistence (legacycore::World+ ECS substrate) documented, four parallel animation type families catalogued, and the §7.7 wrapped-component resource identity trap promoted to a workspace-wide structural axiom.Why 57.35%? The whole-workspace measurement (
cargo llvm-cov --workspace) counts all ~51 production + bin/tool crate source — including large GPU-only and async code paths (rendering, terrain, audio) that are hard to exercise in headless mode. It supersedes the earlier 59.3%, which measured only a 29-crate curated subset (a higher number because it excluded the lower-coverage crates — a denominator change, not a regression). See MASTER_COVERAGE_REPORT for full analysis.What changed (April 2026)? The editor underwent a comprehensive Behavioral Correctness Audit: 37 fixes across 48 commits addressing shader math (GGX NDF, Fresnel energy conservation, multi-scatter compensation), undo system completion (all 9 operations now undoable), silent failure resolution (60 patterns identified, critical ones fixed), and a 7-phase architectural refactor that eliminated the dual rendering pipeline (-4,669 LOC). Health grade upgraded from B+ to A- reflecting the correctness improvements.
Miri Validated: astraweave-ecs (419 tests), astraweave-math (109 tests), astraweave-core (503 tests), astraweave-sdk (28 tests) = 1,059 — ZERO undefined behavior | MIRI_VALIDATION_REPORT
Unsafe Code Validated: BlobVec, SparseSet, EntityAllocator, SIMD intrinsics (SSE2), C ABI FFI functions — all memory-safe ✅
git clone https://github.com/lazyxeon/AstraWeave.git
cd AstraWeave
# Build core engine
cargo build --release -p astraweave-core
# Run the flagship AI companion demo (7 planning modes, feature-gated)
cargo run -p hello_companion --release
# Run the visual editor (fetch the asset packs first: cargo xtask fetch-assets)
cargo editor
Note: Editor (aw_editor) has 9,425 test annotations. See workflow tests in tools/aw_editor/tests.
Key Documentation:
AstraWeave's architecture is documented through a forensic trace campaign covering 13 subsystems under docs/architecture/. Each trace is evidence-grounded, version-controlled, and explicitly separates load-bearing code from in-design surface. Trace docs are part of the production contract: when subsystem code changes, the trace updates in the same commit (see CLAUDE.md).
The campaign produced three artifacts that together form the engine's navigational surface:
The methodology — applying forensic auditing as a counterweight to AI-generated documentation drift — is part of the Genesis Code Protocol (GCP) approach to AI-augmented development. Cross-cutting structural rules surfaced by the campaign (the §7.7 wrapped-component resource identity trap, the no-second-implementation Fix-27 lesson, the "wired beats tested" axiom, the silent-failure policy) are documented in ARCHITECTURE_MAP.md §4 and applied across the workspace.
Traditional game engines bolt AI onto simulation. AstraWeave weaves AI into the core.
In AstraWeave, the "Game Loop" is an Intelligence Loop:
This architecture enables 12,700+ intelligent agents running at 60 FPS with complex reasoning on reference hardware (HP Pavilion Gaming Laptop — benchmarks), not just simple state machines.
The diagram below is the high-level Intelligence Loop abstraction; the actual ECS scheduler runs an 8-stage canonical pipeline described below the diagram. See ARCHITECTURE_MAP.md §3 for the full data flow.
flowchart TB
A[Perception] --> B[Reasoning]
B --> C[Planning]
C --> D[Action]
D --> E[Validation]
E --> F[Simulation]
F --> A
style A fill:#4a90e2
style B fill:#7b68ee
style C fill:#50c878
style D fill:#ffa500
style E fill:#ff6b6b
style F fill:#45b7d1
8-Stage Deterministic ECS Pipeline (executed in canonical order, single-threaded per tick):
PRE_SIMULATION → 2. PERCEPTION → 3. SIMULATION → 4. SYNC (ECS ↔ legacy core::World) → 5. AI_PLANNING → 6. PHYSICS → 7. POST_SIMULATION → 8. PRESENTATIONSystems within a stage execute in registration order; stages execute in the order above. ParallelSchedule was removed 2026-04-18 (see docs/audits/parallel_schedule_removal_2026-04-18.md); parallelism lives at the subsystem level (rayon for terrain meshing; tokio for I/O and LLM inference; GPU compute for rendering).
Multi-Modal Intelligence: 6 validated AI modes (GOAP, Behavior Trees, LLM, Hybrid ensembles). Local LLM via Ollama — model configurable via OLLAMA_MODEL and defaults to Qwen (qwen3.5:4b) for active examples and probes.
Massive Scale: Orchestrates 12,700+ agents @ 60 FPS on reference hardware (HP Pavilion Gaming Laptop — see benchmark hardware spec).
LLM Integration: Streaming API, batch executor, response caching, and tool-sandbox validation are production-wired. The broader production-hardening surface (rate limiting, circuit breakers, A/B routing, 4-tier fallback — ~15K LoC) ships as research surface and is currently bypassed by the runtime arbiter path. Q4 in ARCHITECTURE_MAP.md §14.
Dynamic Terrain: ✅ Production AI-orchestrated terrain generation with LLM integration.
Scripting: Active/Alpha Rhai-based scripting system for behavior logic (astraweave-scripting).
Generative AI: Experimental Asset generation pipeline (astraweave-ai-gen).
Deterministic ECS: Single-threaded archetype scheduler with 100% bit-identical replay validation and Miri-validated memory safety. Systems execute in a fixed stage order on one thread per tick; parallelism lives at the subsystem level, not inside the schedule. See docs/audits/parallel_schedule_removal_2026-04-18.md for the rationale behind the single-threaded-ECS choice.
Subsystem parallelism: rayon drives terrain chunk meshing (astraweave-terrain); tokio drives async asset streaming, LLM inference, and network I/O. GPU compute handles rendering and shader work. Where the engine spends multi-core budget today is these subsystems — not the ECS tick loop. (The former SPH fluid simulation that also used rayon was removed in the W.1 water-successor deprecation, 2026-06-20.)
Memory Safety: All unsafe code validated with Miri (1,059 tests, 0 UB).
Sequential throughput: at 1000 entities on the reference profiling_demo workload, sequential ECS median ~1 760 FPS with fast-alloc (mimalloc), ~1 200 FPS on the platform default allocator — measured with allocation-counter instrumentation active, across three runs each, per docs/audits/schedule_stage_fix_2026-04-18.md §4. Scaling is approximately inverse to entity count (200e ≈ 10 k FPS, 2000e ≈ 940 FPS, 4000e ≈ 449 FPS). These numbers are measurement baselines, not shipping numbers.
Performance: Fixed 60Hz simulation, SIMD acceleration (glam), cache-friendly archetype storage.
Networking: Client-server architecture with delta encoding and state synchronization.
Persistence: ECS world save/load with version migration.
AAA Pipeline: Disney BRDF with multi-scatter energy compensation (Turquin 2019), IBL via prefiltered cubemaps, and clustered forward lighting (100k+ lights).
Advanced Effects: VXGI, Volumetric Fog, SSAO, SSR, Bloom, DOF, Motion Blur, 4-cascade CSM shadows with frustum fitting + texel-snap stabilization.
Optimization: Nanite-inspired virtualized geometry, GPU occlusion culling, 3-channel DFG LUT (GGX + cloth sheen).
Materials: Advanced shaders (Clearcoat, Sheen/Charlie, SSS, Anisotropy). Tonemapping: ACES (default), AgX, Reinhard — one shared post pipeline for engine and editor.
Unified Editor Pipeline: Editor viewport renders through the engine — single source of truth for PBR, shadows, IBL, and post-processing, enforced by a bit-identical (SHA-256) editor↔engine parity harness (Render Parity P.1–P.7, May 2026). See Architecture Map.
Rapier3D Integration: Rigid bodies, character controllers, and spatial queries.
Navigation: Navmesh generation (Delaunay) + A* pathfinding (142k queries/sec).
Terrain: Voxel-based terrain with AI-orchestrated dynamic modification.
Audio: Spatial audio with occlusion and dialogue runtime.
Overall Status: Active research-grade engine under solo development for the Veilweaver game project. Phase 8 (Game Engine Readiness). Active campaign: Editor Multi-Tool Architecture Sub-phase 5 (Phase 8.8 Physics Robustness paused — no physics commits since Feb 2026). Engine ships when Veilweaver ships (12–18 month horizon as of May 2026). Status icons below: ✅ production-wired · 🔧 active, mid-campaign · 🔬 research surface (in-design, not currently runtime-wired) · 🧪 experimental.
| Component | Status | Notes |
|---|---|---|
| Core ECS | ✅ Production Ready | 728 tests (331 lib + 397 integration), 96.39% coverage, Miri + Kani validated. Deterministic single-threaded scheduler. |
| Rendering | ✅ Production Ready | 4,272+ tests, Disney BRDF + multi-scatter, 4-cascade CSM, IBL cubemaps, ACES/AgX/Reinhard tonemapping. Editor↔engine bit-identical parity harness (Render Parity P.1–P.7, closed 2026-05-17). |
| Camera | ✅ Production Ready | New astraweave-camera crate (Unified Camera C.0–C.9, closed 2026-06-01): canonical RenderView upload contract, two producers (FreeFly, Orbit), hardened cinematics keyframe path. 8 codepaths consolidated; 25 crate tests + 8 renderer contract tests + parity-harness matrix fixtures (all green 2026-06-10). |
| Physics/Nav | ✅ Production Ready | 2,380 tests (1,884 physics + 496 nav), Rapier3D wrapper. SpatialHash module dormant (1,038 LoC, doc-comment drift — Q19). Phase 8.8 robustness campaign paused since Feb 2026. |
| AI Orchestration | ✅ Production Ready | 921 tests (514 lib + 407 integration), validated at 12,700+ agents. Canonical GOAP + Behavior Trees + LLM hybrid arbiter. |
| Terrain | ✅ Production Ready | Climate field, Whittaker biome lookup, 32-layer material pipeline (21 named + 11 reserved materials), regional archetype variation. Texture VRAM budget-verified: 80 MiB/active pack (31% of 256 MB soft budget); BC7/KTX2 cook path currently non-functional (runtime uploads uncompressed RGBA8) — see Terrain Asset Quality outcome. |
| Editor | 🔧 Active, Mid-Campaign | 9,425 test annotations, unified engine pipeline with public parity harness. Multi-Tool Architecture campaign: Sub-phases 3 + 4 complete (2026-05-14 / 2026-06-06); Sub-phase 5 in flight (5.A/5.B landed 2026-06-06; 5.C closeout, Mediator Removal, and Sub-phase 6 pending). Behavioral Correctness post-remediation items open per aw_editor.md §1/§11. |
| Networking | 🔧 Two Coexisting Subsystems | Snapshot-based (astraweave-net, JSON/WebSocket) and ECS Plugin (astraweave-net-ecs) with disjoint data models. Standalone matchmaking trio (aw-net-{proto,client,server}): HMAC-SHA256 input signing canonical and enforced end-to-end — server verifies first and kicks by default (SignatureFailurePolicy::Kick); XOR sign16 stub deleted (Net-Trio-Remediation, 2026-06-10; 104 tests). Deliberate boundaries: no replay protection; server→client unsigned (asymmetric-trust design). See net_ecs.md. |
| Prompts | ✅ Production Ready | 1,375 tests (556 lib + 819 integration), 100% mutation kill rate (792 mutants). |
Scripting (astraweave-scripting) | ⚠️ Alpha | 128 tests (45 lib + 83 integration), functional Rhai integration. Authoring tooling layer (astraweave-author, rhai_authoring) now compiles clean (former Rhai Sync trait errors resolved — verified 2026-06-10). |
| UI Framework | ✅ Production Ready | 751 tests (320 lib + 431 integration), functional coverage. |
| LLM Support | ✅ Production Ready (core) / 🔬 Hardening Layer | 16,776 lines. Core inference pipeline + tool sandbox is production-wired. The ~15K LoC production-hardening surface (rate limiting, circuit breakers, A/B routing, 4-tier fallback) is dormant — Q4 in §14. |
| Fluids | 🔬 Research Surface (deprecated sim) | 738 test markers . W.1 (2026-06-20) removed the SPH/voxel solver (−58.8K LoC); the crate is now ~24.2K LoC — the deprecated PBD remnant plus the retained F.4 GPU-particle accent substrate (FluidSystem + WaterEffectsManager; PcisphSystem/UnifiedSolver deleted). Only examples/ consume it; no production game-loop crate depends on astraweave-fluids. The live water system is the view-side successor — astraweave-water facade + astraweave-render/src/water.rs, see water.md. Q12 in §14. See fluids.md. |
| Memory / Coordination / RAG | 🔬 Research Surface | Memory pipeline ~11K, Coordination ~5.3K, RAG composite ~12.3K. Zero in-engine production consumers; HNSW vector index is currently a linear scan. Q11 in §14. |
| AI Generation | 🧪 Orphan Source | astraweave-ai-gen/ holds 4 loose source files with no Cargo.toml and no crate root — not a workspace member, cannot build as-is. See the dormant-code taxonomy in ARCHITECTURE_MAP.md §5. |
cargo check --workspace clean — 130/130 members, 0 errors (verified 2026-06-10)cargo llvm-cov --workspace (130 members; measured 2026-06-29, supersedes the prior 29-crate-subset 59.3%)#[test]/#[tokio::test] markers; cargo metadata 130 members)docs/architecture/ (forensic file map / conflict map / decision log / invariants / open questions per trace)AstraWeave is a modular workspace of ~51 production crates organized into 7 functional domains, plus 12 tools and 59 example crates (130 workspace members via cargo metadata --no-deps, verified 2026-06-10). Each crate is designed for composability, testability, and production deployment.
astraweave-core: Foundation framework with WorldSnapshot, PlanIntent schemas, and tool registry systemastraweave-ecs: AI-native archetype-based ECS with deterministic scheduling and event systemsastraweave-math: SIMD-accelerated math operations (1.7-2.5× speedup, SSE2/AVX2/NEON support)astraweave-profiling: Zero-cost Tracy integration with GPU/memory/lock tracingastraweave-input: Action-based input binding system with multi-device supportastraweave-sdk: C ABI interface for embedding AstraWeave in external enginesastraweave-observability: Production telemetry, logging, and crash reportingastraweave-optimization: LLM performance optimization (batching, caching, token compression)astraweave-alloc: Opt-in mimalloc global-allocator shim (fast-alloc feature; +43% FPS on the profiling-demo workload, default-on in profiling_demo, hello_companion, and the editor)astraweave-ai: Core loop orchestration with GOAP planner and async LLM executorastraweave-llm: Production LLM integration (Qwen via Ollama, prompt caching, circuit breaker; Phi-3/Hermes clients retained only as legacy comparison modules)astraweave-llm-eval: Automated LLM evaluation with multi-metric scoringastraweave-behavior: Behavior trees, HTN planning, GOAP with LRU plan cachingastraweave-context: Conversation history with token-aware sliding windows and summarizationastraweave-embeddings: Vector embeddings with linear-scan similarity search (cosine default; Euclidean/Manhattan/dot-product configurable). HNSW is advertised in doc-comments but not implemented — VectorStore::search is a brute-force scan (see the Memory / Coordination / RAG research-surface row above)astraweave-rag: Retrieval-augmented generation pipeline with memory consolidationastraweave-prompts: Handlebars templating with persona integration and A/B testingastraweave-persona: NPC personality system with zip-based persona packsastraweave-memory: Hierarchical memory (sensory/working/episodic/semantic) with SQLite persistenceastraweave-coordination: Multi-agent coordination framework (Experimental)astraweave-director: Boss director with LLM orchestration and dynamic difficultyastraweave-npc: NPC runtime with sensing, behavior execution, and profile managementastraweave-dialogue: Branching dialogue graph system with validationastraweave-render: AAA rendering pipeline (PBR, clustered lighting, VXGI, MegaLights, Nanite virtualized geometry)astraweave-camera: Canonical camera types (Projection, RenderView, CameraProducer trait, FreeFly controller) — sole upload contract for the renderer (Unified Camera campaign, 2026-06)astraweave-materials: Material graph system with PBR-E advanced shading (clearcoat, anisotropy, transmission)astraweave-asset: Asset management with Nanite preprocessing and World Partition cell loadingastraweave-asset-pipeline: Texture and mesh optimization pipeline. BC7/ASTC cook path present but currently non-functional (placeholder encoder; runtime uploads uncompressed RGBA8 — Terrain Asset Quality outcome, 2026-06)astraweave-physics: Rapier3D integration with spatial hash, projectiles, gravity zones, and ragdollastraweave-nav: Navigation mesh with pathfinding and geometric utilitiesastraweave-terrain: Procedural terrain with erosion, biomes, LOD, and async streamingastraweave-fluids: Deprecated PBD/accent remnant — W.1 (2026-06-20) removed the SPH/voxel sim (−58.8K LoC); retains in-crate caustics/foam + the F.4 GPU-particle accent substrate. Live water is the view-side successor (astraweave-water + astraweave-render/src/water.rs)astraweave-scene: Scene management with world partitioning and GPU resource streamingastraweave-gameplay: Core gameplay framework (biomes, combat, crafting, quests, cutscenes)astraweave-quests: Quest system with authorable steps and LLM-powered generationastraweave-weaving: Emergent behavior layer with anchor system and echo currency (VeilWeaver mechanics)astraweave-cinematics: Cinematic timeline system for cutscenes and scripted sequencesastraweave-pcg: Procedural content generation with deterministic seed-based RNGastraweave-net: Snapshot-based networking with delta compression and interest managementastraweave-net-ecs: ECS networking plugin with client prediction and server reconciliationastraweave-persistence-ecs: ECS save/load integration with replay recordingastraweave-ipc: Inter-process communication for AI orchestration via WebSocketastraweave-audio: Spatial audio engine with dialogue integration and TTS adapterastraweave-ui: UI framework with HUD (quest tracker, minimap), menus, and accessibilityastraweave-scripting: Rhai-based scripting for game logic and AI behaviorastraweave-author: Rhai authoring for map design and encounter configurationastraweave-security: Security framework with sandboxing and input validationastraweave-secrets: Secrets management with keyring backendastraweave-steam: Steamworks SDK integration (achievements, cloud saves, statistics)astraweave-stress-test: Comprehensive stress testing and benchmarking frameworkaw_editor (active mid-campaign, 9,425 test annotations), aw_asset_cli, aw_texture_gen, aw_save_cli, and ~8 other build/debugging utilities (12 tool crates total)hello_companion (7 AI modes, feature-gated), biome_showcase, adaptive_boss, and physics/fluids demosAstraWeave is an experimental project being built solo through AI-augmented development under the Genesis Code Protocol (GCP) — a methodology that pairs AI code generation with forensic auditing (the architecture trace campaign) as a counterweight to AI-generated documentation drift. The project's mandate is zero human-written code; the audit campaign is how that mandate stays honest.
Current Development Status:
docs/architecture/ + the Architecture Map (v0.7.2) + the Interactive Workspace MapSee CONTRIBUTING.md, CLAUDE.md, and docs/masters/MASTER_ROADMAP.md for detailed roadmap and contribution guidelines.
Building the future of AI‑native gaming.
If this experiment interests you, please ⭐ the repo.
Rust
93.9%
HTML
2.9%
WGSL
1.4%