Skip to content

Writing a Game Once and Running It Everywhere: Where Exact Replay Ends and Tolerance Begins

Plain-Words Quick Guide (30 sec) 📊 3-OS Bit-Exact Replay + Linux RAPL Counter Suites (reported_j)

Writing a Game Once So Replays Never Drift Across Computers

Standard decimal math drifts apart between Mac, Linux, and Windows in less than one second—switching simulation rules to exact fixed-point numbers keeps one-hour replays identical everywhere.

Think of it like: Think of two pianos playing a duet from sheet music: whole-number beats keep every measure locked together for an hour, whereas slightly different metronomes drift into chaos within bars.
And (Setup)
Multiplayer games, physics sims, and robot trainers need the same button presses to produce the exact same world on Mac, Linux, Windows, and web browsers.
But (Problem)
Built-in decimal math (`sin`, `cos`, fused multiply-add) rounds tiny fractions differently across operating systems—splitting trajectories apart by tick 10 to 37—while graphics pixels naturally vary slightly across GPU brands.
Therefore (Result)
Splitting exact fixed-point game logic from bounded-tolerance graphics lets one checked blueprint run for 216,000 ticks (one full hour) from a 45-kilobyte input log with zero mismatches across all three operating systems while cutting behavior code by up to 76%.
Key Result:0 mismatches across 25,500 cross-OS checkpoints and 1-hour (216,000-tick) replays across macOS, Linux, and Windows 11, vs. standard floating-point drift starting at tick 10–37 (`reported_j` on GE-H1/H5; `measured_j` unset). ▶ Watch 15s Plain Film →

This study asks whether a game can be written once as a checked state machine and then projected across languages, operating systems, CPU instruction set architectures, and GPU rendering stacks. Both the surveyed specifications and all nine executed falsifier suites (Section 6, GE-H1 through GE-H9) establish the boundary: yes for game rules, interface contracts, and long-horizon simulation under pinned integer arithmetic (GE-H1, GE-H4, GE-H5, GE-H6, GE-H8, and GE-H9); no when standard library transcendentals or fused multiply-add lowering cross OS/compiler/ISA boundaries in chaotic collisions, where divergence time scales linearly with ln(Δ / δ₀) (GE-H2 and GE-H7); and no for bit-exact pixels across graphics APIs and vendors, yet yes under a checked perceptual tolerance gate (GE-H3 across 8 hardware GPU × API endpoints spanning Windows DirectX 12, Apple Metal, and Linux/Windows Vulkan; measured_j = None, board_metered = false).

In plain words

  1. Under Q32.32 64-bit integer physics (GE-H1, 100,000 ticks), a 16-body 2D arena replays bit-for-bit across native Rust, C++20 (Clang, GCC, and Windows MSVC cl.exe), WebAssembly, Node.js BigInt, and Python across six machines spanning macOS, Linux, and Windows 11 (0 / 25,500 SHA-256 mismatches; 0.073–13.60 J macOS L3 reported_j; 1.89–181.87 J Linux L2 RAPL package reported_j; 138.9M–24,722.2M Win32 L3 CPU cycles).
  2. Under IEEE 754 floating-point physics (GE-H2, 25,000 ticks; GE-H7, 840 paired trajectories across δ₀ ∈ [2⁻⁵², 2⁻¹⁰]), all three desktop OS math libraries diverge pairwise on std::sin/std::cos at ticks 10–37 without -ffast-math, while macroscopic divergence time follows t* = (1 / Λ) ln(Δ / δ₀) across three chaotic templates (Λ̂ = 2.48, 5.07, and 1.95 s⁻¹; cell-mean R² = 0.9940–0.9995, p ≤ 10⁻⁷⁷).
  3. Across eight hardware GPU × API endpoints on headless wgpu (GE-H3, 512×512 RGBA8Unorm across DirectX 12, Metal, and Vulkan), even switching DirectX 12 vs Vulkan on the same Windows 11 GPU alters 1 LSB via shader lowering, yet all 28 / 28 hardware endpoint pairs pass perceptual tolerance (PSNR ≥ 64.16 dB, SSIM ≥ 0.99983, Δ_max ≤ 2).
  4. Across 17 reference gameplay modules spanning Haunted Jaunt, Survival Shooter, and Tanks (GE-H4, 0 / 680 cross-language trace mismatches), admitted .rce Forms cut behavior SLOC by 76.22% vs Unity MonoBehaviour C# (72.50% including embedded intent proofs, 92.51% boilerplate glue cut), 61.47% vs Bevy Rust ECS, and 51.99% vs Godot 4 GDScript, while compiled Form projections (GE-H5) sustain 10,000 actors in 0.0583 ms (C++20 -O3, 1.694 mJ/tick Linux L2 RAPL), 0.0724 ms (Wasm32), and 0.1248 ms (Rust -O3) vs Python's 390-actor 20 ms ceiling (7,728× lower socket energy at N = 10,000).
  5. Static Form + four-edge scene/asset manifest checking (GE-H6, 260 modules across 26 defect families, zero runtime ticks) achieves 98.46% recall, 100.0% precision, and F1 = 0.9922 vs F1 = 0.1159 on untyped godot --headless --check-only; three one-hour (216,000-tick) sessions replay with 0 / 6,480 SHA-256 mismatches across macOS arm64, Linux x86_64, and Windows 11 x86_64 from 44.6 KB gzip input logs alone (GE-H8, 116×–292× smaller than gzip state snapshots, whereas all 4 ambient-leak controls fail at tick 1); and form_to_gdscript.py achieves 36 / 36 (100.0%) headless Godot 4.7.2 parity across 18,000 ticks (GE-H9). Explore all six interactive instruments and the playable Q32.32 Chrono-Budget Arena at /living/game-engines/.