Proposal: copy shader writes back only when the title's CPU touches them (page guards), not after every flight #2581
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?
Imported from Marvisak/VIctory. Originally posted by shawshanker18 on 2026-11-25T16:13:37Z.
Idea
Today every flight's shader writes come back to title memory after the flight: the layer snapshots or hashes the ranges, fetches the changed pieces, and merges them. Separately, a submission whose preparation reads title memory that a flight may write waits for that flight to land (a "settle").
Proposal: leave GPU-written ranges on the card and copy them back only when the title's CPU actually touches them:
PAGE_NOACCESS, the same guard machinerywatch.rsalready uses for writes).Other emulators reach their speed the same way: Yuzu/Ryujinx ("GPU accuracy: normal" skips most readbacks), Xenia (resolve readbacks off by default), Dolphin (skip EFB access from CPU).
Why (measured, fxceless fork
9376fd6, RTX 4050 Laptop, Series X, lit world)VICTORY_BARRIER_TEST=both) the frame does not change, and the card sits at about 60% load and 40 W (nvidia-smi). The card is waiting on the layer, not working.Risks / open questions
No game data in this proposal.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:45:52Z.
Automated triage for the maintainers.
This is a performance proposal for the GPU layer: copy shader writes back to title memory only when the title's CPU first touches them, using page guards. It fits the project's scope, and it is labelled and kept as a request.
The measurements quoted come from a fork, not from main, so a count of first CPU touches of declared ranges per frame on main would be the useful first data point, as the proposal itself suggests.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by Fran-co-F on 2026-11-26T20:57:29Z.
Data point for the first-touch count asked for here. This is only a counter: copy-back still runs as on main, then the declared pages are re-armed
PAGE_NOACCESSand the first touch is recorded.Setup: main
63bcca4plus the diagnostic, Linux, Wine 11.17 (patched wineserver) + vkd3d-proton, RX 9070 XT, 32 GB RAM, Series X profile. One run, one scene: in 3D at about 2 fps, character faces missing (as I have seen on other builds here). 64 KiB pages.Per frame, across the 16 five-second windows of the run:
copy_mapped) touch 30–44 % of the declared pages+0x35a3d6c(writes),+0x75885(writes),+0x4e4b680(reads)So for the title itself the idea looks promising; the layer's reads are the larger obstacle and would need to move to the card or fetch on demand. This does not measure any speedup, nor fault cost under demand copy-back. The run ended in an abort in dxil-spirv (
Invalid type ID in cast<T>), which looks specific to the Linux translation path; I have not checked whether the diagnostic plays a part.AI-assisted (patch and summary).