Research study · about
Writing a Game Once and Running It Everywhere: Where Exact Replay Ends and Tolerance Begins
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.
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
- Under
Q32.3264-bit integer physics (GE-H1,100,000ticks), a 16-body 2D arena replays bit-for-bit across native Rust, C++20 (Clang, GCC, and Windows MSVCcl.exe), WebAssembly, Node.jsBigInt, and Python across six machines spanning macOS, Linux, and Windows 11 (0 / 25,500SHA-256mismatches;0.073–13.60 JmacOSL3reported_j;1.89–181.87 JLinuxL2RAPL packagereported_j;138.9M–24,722.2MWin32L3CPU cycles). - Under IEEE 754 floating-point physics (
GE-H2,25,000ticks;GE-H7,840paired trajectories acrossδ₀ ∈ [2⁻⁵², 2⁻¹⁰]), all three desktop OS math libraries diverge pairwise onstd::sin/std::cosat ticks10–37without-ffast-math, while macroscopic divergence time followst* = (1 / Λ) ln(Δ / δ₀)across three chaotic templates (Λ̂ = 2.48,5.07, and1.95 s⁻¹; cell-meanR² = 0.9940–0.9995,p ≤ 10⁻⁷⁷). - Across eight hardware
GPU × APIendpoints on headlesswgpu(GE-H3,512×512RGBA8UnormacrossDirectX 12,Metal, andVulkan), even switchingDirectX 12vsVulkanon the same Windows 11 GPU alters1LSB via shader lowering, yet all28 / 28hardware endpoint pairs pass perceptual tolerance (PSNR ≥ 64.16 dB,SSIM ≥ 0.99983,Δ_max ≤ 2). - Across
17reference gameplay modules spanning Haunted Jaunt, Survival Shooter, and Tanks (GE-H4,0 / 680cross-language trace mismatches), admitted.rceForms cut behaviorSLOCby76.22%vs UnityMonoBehaviourC# (72.50%including embeddedintentproofs,92.51%boilerplate glue cut),61.47%vs Bevy Rust ECS, and51.99%vs Godot 4 GDScript, while compiled Form projections (GE-H5) sustain10,000actors in0.0583 ms(C++20 -O3,1.694 mJ/tickLinuxL2RAPL),0.0724 ms(Wasm32), and0.1248 ms(Rust -O3) vs Python's390-actor20 msceiling (7,728×lower socket energy atN = 10,000). - Static Form + four-edge scene/asset manifest checking (
GE-H6,260modules across26defect families, zero runtime ticks) achieves98.46%recall,100.0%precision, andF1 = 0.9922vsF1 = 0.1159on untypedgodot --headless --check-only; three one-hour (216,000-tick) sessions replay with0 / 6,480SHA-256mismatches across macOSarm64, Linuxx86_64, and Windows 11x86_64from44.6 KBgzip input logs alone (GE-H8,116×–292×smaller than gzip state snapshots, whereas all4ambient-leak controls fail at tick1); andform_to_gdscript.pyachieves36 / 36(100.0%) headless Godot 4.7.2 parity across18,000ticks (GE-H9). Explore all six interactive instruments and the playableQ32.32Chrono-Budget Arena at /living/game-engines/.