D3D12.X: a list's own GPU writes land in a sparse chunk the CPU changed #3149
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3149"
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?
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T13:02:04Z.
Since #2959, land_page (
04de3234, "preserve CPU writes during sparse copy-back") keeps the CPU'sbytes for every 64-byte chunk the CPU changed since its last upload, and drops the GPU's bytes in
it. That is right for a chunk the CPU rewrote, but not when the two wrote different bytes of one
chunk. The test title's Wait32 / Wait64 at +0x300 / +0x308 and Write32 at +0x310 are such a case:
its CPU thread writes the wait cells after the submit, XCL sees the waits satisfied, the GPU writes
+0x310, and the copy-back after ExecuteCommandLists drops it (the three e2e title tests of #3093,
"post-Wait32/64 write failed (0x0)").
The copy-back after ExecuteCommandLists reads back only the intervals the lists' own commands
wrote (
sparse_writes, recorded by note_write for in-segment GPU writes). Those bytes now land ina changed chunk too, and the chunk keeps its old hash, so the next write-watch look uploads it whole,
the GPU's bytes with the CPU's. A Map readback (readback_now) still keeps a changed chunk's CPU
bytes, since its range is what the CPU reads, not what the GPU wrote.
Part of #3093.
What is in it
crates/xcl/src/hle/d3d12x/sparse.rs: +40 / -11gpu_written_bytes_land_in_a_chunk_the_cpu_changedTested
cargo test -p xcl --test e2e -- --test-threads=1on the head before the final rebase ontomain(identical tree): 5 passed, 0 failed (onmain336fddda: 3 failed, "post-Wait32/64 write failed (0x0)").gpu_written_bytes_land_in_a_chunk_the_cpu_changedand the two existingland_pagetests: 3 passed; the new one fails without the change ("the GPU's write was dropped").Regression run
Not run yet.
scripts/smoke.ps1onmainand on this head, from the same warm cache, will be run; two earlier attempts were stopped by the harness (low memory) before they started. The twoxcl-smokeblocks will be added here when they exist.Not tested
land_pagetests above only).AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T13:17:47Z.
Ran the sparse-write copy-back tests at
5f284cc2on an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
The new unit test passes. Of the five
e2etests,test_title_draws_with_a_root_signature_under_the_debug_layerandtest_title_runs_under_the_debug_layer_with_drednow pass here; both failed onmaine429936in my earlier run for issue #3093 withpost-Wait32/64 write failed (0x0). One test still fails:test_title_runs_and_game_folder_is_untouchedpanics ate2e.rs:198(Option::unwrap()on a missing window line); reproduced 2 of 2 times. I am reporting the measured outputs, not attributing that failure to the change. The PR has no comments yet.Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-28T13:36:55Z.
Test report for head
5f284cc2, run against the whole suite. With this PR the 3e2etitle tests of #3093 pass, and nothing fails that does not already fail onmain.Tested: NVIDIA GeForce RTX 3070 8 GB (driver 617.42, wave32), Intel i9-9900K, 32 GB RAM, Windows 11 Pro N 26200, rustc 1.99.0, DXC 1.8.2502.11, debug, no
XCL_*variable set. Two trees with separate target directories:maine429936c, ande429936cwith this head merged (no conflict). The D3D12 debug layer is installed, so the two debug-layere2etests ran and were not skipped.cargo test --workspace --no-fail-fast -- --test-threads=4maine429936ce429936c+5f284cc2SKIPPEDlinese2e(5 tests)test_title_draws_with_a_root_signature_under_the_debug_layer,test_title_runs_and_game_folder_is_untouched,test_title_runs_under_the_debug_layer_with_dred, allpost-Wait32/64 write failed (0x0)gpu_written_bytes_land_in_a_chunk_the_cpu_changedmain:dispatch_chain_oversized_loop_matches_whole,dispatch_chain_wave32_live_loops,dispatch_chain_wave64_live_loops_and_exchange,gpu_heap_flat_reads_match_guarded_and_root_output,gpu_compute_mode_dispatch_abi,gpu_float_cas_uses_ieee_equality.cargo test -p xcl --test e2e -- --test-threads=1on the merge: 5 passed, 0 failed, 3 runs out of 3. Onmain: 2 passed, 3 failed (post-Wait32/64 write failed (0x0)). Heretest_title_runs_and_game_folder_is_untouchedpasses in all three runs.gpu_writtenare the lists'sparse_writes.readback_after_execute_lockedmerges only overlapping or adjacent ones, andreadback_rangescopies exactly those bytes page by page. So a changed chunk gets only the bytes the GPU's commands wrote, and the CPU's other bytes in it stay.readback_now(Map) keeps the old behaviour (false). I found nothing to change.mainhas since moved toe13d6250(#1809, #3102, #1873, #1908; none of them touchessparse.rs). This head merges into it without conflict; I did not rerun the suite there.Not tested: a smoke or title run (the regression run the PR still needs), a release build, AMD and Intel GPUs, wave64 hardware.
AI use: Claude Code (Claude Opus 5.5) ran the merge, builds and tests, reviewed the diff, and wrote this report.