RFC: Two-speed closed optimization loop pairing victory replay with deterministic GameInput traversal #252

Open
opened 2026-11-26 13:20:38 +00:00 by github-bot · 0 comments
Owner

@⁠Vladimir-Human on GitHub · 2026-11-26 13:18 UTC · original

VIctory-7900XTX already has one of the strongest fast-iteration tools in the project: victory replay (docs/replay.md + crates/victory-gpu/src/replay/play/pixel.rs), which replays a captured frame offline in seconds with per-list/command GPU timings and pixel verification.

Where we think an automated loop can complement victory replay nicely is closing the gap for CPU/memory/streaming bottlenecks that single-frame replay intentionally excludes (multi-minute traversal, watch.rs remaps, pool/shadow RAM commit growth #234/#251, and live VRAM LRU/mip-clamp pressure).

Two-speed closed optimization loop (RFC)

  1. Stage 1 (10-second inner filter via --fast-cmd): Run victory replay <capture> --compare (plus pixel diff + cargo test / xtask policy) as a fast pre-screen before touching live runs.
  2. Stage 2 (deterministic traversal outer loop): Record one controller/keyboard traversal trace once (world_frame-indexed GameInput starting at the first >= 500-draw frame, so loading screens pause automatically and 5 FPS -> 60 FPS improvements never desync inputs), run interleaved A/B passes over 1–3 saves (VICTORY_BENCH_OUT, VICTORY_BENCH_WARMUP, auto-exit after N world frames), and feed structured bottleneck telemetry + experiments.jsonl dead-end history back into any coding agent (--agent-cmd).
  3. Hard anti-reward-hacking gates: Every candidate must pass build/clippy/policy/tests, zero device_removed / crash exit codes, avg_draws within ±15% of baseline, zero black/zero-draw world frames + optional PNG luma/MAE parity, and non-regression caps on 1% low FPS, DXGI VRAM, and Win32 private RAM commit.

We built and tested full working reference implementations (0 new third-party dependencies, Cargo.lock untouched) in:

  • https://github.com/fxceless/victory-fork/pull/1302 (bench.rs + gameinput_script.rs + pure-Rust cargo xtask bench-loop)
  • https://github.com/PastiiJay/klbf-lab/pull/78 (companion tools/bench_loop.py harness)

If maintainers want this alongside #180 / #205 / #212, we would be happy to port bench.rs + gameinput_script.rs + xtask bench-loop cleanly into VIctory-7900XTX wired to victory replay --compare as the --fast-cmd gate!

**@⁠Vladimir-Human** on GitHub · 2026-11-26 13:18 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/252) `VIctory-7900XTX` already has one of the strongest fast-iteration tools in the project: **`victory replay`** (`docs/replay.md` + `crates/victory-gpu/src/replay/play/pixel.rs`), which replays a captured frame offline in seconds with per-list/command GPU timings and pixel verification. Where we think an automated loop can complement `victory replay` nicely is closing the gap for **CPU/memory/streaming bottlenecks that single-frame replay intentionally excludes** (multi-minute traversal, `watch.rs` remaps, `pool`/`shadow` RAM commit growth `#234`/`#251`, and live VRAM LRU/mip-clamp pressure). ### Two-speed closed optimization loop (RFC) 1. **Stage 1 (10-second inner filter via `--fast-cmd`):** Run `victory replay <capture> --compare` (plus pixel diff + `cargo test` / `xtask policy`) as a fast pre-screen before touching live runs. 2. **Stage 2 (deterministic traversal outer loop):** Record one controller/keyboard traversal trace once (`world_frame`-indexed `GameInput` starting at the first `>= 500`-draw frame, so loading screens pause automatically and 5 FPS -> 60 FPS improvements never desync inputs), run interleaved A/B passes over 1–3 saves (`VICTORY_BENCH_OUT`, `VICTORY_BENCH_WARMUP`, auto-exit after `N` world frames), and feed structured bottleneck telemetry + `experiments.jsonl` dead-end history back into any coding agent (`--agent-cmd`). 3. **Hard anti-reward-hacking gates:** Every candidate must pass build/clippy/policy/tests, zero `device_removed` / crash exit codes, `avg_draws` within ±15% of baseline, zero black/zero-draw world frames + optional PNG luma/MAE parity, and non-regression caps on 1% low FPS, DXGI VRAM, and Win32 private RAM commit. We built and tested full working reference implementations (0 new third-party dependencies, `Cargo.lock` untouched) in: - `https://github.com/fxceless/victory-fork/pull/1302` (`bench.rs` + `gameinput_script.rs` + pure-Rust `cargo xtask bench-loop`) - `https://github.com/PastiiJay/klbf-lab/pull/78` (companion `tools/bench_loop.py` harness) If maintainers want this alongside #180 / #205 / #212, we would be happy to port `bench.rs` + `gameinput_script.rs` + `xtask bench-loop` cleanly into `VIctory-7900XTX` wired to `victory replay --compare` as the `--fast-cmd` gate!
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:20:38 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/avatarmanz--VIctory-7900XTX#252
No description provided.