XMem: title memory below 128 GiB, the by-address directory's reach (#218) #1041
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1041
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1041"
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?
@Mumogg on GitHub · 2026-11-28 11:52 UTC · original
Mumogg:fix/xmem-below-128gib→main· +21 −1 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCFixes the vehicle body panels that vanish a second after they are drawn (and the matching "pages that had no copy" reads), reported in #218.
Cause
Shaders that reach title memory by address look pages up in a directory of
MEMORY_PAGES= 2^21 pages × 64 KiB = 128 GiB.XMemVirtualAllocallowed addresses up to 40 bits, so on some starts the host placed several GB of the title's pools above 128 GiB. Every access there was capped to page0x1fffffand read as 0: panels, and sometimes faces, disappear.Change
address_rangecaps 64-bit title allocations below 2^37 (TITLE_TOP_BITS), the directory's reach. 32-bit requests are unchanged. The title's pools fit below that many times over. It is one constant plus amin. New unit test:title_memory_stays_within_the_by_address_directory.This is separate from
108a897, which keeps physical page numbers within 21 bits. This one is about where the virtual pools are placed.Tested
RTX 5070 Ti 16 GB, Linux + Wine/GE-Proton (vkd3d-proton), 1440p:
0x2000000000; 3 of 3 good runs were below it.0x1fffffin 5 runs, including a full session on63b902f+ this commit. The same build without it had 106 such reads in a comparable run.victory-hlexmem tests: 23 passed (Windows target run under Wine).It is not tested on native Windows; there, address placement may not reach 128 GiB as often.
Found and written with AI assistance (Claude Code). I checked the log evidence and ran the builds myself.
🤖 Generated with Claude Code
Shaders that reach title memory by address look pages up in a directory of MEMORY_PAGES (2^21 x 64 KiB = 128 GiB). XMemVirtualAlloc allowed up to 40 bits, so on some starts Wine placed ~7.5 GB of the title's pools above 128 GiB: every access there capped to page 0x1fffff ("pages that had no copy", read 0), and vehicle body panels vanished a second after they were drawn (#218). Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit df0893b44c3c99b76dbe9fa32e0d96e122039ec2)@Exopus-0x65f7ad0 on GitHub · 2026-11-28 12:59 UTC · original
A data point from native Windows, since the PR says it has not been tested there.
Setup: Windows 11 (build 26300), RTX 5060 Ti 8 GB, 16 GB RAM. Base:
63b902fplus a few local commits that do not touchxmem, so this run is without the cap. README launcher defaults, 5 starts today that each reached gameplay in the prison opening.address=/start=field of the logs0x12b8500000(~75 GiB); the other four peak at0xdd2b00000–0xea3e90000(~55–58 GiB)pages that had no copy(per-frame value in thetitle memory by addresslines)0x1fffffin the logSo on native Windows, D3D12 never placed the pools above
0x2000000000in these runs, which matches your guess. The cap would have been a no-op there, so it looks safe to take for Windows users too.Caveat: these are only the addresses that show up in the log fields, not a full map of
XMemVirtualAllocresults. If you want a stricter check, I can run a build that logs the highest addressXMemVirtualAllocreturns.@Mumogg on GitHub · 2026-11-28 13:27 UTC · original
Thanks, that's exactly the check that was missing. On Windows the pools stayed far below 128 GiB, so the cap does nothing there, and on Linux/Wine it is what keeps the panels. (AI-assisted reply.)
@Vaporisateur on GitHub · 2026-11-28 14:39 UTC · original
Tried this on Windows 11 with an RTX 3080 10 GB (Series X profile, DLSS Quality), diagnostics build of v2026.11.28.01 plus this PR (and #1007), one 8.5-minute session in the first chapter's streets: the green vehicles are still there.
So on Windows with this setup the green cars look like a different path than the one this PR closes. Happy to run a build with more logging if there is something specific to look at.
@Mumogg on GitHub · 2026-11-28 15:22 UTC · original
Thanks for testing. Since your title memory never went above 128 GiB, the green cars you saw have a second cause that this PR doesn't touch. This one only fixes the placement that Wine produces. One more thing we found on Linux: with the title's ray tracing on (VICTORY_BVH_BUILDER=1), cars also turn green about 35 s in, because the by-address pages made from shader faults hit a run-wide cap (
FAULTS_ALL= 2048 in memory.rs). fxceless's 3e573d25 turns that into a recycled budget. If your diagnostics log hasmade=0fault warnings, or a "faults in all" count stuck at 2048 when the cars go green, that's the same cap. If it doesn't, it's something else. (AI-assisted reply.)