Keystone is a game-agnostic 3D engine core rewritten entirely in Rust. The
Python package has been removed; the Rust implementation in src/ is the only
engine. Python-derived values are pinned as parity vectors in tests/parity.rs.
- Rust 1.100+ (the pinned
rust-toolchain.tomlselects the GNU toolchain on Windows because the MSVC linker is not installed in this environment). - No display or GPU is required: rendering is deterministic and headless.
cargo test
cargo build --release
cargo run -- --describe
cargo run -- --simulate 120 --seed 7
cargo run -- --headless --size 320x240 --out rust_frame.png --frames 1cargo test runs unit tests for every module plus cross-language parity tests
covering RNG streams, hashes, routes, scenes, animation, navigation, audio and
renderer statistics.
| Task | Command |
|---|---|
| Describe engine capabilities | cargo run -- --describe |
| Deterministic trace hash | cargo run -- --simulate 120 --seed 7 |
| Render a headless frame | cargo run -- --headless --size 320x240 --out rust_frame.png |
| Full gate | cargo test && cargo build --release |
- Frame-report hash includes the artifact path.
analysis::report_hashhashes the entireimageblock, whose fields arepath,width,height,rgba_sha256andpng_sha256. Two reports for byte-identical pixels stored at different paths therefore have different report hashes. To compare pixels only, compareimage.png_sha256(orimage.rgba_sha256) directly — do not compare the top-level report hash across machines or folders. - Determinism has two scopes.
testing::verify_determinismruns two passes in one process (fast, CI default);testing::verify_determinism_across_processesspawns separate processes with a seed inKEYSTONE_HASH_SEED(or a custom env name via..._with_env) and compares their stdout. Only the latter detects hash-order dependence between processes. - Hidden replay state is opt-in.
testing::state_hash/full_state_hashcoverrng,spawn_queue,velocityandcooldownsfrom a game'sfull_state()hook without changing the publicsnapshot()progress record.
math3d,geometry,scene,physics,input,clock— deterministic core.animation,animation_blend,animation_state,root_motion*,particles,character,navigation,nav_agent,pathfinding,steering— gameplay primitives.persistence,project,assets,asset_io,content,gltf*,export, and the*_librarymodules — projects and file-backed content.gpu,gpu_passes,render,png,ui*,audio*,web*— rendering, interface, audio and console layers. SeeGPU_PARITY.mdfor the mapping from the former OpenGL backend to the headless renderer.ecs,runtime,plugin,engine,headless— engine architecture: entities/components, ordered systems with deferred commands, plugins, a fixed-step application loop, transform hierarchy and render queue.testing,evidence,analysis,agents,playtest— verification and AI adapters.
Every former Python module name has a same-named Rust module in src/.
Consolidated implementations live in gpu, ui, web_routes and gltf; the
same-named modules delegate to them and each has behavior-level tests.
A game implements the GameModule trait (five operations: name,
build_scene, update, snapshot, actions, status plus optional
bind_input/full_state). samples::CubeDemo is a complete example with no
genre rules. Games can be driven headlessly through engine::Engine or
headless::run_simulation.
Cargo.toml package manifest
src/ one Rust module per former Python module + core layers
tests/parity.rs Python-derived parity vectors
RUST.md full module map
GPU_PARITY.md OpenGL -> headless renderer mapping
rust_frame.png generated sample screenshot
assets/foundry/ preserved Foundry packs, schemas and targets (data only)
The former Foundry Python tooling was removed after the Rust port; its authored
packs, schemas and target manifests are preserved under assets/foundry/.
AL-1.1 — see LICENSE.