feat(testing): add deterministic mechanics capture

Add named launcher, flipper, and claw scenarios that advance at exact 120 Hz steps with stable seeds. Emit per-step JSON state/event traces and optionally capture the logical 640x460 framebuffer at any requested time or step.

Cover parser behavior, deterministic replay, launcher timing, flipper edges, and complete capture/release/idle cycles for all claw terminals.

Test Plan:
- cargo fmt --check
- cargo test
- cargo clippy --all-targets --all-features -- -D warnings
- cargo run -- --simulate claw-6 --at 0.15 --screenshot /tmp/tdkpin-sim-validation/claw-6-after-flush.png --trace /tmp/tdkpin-sim-validation/claw-6.json
- Inspect both generated 640x460 PNGs and JSON traces
- git diff --cached --check
This commit is contained in:
2026-08-22 18:50:25 +02:00
parent 75c2464e72
commit 16c055eec6
6 changed files with 481 additions and 1 deletions
+16
View File
@@ -31,6 +31,22 @@ development packages are also required (X11, OpenGL, and ALSA). Windows needs
no extra runtime installation; macOS builds with the normal Apple developer
command-line tools.
## Deterministic mechanics validation
Named scenarios can be advanced without waiting in real time. The simulator
uses exact 120 Hz steps, prints its final state as JSON, and can write both the
complete step trace and the original-size 640x460 framebuffer:
```sh
cargo run -- --simulate claw-6 --at 0.15 \
--trace /tmp/claw-6.json \
--screenshot /tmp/claw-6.png
```
Use `--step N` instead of `--at SECONDS` to reproduce one exact update. The
available scenarios are `launcher`, `flippers`, `claw-1`, `claw-6`, `claw-7`,
and `claw-18`; `--seed N` fixes random choices for later seeded scenarios.
## Original and modern controls
| Action | Original key | Additional modern key |