Repository navigation
docs: plan autonomous gameplay QA for the Aravath slice - #277
Conversation
Map the slice, greybox golden replay, save path, and CI tiers, and stop before adding a runner. The design is for review and is not merged. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4cc6b1ac5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - `Reach` matches the unit test: sword hp 15, weave hp 25, cover not intact, cover damage at least 25. | ||
| - `SaveReload` at that tick writes `combat_vitals` plus `DestructionWorld::state_hash` through the combat and destruction helpers, loads them into a new app with the same seed and table, and requires the twin hash. It does not call `SaveManager::save`, so `Uuid` and the clock stay out of the trace. | ||
| - `SameSeqTwice` replays the sword hit with seq 0 a second time in that tick. The predicate fails if vitals or the destruction hash move. If today's resolver applies the hit twice, the run fails and the artifact is the finding. The design does not pre-decide a resolver change. | ||
| - A goal-bot twin of the same file must finish on the same hash trace. A difference is `TerminalMismatch` with detail `goal_bot_diverged`, which means the policy is wrong. It is not a game defect until the scripted run also fails. |
There was a problem hiding this comment.
Compare the goal bot's terminal state instead
The scripted bot applies both hits and WeaveDecay in one tick, whereas the policy defined above necessarily emits the sword hit, weave hit, and decay on successive ticks because it calls decide only once per tick. Their per-tick hash traces therefore differ even when both reach exactly the intended final state, so this required goal-bot twin will always report goal_bot_diverged; compare the terminal hash or give both bots the same action schedule.
Useful? React with 👍 / 👎.
| - Seed `0xA11C_E5EE`, the seed already in `run_aravath_slice`. | ||
| - Scripted bot emits the two `HitEvent`s the function already pushes (`sword_light` id 1 at the cover, `weave_bolt` id 3 at the woven target) and the weave-decay command, in one tick, seq order 0 then 1. | ||
| - `Reach` matches the unit test: sword hp 15, weave hp 25, cover not intact, cover damage at least 25. | ||
| - `SaveReload` at that tick writes `combat_vitals` plus `DestructionWorld::state_hash` through the combat and destruction helpers, loads them into a new app with the same seed and table, and requires the twin hash. It does not call `SaveManager::save`, so `Uuid` and the clock stay out of the trace. |
There was a problem hiding this comment.
Persist restorable destruction state
DestructionWorld::state_hash is only a digest and cannot be loaded to reconstruct the broken cover bond. Creating a new app with the same seed recreates the initial intact destruction world, so the proposed save/reload twin either mismatches every time or must replay prior inputs instead of testing restoration; the checkpoint needs to serialize and restore the actual destruction state, using the hash only for comparison.
Useful? React with 👍 / 👎.
|
|
||
| The minimizer runs only after a predicate fails, and only off the pull-request path. It is ddmin on the input list: | ||
|
|
||
| - Delete a chunk of ticks, replay from tick 0, keep the deletion when the failure `kind` is the same. The tick index inside the condition is allowed to move. The kind is not. |
There was a problem hiding this comment.
Preserve the exact failing predicate during minimization
Keeping a deletion whenever only the failure kind matches can minimize to an unrelated defect: all named exploit predicates map to Exploit, and both reach failures and goal-policy divergence map to TerminalMismatch. In scenarios with more than one such check, ddmin can remove the input that triggers the original finding while retaining another failure of the same kind, producing a misleading artifact; preservation must include a stable predicate/check identifier as well as the kind.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
🟡 Changes recommended
Replay, minimization, action ordering, and snapshot contracts need corrections before they can reliably guide implementation.
5 open findings
Include combat clock and timers in replay state encoding · New Record typed checks and replay schedules for reproducible failures · New Preserve check identity, parameters, signatures, and preconditions · New Persist restorable destruction and combat state, not just hashes · New Define explicit action and destruction processing phases · New
What changed in this PR
Designs autonomous gameplay QA for Aravath without adding runtime code or workflows.
Changes:
- Maps existing simulation, replay, and persistence capabilities.
- Defines bot actions, scenarios, failure artifacts, and minimization.
- Plans staged implementation within existing CI tiers.
| File | Description |
|---|---|
docs/current/AUTONOMOUS_GAMEPLAY_QA.md |
Defines the QA design, dependencies, and rollout plan. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
| ``` | ||
|
|
||
| Per-tick state bytes for the slice are the combat replay's layout: sorted entity ids, `Fixed64` raw little-endian, then the 32-byte destruction hash. That is integer data, so Linux, Windows, and macOS can match without an FMA pin. The greybox FNV `Canon` digest may be stored in a later artifact as 16 hex digits. It is not a required three-OS case until a macOS run matches Ubuntu and Windows on the same pin. Putting `f32` physics bits into the required compare would fail macOS for a reason the greybox workflow has never measured. |
| 2. Build `setup` at `seed`. | ||
| 3. Apply `inputs[t]` and step once. Hash. Compare to `hashes[t]`. | ||
| 4. Stop at the first mismatch. The message includes the tick, the expected hash, and the actual hash. | ||
| 5. If the hashes match through the end, re-evaluate `failure` against the live world. A reproduced failure exits non-zero with the condition. A clean run of an artifact that claimed a failure exits non-zero with `artifact_did_not_reproduce`. |
|
|
||
| The minimizer runs only after a predicate fails, and only off the pull-request path. It is ddmin on the input list: | ||
|
|
||
| - Delete a chunk of ticks, replay from tick 0, keep the deletion when the failure `kind` is the same. The tick index inside the condition is allowed to move. The kind is not. |
| - Seed `0xA11C_E5EE`, the seed already in `run_aravath_slice`. | ||
| - Scripted bot emits the two `HitEvent`s the function already pushes (`sword_light` id 1 at the cover, `weave_bolt` id 3 at the woven target) and the weave-decay command, in one tick, seq order 0 then 1. | ||
| - `Reach` matches the unit test: sword hp 15, weave hp 25, cover not intact, cover damage at least 25. | ||
| - `SaveReload` at that tick writes `combat_vitals` plus `DestructionWorld::state_hash` through the combat and destruction helpers, loads them into a new app with the same seed and table, and requires the twin hash. It does not call `SaveManager::save`, so `Uuid` and the clock stay out of the trace. |
| The runner: | ||
|
|
||
| 1. Builds the world with the scenario seed by running the same table install and spawns as `run_aravath_slice`. The function stays the reference for the unsplit end state. The tickable session is that function's steps pulled apart, still calling `install`, `combat_resolve_system`, `enqueue_weave`, and `DestructionWorld::tick`. It is not a new resolver. | ||
| 2. For each tick, takes `decide`, applies actions in `seq` order, runs the existing systems once, appends the state hash. |


Description
Design only. No runner, scenario loader, or workflow is added. Review the plan in
docs/current/AUTONOMOUS_GAMEPLAY_QA.mdbefore any implementation.Synthetic players should attempt objectives in headless fixed-tick runs and report softlocks, unreachable objectives, save/reload breakage, and simple exploits. Each failure writes a seed, an input stream, per-tick state hashes, and a failure condition that replays on Linux, Windows, and macOS. Scripted and goal-driven bots come first. Learning-based exploit hunters stay deferred.
The dig found:
run_aravath_sliceis on PR feat(combat): deterministic Q32.32 damage resolver #212 (5bc00302) and PR feat(aravath): wire sword hits through the combat slice #275, not onmain. It is one Fixed64 resolve at seed0xA11C_E5EE(sword hp 15, weave hp 25, cover bond broken).9b607d1a840ecd64, an FNV-1a end hash off32state, checked on Ubuntu and Windows only.Vec<TickInput>.aw-savefile identity uses a random id and the wall clock. Persistence replay does not apply events.determinism-replayrequired and moves heavy jobs off pull requests. The plan adds one hash case to that job later, and does not add a required workflow.This pull request does not merge.
Type of change
Security Considerations
Checklist
Tests are intentionally absent: this change is a design document. Claims in the doc were checked against
mainand the open PR heads (golden hash9b607d1a840ecd64,run_aravath_sliceon #212 and #275, required replay cases onmain).