D3D12.X: GPU addresses above 2^40 make the title's BVH builder throw ("more than 40b of address set") #585
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#585
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?
@13hourstilliland on GitHub · 2026-11-24 02:09 UTC · original
On
main7ebf1b8@sub-north's run of the newer retail title (in #505) ends ~290 s in, before the watchdog, with:with a GPU address of
0x1d1ae5c0000(above 2^40 =0x100_0000_0000). The check is in the title's own XboxBvhBuilder, so the address the title gets for its destination buffer has to stay under 40 bits, as it does on the console.Where such an address can come from (read from the code, not measured)
gpu/uma.rsplaces the UMA atslot << 32forslot in (4..512).step_by(4)(for_runtime_with, line 172; same loop inwith_windows, line 379), so the base can be anywhere from 16 GiB to 2 TiB. Nothing incrates/xcl/srckeeps it under 2^40.0x1d1ae5c0000is exactly slot 464 (base0x1d0_0000_0000), window 1, offset0xae5c0000, and window 1 is a sparse window holding large title reservations.res_gpu_va_x(d3d12x/real.rs:1688) returns the host driver's GPU address for a buffer that is not a console buffer. That can also be above 2^40, depending on the driver.kernelx.rs,reserve_watched) isVirtualAlloc(NULL), so it can land anywhere too.How to tell which one it is: the log's
UMA: … sparse VRAM window(s) … at 0x…line gives the base of that run. If it is0x1d000000000, the UMA placement is the cause.Possible fix (not written; a runtime change needs a regression run I cannot make)
base + 16 GiB <= 2^40(slot <= 252). If nothing below fits, warn rather than go higher.Not tested: no run. I do not have the title's package. Static reading of
main508a0c7only.AI use: Claude Code (Claude Opus 5.5) read the XCL source and wrote this issue.
github-bot referenced this issue2026-11-26 04:35:45 +00:00
@sub-north on GitHub · 2026-11-24 02:17 UTC · original
Measured data from another lab, in case it saves the implementer a couple of runs.
The check is exactly as described. In
XboxBvhBuilder.dll:mov r8,[rdx](desc+0x00,DestAccelerationStructureData),cmp r8,0x10000000000,jae-> message and0x80070057. The same function checksSource(+0x20) andScratch(+0x28) identically, plussize <= 2 GB(+0x58). It is a plain unsigned compare on the GPU VA.Which path produced it here. Failing AS descriptors sat at
0x20eb5240000,0x20eb7002b00,0x20eb7f9c700,0x20eb8824b00- about 2.06 TiB, past the top of the UMA slot search (slots 4..512, max base 2 TiB). They did not come fromres_gpu_va_xor a UMA base: they are GPU views of write-watched reservations, e.g.kernelx: reservation 0x208a0b30000 (0x600000000 bytes, no CPU access) is the GPU view of 0x202a0b30000. The view is the CPU reservation + 24 GiB, so a CPU-side placement that looks fine still yields a descriptor above 2^40.We implemented roughly half the suggestion and measured it.
VirtualAlloc2+MEM_ADDRESS_REQUIREMENTScapped at 2^40 - 24 GiB placed a 24 GiB reservation at0xee00000000with its view at0xf400000000, both under the ceiling, and that path works. But a0x89700000(2.3 GB) write-watched reservation found nothing below the ceiling and silently fell back:mem: nothing below 0xfa00000000 for 0x89700000 write-watched bytes; falling back to any addressThe wall was unchanged, at the same call. That 2.3 GB reservation is the one that matters - most likely the AS memory itself.
Suggestion: apply the ceiling to the write-watched/GPU-view reservation and to the
VirtualAlloc(NULL)fallback, not only the slot search, and make an above-2^40 fallback a loud warning. The silent fallback hid this here for two runs.No PR from us:
crates/xcl/AGENTS.mdexcludes open-weight-model contributions, so this is a data point only.@13hourstilliland on GitHub · 2026-11-24 02:42 UTC · original
Thanks @sub-north, that settles it, and it corrects my issue text. My "slot 464" decode means nothing: every address above 16 GiB maps to some slot. Your data shows the addresses come from write-watched reservations, not the UMA windows.
Why those reservations land around 2 TiB:
xcl.exeis linked with high-entropy VA (Rust's default), and Windows then places every bottom-up allocation in the process around 1 to 2.5 TiB. Measured with a probe linked both ways (Windows 11 26200):VirtualAlloc(NULL, 24 GiB)landed at0x1e1cb8a0000and up (20/20 above 2^40); with high-entropy VA off it landed from0x7fff0000(0/20).So instead of capping each allocation, #631 links
xcl.exewithout high-entropy VA (build.rs, with a test of the PE flag). I have no retail title, so it needs a run on yours:smoke.ps1onmainand on the PR head, and whether the40b of address setstop is gone. Allocations a title makes withMEM_TOP_DOWNwould still go high. This change does not cover them.AI use: Claude Code (Claude Opus 5.5).
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@JFyuhong on GitHub · 2026-11-24 07:22 UTC · original · edited 2026-11-24 07:45 UTC
Four out-of-range acceleration-structure SRVs in the intro world load came from the same 2,199 MiB write-watched allocation. This confirms the allocation behind the SRV warnings that @sub-north suspected.
Tested
b54f6fe(#879 ona1672ef), default four windows. Ranxcl runoffline with a saved profile,XCL_TRACE_MEM=10000andXCL_ACTIVITY=1.kernelx::VirtualAlloclogged the GPU-visible, write-watched fallback forsize=0x89700000, flags=0x20003000, protect=0x2404. It returned0x205158f0000. All four empty RT SRVs fell inside this allocation at offsets0x14710000,0x1646e600,0x17408200and0x17c90a00. LiveVirtualQueryExindependently reported that allocation base for all four addresses. Both 24 GiB views had other bases.+0x23cf683at 222.211 s, about 30 s after the last two-second interval with a present. In a separate run on #822 (e9705bbplus the #879 runtime change), 16 windows placed both 24 GiB views below 2^40. An RT SRV still appeared at0x28400f80000, and the title again ended at+0x23cf683.808a8a4), both with the texture budget off and withXCL_PAGE_BUDGET_MB=4096. Peak title texture pages fell from 9,859 to 6,726 MiB in those two runs. Both raised0xe06d7363.Not tested
The builder did not print the value of its rejected destination. The measured allocation owns the four SRVs. Whether it also supplied
DestAccelerationStructureDatain a throwing run is still open.Follow-up on the 2,199 MiB allocation
I repeated the
b54f6fefour-window run on the same hardware, profile and 51-key shader seed. My earlier harness created a fresh title data directory each time and omitted XCL's learnedcache/uma_coherent.txt. I copied the file XCL had actually written (4,804,771,840 bytes requested) into the new test profile. XCL automatically opened a 4,095 MiB coherent window instead of 512 MiB. The samesize=0x89700000, flags=0x20003000, protect=0x2404allocation now came fromVirtualAlloc (graphics, coherent window)at0x749400000. The four outside-UMA BVH SRV warnings fell to zero.That placement change is enough for the four measured SRVs on this machine. The title still stopped in intro Prestream at
+0x23cf683, about 29 s after the last present interval. Neither run in this particular A/B printed the builder's destination-address exception.AI use
OpenAI Codex (GPT-6) ran the tests, matched the allocation records, and wrote this report.
@ivall on GitHub · 2026-11-24 10:06 UTC · original
Fixed on main (
02bfd1d): #631 is merged (xcl.exe without high-entropy ASLR, so the title's memory stays under 2^40); AlexLopezDevelop's run with it went past the40b of address seterror. Please reopen if it shows up again on current main.