D3D12.X: return title address in Map before calling PC Map (#940) #1104
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!1104
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1104/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?
@b3IKK on GitHub · 2026-11-24 11:38 UTC · original
b3IKK:d3d12x/map-title-address-before-pc→main· +120 −18 · 1 files · 1 commits · closed without mergingPart of #940.
res_mapcalled PCID3D12Resource::Mapbefore checkingtitle_textures::addressandTITLE_ADDRESS. Resources placed at a title address (reserved resources invram::place/vram::place_pagesorD3D12_HEAP_TYPE_DEFAULTarenas/committed textures) and textures with a title address always fail PCMap, raising D3D12 debug layer errors (#940 id824on reserved resources andMAP_INVALIDHEAPonDEFAULTheaps) before falling back to returning the title address.Checking
title_textures::addressandTITLE_ADDRESSbefore forwarding to PCMapreturns the title address directly and records the resource inUNMAPPABLEsores_unmapskips PCUnmapas well. Plain PC resources continue to forward to PCMap/Unmap.Note on docs:
HANDOFF.md("Retail game bring-up", open items) mentions the debug layer'sMapof aDEFAULT-heap resource; this fixes that path for resources tracked intitle_textures/TITLE_ADDRESS.What is in it
crates/xcl/src/hle/d3d12x/real.rs: checktitle_textures::addressandTITLE_ADDRESSinres_mapbefore calling PCMap; add unit testres_map_tests::title_address_resource_returns_address_without_calling_pc_map(fails before the fix withPC_MAP_CALLS == 1, passes after with0, plus plain PC resource control).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, Agility SDK 1.620.2, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib res_map_tests: 1 passed, 0 failed (verified failing before the fix)Regression run
main:
PR:
Not tested
XCL_D3D12_DEBUG=1run on the retail title (Windows Graphics Tools optional feature is not installed on this machine, so the D3D12 debug layer did not activate)AI use
real.rs, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.@mynzjerko on GitHub · 2026-11-24 11:53 UTC · original
Tested on native Windows + AMD RDNA4: the unit test and full workspace suite passed. (Note: no retail title run was performed here, so the #940 debug-layer scenario on a real game was not exercised.)
Tested
14e7230ef8213d5d77e0d73726f1997ad113c71332.0.32029.2010), AMD Ryzen 5 7500F, Windows 11 Pro 10.0.26300,rustc 1.100.0(stable-x86_64-pc-windows-msvc), DXC1.9.2602.17, debug buildcargo build --workspace: okcargo test -p xcl --lib -- title_address_resource_returns_address_without_calling_pc_map res_map --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignoredcargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (xcl --lib: 699 passed, 0 failed, 21 ignored;SKIPPEDGPU tests: 0)Not tested
scripts/smoke.ps1) / live D3D12 debug layer repro of #940, NVIDIA / Intel GPUs, Linux / Wine, release buildAI use
@ofc0urse on GitHub · 2026-11-24 11:56 UTC · original
Heads-up: #1099 changes the same lines of
res_map, so whichever of the two lands second will conflict.How they differ:
CreateReservedResourcereturns),DEFAULTheaps andCUSTOMheaps withCPU_PAGE_PROPERTY_NOT_AVAILABLEnever reach the PCMap. This also covers aDEFAULT-heap resource that has no title address.DEFAULTresource without one still goes to the PCMapand still raises 824 / MAP_INVALIDHEAP. A CPU-visible resource that has a title address now gets the title address instead of the PC pointer.On an RTX 4060 Ti with the debug layer, #1099 took ids 822/824/901 from 8/8/0 to 0/0/0. I have not run #1104.
@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.
@b3IKK on GitHub · 2026-11-24 17:25 UTC · original
Closing: superseded by #1099 which landed on main.
Pull request closed