gpu: opt in to fenced copy-queue uploads of submission snapshots, gated by size #60
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/trustno1-coder--VIctory-NVIDIA!60
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-60"
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?
@superboynick on GitHub · 2026-11-27 15:29 UTC · original
superboynick:pr/upload-queue→main· +307 −4 · 3 files · 3 commits · openRewritten with the numbers I actually have, and narrowed to what they support.
What the switch is
VICTORY_UPLOAD_QUEUEis a size gate in MiB. Unset or0: nothing leaves the original path.1: every upload goesthrough a copy queue (the first version's behaviour).
Nabove one: only uploads of at leastNMiB.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%.
That is no change. The
9.5 -> 10.0 fpsin earlier versions of this description came from a run whose windows werenot 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 << 20wrapping), which is fixed ine1ee76awith 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.
@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
d12eb1band PR097d28bwithVICTORY_UPLOAD_QUEUE=1.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.
@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.
@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.
gpu: opt in to fenced copy-queue uploads of submission snapshotsto gpu: opt in to fenced copy-queue uploads of submission snapshots, gated by size@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
Signalon the copy queue and aWaiton 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_QUEUEis now a size gate in MiB: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:
1queued 7.0 uploads and 47.8 MB a frame,4queued 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=4on 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.
9795609d52to46b7af624e@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 inhost/upq.rs:Some(mebibytes << 20)can truncate the high bits of an out-of-range parsedu64, turning a very large threshold into a small threshold or zero. This does not affect the normal1or4settings.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=1passed 3/3, including the D3D12 byte-preservation/slot-reuse test. The debugvictoryexecutable 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.46b7af624eto15934e7f3415934e7f34toe1ee76ab0c@superboynick on GitHub · 2026-11-27 22:46 UTC · original
You are right, and it is fixed in the branch (
07a5ed4): the arm is nowso 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_thresholdbeside the gate's own test,covering
0,1,4,u64::MAXandu64::MAX / 1 MiB + 1, and left the two settings you exercised alone.Thank you for reading it closely enough to find that —
1and4were the only values I ever typed, which isexactly 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.
e1ee76ab0cto5e122e7e3e5e122e7e3eto457c7986d5View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.