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

Open
github-bot wants to merge 2 commits from github-bot/gh-617 into main AGit
Owner

@⁠abilliontokens on GitHub · 2026-11-25 03:24 UTC · original
abilliontokens:tools/bench-script → main · +657 −18 · 4 files · 2 commits · open

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.

**@⁠abilliontokens** on GitHub · 2026-11-25 03:24 UTC · [original](https://github.com/fxceless/victory-fork/pull/617) `abilliontokens:tools/bench-script` → `main` · +657 −18 · 4 files · 2 commits · open 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.
- scripts/bench.ps1 starts the diagnostics build, drives the menus into
  the world from what each captured frame shows (the legal notices' Next,
  the terms' two boxes and Confirm are recognised by their layout; A on
  every other screen), measures a window of world frames and writes
  summary.md / summary.json beside the log and periodic frames. Each run
  starts from a copy of the data folder, so runs load the same save;
  -FirstBoot starts from no saves at all, -Compare tabulates runs, -From
  summarises an earlier run again.
- VICTORY_KEYS_FILE: keys appended to a file as lines are pressed in
  order, 0.6 s apart (the title's menus drop quicker presses), focus or not.
- VICTORY_CAPTURE: a file named `now` in the folder saves the next frame.
- Checked on an RTX 5060 Ti: from an empty data folder to the world in 98 s
  with no input by hand.
- `powershell -File` passes every argument as a string, so a hashtable
  literal could not reach the script from cmd or another shell.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:47:30 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/capture.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/617/head:github-bot/gh-617'
git switch 'github-bot/gh-617'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-617'
git switch 'github-bot/gh-617'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-617'
git switch 'github-bot/gh-617'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-617'
git switch 'main'
git merge --squash 'github-bot/gh-617'
git switch 'main'
git merge --ff-only 'github-bot/gh-617'
git switch 'main'
git merge 'github-bot/gh-617'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.