GPU: speed work for Radeon and 32 GB hosts (buffer reuse, burying thread, fills through placed copies) + measured switches #1044

Open
imad7x wants to merge 22 commits from upstream-pr/1044 into main
imad7x commented 2026-11-28 11:59:23 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by imad7x on 2026-11-28T11:59:23Z.


22 commits on top of 63b902f: speed work for a Radeon card on a 6-core CPU with 32 GB of RAM. Three changes are on by default and each has a switch back; the rest are live switches and counters that are off by default. Please take what is useful: I can split this into smaller pull requests or drop the switches.

Tested on

One machine only: i5-12500, 32 GB DDR4-3200, RX 7900 GRE 16 GB, Windows 11, 1440p output. Upscaling and frame generation 2x go through OptiScaler. Every number below is the rendered frame time in the opening prison room (about 5,800 draws), not the open world. No NVIDIA card was tested.

On by default

Change Switch back Measured
A fill inside a copy placed earlier in its list reads that copy's source VICTORY_FILL_THROUGH_PLACED=0 submitting thread's wait 24.3 -> 2.7 ms a frame; frame 56.9 -> 53.8 ms
Retired objects are dropped by a thread of their own (victory-bury), handed over by a channel VICTORY_BURY_ASIDE=0 landing thread 46.5 -> 17.7 ms a frame; frame unchanged on its own
Upload and shared buffers are kept for reuse when their last holder lets go lab switch reuse=0 with limited_host_ram() (32 GB): slow destroys 84 -> 12 a frame, frame about 53 -> 50 ms
Fills look for a placed copy only in lists that have one none about 11 ms of CPU a frame less on the list threads
Streamline saying its plugins already have a device is no longer fatal at the hand-over none needed when OptiScaler creates the device first
DirectStorage workers below normal priority and the reflection stand-in's depth (from foxhound), plus a fat-LTO lab profile none not measured separately

Over these changes the same scene went from about 57 ms to 45.6 ms on the older base (959dcaf, native 1440p). On 63b902f it runs 43.0 ms (23.2 fps) without ray tracing and 55 to 59 ms with it.

Off by default (live switches read from VICTORY_LAB_FILE)

  • w: the title's fence waits are woken when the card answers. -0.4 ms while the card is the limit, nothing otherwise.
  • p: the submitting thread (and with 2 its helpers) at priority "highest". About -1 ms with p=2.
  • spin, once: the guards' lock. All threads' waits at it 58 -> 20 ms a frame; frame -0.3 ms, inside the noise.
  • q: a refresh that copies nothing learns so with no lock taken. Refreshes on helper threads 8,500 -> 2,900 a frame; frame unchanged.
  • seal: private ranges of 16 MB and more that stayed clean for 2 s are made read-only instead of asked about, by 64ths. Write-watch asking 11.6 -> 8.7 ms a frame with ray tracing; frame -0.5 ms because the card is the limit there. Three tests in watch::seal_tests.
  • gap, u, hot, own, wide, lists: measured slower or no gain. Kept only so the result can be reproduced.
  • cyc, t, frames, g, h, nf, cut: counters, traces and the statistics lines used for the numbers above.

What I found, in case it helps others

  • On this CPU the submitting thread is the wall without ray tracing: it works about 37 of 42 ms a frame and the card idles about 6.5 ms behind it. With ray tracing the card is the wall (94 to 98 % busy), so CPU savings do not reach the frame.
  • With ray tracing, about 22 title buffers of 64 MB are asked whole by four submissions a frame (about 7 ms of write watch).

Not verified

  • cargo clippy -- -D warnings was not run locally. The branch was built with cargo check and the lab profile, and the watch:: module's tests pass.
  • Single runs repeat to about 0.6 ms without ray tracing and about 3 ms with it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5539893108 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1044). Originally posted by [imad7x](https://github.com/imad7x) on 2026-11-28T11:59:23Z. --- 22 commits on top of `63b902f`: speed work for a Radeon card on a 6-core CPU with 32 GB of RAM. Three changes are on by default and each has a switch back; the rest are live switches and counters that are **off by default**. Please take what is useful: I can split this into smaller pull requests or drop the switches. ## Tested on One machine only: i5-12500, 32 GB DDR4-3200, RX 7900 GRE 16 GB, Windows 11, 1440p output. Upscaling and frame generation 2x go through OptiScaler. Every number below is the rendered frame time in the opening prison room (about 5,800 draws), not the open world. **No NVIDIA card was tested.** ## On by default | Change | Switch back | Measured | |---|---|---| | A fill inside a copy placed earlier in its list reads that copy's source | `VICTORY_FILL_THROUGH_PLACED=0` | submitting thread's wait 24.3 -> 2.7 ms a frame; frame 56.9 -> 53.8 ms | | Retired objects are dropped by a thread of their own (`victory-bury`), handed over by a channel | `VICTORY_BURY_ASIDE=0` | landing thread 46.5 -> 17.7 ms a frame; frame unchanged on its own | | Upload and shared buffers are kept for reuse when their last holder lets go | lab switch `reuse=0` | with `limited_host_ram()` (32 GB): slow destroys 84 -> 12 a frame, frame about 53 -> 50 ms | | Fills look for a placed copy only in lists that have one | none | about 11 ms of CPU a frame less on the list threads | | Streamline saying its plugins already have a device is no longer fatal at the hand-over | none | needed when OptiScaler creates the device first | | DirectStorage workers below normal priority and the reflection stand-in's depth (from foxhound), plus a fat-LTO `lab` profile | none | not measured separately | Over these changes the same scene went from about 57 ms to 45.6 ms on the older base (`959dcaf`, native 1440p). On `63b902f` it runs 43.0 ms (23.2 fps) without ray tracing and 55 to 59 ms with it. ## Off by default (live switches read from `VICTORY_LAB_FILE`) - `w`: the title's fence waits are woken when the card answers. -0.4 ms while the card is the limit, nothing otherwise. - `p`: the submitting thread (and with 2 its helpers) at priority "highest". About -1 ms with `p=2`. - `spin`, `once`: the guards' lock. All threads' waits at it 58 -> 20 ms a frame; frame -0.3 ms, inside the noise. - `q`: a refresh that copies nothing learns so with no lock taken. Refreshes on helper threads 8,500 -> 2,900 a frame; frame unchanged. - `seal`: private ranges of 16 MB and more that stayed clean for 2 s are made read-only instead of asked about, by 64ths. Write-watch asking 11.6 -> 8.7 ms a frame with ray tracing; frame -0.5 ms because the card is the limit there. Three tests in `watch::seal_tests`. - `gap`, `u`, `hot`, `own`, `wide`, `lists`: measured slower or no gain. Kept only so the result can be reproduced. - `cyc`, `t`, `frames`, `g`, `h`, `nf`, `cut`: counters, traces and the statistics lines used for the numbers above. ## What I found, in case it helps others - On this CPU the submitting thread is the wall without ray tracing: it works about 37 of 42 ms a frame and the card idles about 6.5 ms behind it. With ray tracing the card is the wall (94 to 98 % busy), so CPU savings do not reach the frame. - With ray tracing, about 22 title buffers of 64 MB are asked whole by four submissions a frame (about 7 ms of write watch). ## Not verified - `cargo clippy -- -D warnings` was not run locally. The branch was built with `cargo check` and the `lab` profile, and the `watch::` module's tests pass. - Single runs repeat to about 0.6 ms without ray tracing and about 3 ms with it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Exopus-0x65f7ad0 commented 2026-11-28 13:51:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Exopus-0x65f7ad0 on 2026-11-28T13:51:14Z.


An NVIDIA run, since the PR says none was tested.

Setup: RTX 5060 Ti 8 GB, 16 GB RAM, Windows 11 26300, native D3D12 (no OptiScaler: VIctory's own Streamline DLSS). Base: 63b902f plus a few local commits, with this PR merged (it merged cleanly). Default switches only, so the three on-by-default changes apply. README launcher defaults: Series X, native 1440p, DLSS Quality, no frame generation. Opening prison room, same save each time, a 90 s scripted walk. The card is GPU-bound and VRAM-full on this scene (no room most of the run), so this is not where CPU savings show best.

Frame lines from the log, every 5 s, counting only lines with ≥ 4,000 draws (the walk and cutscene, not the load):

baseline (no PR) another PR's run (#991) this PR
frame lines 85 74 77
fps, median 15.7 16.0 16.7
ms/frame, median / p90 / p95 63.7 / 85.4 / 87.4 62.3 / 83.8 / 127.9 59.8 / 79.7 / 83.8
"preparing" ms, median / p90 36.1 / 61.8 38.9 / 59.4 38.6 / 58.3
5-s windows over 200 ms/frame 4 2 1
worst 5-s window 4,474 ms 3,841 ms 2,025 ms
  • Steady state: about +6 % on the median, which is within run-to-run noise for one run each on a GPU-bound card. The "preparing" median barely moves here.
  • Hitches: the clearest difference. Fewer and shorter long windows during the walk and cutscene. That fits the bury thread taking drops off the landing thread, and buffer reuse cutting slow destroys. One run each, though.
  • Stability: no new warning kinds and no crash. The single ERROR (Streamline presentCommon() was not observed) appears in the baseline runs too.
  • The Streamline hand-over change was not exercised: there's no OptiScaler here, so Streamline creates the device itself.

I'd be happy to repeat with the on-by-default changes switched off one at a time (VICTORY_FILL_THROUGH_PLACED=0, VICTORY_BURY_ASIDE=0), if that helps you decide how to split the PR.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240231925 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1044#issuecomment-7240231925). Originally posted by [Exopus-0x65f7ad0](https://github.com/Exopus-0x65f7ad0) on 2026-11-28T13:51:14Z. --- An NVIDIA run, since the PR says none was tested. **Setup:** RTX 5060 Ti 8 GB, 16 GB RAM, Windows 11 26300, native D3D12 (no OptiScaler: VIctory's own Streamline DLSS). Base: `63b902f` plus a few local commits, with this PR merged (it merged cleanly). Default switches only, so the three on-by-default changes apply. README launcher defaults: Series X, native 1440p, DLSS Quality, no frame generation. Opening prison room, same save each time, a 90 s scripted walk. The card is GPU-bound and VRAM-full on this scene (`no room` most of the run), so this is not where CPU savings show best. Frame lines from the log, every 5 s, counting only lines with ≥ 4,000 draws (the walk and cutscene, not the load): | | baseline (no PR) | another PR's run (#991) | **this PR** | |---|---|---|---| | frame lines | 85 | 74 | 77 | | fps, median | 15.7 | 16.0 | **16.7** | | ms/frame, median / p90 / p95 | 63.7 / 85.4 / 87.4 | 62.3 / 83.8 / 127.9 | **59.8 / 79.7 / 83.8** | | "preparing" ms, median / p90 | 36.1 / 61.8 | 38.9 / 59.4 | 38.6 / 58.3 | | 5-s windows over 200 ms/frame | 4 | 2 | **1** | | worst 5-s window | 4,474 ms | 3,841 ms | **2,025 ms** | - **Steady state:** about +6 % on the median, which is within run-to-run noise for one run each on a GPU-bound card. The "preparing" median barely moves here. - **Hitches:** the clearest difference. Fewer and shorter long windows during the walk and cutscene. That fits the bury thread taking drops off the landing thread, and buffer reuse cutting slow destroys. One run each, though. - **Stability:** no new warning kinds and no crash. The single `ERROR` (Streamline `presentCommon() was not observed`) appears in the baseline runs too. - The Streamline hand-over change was not exercised: there's no OptiScaler here, so Streamline creates the device itself. I'd be happy to repeat with the on-by-default changes switched off one at a time (`VICTORY_FILL_THROUGH_PLACED=0`, `VICTORY_BURY_ASIDE=0`), if that helps you decide how to split the PR.
tippythetaidum commented 2026-11-28 18:26:48 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tippythetaidum on 2026-11-28T18:26:48Z.


One data point for the fill-through-placed commit alone (e9bda4c), on NVIDIA. RTX 5080 + Ryzen 7 9800X3D, 32 GB, Windows 11 26200. It was cherry-picked onto 63b902f with #1014 and #393. Series X 2560x1440, DLSS Quality, frame generation off, indoors, the same save restored each run.

I used one process and a local switch that turned fill_through_placed off every other 30 s, so both sides saw the same scenes. That gave 4 minutes, with 5-second frame lines cut at the switches:

fill through placed copies off
submitting thread, preparing (median) 29.5 ms 30.8 ms
fps (mean of the lines) 18.3 17.8

That's about -1.3 ms on the submitting thread here, no errors, and no visual difference seen. (This PC was paging during that run, so the absolute rates are low.) I didn't test the rest of the PR.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243795949 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1044#issuecomment-7243795949). Originally posted by [tippythetaidum](https://github.com/tippythetaidum) on 2026-11-28T18:26:48Z. --- One data point for the fill-through-placed commit alone (`e9bda4c`), on NVIDIA. RTX 5080 + Ryzen 7 9800X3D, 32 GB, Windows 11 26200. It was cherry-picked onto `63b902f` with #1014 and #393. Series X 2560x1440, DLSS Quality, frame generation off, indoors, the same save restored each run. I used one process and a local switch that turned `fill_through_placed` off every other 30 s, so both sides saw the same scenes. That gave 4 minutes, with 5-second frame lines cut at the switches: | | fill through placed copies | off | |---|---:|---:| | submitting thread, preparing (median) | 29.5 ms | 30.8 ms | | fps (mean of the lines) | 18.3 | 17.8 | That's about -1.3 ms on the submitting thread here, no errors, and no visual difference seen. (This PC was paging during that run, so the absolute rates are low.) I didn't test the rest of the PR.
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/1044:upstream-pr/1044'
git switch 'upstream-pr/1044'

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/1044'
git switch 'upstream-pr/1044'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1044'
git switch 'upstream-pr/1044'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1044'
git switch 'main'
git merge --squash 'upstream-pr/1044'
git switch 'main'
git merge --ff-only 'upstream-pr/1044'
git switch 'main'
git merge 'upstream-pr/1044'
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
trustno1-coder/VIctory-NVIDIA!1044
No description provided.