D3D12.X: sparse upload lists move the windows they copied into back to COMMON #1536
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!1536
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1536"
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?
@dhanush2412 on GitHub · 2026-11-24 17:22 UTC · original
dhanush2412:d3d12x-upload-barrier→main· +37 −2 · 1 files · 1 commits · draftPart of #1452. With
XCL_D3D12_DEBUG=1a 130-170 s run of the retail game (retail title 1.0.2.1, Series X) reports 2,569 xINVALID_SUBRESOURCE_STATEonIASetIndexBuffer(the buffer is inCOPY_DEST, "promoted from COMMON", needsINDEX_BUFFER) and a few dozen onIASetVertexBuffers. The sparse upload lists (sparse.rs,upload_dirtyand the zero fill) copy into the window buffers; the copy promotes a window from COMMON to COPY_DEST, and a write state does not decay at the end ofExecuteCommandLists, so the title's own lists find it there. This records which windows an upload list copied into and, before it is closed, moves them from COPY_DEST back to COMMON. Off by default (XCL_UPLOAD_BARRIER=1).What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:UploadSlot.touched(a bit per window),upload_barrier()(the switch), the barrier insubmit_slot, andtouchedset at the twoCopyBufferRegionsites.Tested
cargo test --release --workspace -- --test-threads=4: 776 passed, 0 failed, 41 ignored (SKIPPED GPU tests on this adapter:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows))XCL_PRESENT_SRC_BARRIER=1as well, see the sibling PR):IASetIndexBuffererrors 2,569 -> 892 (the rest come from a copy path this does not cover), allINVALID_SUBRESOURCE_STATE8,808 -> 1,127. The device is still removed at the end of that run (#1452), so this does not fix that.Regression run
main:
PR:
Not tested
AI use
@crosettiremi on GitHub · 2026-11-24 17:50 UTC · original
Windows RX 7900 XT, Series X retail profile. I applied
a780e1dby itself to a downstream XCL build with the sparse-release, streaming and partial-readback fixes. Release build. XCL_UPLOAD_BARRIER=1, DRED on, 28 GiB whole-job limit. The present-source barrier was absent.The game passed the Player1 picker after a second scripted A, displayed loading artwork and streamed assets. Last positive present interval 299.155 s. Device removal at 302.892 s (0x887a0006), DRED page fault at GPU VA 0xd79c28000 with no matching existing or recently freed allocation. Peak sampled process commit 28,433 MB. The final capture was dark. The previous build without this patch ended in a guest watchdog after 258 s. Input timing differed substantially, so elapsed times do not establish a performance improvement.
This tests the opt-in path on AMD. The D3D12 debug layer was off, so this run cannot compare your index/vertex resource-state error counts.
@srcamarda on GitHub · 2026-11-24 18:14 UTC · original
#1535 and #1536 on AMD RDNA3 (RX 7800 XT) with the debug layer: #1535 removes the presenter's errors here too (~4 500 → 0); #1536's case does not come up on this card in 150 s; no fps drop in either setting
Both PRs were merged together onto
main9e3831elocally (clean merges, not pushed; local merge commit944fc18). Each switch was then turned on alone and together.Setup
XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=150, Enter (= A) at 30 / 40 / 50 s (title screens into the start of loading).Debug layer (
XCL_D3D12_DEBUG=1). XCL logs only 8 messages per id, so for these five runs both builds carried the same local diagnostic, not part of either PR: every debug-layer message counted by id, call and actual state, printed at the end of the run. Totals over 150 s:mainXCL_PRESENT_SRC_BARRIER=1XCL_UPLOAD_BARRIER=1CopyResource, source inRENDER_TARGETClearRenderTargetView, inCOPY_SOURCECopyTextureRegion, source inNON_PIXEL|PIXEL_SHADER_RESOURCE(0xC0)IASetIndexBuffer/IASetVertexBuffersNo device removal or crash in any of the five.
CopyResourceand the title's nextClearRenderTargetViewboth go to 0 on this card as on the RTX 3060.IASetIndexBufferinCOPY_DESTcase on this card in these 150 s, not even onmain, so these runs show neither the fix nor a regression. Your 130–170 s runs reach further into the world load than mine.CopyTextureRegionwith its source in a shader-resource state (0xC0), about 200–320 per run. The ids outside 538 are the same in every column: 745 (simultaneous-access / buffer still referenced onExecuteCommandLists/UpdateTileMappings), 677, 679, 680, 1047, 1422.Smoke runs, no debug layer (
scripts/smoke.ps1 -Seconds 60, interleaved, two rounds):main9e3831eNo device removal or crash. The drop in your PR smoke block (presents 42 22 8, peak commit +3.3 GB, with the switch off) does not reproduce here.
Tests:
cargo test --workspace --no-fail-fast -- --test-threads=4on the merged tree: 776 passed, 0 failed, 41 ignored, with the switches unset and with both set to 1.SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows), in both.Not tested
Claude Code (Claude Opus 5.5), from runs on the hardware above.
@DavidM1911 on GitHub · 2026-11-24 19:05 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.Thanks!
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.