scripts/bench.ps1: unattended runs into the world with a frame-time summary #617

Open
abilliontokens wants to merge 2 commits from upstream-pr/617 into main
abilliontokens commented 2026-11-25 03:24:13 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by abilliontokens on 2026-11-25T03:24:13Z.


A script for unattended, comparable runs: start the title, get through the menus into the world, measure a window of world frames, and write a summary. Same steps on every machine and with any switches, so reports can be put side by side.

What it does

scripts\bench.ps1 (PowerShell, Windows; needs the diagnostics build, or pass -Build):

  • Runs victory run <game exe> --execute and keeps everything in one run folder (default <cache_dir>\bench\<time>-<label>): victory.log, a frame every 20 s in frames\, the run's copy of the data folder, summary.md, summary.json.
  • Drives the menus from what is on screen. Every 2 s before the world starts, it asks for a frame and classifies it. Two screens need more than A: the legal notices (Down to Next) and the terms (A on each box the frame shows unticked, then Confirm). They are recognised by their layout. Any other screen gets A every 4 s, which passes the account picker, the settings, the start screen and Continue.
  • Same save every run. Each run starts from a copy of the data folder (the configured data_dir, or -Seed), so autosaves never leak between runs. -FirstBoot starts from no saves at all; that run's data\ is then a seed for the rest.
  • Summarises the 5-second frame lines in the window (-Warmup s after the first frame with ≥ 500 draws, for -Seconds s): medians and means of fps, ms/frame, preparing, GPU, copying back, draws, dropped and being made. Also counted: untranslated shaders, refused pipelines, crashes.log lines, peak private memory. Device removals and unhandled exceptions are listed as notes.
  • Compares: -Compare <run>,<run> prints one markdown table of medians. -From <run> summarises an earlier run again over another window.
.\scripts\bench.ps1 -FirstBoot -Label seed -Seconds 60
.\scripts\bench.ps1 -Seed <seed run>\data -Label baseline
.\scripts\bench.ps1 -Seed <seed run>\data -Label no-opt -Switches @{ VICTORY_SHADER_OPT = '0' }
.\scripts\bench.ps1 -Compare <baseline run>,<no-opt run>

Two diagnostics hooks it needs (both diagnostics-only)

  • VICTORY_KEYS_FILE=<file>: each line appended to the file (Enter, or Enter 0.5 to hold it) is pressed once, in order, focus or not. Same key names as VICTORY_KEYS. Presses are 0.6 s apart. The title's menus dropped a Down then Enter sent 0.15 s apart: the focus moved and the Enter was lost.
  • VICTORY_CAPTURE=<dir>: a file named now in the folder saves the next presented frame and is removed. #267 proposes the same file with three frames; this one takes a single frame and keeps it wanted for both checks the present path makes, so one ask is one PNG.

Checked

RTX 5060 Ti 16 GB (driver 621.24), Ryzen 5 7600X, Windows 11, c96b4f2:

  • Fresh profile (-FirstBoot, empty data folder): world reached in 98 s with no input by hand. Screens recognised in order: notices:copyright → photo → next, terms:privacy:0:0 → privacy:1:0 → terms:1:0 → terms:1:1 → confirm:1:1.
  • Classifier: 14 of 14 frames from two runs classified as expected: the notices with each focus, the terms in each tick and focus state, and settings, brightness, start screen and world frames as other.
  • Summary on a warm run (window 420–680 s): 3.7 fps median, 276 ms/frame (92 preparing, 135 GPU, 220 copying back), 4,825 draws, 354 dropped.
  • cargo test -p victory-hle --features diagnostics: 96 passed. cargo clippy -p victory-hle -p victory-gpu --all-targets --all-features -- -D warnings: clean. cargo xtask policy: ok.

Not checked: other titles, Series S, or a title language other than English. The layout checks are relative to the frame size, but a translated legal screen may lay out differently; it then falls back to A, as for any other screen. No game files, frames or logs are in the change.

AI-assisted (Claude Code). Runs and checks done on the machine above.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6596469689 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/617). Originally posted by [abilliontokens](https://github.com/abilliontokens) on 2026-11-25T03:24:13Z. --- A script for unattended, comparable runs: start the title, get through the menus into the world, measure a window of world frames, and write a summary. Same steps on every machine and with any switches, so reports can be put side by side. ## What it does `scripts\bench.ps1` (PowerShell, Windows; needs the diagnostics build, or pass `-Build`): - **Runs** `victory run <game exe> --execute` and keeps everything in one run folder (default `<cache_dir>\bench\<time>-<label>`): `victory.log`, a frame every 20 s in `frames\`, the run's copy of the data folder, `summary.md`, `summary.json`. - **Drives the menus from what is on screen.** Every 2 s before the world starts, it asks for a frame and classifies it. Two screens need more than A: the legal notices (Down to *Next*) and the terms (A on each box the frame shows unticked, then *Confirm*). They are recognised by their layout. Any other screen gets A every 4 s, which passes the account picker, the settings, the start screen and *Continue*. - **Same save every run.** Each run starts from a copy of the data folder (the configured `data_dir`, or `-Seed`), so autosaves never leak between runs. `-FirstBoot` starts from no saves at all; that run's `data\` is then a seed for the rest. - **Summarises** the 5-second frame lines in the window (`-Warmup` s after the first frame with ≥ 500 draws, for `-Seconds` s): medians and means of fps, ms/frame, preparing, GPU, copying back, draws, dropped and *being made*. Also counted: untranslated shaders, refused pipelines, `crashes.log` lines, peak private memory. Device removals and unhandled exceptions are listed as notes. - **Compares**: `-Compare <run>,<run>` prints one markdown table of medians. `-From <run>` summarises an earlier run again over another window. ```powershell .\scripts\bench.ps1 -FirstBoot -Label seed -Seconds 60 .\scripts\bench.ps1 -Seed <seed run>\data -Label baseline .\scripts\bench.ps1 -Seed <seed run>\data -Label no-opt -Switches @{ VICTORY_SHADER_OPT = '0' } .\scripts\bench.ps1 -Compare <baseline run>,<no-opt run> ``` ## Two diagnostics hooks it needs (both `diagnostics`-only) - **`VICTORY_KEYS_FILE=<file>`**: each line appended to the file (`Enter`, or `Enter 0.5` to hold it) is pressed once, in order, focus or not. Same key names as `VICTORY_KEYS`. Presses are 0.6 s apart. The title's menus dropped a `Down` then `Enter` sent 0.15 s apart: the focus moved and the `Enter` was lost. - **`VICTORY_CAPTURE=<dir>`**: a file named `now` in the folder saves the next presented frame and is removed. #267 proposes the same file with three frames; this one takes a single frame and keeps it wanted for both checks the present path makes, so one ask is one PNG. ## Checked RTX 5060 Ti 16 GB (driver 621.24), Ryzen 5 7600X, Windows 11, `c96b4f2`: - **Fresh profile** (`-FirstBoot`, empty data folder): world reached in 98 s with no input by hand. Screens recognised in order: `notices:copyright → photo → next`, `terms:privacy:0:0 → privacy:1:0 → terms:1:0 → terms:1:1 → confirm:1:1`. - **Classifier**: 14 of 14 frames from two runs classified as expected: the notices with each focus, the terms in each tick and focus state, and settings, brightness, start screen and world frames as `other`. - **Summary** on a warm run (window 420–680 s): 3.7 fps median, 276 ms/frame (92 preparing, 135 GPU, 220 copying back), 4,825 draws, 354 dropped. - `cargo test -p victory-hle --features diagnostics`: 96 passed. `cargo clippy -p victory-hle -p victory-gpu --all-targets --all-features -- -D warnings`: clean. `cargo xtask policy`: ok. Not checked: other titles, Series S, or a title language other than English. The layout checks are relative to the frame size, but a translated legal screen may lay out differently; it then falls back to A, as for any other screen. No game files, frames or logs are in the change. AI-assisted (Claude Code). Runs and checks done on the machine above.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/617:upstream-pr/617'
git switch 'upstream-pr/617'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/617'
git switch 'upstream-pr/617'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/617'
git switch 'upstream-pr/617'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/617'
git switch 'main'
git merge --squash 'upstream-pr/617'
git switch 'main'
git merge --ff-only 'upstream-pr/617'
git switch 'main'
git merge 'upstream-pr/617'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!617
No description provided.