Skip to content

Bench: scripts/bench.ps1 on its own (from #1046), with a route from the world's first frame - #1099

Open
ballsimulation wants to merge 2 commits into
trustno1-coder:mainfrom
ballsimulation:bench/script
Open

ballsimulation wants to merge 2 commits into
trustno1-coder:mainfrom
ballsimulation:bench/script

Conversation

@ballsimulation

@ballsimulation ballsimulation commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

scripts/bench.ps1 by @ldanyyl, taken out of #1046 so it can land without that PR's 25 ray-tracing files. It runs the game unattended and writes a summary, so runs on different machines or with different switches can be compared:

  • Every run starts from a copy of the same saves, so two runs load the same checkpoint and their autosaves never reach your own.
  • It gets through the menus by itself: the legal screens, the terms, the start screen and continuing the save.
  • It writes summary.json and summary.md: median, mean, p99 / 1 % low, fps by draws per frame, CPU / memory / card samples, crashes, untranslated shaders, and the effective settings. -Compare prints earlier runs side by side.

Added here: -Route, a walk in the world, either as a file of <seconds>:<key> / <from>-<to>:<key> lines or inline (-Route '5-10:W,10-12:L,12-18:W'). It is passed as VICTORY_KEYS with VICTORY_KEYS_FROM=world (#1098), so every run walks the same way from the same moment. The route's name and hash are in summary.json.

Why

A/B reports on open PRs often can't be compared. One reason is the two runs loading different spots: #175, and the A/B on main in #501. Another is that each tester has their own route. This script fixes the first problem, and -Route fixes the second.

Changes

  • scripts/bench.ps1: new. ldanyyl's commit 7756cd9, unchanged, applied onto main 63b902fe. Its author stays ldanyyl.
  • crates/victory-gpu/src/capture.rs (from the same commit): a file named now in the capture folder saves the next frame, so the script can see the screen.
  • crates/victory-gpu/src/host.rs (from the same commit): in diagnostics builds, a frame-times line every 5 s.
  • A second commit adds -Route.

Checked

One unattended run on an RTX 4070 + Ryzen 9 7950X, main 63b902fe with both PRs, diagnostics build: -Dlss performance -Warmup 15 -Seconds 45 -Route '3-9:W,9-11:L,11-17:W'.

  • It got through the boot screens alone; the world came after 48 s.
  • It stopped the game itself and wrote summary.json / summary.md: 35.8 fps median, p99 66.7 ms, by draw bands.
  • config.route in summary.json reads inline (f10f4539e65e0371).

Two more runs from the free-roam save shared in #332, used as -Seed, with -Route '12-22:W,22-24:L,24-34:W,34-36:J,36-46:W':

run 1 run 2
world after 45 s 39 s
median frame 47.0 ms (21.3 fps) 45.6 ms (22.0 fps)
p99 94.3 ms 102.9 ms
draws (median) 7,587 6,882

The world came 6 s apart, yet both walks ended at the same spot with the same camera angle: the green wall under the awning, at 49 s and 51 s after the world's first frame. Traffic and pedestrians still differ between runs (a parked car in one, a passing van in the other). That is part of why the two medians differ by 3 %, and why the next step is an interleaved A/B in one run (VICTORY_AB).

Not checked

If this lands, #1046 can drop its copy of the script.

🤖 Generated with Claude Code

ldanyyl and others added 2 commits November 28, 2026 13:56
… tracing, DLSS and frame generation; frame times on the frame log

- scripts/bench.ps1 starts the title through `victory play ... --set ...` and
  summarises the frame lines (median, 1 % low, draw bands), CPU, memory, GPU
  and video-memory samples, and compares earlier runs (-Compare). Options
  for ray tracing, DLSS, frame generation and the pipeline book. Run folders
  sit beside cache_dir, not in it.
- A video-memory sample over 1 TB (a counter that underflowed) is left out of
  the mean and the peak, and the summary says how many were.
- A comma inside a switch value ('A=1,2,3') stays in the value.
- host.rs: the Meter writes a frame-times line every 5 s (diagnostics builds),
  the lengths taken from the frame meter's intervals.
- capture.rs: a file named `now` in the capture folder saves the next frame,
  so a tool can look at the screen of a title running in the background.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The route (a file of `<seconds>:<key>` / `<from>-<to>:<key>` lines, or
entries separated by commas) goes to VICTORY_KEYS with
VICTORY_KEYS_FROM=world, so every run walks the same way from the same
moment. Its name and hash are in summary.json's config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Exopus-0x65f7ad0

Exopus-0x65f7ad0 commented Nov 28, 2026 •

Copy link
Copy Markdown

Ran bench.ps1 unattended on a second machine: RTX 5060 Ti 8 GB, 16 GB RAM, Windows 11 26300. 63b902f + #1098 + this PR, diag build. Command:
.\scripts\bench.ps1 -Label pr1099-route -Dlss quality -Warmup 15 -Seconds 60 -Route '3-9:W,9-11:L,11-17:W,17-19:S,19-25:W' -AllowMenuFile, twice in a row.

What worked:

  • It got through the boot screens, terms and save by itself both times, with no help. The world came at 152 s (first run of this build) and 80 s (second).
  • scripted keys count from the world's first frame (VICTORY_KEYS_FROM=world) is in the log, and the route hash is in the summary.
  • It stopped the game itself and wrote summary.md / summary.json. The saves were copied into the run folder, and my own were untouched.

Three things I'd change:

  1. GPU line picks up virtual adapters. The summary says GPU Parsec Virtual Display Adapter; NVIDIA GeForce RTX 5060 Ti, driver 0.45.0.0; 32.0.16.2114: Parsec, a remote-desktop tool, adds a display adapter, and Win32_VideoController lists it first. The run's own log already names the card it used, so it can be the filter:

    $cards = @(Get-CimInstance Win32_VideoController)
    $used = Select-String -LiteralPath $log -Pattern 'host device on the card .*? adapter=(.+?) own_memory_mb=' | Select-Object -First 1
    if ($used) {
        $name = $used.Matches[0].Groups[1].Value.Trim('"')
        $match = @($cards | Where-Object Name -eq $name)
        if ($match.Count) { $cards = $match }
    }
  2. "World" can fire while the world is still streaming on slower machines. On the first run, the 500-draw line came while pipelines were still being made: the window shows being made 104 and dropped 813, with a 2.6 fps median. So the 15 s warm-up landed inside the load, and the summary measured the loading screen. It would help to warn, or extend the warm-up, while the frame lines in the window still show being made > 0 or a large dropped.

  3. A stall shows up only as "incomplete run". The second run hit the Intermittent title crash (write 0x0 at +0x23cf683) after a stall with no presents: held value wait never released #846 stall during world load: the last frame line was at +15 s, and nothing more came for the remaining 60 s (card 5.9 % busy, 9 W). The summary averaged that single line (8.9 fps) and noted incomplete run: 1 frame lines … about 10.9 expected. Saying it outright — "no frame line for N s while the process was alive: stalled (see Intermittent title crash (write 0x0 at +0x23cf683) after a stall with no presents: held value wait never released #846)" — and leaving such a run out of -Compare would stop it from passing for a slow result. My build has the title's watchdog fault patched out, so upstream this run would have ended as the +0x23cf683 crash instead.

Very handy script otherwise. 👍

Edit: the stalls I mention here turned out to come from a local, unpublished commit in my own build (a dispatch that waits for its compute pipeline with no time limit). With it off, 0 stalls in 5 starts. They are not the upstream #846 stall; see my correction on #846.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants