GPU: VICTORY_BACK_JOIN writes nearby runs of shader writes back as one kernel call (opt-in) #842
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/fxceless--victory-fork!842
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-842"
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?
@Xeltax on GitHub · 2026-11-25 10:17 UTC · original
Xeltax:vicky/back-join→main· +108 −6 · 1 files · 1 commits · openWhat.
copy_back_withputs the GPU's bytes back into title memory one run at a time, with oneNtWriteVirtualMemoryper run (#2009: only the GPU's bytes are written).With the ray-tracing structure builder on, the runs are tiny and countless: the builder changes a few bytes here and there in each node. Per frame on an RTX 4080:
This PR adds an opt-in switch,
VICTORY_BACK_JOIN=<bytes>. Runs of GPU bytes no more than that many bytes apart are written with one call, the gap included. The gap holds the title's bytes asback_pieceread them just before. Unset or 0: each run alone, exactly as now.It also adds one frame-rate line,
putting shader writes back, per frame:watch::writing) and writing.Measured. RTX 4080, Series X profile,
VICTORY_BVH_BUILDER=1without quarantine, same shot, single runs. The base is VIcky'srtbranch:8dd30ab+ #36, #646, #579, #213, #188, #346 and three opt-in VIcky switches (see #346's thread). It is not plainmain: onmainthe builder's frames are dominated by #346's problem.VICTORY_BACK_JOINunsetVICTORY_BACK_JOIN=256With the builder off I have not measured it; the runs there are far fewer.
The shortcut (written in the switch's doc). A title write that lands in a gap between the read and the write (microseconds) is overwritten with the byte read before it. The gaps are at most
VICTORY_BACK_JOINbytes and lie only between bytes the GPU wrote. That is narrower than what the relay's merge (relay_merge) already does: it writes the whole stretch. It is off by default for that reason.Tests
joined_runs(the joining alone): three tests, for no join, joins of 1, 3 and 96 bytes, and no runs.cargo test -p victory-gpu --lib: 147 (3 new) passed.-p victory-shader --lib: 215 passed.-p victory-hle --lib: 98 passed.cargo xtask policy: ok.AI-assisted (Claude Code).
🤖 Generated with Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.