D3D12.X: title texture uploads run on the title's queue and wait for its page mappings #2558
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!2558
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2558"
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?
@treybertram06 on GitHub · 2026-11-25 22:55 UTC · original
treybertram06:title-queue-uploads→main· +329 −54 · 3 files · 2 commits · openSupersedes #455 (@Cattn). That PR has had no update from its author since 2026-11-24, and it no longer merges into
main. This carries its commit forward unchanged in substance, with Cattn's authorship kept, rebased onto currentmain. It adds the fix for a race the reviews and runs found in it.Title texture uploads go on the queue of the submit that needs them (
ExecuteCommandLists/KickoffXon a DIRECT queue), ahead of the title's lists, instead of on XCL's upload queue followed by a CPU wait (#455's description has the rest). With uploads on the title's queue, nothing made that queue wait for the texture page mappings, which XCL's own upload queue waits for (vram::before_execute). A texture created on another thread afterrefresh_once's wait, or the levelsmap_levels_with_texelsmaps right before the copies, could therefore be copied into tiles whoseUpdateTileMappingshadn't run yet on the page queue.On an RTX 3080 that was a copy-engine write page fault and a hung device in the retail title's world load:
DmaPageFaultWrite | EngineResetRequired4.6 ms beforeVidSchErrorHardwarePageFaultin a DxgKrnl trace. This is the one in my Aftermath report on #1452.What is in it
D3D12.X: title texture uploads run on the submitting queue, without a CPU wait(gpu/texture.rs,hle/d3d12x/title_textures.rs). This is #455's commit by Cattn, rebased ontomaine1d84b7. The two conflicts intitle_textures.rswere with code added onmainsince. Both sides are kept:seed_stream_recheckruns beforeupload_all, which takes the title queue;main's stream recheck andbatch_fits/BATCH_ITEMScaps come before #455'sON_QUEUE/submit_on_title_queue.D3D12.X: a title-queue texture upload waits for the page mappings first(hle/d3d12x/title_textures.rs, test hooks inhle/d3d12x/vram.rs):submit_on_title_queuecallsvram::before_executefirst.gpu_a_title_queue_upload_waits_for_the_page_mappings_before_it. It records a page mapping, uploads on a title queue, and checks the queue waited for that mapping. Without the wait it fails (waited 0, needed 1).#455's review points
mainthis is covered bylate_release. The title's lastReleaseof a resource is held until a fence value signalled on every known title queue (present::known_queues), the sparse queue and the upload queues has been passed. An upload submitted on the title queue before that release is ahead of the fence on the same queue, so the texture can't be destroyed under the copy. This also avoids holding the destinations inInFlight, which @ozimchuk measured breaksplaced_title_textures_share_vram_and_preserve_pixelsby moving a shadowed placement's reactivation to a laterreclaim. I checked this by readinglate_release.rs; I didn't add a test of it here.Tested
cargo test -p xcl --lib title_textures -- --test-threads=1: 22 passed, 0 failed. The new test fails without the wait.cargo test --workspace --no-fail-fast -- --test-threads=4(XCL_DXC_DIRset to DXC 1.9): 1426 passed, 0 failed, 46 ignored.SKIPPED:no wave64;no heap windows;XCL_DIRECT_DXIL=1 XCL_UMA_SHADOW=1): page-fault device removals (0x887a0006, nvlddmkm 153) in 3 of 4 runs without the wait, 0 of 7 with it. The silent0x887a0005that remains in those runs is the 512 MB driver shader-code heap of #2403, not this.Regression run
Not tested
Releaseis held behind an in-flight title-queue upload (reasoned fromlate_release, above).AI use
@DarkPanda69 on GitHub · 2026-11-25 23:15 UTC · original
AMD run (listed as untested) on an RX 9070 XT, plus an RTX 3060: all 3 new GPU tests pass on both cards, with no skips.
Head
2dc76acapplied onmain08db802, debug, Windows 11 Pro 26200,cargo test -p xcl --lib -- title_textures --test-threads=4, card chosen withXCL_ADAPTER(the tests take the backend device,real::device_raw()):gpu_uploads_on_the_title_queue_run_before_its_later_work_and_are_released,gpu_a_title_queue_upload_waits_for_the_page_mappings_before_itandgpu_an_upload_still_running_is_kept_when_its_wait_times_outok.Not tested: the whole suite with this PR, Intel, Linux / vkd3d-proton, a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 23:19 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.Thanks!
— Devin
@fromthemoonx on GitHub · 2026-11-25 23:22 UTC · original
D3D12 debug-layer check: the three new GPU tests run clean under the layer (only the exit-time live-object report), and the e2e title's messages are the same as
main's. It adds the layer to the RTX 3080 / 3060 runs above.Tested:
2dc76acmerged ontomain08db802(clean). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug, Graphics Tools (D3D12 debug layer) installed.gpu_uploads_on_the_title_queue_run_before_its_later_work_and_are_released,gpu_a_title_queue_upload_waits_for_the_page_mappings_before_it,gpu_an_upload_still_running_is_kept_when_its_wait_times_out, each withXCL_D3D12_DEBUG=1(D3D12: debug layer enabledin the output)id 0live-object lines at process exite2etest_title_draws_with_a_root_signature_under_the_debug_layer, merged vsmain08db802The e2e title's log doesn't show whether it takes the title-queue upload path, so the three tests are what checks the new code here.
Not tested: the whole suite (DarkPanda69 and the description cover NVIDIA), a title, a release build.
AI use: Claude Code (Claude Opus 5.5) ran the debug-layer checks and wrote this report.
@luckyteagirl on GitHub · 2026-11-26 01:37 UTC · original
RX 6800M focused GPU report for #2558: the title-queue upload mapping-wait regression passes on this RDNA2 card.
Setup: clean detached head
2dc76ac89461198bc502f26bd6088eed26a3f521; Windows 11 Home build 26200; Ryzen 9 5980HX; AMD Radeon RX 6800M, driver30.0.13002.13003; Rust 1.99.0 MSVC, debug lib-test build with its own Cargo target.XCL_ADAPTER=6800MandXCL_REQUIRE_GPU=wave64were set. The run log confirmsbackend 'real' – AMD Radeon RX 6800M (11987 MiB VRAM)and the tiled-resource page queue/fence path.Tested:
cargo test --locked -p xcl --lib -j 1 hle::d3d12x::title_textures::tests::gpu_a_title_queue_upload_waits_for_the_page_mappings_before_it -- --exact --test-threads=1 --nocapture, under a free-memory guard: 1 passed, 0 failed, 0 ignored, 0 measured, 1326 filtered out, 0.65 s; noSKIPPEDline and no guard stop. The fixture checked that the title queue waited for the mapping-fence value before the upload and completed a 64×64 texture upload/readback.Limit: The fixture's test helper signals the page-mapping fence but does not itself issue
UpdateTileMappings, so this verifies the queue-wait ordering and GPU upload/readback rather than a physical tile-mapping race. I did not run the full suite or a title smoke pair. DXC was configured but this fixture did not compile a shader. No game files were used.AI use: Codex (GPT-6) and a Codex Luna subagent prepared the clean worktree, ran the guarded focused test, checked the log and source coverage, and wrote this report.
@itsSio on GitHub · 2026-11-26 03:24 UTC · original
Independent dual-PC NVIDIA full-workspace test report on clean head
2dc76ac89461198bc502f26bd6088eed26a3f521.Tested
32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200.9974,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug buildcargo build --workspace: exit 0 (1dead_codewarning invram.rs:1110)cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1426 passed, 0 failed, 46 ignored (all 22title_texturestests passed)SKIPPED: 26 (wave64-only GPU tests,#1426wave32 f16/cvt refusals, no heap windows,pso_measurementdriver-cache disable0x887A002D)32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200.8653,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11, debug buildcargo build --workspace: exit 0 (3 warnings)cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1426 passed, 0 failed, 46 ignoredSKIPPED: 29 (same 26 as Machine 1 plus 3 requiringd3d12SDKLayers.dll)Not tested
scripts/smoke.ps1runs--release)AI use
Ran via Samaritan:
@pickles976 on GitHub · 2026-11-26 04:57 UTC · original
First Wine/NVIDIA verdict for the mapping-wait fixture, now that a diagnostic stack can run it. Head
2dc76ac89461198bc502f26bd6088eed26a3f521, RTX 4060 Laptop GPU 8 GiB, Wine 11.0, NVIDIA 590.48.1,--locked --target x86_64-pc-windows-msvc, one test thread, freshCompiling xcl .../xcl-pr2558/...provenance.On stock vkd3d-proton 3.2.0 this fixture aborts before its body:
ID3D12Fence1 – 12 PC methods, 10 internal slots under the guardthenAssertion failed: iface->lpVtbl == &d3d12_fence_vtbl (vkd3d_private.h:705)— the #175 identity wall, which is why my earlier report could make no pass/fail claim for the GPU leg.On a relaxed diagnostic build of the exact same provenance commit (
2576c0b4adfae4a,-Db_ndebug=true+ the twofrom_ifacerelaxations described in #175, local-only, not proposed anywhere),gpu_a_title_queue_upload_waits_for_the_page_mappings_before_itpasses 1/1 (0.86 s, 0 ignored) on the real adapter: the upload waits for the title queue's page mappings ahead of it and the fixture's readback checks hold.Scope: this verifies the fixture's own assertions under Wine/vkd3d-proton, not retail title behavior, and the relaxed DLL means the identity checks that stock builds enforce were absent — it removes the abort, it does not validate XCL's vtable patching against a stock runtime. Log:
.compat-xcl/logs/verify-pr2558-wine-mapping-wait-relaxed.log(local). AI-assisted verification and report (OpenAI Codex).@SlopTart on GitHub · 2026-11-26 05:04 UTC · original
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite (cold cache): 168 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.The three new upload-queue tests (
gpu_uploads_on_the_title_queue_run_before_its_later_work_and_are_released,gpu_a_title_queue_upload_waits_for_the_page_mappings_before_it,gpu_an_upload_still_running_is_kept_when_its_wait_times_out) ran inside the suite: passed (suite gained 3 passes over main).Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@luckyteagirl on GitHub · 2026-11-26 06:37 UTC · original · reviewed
Both error branches run after
texture::submit_batch()has submitted the upload list. IfCreateFenceorqueue.Signalfails, they calltexture::wait(dev, queue)?; that recovery wait can also fail (including its 10-second timeout), so?returns and dropsfwithout proving the queued copy finished.fowns the staging resource and command allocator used by that copy. Microsoft's D3D12 synchronization guidance requires those objects to remain valid until GPU work is done. Could the retirement fence be established before submission where possible, and could a failed recovery wait retain/quarantinefinstead of dropping it? A blocked-queue fault injection (submit, fail fence setup or signal, let recovery time out, then unblock) would cover this path. The normal success path and the new mapping-wait tests do not exercise it.Exact-head source review of
2dc76ac89461198bc502f26bd6088eed26a3f521; I did not force a device/fence failure or run a title on this head. AI-assisted review with Codex.github-bot referenced this pull request2026-11-26 08:59:16 +00:00
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.