D3D12.X: stop sparse upload_dirty ring wait when fence times out #1277
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!1277
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1277"
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?
@ExoCalibra on GitHub · 2026-11-24 14:08 UTC · original
ExoCalibra:pr/sparse-upload-wait-timeout→main· +110 −5 · 1 files · 1 commits · opensparse::State::wait_forreturns after 5 s with a warning if the sparse upload queue stalls, butupload_dirtycalledwait_for(fv)inside awhileloop waiting for staging ring space. When the oldest in-flight fence failed to advance,reclaim_ringfreed nothing andupload_dirtylooped forever while holding the globalSTATEmutex, hangingxcl-activity(sparse::pool_bytes) and every subsequent submit thread permanently.What is in it
crates/xcl/src/hle/d3d12x/sparse.rs: return whetherwait_forreached its target fence value, break out ofupload_dirtywith a bounded warning on timeout soSTATEis released cleanly, and add GPU regression testupload_dirty_exits_when_ring_fence_wait_times_out.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), debug (scripts/test.ps1) + release (cargo build --release -p xcl)..\scripts\test.ps1(cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored.SKIPPEDGPU tests on this adapter: 2 (no wave64—gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).Regression run
Main (
67a3735):PR (
0f66820):Not tested
upload_dirty_exits_when_ring_fence_wait_times_out) and did not trigger during the healthy 60 s retail smoke run.XCL_SAMPLE_*tests on local sample files (not set).AI use
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@DavidM1911 on GitHub · 2026-11-24 14:10 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib sparse: 17 passed, 0 failed, 1 ignored.Thanks!
@futurepro62 on GitHub · 2026-11-24 14:38 UTC · original
Full-suite run to go with the subset check above. Tested exact head
0f66820(on its base47efa2e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.upload_dirty_exits_when_ring_fence_wait_times_out.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@WebIdentity1 on GitHub · 2026-11-24 17:08 UTC · original · edited 2026-11-24 17:13 UTC
Independent native recovery check: this branch reproduces the dropped-upload risk already described by #1385's author. Exact head
0f66820065129bca1e0cd7f3ae0125e140d835f3; exact parent47efa2ecea0a12934719ae69b81930cf02a4b1c3.Tested
The same fixture used for #1495, unchanged (SHA256
1fd8f7d154e9663b25d9fe98153fccd2bc8de5291db5aa24414e48f3ddfaa958): fill the real64MiB staging ring behind a controlled queue fence with0x11, change a4KiB page to0x22, wait through the actual5-second timeout, release the gate, explicitly retry that same dirty page, then read all1,024words from the GPU. A six-second recovery guard lets the parent finish without an infinite wait.No skips or harness timeouts. Head exits101 on the byte assertion; parent exits0. All wrong head words are the old0x11111111. Head ring_write stays67108864 through timeout and retry; parent advances to67112960. Invalidating only the page's
senthashes and explicitly retrying the unchanged bytes yields0wrong on both GPUs. Queue drain/device-removal checks succeed; cleanup occurs before the failing assertion.scan_pageupdates the hashes before upload, and the new early return loses the remaining bytes whilebefore_executeclears its dirty runs. The next same-page retry sees matching hashes and stages nothing. Invalidation alone is not a complete fix: normal write-watch scans reset their records, so the next dirty-page list need not include the page. Retain pending uploads or propagate the failure. #1385 already proposes keeping pending work while releasing STATE during waits; native validation of that alternative now passes the byte-recovery and existing lock-progress tests on RTX3090 and AMD, with exact-parent controls. These focused results do not establish full merge readiness.Fresh process for each run,
XCL_ADAPTER=3090/AMD:cargo test --locked -p xcl --lib timed_out_sparse_upload_retries_unsent_bytes -- --test-threads=1 --show-output --nocaptureWindows10 Home19045, Ryzen7 7800X3D, RTX3090 driver591.74 / AMD Radeon integrated32.0.21030.2001, Rust1.98.1 MSVC, Agility1.620.2, debug, SSH Session0. All222source-file hashes match each tree; parent/head differ only in sparse.rs, plus identical diagnostic wiring. Restored head verified. Patch reverse-apply and diff checks pass.
Not tested
Full workspace with this fixture, retail /
xcl-smoke, actual device loss, partial multi-run suffixes, release, Linux/Wine. The existing timeout test demonstrates bounded return; this additional test checks recovery bytes. The parent control does not endorse repeated waits under STATE. Run alone because the fixture initializes sparse globals. No competing runtime implementation or PR.AI use
Codex (GPT-6) inspected the overlap, adapted diagnostic wiring, ran tests and prepared this report. Synthetic bytes/public source only.
Complete diagnostic patch against0f66820
@xpatfussy69x on GitHub · 2026-11-25 11:42 UTC · original
Test report for head
0f66820as pushed (not merged onto currentmain) – NVIDIA, wave32.Tested
.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignoredupload_dirty_exits_when_ring_fence_wait_times_outran and passedXCL_SAMPLE_*data set (game-data tests not run)Not tested
mainAI use
@4usphs on GitHub · 2026-11-25 11:52 UTC · original
AMD run on the exact head
0f66820(0f66820065), as pushed on its base47efa2e(not merged onto currentmain), on two AMD adapters with native 64-lane waves: RDNA4 and the console's generation, RDNA2.Tested
XCL_TRANSLATED_CACHE=0; adapter picked withXCL_ADAPTER.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:gfx1036), driver 32.0.21045.29003: 742 passed, 0 failed, 41 ignoredSKIPPEDtests on either adapter.upload_dirty_exits_when_ring_fence_wait_times_outruns and passes on both adapters.Not tested
AI use
@ClosetPie107 on GitHub · 2026-11-25 12:19 UTC · original
Linux / AMD RDNA4 (RADV) test report for head
0f66820merged locally ontomain1a0bbe3(clean merge).Environment
experimental-11.0-20261112), vkd3d-proton v3.1 (#257+dxil-spirv53aac418), DXVKv3.1.1-209, DXC1.9.2609.5,x86_64-pc-windows-gnucross-compileTested (debug test binary under Wine,
XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64,--test-threads=1 --nocapture)hle::d3d12x::sparse: 16 passed, 0 failed, 1 ignored (early_commit_timing), 0 skipped (2.31 s), includingupload_dirty_exits_when_ring_fence_wait_times_outon RX 9070 / RADV.Not tested: full workspace suite, retail title run, native Windows.
AI use: T3 Code / Antigravity (Gemini 4 Neon) merged, built, ran the tests on this machine, and drafted this report.
@oni-swr on GitHub · 2026-11-25 13:19 UTC · original
AMD RDNA3 (native wave64) test report for exact head
0f66820065129bca1e0cd7f3ae0125e140d835f3, as pushed on its base47efa2e(not merged onto currentmain).Tested
cargo build --workspace: okupload_dirty_exits_when_ring_fence_wait_times_out: 1 passed;sparsefilter: 17 passed, 0 failed, 1 ignoredcargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored (summed over all test binaries)Not tested
scripts/smoke.ps1regression run (synthetic GPU/unit tests only)main; other GPUs (NVIDIA / Intel / RDNA2 / RDNA4)AI use: Claude Code (Claude Sonnet 5.5) ran the build and tests and wrote this report; the numbers are from the runs above.
@DavidM1911 on GitHub · 2026-11-26 04:40 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
github-bot referenced this pull request2026-11-26 12:40:17 +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.