GPU: opt-in batched prewarm for 64 KiB title shadow buffers #178
No reviewers
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/TaynanGT--Vice-Tay!178
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-178"
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?
@KGAT1W on GitHub · 2026-11-27 06:23 UTC · original
KGAT1W:perf/opt-in-title-buffer-prewarm→main· +253 −26 · 3 files · 1 commits · merged 2026-11-27 07:24 UTCWhy
On a Ryzen 7 5700X / RX 7600 (8 GiB), world entry in the opening scene triggers thousands of small title shadow allocations. Move a bounded number of those allocations into the menu/loading period. This targets the transition hitch, not sustained render FPS.
What changes
VICTORY_TITLE_PREWARM_COUNTdefaults to 0. For example, add-More @{VICTORY_TITLE_PREWARM_COUNT='3328'}to an existingscripts/play.ps1invocation. The cap is 3584 buffers (224 MiB of payload); 3328 is 208 MiB.Evidence and limits
In the local experimental branch, two control runs with the previous 256-buffer stock had a 2.56 / 2.67 s world-entry interval. Two runs with the 3328-buffer package had 1.16 / 1.22 s; all 3328 buffers were used. The package also changed worker and lock handling, so this is not an isolated A/B of this PR. I have not rebenchmarked this standalone port on current main. An isolated confirmation would compare unset vs 3328 on the same scene/driver and log the transition separately from FPS.
On the upstream-based branch:
cargo test --locked --release -p victory-gpu --features diagnostics --lib -- --test-threads=1: 517 passed, 42 ignored. Includes independent mapped buffers after pressure trimming and the budget guard.The RX 7600 experimental source and build instructions are available for reference. Only the prewarm change is proposed here.
@TaynanGT on GitHub · 2026-11-27 06:43 UTC · original
@KGAT1W I enabled CI and ran the two stock tests with your change on current
main. Both passed. They cover budget gating and keeping issued buffers after the unused stock is trimmed. The switch stays off by default.The 1.16–1.22 s result is for the experimental package. The number that would pin down this PR is the world-entry interval on the same RX 7600 setup with the switch unset and set to 3328.
@KGAT1W on GitHub · 2026-11-27 07:06 UTC · original
Ran the isolated A/B you requested. On this RX 7600,
VICTORY_TITLE_PREWARM_COUNT=3328reduced the mean world-entry present interval from 4.084 s to 1.978 s (−2.106 s / −51.6%). All four fresh-process runs, in execution order:VICTORY_TITLE_PREWARM_COUNTBuild/setup: upstream
6594538+ PR head5d856ea, release build with diagnostics. Same binary in all four runs (SHA-256063ba5c4e8577ded5f7a28b532663abc19fd6b616e77997429dc782f37bd917d); the only additional source changes were a local timing/marker probe and a post-window screenshot. No experimental package patches. Ryzen 7 5700X, RX 7600 8 GB, driver32.0.31041.1004, Windows build26200. Series S, 1280×720 output, internal scale 0.8, title upscaler 6, windowed, relay 2. Same opening save and copies of the same existing application shader/pipeline/image caches restored before each run; OS/driver caches were not flushed. The control variable was absent from the process environment, not set to 0.Metric: time between consecutive successful swap-chain Presents, measured with
Instant. W = first title frame with ≥500 host draws since the previous one. Took the largest interval ending in[W−12, W], as in the package test; in all four it ended at W−2. No screenshots during that window; a single capture at W+8 confirmed the opening car scene. Both enabled runs loggedmade=3328 reason="cap"(worker durations 1.112 s and 1.123 s).This isolates the PR on this machine. It measures the transition hitch, not launch-to-world time or sustained FPS; the earlier 1.16–1.22 s values remain package-only.
@NotADonky43 on GitHub · 2026-11-27 07:41 UTC · original
Independent RTX 5070 Ti / Series X allocation attribution
I tested merged
791648b9with aggregate counters at the registered-title-buffer allocation path (same diagnostic executable, Series X settings, 25,692 offline shader entries and same loaded 1,625-key D3D12 library on both sides). OnlyVICTORY_TITLE_PREWARM_COUNTchanged, 0 to 3328. The worker published all 3328 buffers in 697 ms, well before the world-entry burst.This confirms the intended mechanism on this GPU and profile. These timings include the existing residency/map wait and do not add up to a wall-clock world-entry saving. The first heavy telemetry interval appeared at 55.8/56.3 seconds; I did not measure the same per-present stall as the RX 7600 report or do a visual comparison. Peak private/shared memory was about 23.64/5.66 GiB off and 23.77/5.58 GiB on, so no meaningful peak-memory reduction. Both tests closed cleanly under the same 240-second watchdog, with no logged device loss or buffer allocation failure.
@TaynanGT on GitHub · 2026-11-27 07:41 UTC · original
@KGAT1W Thanks for controlling the cache and alternating the settings. The four runs put the mean entry hitch at 4.084 s unset and 1.978 s at 3328 on your RX 7600. That was the comparison I needed. The tested revision is on
mainwith the setting still opt-in.@TaynanGT on GitHub · 2026-11-27 08:01 UTC · original
@NotADonky43 Thanks for measuring the allocation path on Series X. With 3328 configured, the pool served 3,230 requests and synchronous 64 KiB allocations fell from 3,252 to 35. The summed allocation time fell from 1,748 ms to 34 ms. That confirms the pool is taking work out of the transition on the RTX 5070 Ti.