play.ps1: VICTORY_SUBMIT_FRAMES=2, the title records the next frame while ours sends this one #379
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!379
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-379"
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?
@Jesper-Andersson on GitHub · 2026-11-26 21:05 UTC · original
Jesper-Andersson:play-submit-frames-2→main· +2 −0 · 1 files · 1 commits · openRefs #370.
With
VICTORY_THIN=1(aplay.ps1default), submissions go through our own submit thread (queue/behind.rs). A present returns only once at mostVICTORY_SUBMIT_FRAMESpresents are left in that line, and the default is 1 (frames_most,behind.rs:722). So the title cannot record frame N+1 while frame N's lists are still being translated and sent: the title, our submit thread and the card take turns.On an RTX 2070 SUPER, letting the line hold two frames removes the title's wait at presents altogether, and the card goes from 79 % to 92 % busy.
Change
scripts/play.ps1:VICTORY_SUBMIT_FRAMES = '2', next toVICTORY_THIN. Like THIN, it is not set with-Safe.-More @{VICTORY_SUBMIT_FRAMES='1'}gives the old behaviour.behind.rs's module doc. The line already keeps everything the title may touch between its call and our send: upload memory, descriptors and constants stay the card's until a fence behind the lists is reached, and no fence is set before the lists have run. Two frames in the line only make that window longer.VICTORY_SUBMIT_DEPTH(64 submissions) still bounds it.Where it does nothing
VICTORY_THIN/VICTORY_ASYNC_SUBMITthere is no line, and the switch is not read.Measured
RTX 2070 SUPER 8 GB (driver 621.14), Ryzen 7 5800X, 32 GB, Windows 11.
2de9980plus open PRs (local branch), including the own-bytes pool from #221.scripts\play.ps1defaults, plus Series S, DLSS (VICTORY_UPSCALE=dlss),VICTORY_CARD_BUFFERS_MIN_KB=64andVICTORY_CARD_BUFFERS_MB=1024.SUBMIT_FRAMES=1)=2)queue::behindline)the card's clockline)Checks
cargo xtask policy: 265 files okNot checked
Related
VICTORY_SUBMIT_FRAMES. #176 changesplay.ps1's-Safesettings only, so it does not overlap.This change was made with AI assistance (Claude Code).
RTX 2070 SUPER 8 GB, Series S: 179 -> 164 ms median, p90 260 -> 210; the title's threads no longer wait at presents, the card 79 -> 92 % busy. Not with -Safe; -More @{VICTORY_SUBMIT_FRAMES='1'} for the old way. This change was made with AI assistance (Claude Code).@Jesper-Andersson on GitHub · 2026-11-26 22:02 UTC · original
A second measurement, on a different build, adds a caveat. I'm marking this as a draft until it is understood.
Run I is the local
testbranch atb9b32e4(the ordinary build here; the runs above were on a branch of it), withVICTORY_SUBMIT_FRAMES=2. It is compared with run H, the same build without the switch, on the same PC, route and settings (Series S, DLSS Quality):=1)=2)behind.rs's module doc says. Upload memory, descriptors and constants are covered there. Memory the title writes by the CPU and the card reads in place (renderer port 1's regions,PORT_ALL) may not be.To try next:
=2with port 1 off, and a capture of a frame with the artifacts. Until then,VICTORY_SUBMIT_FRAMES=2is a frame-time gain with a possible correctness cost. It should not be a default yet.AI use: log reading and write-up with AI assistance (Claude Code). The runs are my own.
@Jesper-Andersson on GitHub · 2026-11-26 23:10 UTC · original
The next measurement from my last comment:
=2with renderer port 1 off. The artifacting from run I did not show, and frames were faster.Run J is the same
testbuild as H and I (b9b32e4), on the same PC, route and settings (Series S, DLSS Quality). It hasVICTORY_SUBMIT_FRAMES=2andVICTORY_PORT_ALL=0, so port 1 is off;play.ps1setsVICTORY_PORT_ALL=1by default.J2 repeats J with the same settings.
=1, port 1 on)=2, port 1 on)=2, port 1 off)VICTORY_CAPTURE) look clean too. That points at port 1 together with two frames in flight, not at=2alone.A likely cause in the code (not confirmed yet):
Shadow::gpu_writes, the early return forplace). So nothing waits on them.card_stepsrefuses memory in place, so fills and copies that read it are done on the CPU when the submission is prepared. In H and I that's about 600-740 fills a frame.=2our thread runs further ahead of the card, so more of these reads come too early. That would fit "some artifacting at=1, more at=2, none with port 1 off".=1and=2.For now:
VICTORY_SUBMIT_FRAMES=2looks safe and faster on this PC with port 1 off. With port 1 on it is not. I'd keep this PR as a draft. If the counter confirms it, the fix belongs in port 1 and not here: letcard_stepstake memory in place, so those fills run on the card in queue order. That would also bring back the roughly 12,000 fills a frame that moved to the CPU in #365.AI use: log reading and write-up with AI assistance (Claude Code). The runs are my own.
@Jesper-Andersson on GitHub · 2026-11-26 23:20 UTC · original
A correction to my last comment: the cause I called likely there is ruled out.
I added a diagnostics counter (local branch, not pushed). Each list notes the title memory in place that its shaders may write. Flights keep those ranges until the card passes their fence value. Before a submission's CPU fills and copies run, it counts the ones that read those bytes while a flight that writes them is unfinished, or that read bytes a list ahead in the same submission writes.
Two runs on the same build, port 1 on (
VICTORY_PORT_ALL=1, with xmem's half off as ontest), Series S, DLSS Quality:=1)=2)All shader writes into title memory go through
Shadow::gpu_writes, so the counter sees all of them:draw.rs, binding a UAV);root_uav, the rest of the buffer unlessVICTORY_ROOT_UAV_MBis set);memory.rs.So our CPU steps don't read port 1's memory too early, and that isn't what goes wrong.
What's left (not checked yet): the title's own CPU writes.
=2, a present returns while two frames are queued, so the title starts on the next frame earlier. If it reuses memory (a ring of constants, for example) based on frames presented rather than on fences, it overwrites bytes the card hasn't read yet.That fits a little artifacting at
=1, more at=2, and none with port 1 off. Checking it means watching the title's writes to port 1's regions while flights that read them are in the air. That's the next diagnostic.On this PC
=2is only a gain with port 1 off. The localplay.ps1now pairsVICTORY_SUBMIT_FRAMES=2withVICTORY_PORT_ALL=0. This PR stays a draft until the port 1 side is understood.AI use: diagnostics, log reading and write-up with AI assistance (Claude Code). The runs are my own.
@YeokiNoewChi on GitHub · 2026-11-26 23:53 UTC · original
A data point from a different machine: RTX 3070 Ti 8 GB, Ryzen 5 5600X, Windows 11, Series S with DLSS,
VICTORY_THIN=1. This was not on your main. It was a cool_fox-based tree with renderer ports 1, 2, 6 and 7. I A/B'dVICTORY_SUBMIT_FRAMES1 against 2 within one run at the boat save, in 10 s phases, with 29 adjacent pairs.queue::behindline) went from 1-5 ms to 0.0 ms, as in your run.So here it removes the wait but the frame stays where it was. Our submitting thread works 37-44 ms of a ~56 ms frame, so that thread sets the frame, not the line. I'd expect the gain you measured where the submitting thread has slack and the title is what waits.
View 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.