RFC: Deterministic world-frame GameInput replay & gated autonomous benchmark loop over framelog #1303
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#1303
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Vladimir-Human on GitHub · 2026-11-26 13:18 UTC · original
Right now performance iteration here (including the daily AI-assisted workflow in #1272) has great per-stage timing via
framelog.rsand visual captures viashot.rs/capture.rs, but live testing still relies on manual play or wall-clockVICTORY_KEYS=<seconds>:<key>, and multi-step A/B or autonomous agent loops lack built-in guards against regressions, subtle blackouts, or metric gaming.We opened companion PR #1302 (
https://github.com/fxceless/victory-fork/pull/1302) implementing a deterministic traversal benchmark and closed-loop optimization harness directly invictory-gpu,victory-hle, andxtask— with zero changes toCargo.toml,Cargo.lock, orxtask/src/policy.rs(kept 100% compliant withdocs/asset-policy.md, no external dependencies, works on both Windows and Linux/Wine).Design highlights (PR #1302)
world_frame-indexedGameInputreplay + multi-save playlists beats title memory teleports:crates/victory-gpu/src/bench.rstracksWORLD_FRAMEfrom the first>= 500-draw presented frame (matchingcapture.rs/shot.rs), andcrates/victory-hle/src/modules/gameinput_script.rsrecords/replays fullPadState(analog sticks, triggers, buttons) +KeyStatekeyed byworld_frame. Loading screens (world_frame == 0) are waited out automatically, and speedups never desync the route.framelog.rs(bench.rs):VICTORY_BENCH_OUT=<abs.json>is set (ensure_outside_repochecked, atomic temp+rename write),bench.rsemitsframe_ms(avg/median/p95/p99, 5%/1% low FPS),draws(min/avg/max), DXGI VRAM + Win32PROCESS_MEMORY_COUNTERS_EXpeaks,device_removed,zero_draw_world_frames,black_frames, and 12 per-frameframelog.rsstage averages (prepare_ms,card_wait_ms,card_idle_ms,copy_ms,copyback_ms,remap_ms,refresh_ms,pipeline_wait_ms,guard_faults,card_sync_ms,card_check_ms,card_lists_ms), then exits cleanly afterVICTORY_BENCH_WARMUP + VICTORY_BENCH_EXIT_FRAMES.cargo xtask bench-loop(xtask/src/bench_loop.rs):--mode abruns interleaved baseline vs. candidate passes over a TOML playlist of saves/input scripts.--mode loopplugs into any--agent-cmd(Claude Code, Codex, Gemini CLI, etc.), optionally pre-filters with--fast-cmd(micro-benchmarks / offline frame replay) before live launches, commits kept wins so later reverts never wipe earlier gains, rolls back failed trees cleanly, and writesexperiments.jsonl(hypothesis, git SHA, diff stat, topframelogbottlenecks, gate verdicts) so agents do not repeat dead ends.--lockedbuild +cargo xtask policy+--lockedclippy+ tests0, watchdog timeout (taskkill /F /Ttree cleanup on Windows),device_removed == falseavg_drawswithin ±15% of baseline +input_script_sha256match (blocks draw-skip cheats)zero_draw_world_frames == 0,black_frames == 0, plus pure-std PNG checkpoint luma/MAE parity against baseline capturesmedian frame_msgain>= --min-gain-pctwith non-regression guardrails on 1% low FPS, peak VRAM, and peak system RAM commitTested on both debug and
diagnosticsbuilds (cargo test --locked -p xtask17/17 with mock loop & git-revert tests). Feedback on thresholds or additionalframelogfields is very welcome on #1302.