Deterministic Simulation and Evidence
"The code is written" is not evidence. Neither is "it compiles", "it looks right", or a
screenshot of the editor. For agent-driven development this matters more than usual, because
the agent cannot see the game and the human is not watching every run.
The cheapest evidence in a vehicle-combat game is a seeded headless match: run twenty
full AI matches in seconds, with no rendering, and assert every one terminated with a legal
winner. That single test catches AI stalls, unclosable endgames, scoring bugs, and match-flow
regressions at once — and it costs nothing to re-run on every change.
Establish the determinism contract first
Determinism is not a feature you add later. It is a set of constraints you either adopt at the
start or pay dearly to retrofit.
- Fixed logic timestep. Gameplay state advances on a fixed step, accumulated from real
time. Rendering interpolates. Anything gameplay-authoritative that integrates with a
variable
DeltaTime is non-deterministic by construction.
- Seeded streams, one per subsystem, all derived from a single match seed. Never a global
RNG. See
references/determinism-rules.md.
- No gameplay reads from presentation. Physics-driven visual motion, particle state, and
animation must not influence outcomes. This is the rule that makes headless running
possible at all.
- No frame-rate-dependent smoothing in gameplay code — time constants, never per-frame
lerp factors.
- Iteration order must be stable. Iterating a hash map whose order varies between runs
silently breaks determinism in a way that is very hard to find.
- Simulation must link without rendering. Enforced by module boundaries — see
ue5-project-context.
- Decide the tolerance. Bit-exact is achievable if you are careful with floating point;
"same winner, same seed" is much cheaper and usually sufficient. Pick one and state it,
because it determines how strict every assertion must be.
Load only what applies:
references/determinism-rules.md — the constraints, the
common violations, and how each one presents.
references/headless-harness.md — building the
no-rendering match runner and what to log.
references/evidence-artifacts.md — what to save so a
claim is checkable later, and what "done" means.
Required answer format
Return:
- Determinism contract — timestep, tolerance level, and the stream list.
- Violations found — every place gameplay reads presentation, uses a global RNG, or uses
variable-step integration.
- Harness description — how a match runs headlessly, and how long one takes.
- Test inventory — what is asserted, at what level (unit, functional, batch).
- Batch results — matches run, outcomes, durations, failures.
- Artifacts — paths to logs, CSV dumps, replays, screenshots, and performance baselines.
- Known gaps — what is not covered by a test, stated plainly rather than omitted.
Hard rules
- A test that has never failed has never been checked. Break the thing it tests, confirm
it fails, restore. An assertion that cannot fail is decoration, and this class of test is
especially prone to it because a headless match "passing" can mean it never ran.
- Never assert on wall-clock timing in a simulation test. Assert on simulated time.
- Seeds must be explicit and logged. A failure you cannot reproduce is an anecdote. Every
batch run logs its seed list, and the log is the artifact.
- Different seeds must produce different outcomes. If all twenty matches end identically,
the seed is not reaching the systems that matter — a passing batch that proves nothing.
- Evidence is a file, not a sentence. "Tests pass" in a report without a path to the
report is not evidence.
- Never report an untried command. A runbook containing a plausible command that was never
executed is worse than an empty runbook, because it will be trusted.
- Report the failures too. A run summary that lists only successes is an unreliable
narrator, and the next agent will act on it.
- Performance numbers come from packaged builds with the hardware, settings, and scenario
recorded. Editor numbers are not comparable to anything, including other editor numbers.
Verification
- Repeat run. Same seed twice → identical result at the stated tolerance.
- Frame-rate independence. Same seed at 30 and 120 fps caps → identical result. This is
the test that catches variable-step integration and per-frame lerp.
- Seed spread. 20 seeds → a distribution of outcomes, not one repeated outcome.
- Termination. Every headless match ends with a legal result inside the hard timeout.
- Mutation check. Deliberately introduce a bug (disable AI target selection, break the
lead solver) and confirm the batch fails. Restore.
- Cold-start check. A fresh agent with no conversation history runs the documented
commands from the repository and reproduces the reported results. This is the acceptance
test for the whole evidence system.
Scope
Not covered: networked determinism and lockstep, replay compression formats, cross-platform
floating-point determinism (hard, and rarely needed for single-player), CI infrastructure
setup, and performance profiling method (that belongs to the platform skill).
1---2name: ue5-deterministic-sim-tests3description: Make a game's core loop provable — seeded random streams, a fixed logic timestep, a headless match harness that runs full AI matches without rendering, automation tests for gameplay math, and the evidence artifacts (seeded replays, CSV dumps, logs, screenshots, performance baselines) that let an agent or a reviewer verify a claim instead of trusting it. Use when a build must be shown to work rather than asserted to work, when AI matches must be proven to terminate, when a change needs a before/after comparison, when bugs reproduce only sometimes, or when a project needs to be resumable by an agent with no conversation history.4---56# Deterministic Simulation and Evidence78"The code is written" is not evidence. Neither is "it compiles", "it looks right", or a9screenshot of the editor. For agent-driven development this matters more than usual, because10the agent cannot see the game and the human is not watching every run.1112The cheapest evidence in a vehicle-combat game is a **seeded headless match**: run twenty13full AI matches in seconds, with no rendering, and assert every one terminated with a legal14winner. That single test catches AI stalls, unclosable endgames, scoring bugs, and match-flow15regressions at once — and it costs nothing to re-run on every change.1617## Establish the determinism contract first1819Determinism is not a feature you add later. It is a set of constraints you either adopt at the20start or pay dearly to retrofit.21221. **Fixed logic timestep.** Gameplay state advances on a fixed step, accumulated from real23 time. Rendering interpolates. Anything gameplay-authoritative that integrates with a24 variable `DeltaTime` is non-deterministic by construction.252. **Seeded streams, one per subsystem**, all derived from a single match seed. Never a global26 RNG. See [`references/determinism-rules.md`](references/determinism-rules.md).273. **No gameplay reads from presentation.** Physics-driven visual motion, particle state, and28 animation must not influence outcomes. This is the rule that makes headless running29 possible at all.304. **No frame-rate-dependent smoothing** in gameplay code — time constants, never per-frame31 lerp factors.325. **Iteration order must be stable.** Iterating a hash map whose order varies between runs33 silently breaks determinism in a way that is very hard to find.346. **Simulation must link without rendering.** Enforced by module boundaries — see35 `ue5-project-context`.367. **Decide the tolerance.** Bit-exact is achievable if you are careful with floating point;37 "same winner, same seed" is much cheaper and usually sufficient. Pick one and state it,38 because it determines how strict every assertion must be.3940Load only what applies:4142- [`references/determinism-rules.md`](references/determinism-rules.md) — the constraints, the43 common violations, and how each one presents.44- [`references/headless-harness.md`](references/headless-harness.md) — building the45 no-rendering match runner and what to log.46- [`references/evidence-artifacts.md`](references/evidence-artifacts.md) — what to save so a47 claim is checkable later, and what "done" means.4849## Required answer format5051Return:52531. **Determinism contract** — timestep, tolerance level, and the stream list.542. **Violations found** — every place gameplay reads presentation, uses a global RNG, or uses55 variable-step integration.563. **Harness description** — how a match runs headlessly, and how long one takes.574. **Test inventory** — what is asserted, at what level (unit, functional, batch).585. **Batch results** — matches run, outcomes, durations, failures.596. **Artifacts** — paths to logs, CSV dumps, replays, screenshots, and performance baselines.607. **Known gaps** — what is *not* covered by a test, stated plainly rather than omitted.6162## Hard rules6364- **A test that has never failed has never been checked.** Break the thing it tests, confirm65 it fails, restore. An assertion that cannot fail is decoration, and this class of test is66 especially prone to it because a headless match "passing" can mean it never ran.67- **Never assert on wall-clock timing** in a simulation test. Assert on simulated time.68- **Seeds must be explicit and logged.** A failure you cannot reproduce is an anecdote. Every69 batch run logs its seed list, and the log is the artifact.70- **Different seeds must produce different outcomes.** If all twenty matches end identically,71 the seed is not reaching the systems that matter — a passing batch that proves nothing.72- **Evidence is a file, not a sentence.** "Tests pass" in a report without a path to the73 report is not evidence.74- **Never report an untried command.** A runbook containing a plausible command that was never75 executed is worse than an empty runbook, because it will be trusted.76- **Report the failures too.** A run summary that lists only successes is an unreliable77 narrator, and the next agent will act on it.78- **Performance numbers come from packaged builds** with the hardware, settings, and scenario79 recorded. Editor numbers are not comparable to anything, including other editor numbers.8081## Verification8283- **Repeat run.** Same seed twice → identical result at the stated tolerance.84- **Frame-rate independence.** Same seed at 30 and 120 fps caps → identical result. This is85 the test that catches variable-step integration and per-frame lerp.86- **Seed spread.** 20 seeds → a distribution of outcomes, not one repeated outcome.87- **Termination.** Every headless match ends with a legal result inside the hard timeout.88- **Mutation check.** Deliberately introduce a bug (disable AI target selection, break the89 lead solver) and confirm the batch fails. Restore.90- **Cold-start check.** A fresh agent with no conversation history runs the documented91 commands from the repository and reproduces the reported results. This is the acceptance92 test for the whole evidence system.9394## Scope9596Not covered: networked determinism and lockstep, replay compression formats, cross-platform97floating-point determinism (hard, and rarely needed for single-player), CI infrastructure98setup, and performance profiling method (that belongs to the platform skill).