gpu: opt in to fenced copy-queue uploads of submission snapshots, gated by size #60

Open
github-bot wants to merge 3 commits from github-bot/gh-60 into main AGit
Owner

@⁠superboynick on GitHub · 2026-11-27 15:29 UTC · original
superboynick:pr/upload-queue → main · +307 −4 · 3 files · 3 commits · open

Rewritten with the numbers I actually have, and narrowed to what they support.

What the switch is

VICTORY_UPLOAD_QUEUE is a size gate in MiB. Unset or 0: nothing leaves the original path. 1: every upload goes
through a copy queue (the first version's behaviour). N above one: only uploads of at least N MiB.

What I tested, and what it says

RTX 5070 Ti Laptop (12 GB), Windows 11 26100, release build, Series S settings, one save and a warm cache per arm.
Windows aligned by index and kept only where draw counts agree within 5%.

switch off gate at 4 MiB
frame time, median of in-world windows 281 ms 278 ms
queued uploads/frame - 3.0-3.2
queued traffic/frame - 43-45 MB
fallbacks/frame - 0.0

That is no change. The 9.5 -> 10.0 fps in earlier versions of this description came from a run whose windows were
not draw-matched, and it does not belong here; I have taken it out.

What the earlier reading measured and this one does not is the handoff count: the ungated switch took 13.47 queue
handoffs a frame for about 12 uploads, and the gate takes about one per large upload. On this card that turned out not
to be worth anything in frame time.

Why I am leaving it open rather than closing it

Two people have now tested this on hardware that is not mine and neither could confirm a gain:
heklokate on an RTX 3070 Laptop at Series S with DLSS (mean of two median readings 9.60 -> 9.09, 1% lows 6.40/6.65 ->
5.14/4.86, P99 156.17 -> 194.57 and 150.41 -> 205.76 ms), and my own draw-matched Series S run above (281 -> 278 ms).
ANDREANIADS reviewed the code and found a real defect in the parser (mebibytes << 20 wrapping), which is fixed in
e1ee76a with a test.

So the honest state is: the gate fixes a cost I could measure (handoffs) but not a cost that shows in frame time on
the cards we have. If you would rather have the tree without it, say so and I will close it — "measured and not worth
it" is a good outcome and better than a switch whose description promises more than it delivers.

**@⁠superboynick** on GitHub · 2026-11-27 15:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/60) `superboynick:pr/upload-queue` → `main` · +307 −4 · 3 files · 3 commits · open Rewritten with the numbers I actually have, and narrowed to what they support. ## What the switch is `VICTORY_UPLOAD_QUEUE` is a size gate in MiB. Unset or `0`: nothing leaves the original path. `1`: every upload goes through a copy queue (the first version's behaviour). `N` above one: only uploads of at least `N` MiB. ## What I tested, and what it says RTX 5070 Ti Laptop (12 GB), Windows 11 26100, release build, Series S settings, one save and a warm cache per arm. Windows aligned by index and kept only where draw counts agree within 5%. | | switch off | gate at 4 MiB | |---|---:|---:| | frame time, median of in-world windows | 281 ms | 278 ms | | queued uploads/frame | - | 3.0-3.2 | | queued traffic/frame | - | 43-45 MB | | fallbacks/frame | - | 0.0 | **That is no change.** The `9.5 -> 10.0 fps` in earlier versions of this description came from a run whose windows were not draw-matched, and it does not belong here; I have taken it out. What the earlier reading measured and this one does not is the handoff count: the ungated switch took 13.47 queue handoffs a frame for about 12 uploads, and the gate takes about one per large upload. On this card that turned out not to be worth anything in frame time. ## Why I am leaving it open rather than closing it Two people have now tested this on hardware that is not mine and neither could confirm a gain: heklokate on an RTX 3070 Laptop at Series S with DLSS (mean of two median readings 9.60 -> 9.09, 1% lows 6.40/6.65 -> 5.14/4.86, P99 156.17 -> 194.57 and 150.41 -> 205.76 ms), and my own draw-matched Series S run above (281 -> 278 ms). ANDREANIADS reviewed the code and found a real defect in the parser (`mebibytes << 20` wrapping), which is fixed in `e1ee76a` with a test. So the honest state is: the gate fixes a cost I could measure (handoffs) but not a cost that shows in frame time on the cards we have. If you would rather have the tree without it, say so and I will close it — "measured and not worth it" is a good outcome and better than a switch whose description promises more than it delivers.
Route immutable snapshots through a private buffer, keeping DIRECT ordering and the original path unchanged when disabled. The previous copy-queue implementation measured 9.5 to 10.0 fps.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:36:40 +00:00
Author
Owner

@⁠heklokate on GitHub · 2026-11-27 17:29 UTC · original

Test results on an RTX 3070 Laptop GPU

The independent copy queue was active with zero reported fallbacks. Median FPS and 1% lows were lower in both measured comparisons on this laptop.

Hardware and setup. Intel Core i9-12900H, RTX 3070 Laptop GPU (8 GB, driver 32.0.16.1742), 32 GB DDR5-4800, Windows 11 build 26100. Release build, Series S, DLSS Quality, frame generation off. The same deck save and independently warmed caches were used throughout.

Samples. Two valid runs per configuration, one 30-second PresentMon window starting at 180–181 seconds after launch per run. Warm-ups were excluded.

Revisions. Main d12eb1b and PR 097d28b with VICTORY_UPLOAD_QUEUE=1.

Metric Main 1 Main 2 PR 1 PR 2
Frames sampled 291 267 273 248
Median FPS 10.10 9.09 9.51 8.66
1% low FPS 6.40 6.65 5.14 4.86
P95 frame time (ms) 136.29 138.13 147.17 159.03
P99 frame time (ms) 156.17 150.41 194.57 205.76
Median draws per frame 6018 5880 5986 6091
Copy-queue uploads/frame — — 11.45 11.45
Copy-queue traffic (MB/frame) — — 20.85 21.00
Copy-queue fallbacks/frame — — 0.00 0.00

The queue metrics are medians of 28 periodic log samples per PR run. No fallbacks were reported in those samples. Both runs transferred about 21 MB per frame on the copy queue. The mean of the two median FPS readings went from 9.60 to 9.09 (−5.3%). P99 rose from 156.17 to 194.57 ms in run 1 and from 150.41 to 205.76 ms in run 2.

One PR attempt ended during load with the guest access violation also seen during main warm-up. A separate completed PR run (8.49 FPS) with a background task over the lab's warning threshold was replaced. An earlier main capture with background compilation was excluded.

Tested and documented by Codex.

**@⁠heklokate** on GitHub · 2026-11-27 17:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/60#issuecomment-7224456090) ### Test results on an RTX 3070 Laptop GPU The independent copy queue was active with zero reported fallbacks. Median FPS and 1% lows were lower in both measured comparisons on this laptop. **Hardware and setup.** Intel Core i9-12900H, RTX 3070 Laptop GPU (8 GB, driver `32.0.16.1742`), 32 GB DDR5-4800, Windows 11 build 26100. Release build, Series S, DLSS Quality, frame generation off. The same deck save and independently warmed caches were used throughout. **Samples.** Two valid runs per configuration, one 30-second PresentMon window starting at 180–181 seconds after launch per run. Warm-ups were excluded. **Revisions.** Main `d12eb1b` and PR `097d28b` with `VICTORY_UPLOAD_QUEUE=1`. | Metric | Main 1 | Main 2 | PR 1 | PR 2 | |---|---:|---:|---:|---:| | Frames sampled | 291 | 267 | 273 | 248 | | Median FPS | 10.10 | 9.09 | 9.51 | 8.66 | | 1% low FPS | 6.40 | 6.65 | 5.14 | 4.86 | | P95 frame time (ms) | 136.29 | 138.13 | 147.17 | 159.03 | | P99 frame time (ms) | 156.17 | 150.41 | 194.57 | 205.76 | | Median draws per frame | 6018 | 5880 | 5986 | 6091 | | Copy-queue uploads/frame | — | — | 11.45 | 11.45 | | Copy-queue traffic (MB/frame) | — | — | 20.85 | 21.00 | | Copy-queue fallbacks/frame | — | — | 0.00 | 0.00 | The queue metrics are medians of 28 periodic log samples per PR run. No fallbacks were reported in those samples. Both runs transferred about 21 MB per frame on the copy queue. The mean of the two median FPS readings went from 9.60 to 9.09 (−5.3%). P99 rose from 156.17 to 194.57 ms in run 1 and from 150.41 to 205.76 ms in run 2. One PR attempt ended during load with the guest access violation also seen during main warm-up. A separate completed PR run (8.49 FPS) with a background task over the lab's warning threshold was replaced. An earlier main capture with background compilation was excluded. Tested and documented by Codex.
Author
Owner

@⁠superboynick on GitHub · 2026-11-27 17:45 UTC · original

Your upload-queue sample is the more decisive of the two, and it is negative on your configuration: mean of the two median FPS readings 9.60 to 9.09 (−5.3%), 1% lows 6.40/6.65 to 5.14/4.86, P99 156.17 to 194.57 ms in run one and 150.41 to 205.76 ms in run two, with no fallbacks reported and 21 MB a frame moving on the copy queue.

I measured this on Series X, where the frame put 25.7 MB of uploads in front of the 3D work on the graphics queue and the queue measured 9.5 to 10.0 fps. Your build already transfers about the same 21 MB with 11.45 uploads a frame, and the frame is 8-9x shorter, so the copy queue has much less to hide behind and the extra fence per snapshot costs what it costs. That is a plausible reading of a 5% loss with worse tails, and it is enough to stop recommending the switch as a general default.

Plan, same as on the refresh PR: keep it off by default, put your configuration and numbers in the description, and reproduce Series S with DLSS here before claiming anything again. If it loses there too, I will say so and either narrow the switch to "large uploads ahead of a long frame" or withdraw the claim.

One question that would settle it: in your runs, did the queue metrics stay at 11.45 uploads and 0 fallbacks while the P99 was worst, or did the fallback rate move in the slow windows? Fallbacks going up would mean the snapshots are being rejected and taken twice, which would explain both the mean and the tail.

Written with an AI assistant.

**@⁠superboynick** on GitHub · 2026-11-27 17:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/60#issuecomment-7224761102) Your upload-queue sample is the more decisive of the two, and it is negative on your configuration: mean of the two median FPS readings 9.60 to 9.09 (−5.3%), 1% lows 6.40/6.65 to 5.14/4.86, P99 156.17 to 194.57 ms in run one and 150.41 to 205.76 ms in run two, with no fallbacks reported and 21 MB a frame moving on the copy queue. I measured this on Series X, where the frame put 25.7 MB of uploads in front of the 3D work on the graphics queue and the queue measured 9.5 to 10.0 fps. Your build already transfers about the same 21 MB with 11.45 uploads a frame, and the frame is 8-9x shorter, so the copy queue has much less to hide behind and the extra fence per snapshot costs what it costs. That is a plausible reading of a 5% loss with worse tails, and it is enough to stop recommending the switch as a general default. Plan, same as on the refresh PR: keep it off by default, put your configuration and numbers in the description, and reproduce Series S with DLSS here before claiming anything again. If it loses there too, I will say so and either narrow the switch to "large uploads ahead of a long frame" or withdraw the claim. One question that would settle it: in your runs, did the queue metrics stay at 11.45 uploads and 0 fallbacks while the P99 was worst, or did the fallback rate move in the slow windows? Fallbacks going up would mean the snapshots are being rejected and taken twice, which would explain both the mean and the tail. Written with an AI assistant.
Author
Owner

@⁠heklokate on GitHub · 2026-11-27 17:51 UTC · original

@⁠superboynick I checked the raw queue logs for the two 30-second captures. All 28 reports in each run showed 0.0 fallbacks/frame, including the run where P99 reached 205.76 ms. Uploads varied from 10.8 to 11.9 per frame in the first run and from 10.4 to 12.0 in the second. The 11.45 in the table was the median for each run.

I also checked the rest of both logs and found no report above 0.0. The logger averages over frames and prints one decimal place. At that resolution we saw no fallback spike around the slow frames. We don’t have per-frame fence timings to tell whether synchronization caused those spikes.

Tested and documented by Codex.

**@⁠heklokate** on GitHub · 2026-11-27 17:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/60#issuecomment-7224862285) @⁠superboynick I checked the raw queue logs for the two 30-second captures. All 28 reports in each run showed `0.0 fallbacks/frame`, including the run where P99 reached 205.76 ms. Uploads varied from 10.8 to 11.9 per frame in the first run and from 10.4 to 12.0 in the second. The 11.45 in the table was the median for each run. I also checked the rest of both logs and found no report above 0.0. The logger averages over frames and prints one decimal place. At that resolution we saw no fallback spike around the slow frames. We don’t have per-frame fence timings to tell whether synchronization caused those spikes. Tested and documented by Codex.
github-bot changed title from gpu: opt in to fenced copy-queue uploads of submission snapshots to gpu: opt in to fenced copy-queue uploads of submission snapshots, gated by size 2026-11-27 19:08:40 +00:00
`VICTORY_UPLOAD_QUEUE` becomes a size gate in MiB instead of a boolean:

- unset or `0`: no upload leaves the original path, byte for byte as before;
- `1`: every non-empty upload goes through the copy queue, which is what the
  first version of this switch did, kept for comparison runs;
- `N` above one: only uploads of at least `N` MiB go through the copy queue.

Why: on an RTX 3070 Laptop at Series S with DLSS, the ungated version lost 5.3%
(median FPS 9.60 to 9.09, 1% lows 6.40/6.65 to 5.14/4.86, P99 156.17 to 194.57 ms
and 150.41 to 205.76 ms) while the queue reported 11.45 uploads and no fallbacks a
frame. On this machine the same ungated switch measured 13.47 queue handoffs a
frame for about 12 uploads, because every snapshot took a Signal on the copy queue
and a Wait on the drawing queue. A gate turns that into one handoff for the few
large uploads, which is where the queue can actually hide work, and leaves the
small ones at their original position.

The gate is a pure decision over the threshold and the byte count, with a test for
it; the upload path itself is untouched, so the byte-preservation and slot-reuse
test still passes unchanged.
Author
Owner

@⁠superboynick on GitHub · 2026-11-27 19:40 UTC · original

That settles it — thank you for pulling the raw lines. Zero fallbacks across all 28 reports, uploads steady at 10.4-12.0 a frame, so the loss is not rejection and retry. Which leaves the handoff itself: this layer takes a Signal on the copy queue and a Wait on the drawing queue for every snapshot, so 11-12 uploads a frame is 11-12 handoffs a frame. On your 8-9x shorter frame there is nothing left to hide them behind.

I have changed the switch because of your result. VICTORY_UPLOAD_QUEUE is now a size gate in MiB:

  • unset or 0: nothing on the copy queue, byte for byte as before;
  • 1: every upload, i.e. exactly the version you tested, kept so the comparison reproduces;
  • 4: only uploads of at least 4 MiB, the rest stay where the title put them.

Measured here at Series S, ten window samples an arm: 1 queued 7.0 uploads and 47.8 MB a frame, 4 queued 3.0 uploads and 43.4 MB — so 57% fewer handoffs for 9% less traffic, no fallbacks either way. The three fps readings (4.8 / 5.3 / 5.0) were inside the noise of ten samples, so I am not claiming a gain from that table.

The number I cannot produce here is the one that matters: this card is 12 GB and does not exhibit your pressure. If you are willing to run VICTORY_UPLOAD_QUEUE=4 on the same save and the same two 30-second windows, your median / 1% low / P99 comparison would decide this PR — either the 5.3% is gone and it merges as a gate, or it is not and I close it. Per-frame fence timings would be nice but the gated numbers alone answer the question.

Written with an AI assistant.

**@⁠superboynick** on GitHub · 2026-11-27 19:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/60#issuecomment-7226761139) That settles it — thank you for pulling the raw lines. Zero fallbacks across all 28 reports, uploads steady at 10.4-12.0 a frame, so the loss is not rejection and retry. Which leaves the handoff itself: this layer takes a `Signal` on the copy queue and a `Wait` on the drawing queue for **every** snapshot, so 11-12 uploads a frame is 11-12 handoffs a frame. On your 8-9x shorter frame there is nothing left to hide them behind. I have changed the switch because of your result. `VICTORY_UPLOAD_QUEUE` is now a **size gate in MiB**: - unset or `0`: nothing on the copy queue, byte for byte as before; - `1`: every upload, i.e. exactly the version you tested, kept so the comparison reproduces; - `4`: only uploads of at least 4 MiB, the rest stay where the title put them. Measured here at Series S, ten window samples an arm: `1` queued **7.0 uploads and 47.8 MB a frame**, `4` queued **3.0 uploads and 43.4 MB** — so 57% fewer handoffs for 9% less traffic, no fallbacks either way. The three fps readings (4.8 / 5.3 / 5.0) were inside the noise of ten samples, so I am not claiming a gain from that table. The number I cannot produce here is the one that matters: this card is 12 GB and does not exhibit your pressure. If you are willing to run `VICTORY_UPLOAD_QUEUE=4` on the same save and the same two 30-second windows, your median / 1% low / P99 comparison would decide this PR — either the 5.3% is gone and it merges as a gate, or it is not and I close it. Per-frame fence timings would be nice but the gated numbers alone answer the question. Written with an AI assistant.
github-bot force-pushed github-bot/gh-60 from 9795609d52 to 46b7af624e 2026-11-27 19:58:45 +00:00 Compare
Author
Owner

@⁠ANDREANIADS on GitHub · 2026-11-27 20:14 UTC · original

Independent validation on Windows with a desktop RTX 3070 (driver 621.40), based on 46b7af6. I found a small configuration correctness issue in host/upq.rs: Some(mebibytes << 20) can truncate the high bits of an out-of-range parsed u64, turning a very large threshold into a small threshold or zero. This does not affect the normal 1 or 4 settings.

A minimal fix is to replace that match arm with mebibytes => mebibytes.checked_mul(1 << 20), so unrepresentable thresholds follow the existing invalid-config path. With that change and a parser regression test in a local copy, cargo test --locked --offline -p victory-gpu --lib host::upq::tests -- --test-threads=1 passed 3/3, including the D3D12 byte-preservation/slot-reuse test. The debug victory executable also built successfully. No title files were used. This is a correctness check, not the requested 4 MiB in-game FPS / 1% low / P99 result.

**@⁠ANDREANIADS** on GitHub · 2026-11-27 20:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/60#issuecomment-7227319108) Independent validation on Windows with a desktop RTX 3070 (driver 621.40), based on `46b7af6`. I found a small configuration correctness issue in `host/upq.rs`: `Some(mebibytes << 20)` can truncate the high bits of an out-of-range parsed `u64`, turning a very large threshold into a small threshold or zero. This does not affect the normal `1` or `4` settings. A minimal fix is to replace that match arm with `mebibytes => mebibytes.checked_mul(1 << 20),` so unrepresentable thresholds follow the existing invalid-config path. With that change and a parser regression test in a local copy, `cargo test --locked --offline -p victory-gpu --lib host::upq::tests -- --test-threads=1` passed **3/3**, including the D3D12 byte-preservation/slot-reuse test. The debug `victory` executable also built successfully. No title files were used. This is a correctness check, not the requested 4 MiB in-game FPS / 1% low / P99 result.
github-bot force-pushed github-bot/gh-60 from 46b7af624e to 15934e7f34 2026-11-27 21:01:24 +00:00 Compare
github-bot force-pushed github-bot/gh-60 from 15934e7f34 to e1ee76ab0c 2026-11-27 22:49:39 +00:00 Compare
Author
Owner

@⁠superboynick on GitHub · 2026-11-27 22:46 UTC · original

You are right, and it is fixed in the branch (07a5ed4): the arm is now

mebibytes => mebibytes.checked_mul(1 << 20),

so a count too large to represent takes the same path as an unreadable setting instead of wrapping into
a small gate or zero. I added a_threshold_too_large_to_hold_is_not_a_threshold beside the gate's own test,
covering 0, 1, 4, u64::MAX and u64::MAX / 1 MiB + 1, and left the two settings you exercised alone.

cargo test --release -p victory-gpu --lib upq   ->  3 passed
cargo build --release -p victory                    ->  passes

Thank you for reading it closely enough to find that — 1 and 4 were the only values I ever typed, which is
exactly how a wrap in the parser survives.

On the in-game number you could not produce: I could not produce it either, and I now think the framing in the PR
description was too generous. At Series S on this machine the copy queue moves 3.0-3.2 uploads and 43-45 MB a frame
with no fallbacks, and the in-world frame time is unchanged (278 ms with the gate at 4 MiB against 281 ms with the
switch off, draw-matched windows). The 9.5 -> 10.0 fps reading that justified the switch came from an earlier Series S
run whose windows were not draw-matched, so it does not belong in the description as it stands. If your 3070 shows
the same, this is a "measured and not worth it" and I will close it rather than leave a switch with a claim it cannot
carry.

**@⁠superboynick** on GitHub · 2026-11-27 22:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/60#issuecomment-7229604082) You are right, and it is fixed in the branch (`07a5ed4`): the arm is now mebibytes => mebibytes.checked_mul(1 << 20), so a count too large to represent takes the same path as an unreadable setting instead of wrapping into a small gate or zero. I added `a_threshold_too_large_to_hold_is_not_a_threshold` beside the gate's own test, covering `0`, `1`, `4`, `u64::MAX` and `u64::MAX / 1 MiB + 1`, and left the two settings you exercised alone. cargo test --release -p victory-gpu --lib upq -> 3 passed cargo build --release -p victory -> passes Thank you for reading it closely enough to find that — `1` and `4` were the only values I ever typed, which is exactly how a wrap in the parser survives. On the in-game number you could not produce: I could not produce it either, and I now think the framing in the PR description was too generous. At Series S on this machine the copy queue moves 3.0-3.2 uploads and 43-45 MB a frame with no fallbacks, and the in-world frame time is unchanged (278 ms with the gate at 4 MiB against 281 ms with the switch off, draw-matched windows). The 9.5 -> 10.0 fps reading that justified the switch came from an earlier Series S run whose windows were not draw-matched, so it does not belong in the description as it stands. If your 3070 shows the same, this is a "measured and not worth it" and I will close it rather than leave a switch with a claim it cannot carry.
github-bot force-pushed github-bot/gh-60 from e1ee76ab0c to 5e122e7e3e 2026-11-27 23:53:10 +00:00 Compare
github-bot force-pushed github-bot/gh-60 from 5e122e7e3e to 457c7986d5 2026-11-28 01:35:37 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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