PROCESSING
Keep this window open.
Security
Security & Determinism Contract
Stellarch's combat engine is deterministic. Same seed + same teams + same battle config = byte-identical event stream every time. This page is the load-bearing trust statement for spectators and deck-builders: it explains why every match outcome is reproducible from its seed, and what makes that guarantee hold.
How the seeded RNG works
Every match constructs one SeededRng instance from the battle's persisted seed (an Integer). That single instance is threaded through every engine call (Targeting, AttackResolver, DeathResolver, RoundResolver), every ability hook (Splash, Killstreak, Shock, Hemobane), and every ruleset hook (Tectonic Resonance, Time Dilation). No engine or ability constructs its own Random.
Why replays are byte-identical
Three invariants enforce determinism. (1) All randomness flows through one SeededRng. (2) No file under the engine namespace uses Random.new, Kernel.rand, SecureRandom, or Array#sample; a load-bearing test scans every file and fails fast on any match. (3) No clock entropy: Time.current / Time.now are never used for randomness anywhere in the engine.
The no-raw-RNG guard
A dedicated spec scans every Ruby file under the engine namespace at every test run. If any non-seeded RNG source slips in, the spec fails immediately with the exact file + line. Only the SeededRng wrapper itself is exempt. This guard is run on every CI build.
How to verify a battle outcome
Every replay you watch is already a fresh re-simulation: the server re-runs the full combat engine from the battle's seed on each request (cached for 5 minutes), rather than reading a stored log. Because the same seed plus the same team snapshot always produce the same events (damage values, hit rolls, death order, and reflects, all event by event), what you see is reproducible by definition. A deeper byte-level audit, re-running the simulator and diffing the event stream, is possible from the engine itself; a public verification tool is on the roadmap.
Reporting issues
If you find a case where a replay deviates from the original, please file an issue. Include the battle slug, the original event count, and the event index at which divergence appears. The team treats determinism regressions as the highest-priority class of bug.