Launcher: write-watch large XMemAllocDefault allocations on NVIDIA #381
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/TaynanGT--Vice-Tay!381
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-381"
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?
@urielbeaupre on GitHub · 2026-11-27 21:35 UTC · original
urielbeaupre:perf/watch-xmem-nvidia→main· +34 −0 · 2 files · 1 commits · openSets
VICTORY_WATCH_XMEM_ALLOC=1(#321) inscripts/play.ps1for the NVIDIA presets, outside-Safe.Why
A traffic breakdown in the prison cell showed one copy dominating the bus. The title's 21 MB
XMemAllocDefaultbuffer (+0x1412200) went 21.05 MB up and 21.04 MB fetched a frame, all 321 pieces both ways. It is private memory the kernel does not watch, so each refresh copied it whole (copied whole (memory not watched), 1–2× a frame), and the GPU writes it every frame.With the switch the buffer is write-watched.
VICTORY_LAND_ECHOrecognises what its landings put back, so nothing of it goes up. Bytes sent up over the bus fell from 60 to 40 MB a frame, and the echo check reported 37 MB a frame of landings "held already and left", against 16 MB without the switch.When #321 was measured on Windows (RTX 3080, boat scene), the landing re-dirtied ~5,100 pages a frame and made
preparingslower. That measurement came beforeVICTORY_LAND_ECHO(e162982) existed. Herepreparingis 1.4 ms faster.Measurements
RTX 4070 Ti 12 GB, Ryzen 9 7900X (12 cores), 63 GB, Windows 11 26200. Diagnostics build of
aa917f3,-Machine 4070, Series S, windowed 1920×1080, ports 6 and 7 on (#375). Unattended with the intro skipped (A held), measured 100–160 s after the loader started in the prison cell. Separate runs, order alternated:VICTORY_WATCH_XMEM_ALLOCThe mean is 24.0 → 24.75 fps. No run had its video memory budget fall below use. A further run with the switch on, recorded every 4 s, showed the same picture as without it.
What this does not cover
VICTORY_PLACED_FILL_REDIRECT), now on in the same block. The two touch different paths, but they were not measured together.Verification
The launcher's final settings were printed for
-Machine 4070andauto, with and without-Safe: the switch is on outside-Safeand absent under it.play.ps1parses with no errors, andcargo xtask policypasses. The measurements are added todocs/rtx4070-performance.md.🤖 Generated with Claude Code
@urielbeaupre on GitHub · 2026-11-27 22:06 UTC · original
A related finding, posted as a question rather than a proposal.
With this PR the 21 MB buffer (
+0x1412200) no longer goes up. It still comes down every frame: 21.04 MB fetched in 321 pieces, about a third of all copy-back. To see whether the title reads it on the CPU, I added a diagnostics-only test switch that skips fetching copies of that one length, at the same point whereVICTORY_LAND_SKIPskips pieces inrelay_card_back. The switch is local only; it is not in this PR.Same PC as above, newest main (
0148258) plus this PR, ports 6 and 7 off. The intro was skipped, and the measurement is from the prison cell at 100–160 s.Total fetched fell from 64 to 44 MB a frame. No crash, and screenshots every 4 s looked the same as normal runs.
A scripted walk followed (keys: back to turn into the room, forward, strafing, camera turns; screenshots every 2 s, one run each). Walking, the other inmates, the mission prompt ("Go with the prison guard") and the lighting all looked the same. The blocky wall textures appeared in both runs. FPS while moving was about equal (24.0 skipped vs 24.2 normal; slowest quarter 22.8 vs 20.4), so the gain is clear only in the still scene.
That does not show the title never reads it. It could matter outside the cell, later, or in logic that doesn't show on screen. Do you know what this buffer is, and whether anything on the CPU reads what the GPU writes there? If nothing does, its copy-back could go for everyone.
🤖 Generated with Claude Code
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.