D3D12.X: a title's Map of a resource the PC cannot map does not reach the PC's Map #1099
No reviewers
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!1099
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1099/head"
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?
@ofc0urse on GitHub · 2026-11-24 11:33 UTC · original
ofc0urse:fix/map-cpu-invisible→main· +149 −4 · 1 files · 3 commits · merged 2026-11-24 15:58 UTCA title's
Mapof a resource that is not in unified memory went to the PC'sMapfirst and took the title address only after that failed. On a resource in a DEFAULT heap, in a custom heap without CPU pages, or a reserved one, the PC'sMapis an invalid call: the debug layer reports error 822 or 824 for each one.res_mapnow goes straight to the title address for those. Reserved resources are known from their creation, becauseGetHeapPropertieson one is an invalid call as well (901).What is in it
crates/xcl/src/hle/d3d12x/real.rs:res_mapcalls the PC'sMaponly whenpc_can_map: the resource is not reserved, and its heap is UPLOAD, READBACK or a custom heap with CPU pages (pc_mappable). Otherwise it gets E_INVALIDARG, as from the runtime, and takes the existing title-address fallback.CreateReservedResource/CreateReservedResource1keep what they made with its description (RESERVED); the lastReleaseforgets it. A resource counts as reserved only while its description still matches, so an address a later resource reuses without the lastReleasehaving been seen does not keep that resource from the PC'sMap.only_resources_with_cpu_pages_go_to_the_pc_mapon a real device: upload, readback and write-back custom buffers go to the PC'sMap; a DEFAULT buffer, a NOT_AVAILABLE custom buffer and a reserved texture do not, and the PC'sMapof the DEFAULT buffer fails. An upload buffer at an address with a stale reserved entry still goes to the PC'sMap.Tested
cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware: no wave64)XCL_D3D12_DEBUG=1for 170 s, the same local build before and after (main6efdabcplus two local changes that get it through world loading on this card: compute programs of 768 KB of DXIL or more get the fallback CS, and the title's watchdog thread is parked):cf244b0;7d834d4adds only the description check)XCL logs at most 8 messages of one id, so 8 means 8 or more.
Regression run
main:
PR:
Not tested
CreateReservedResourcecalls (the sparse windows, one cube intitle_textures) are not inRESERVED. A titleMapof one of those (not seen here) asks for its heap instead, which the debug layer reports as 901 rather than 824; the outcome is the same title-address fallback.AI use
🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-24 11:38 UTC · original
Independent Windows 11 check at 7d834d4 on an RTX 3080 Ti (621.35). The offline workspace build and the stock Map test passed.
With Graphics Tools enabled, native Map controls for a DEFAULT buffer and a reserved texture failed with D3D12 messages 822 and 824 respectively. The same objects mapped through XCL to the expected synthetic title address and byte. Both wrapped Map/Unmap pairs and a normal UPLOAD-buffer control left the info queue empty. The device stayed healthy.
Synthetic resource tests only. AI-assisted. Codex (GPT-6) wrote and ran the scratch fixture.
@ofc0urse on GitHub · 2026-11-24 11:40 UTC · original
Thanks for the independent check on the 3080 Ti – good to see the same 822/824 controls and a clean info queue through XCL on a second NVIDIA card.
@bjarngard on GitHub · 2026-11-24 13:48 UTC · original
Test report for head
7d834d4(AMD)Tested
XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPEDonly_resources_with_cpu_pages_go_to_the_pc_mappassed when run alone on the AMD adapterNot tested: retail titles (no smoke run), RDNA3/RDNA4.
AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
@srcamarda on GitHub · 2026-11-24 15:01 UTC · original
#1099 and #1104 on the retail title under the debug layer (AMD RDNA3, RX 7800 XT): both remove the
Maperror the title hits (id 824), and nothing else changesThe two change the same lines of
res_map, and neither had a retail run under the debug layer yet. Each was merged ontomain47efa2elocally (clean merges, not pushed): #1099 at7d834d4, #1104 at14e7230.Setup
XCL_D3D12_DEBUG=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=90, Enter (= A) at 30 / 40 / 50 s. One run per build, in the order main, #1099, #1104.Tests
cargo test --workspace --no-fail-fast -- --test-threads=4: main + #1099: 742 passed, 0 failed, 41 ignored; main + #1104: 742 passed, 0 failed, 41 ignored. NoSKIPPEDlines.only_resources_with_cpu_pages_go_to_the_pc_map(#1099) andtitle_address_resource_returns_address_without_calling_pc_map(#1104) pass.Debug-layer messages in the title's run (XCL logs the first 8 of each id, so 8 means "8 or more")
Mapof a reserved resource), from 4.8 sMapof a DEFAULT-heap resource)COPY_SOURCE, #958 / #993)On this title in 90 s, the two are equivalent. The case where they differ, a DEFAULT-heap resource with no title address (822, which #1099 covers and #1104 does not), did not come up in these runs, so they cannot tell the two apart.
Not tested
main47efa2e.Claude Code (Claude Opus 5.5), from runs on the hardware above.