GPU: marked pages could go back on several threads (copy-back 184 to 124 ms here) #2826
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#2826
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Machad3x on GitHub · 2026-11-25 21:33 UTC · original
What
After a submission,
shadow::copy_back_markswrites the marked pages back one after another on the submitting thread. In a world scene here that is about 2,000 pages of 64 KiB a frame at 55 to 80 µs each (two reads, a compare, writes, a protection change).Change tried
Group the pages by address (two buffers covering the same page stay on one thread, in their old order) and take the groups on up to six scoped threads, the submitting one among them; under 16 pages it stays serial.
The final loop of
copy_back_markscalls it with the withheld check andcopy.copy_back_marked(page)in the closure.Measured
Ryzen 7 5700X, RTX 3080 Ti, Windows 11, on a stack of open pull requests (including #2120, #2130 and #2280) merged with main
67e8ae1, not onmainalone. One 7-minute run each, same scene, medians:victory-gputests pass, with a new one writing 96 marked pages of two overlapping buffers back. No device removal in this and later runs. The gain per thread is well under linear; the threads are made anew each submission, so a kept pool may do better.Code, with the test:
github.com/Machad3x/VIctory-nvidia-3080ti@7229f41Written with Claude Code; tested locally.
@Marvisak on GitHub · 2026-11-25 21:46 UTC · original · edited 2026-11-26 00:44 UTC
Automated triage for the maintainers.
Performance change with a patch. On
main, the final loop ofcopy_back_marksincrates/victory-gpu/src/shadow.rscallsShadow::copy_back_markedonce per page, serially, on the submitting thread, as described. The change is now open as pull request #2914 (ported to currentmain, original authorship kept). #2051 does the same for refreshes, and #2280/#2409 make each page's copy-back cheaper.The numbers above were measured on a stack of open PRs (#2120, #2130, #2280); a measurement on
mainalone, which #2914 notes is still open, would help the maintainers judge the gain.Generated by Claude Code
@kotekompotek on GitHub · 2026-11-25 23:52 UTC · original
Opened as #2914 — the
7229f41change ported to current main verbatim (keeping your authorship, minus the fork doc page). The 96-page two-copy test passes on a GTX 1050; the main-alone measurement the triage asked for is still open — noted in the PR.