D3D12.X: read back sparse-window Wait64BitValueX counters during CPU waits #1044
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!1044
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1044"
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?
@xroneyaa on GitHub · 2026-11-24 10:48 UTC · original
xroneyaa:d3d12x-wait64-sparse-readback→main· +163 −0 · 2 files · 1 commits · openWhen a
Wait32/64BitValueXfalls back to CPU polling (PendingWait::wait_until_satisfied) for a counter inside a sparse VRAM window, CPU memory only holds the last uploaded/copied-back value while GPU writes live in sparse VRAM. This reads back[va, va + width)from sparse VRAM (sparse::readback_now) before spinning and at 10 ms intervals during the sleep loop (plus a final readback on timeout). Addresses item #2 measured in#505(and keeps coherent-window / heap addresses lock-free on the fast path viauma::is_sparse). Part of #505.What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:sparse::contains(va): checksgpu::uma::get().is_some_and(|u| u.is_sparse(va))before takingSTATEto verify an active sparse window coversva.crates/xcl/src/hle/d3d12x/list_x.rs:PendingWait::wait_until_satisfied/wait_until_satisfied_with: preserves the zero-overhead fast path when CPU memory already satisfies the wait; for unsatisfied sparse-window addresses, runssparse::readback_now(va, width)before spinning, throttled at 10 ms intervals while polling, and once on timeout expiry.pending_wait_sparse_readback_pulls_gpu_writes_and_skips_coherentverifying coherent waits never call readback and sparse waits pull delayed writes cleanly.pending_wait_reads_back_gpu_write_in_sparse_windowverifying a realCopyBufferRegioninto a sparse window buffer (invisible to CPU-only polling) is read back and satisfiesPendingWait::wait_until_satisfied.Tested
stable-x86_64-pc-windows-msvc), debug (scripts/test.ps1) and release (cargo build --release -p xcl).cargo test --workspace -- --test-threads=4(scripts/test.ps1): 729 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 (no wave64:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware)).cargo test -p xcl --lib pending_wait_ -- --test-threads=4: 3 passed, 0 failed (run 3 consecutive times with 0 flakes). Inpending_wait_reads_back_gpu_write_in_sparse_window, CPU-only polling (wait_until_satisfied_with(..., false, ...)) fails on the real GPU sparse-VRAM write beforewait_until_satisfiedpasses with sparse readback enabled.Regression run
main:
PR:
Not tested
Wait64BitValueXcounter explicitly lands in a sparse window on main (not yet triggered during our 60 s retail smoke run).AI use
#505and the D3D12.X sync/sparse implementation, wrote the fix and tests, and ran the test suite and retail smoke runs.@DavidM1911 on GitHub · 2026-11-24 11:25 UTC · original
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti + Radeon iGPU; Rust stable MSVC, debug.
cargo test -p xcl --lib wait: 15 passed, 0 failed — includes the two new testspending_wait_sparse_readback_pulls_gpu_writes_and_skips_coherentandpending_wait_reads_back_gpu_write_in_sparse_window(the latter exercises the real UMA/sparse path).AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@AlexandreSchuelter on GitHub · 2026-11-24 11:26 UTC · original
Test report on AMD (RX 6900 XT, RDNA2): no new failures, and the sparse-window GPU test runs (not skipped) and passes here.
Tested
stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2602.17;XCL_NETWORK=0,XCL_REQUIRE_GPU=wave64; no SKIPPED testscargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4:main47efa2e8fd5921) merged onto47efa2emain: the RDNA2 packed-mip failure inplaced_title_textures_share_vram_and_preserve_pixels(fixed by #470 / #1028) and its twoPoisonErrorcascades.pending_wait_reads_back_gpu_write_in_sparse_windowandpending_wait_sparse_readback_pulls_gpu_writes_and_skips_coherentpass; neither printed aSKIPPEDline (no "no GPU" / "no sparse UMA" skip).Not tested
scripts/smoke.ps1(no game here), release build, repeated runs of the new tests, Linux / vkd3d-protonmain)AI use: Claude Code (Claude Opus 5.5) fetched the branch, ran the suites and wrote this report; the runs are real, on the hardware above.
@JJAutoCompare on GitHub · 2026-11-25 05:31 UTC · original
Empirical test report (
8fd59213)Commit
8fd59213003554c868d6b8729ecdb1fb7d09a77c(PR #1044).Hardware / environment
XCL_ADAPTER=A770, Windows x64 build 26200, and an AMD Family 23 Model 113 CPU. The fixture initialized three sparse VRAM windows and a 512 MB coherent window. The GPU driver version was not recorded.rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, and Cargo's unoptimized test profile with debug info and incremental compilation disabled. The focused run usedRUST_TEST_NOCAPTURE=1.Commands and results
cargo test --workspace --no-runcompiled the workspace test binaries outside the Arc lock (exit 0).Invoke-ArcTest.ps1, ran only the two new fixtures using the prebuiltxcllibrary test executable (exit 0):Observed behavior
Not tested
The full GPU workspace suite and game smoke runs were omitted.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1044-focused.logand published.@luckyteagirl on GitHub · 2026-11-25 06:17 UTC · original
Independent native Windows AMD GPU check of exact PR head
8fd59213003554c868d6b8729ecdb1fb7d09a77c.Tested
30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.XCL_ADAPTER=6800M XCL_REQUIRE_GPU=wave64 cargo test --locked -p xcl --lib -j 2 pending_wait_ -- --test-threads=1 --show-output: 3 passed, 0 failed, 0 ignored in 1.26 s, with noSKIPPEDline.pending_wait_reads_back_gpu_write_in_sparse_window. Its log shows three sparse VRAM windows and D3D12.X UMA initialization on the RX 6800M; the GPU fixture completed. The other two wait tests passed as well.This checks the focused sparse readback regression on the PR head. I did not run a full workspace suite, a current-main merge, or a retail title phase with a sparse counter wait. No game data was used or uploaded.
AI-assisted testing and report drafting with OpenAI Codex (GPT-6); I checked the exact revision and test log before posting.
@upipibi on GitHub · 2026-11-25 18:19 UTC · original · edited 2026-11-25 18:20 UTC
NVIDIA test report for
8fd5921(head as is, base6efdabc), for #1607's NVIDIA list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, aftercargo build --workspace:cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 720 passed, 0 failed, 41 ignored. The end-to-end title tests pass.mainat0829441(not currentmain) on the same machine, same command: 1263 passed, 0 failed, 46 ignored (the PR's base is older, so it has fewer tests).hle::xaudio2, because its tests fail or hang on this machine onmaintoo. The PR doesn't touch it.no wave64on this card.AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.