Repository navigation
Conversation
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
Hardware test report — commit
|
GonZiin
left a comment
There was a problem hiding this comment.
The final Release can still wait for STATE when the resource owns its sparse UMA allocation. place_console_buffer_sparse records that resource with owned = true. After the new non-blocking forget_buffer, res_release removes the entry from UMA_BUFFERS and calls sparse::free → decommitted → STATE.lock(). This is a separate lock acquisition from the one this PR removes.
Tested
- Head
b3fb51cfbde3f95947c4d7c59cf6fe278d2ba11f, Windows 11 Pro build 26300, Ryzen 7 7800X3D, Rust 1.100.0 MSVC, debug. UsedXCL_LATE_RELEASE=0andXCL_COHERENT_MB=16in an isolated checkout. cargo test -p xcl --lib a_released_buffer_is_forgotten_while_the_state_is_locked -- --nocapture --test-threads=1passed (1 passed, 0 failed, 0 ignored).cargo test -p xcl --lib review_last_release_of_owned_sparse_buffer_does_not_wait_for_state -- --nocapture --test-threads=1ran a temporary probe using the actualres_releasewrapper, a mock COM last-release callback, and a real sparse UMA allocation. WithSTATEheld, the untracked control returned. The owned sparse release timed out after 400 ms and finished once the lock was released (0 passed, 1 failed, 0 ignored).
Please narrow the claim to the placed-buffer bookkeeping, or cover the owned sparse path too. If decommit is deferred, the reservation must stay unavailable for reuse until decommit finishes.
Not tested
Retail title behavior and the default late-release setting.
AI use
Codex (gpt-6.2-sol) traced the call path, wrote and ran the probe, and drafted this review.
|
Test report: RTX 4060 (NVIDIA, 32-lane), Tested
Not tested: no thread dump of the frozen AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and runs, symbolised the thread dump and wrote this report. The runs are from the machine named. xcl-smoke blocks (main, then this PR; round 1)xcl-smoke blocks (round 2) |
…README Integrates 10 open upstream PRs on top of upstream/main (c160d86): - xcl-dev#1643: per-queue cpu_writes worker threads (eliminating cross-queue head-of-line stalls) and atomic 64-bit immediate writes - xcl-dev#1618: skip DXC validator where the runtime accepts the BYPASS hash - xcl-dev#1535, xcl-dev#1536: PresentX COPY_SOURCE barrier and sparse upload COMMON state transitions - xcl-dev#1516: route stream graphics PSO creation through tracked path - xcl-dev#1478: avoid taking sparse state lock on resource final Release - xcl-dev#1473: implement S_QUADMASK_B32 and S_QUADMASK_B64 - xcl-dev#1621, xcl-dev#1625: frame clock revalidation and short uncompressed DirectStorage request zero-padding - xcl-dev#1557: accept no buffer context before Start in XMA2 voice test under Wine Verified under GE-Proton11-14 + vkd3d-proton ec20719452e916b: - Release build (x86_64-pc-windows-msvc): ok (32.14s) - Proton unit tests (heap_window_tests, dxil::core_tests, cpu_writes, frame, sparse, present, dstorage, xma2_source_voice, gpu_sparse_vram_descriptors_buffers_and_xmem, gpu_valu_float_and_int): 71 passed, 0 failed, 2 ignored, 0 skipped.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
…lock A retail title's frame loop releases resources every frame. Each last Release goes through real::res_release to sparse::forget_buffer, which took the sparse state's lock. Other threads hold that lock across GPU waits (readback_now -> State::wait_for, 5 s at a time) and across UpdateTileMappings in map_tiles. When the sparse queue stopped moving (story load with XCL_PSO_WAIT_MS=50, RTX 5070 Ti), thread dumps showed the frame-loop thread in Mutex::lock_contended <- forget_buffer <- res_release from 162 s to the end. Its heartbeat stopped, and the title's stall check ended it at 186.7 s (xcl-dev#505). forget_buffer now queues the buffer and only tries the lock. The lock's next holder applies what is queued: in before_execute (every submit), in take_tile before a new pool is made, and in place_buffer before and right before a new buffer is recorded under an address that may have been in the queue. With no sparse state the queue is cleared. Until a queued release is applied, its tiles stay pinned, which only keeps them from being reused. Not covered: a resource that owns its sparse unified-memory block still reaches sparse::free -> decommitted from res_release, which takes the same lock (found in review). Test a_released_buffer_is_forgotten_while_the_state_is_locked fails on main after its 5 s (forget_buffer waited for the lock). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b3fb51c to
792c69a
Compare
|
@GonZiin thanks, you're right, and thanks for the probe. The title claimed more than the change does:
AI use: Claude Code (Claude Opus 5.5) made the change and wrote this reply. |
|
This also fixes a second path into the same deadlock: with Thread dump ( I wrote the same change locally before finding this PR ( So, as a data point: the same approach removed the Edited: corrected claims I had not verified (every start, story load, GPU page fault). Analysis and text written with AI assistance. |
|
Two contributors checked independently and found that #1697 solves the same problem (for #505) in a different way: #1607, group D42. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Closing in favour of #1697 (@shzyjbr06-dev), which covers everything this PR does and more: the same non-blocking What was measured on this PR, in case it helps #1697's review, since the mechanism is the same:
Thanks everyone who tested and reviewed. AI use: Claude Code (Claude Opus 5.5) compared the two PRs and wrote this comment. |
A placed buffer's last
Releaseno longer waits for the sparse state's lock. In a retail title's story load, the frame-loop thread blocked there behind threads that held the lock across GPU waits and a tile mapping on a stalled sparse queue. Its heartbeat stopped and the title's own stall check ended the run (+0x23cf683). Measured and symbolised in #505 (comment). Part of #505.What is in it
crates/xcl/src/hle/d3d12x/sparse.rs, one commit:forget_buffer(called byreal::res_releasefor every resource) queues the pointer on a newFORGETlist and only triesSTATE. If it gets the lock, it applies the queue, or clears it when there is no sparse state.State::forget_pending→forget_all, the old body unchanged):before_execute(every title submit);take_tile, before a new pool is made;place_buffer, at the start and again right before the new buffer is recorded, becausebuffersis keyed by the resource's address.STATE→FORGET;forget_bufferholds neither while it takes the other.Releasemade while the same thread already holdsSTATE(from inside a D3D12 call under the lock) now queues instead of deadlocking.a_released_buffer_is_forgotten_while_the_state_is_lockedholdsSTATEand callsforget_bufferon another thread. Onmainit fails after its 5 s.a_forgotten_buffer_gives_back_only_its_unused_tilescovers which tiles a forgotten buffer gives back, and a release queued while the lock is held being applied by the next holder. It uses the real GPU, or WARP if there is none.Related open PRs
forget_buffer, to release pins outside the driver callback. It conflicts withmainand keeps the blocking lock.STATE. It complements this one: that PR frees the holder of the lock, and this one frees the waiter.Tested
cargo test --workspace -- --test-threads=4onb3fb51c(the same tree as the head792c69a, which only rewords the commit message): 772 passed, 0 failed, 41 ignored.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64.scripts/smoke.ps1, 60 s, no input (the start screen; every resourceReleasegoes throughforget_bufferthere too), againstmainc160d86. Blocks below.Regression run
Not tested
XCL_PSO_WAIT_MS=50and thread dumps through the story load) has not been rerun with this change, so whether the frame loop now gets further there is not measured. WithoutXCL_PSO_WAIT_MSthe title stops earlier for another reason (pipeline builds; kernelx: Sleep does not count the time a bind waits for a pipeline build #1288), and the smoke runs stay on the start screen, short of the story load.STATE, so still able to block (separate changes):sparse::freefromres_releasefor a resource that owns its sparse unified-memory block (decommittedtakesSTATE; found in review by @GonZiin, who measured it waiting with a probe). Deferring it needs the reservation kept out of reuse until the decommit is done, so it is left for its own PR;before_execute/mapped_rangeson every submit;UpdateTileMappingsinmap_tiles.res_release, the object is released beforeforget_bufferruns. So a buffer placed at the same address in between can still be unpinned by the late forget, as onmain.AI use
🤖 Generated with Claude Code