Repository navigation
Conversation
`sparse::init` assigned the new state under the `STATE` guard, so the old state was dropped while the guard was held. Dropping it releases its resources through `real::res_release`, which calls `forget_buffer`, which locks `STATE` again: the thread waited for itself, and every later user of `STATE` waited behind it. Seen as a suite run hung for 3600 s, with two tests calling `real::init()` at once and both reaching `sparse::init` (ivall#344). The old state is now taken out under the guard and dropped after it. Fixes ivall#344 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coenflict
marked this pull request as ready for review
November 24, 2026 00:40
|
Heads-up for whoever merges: this PR and #443 (opened ~12 minutes earlier) fix the same thing, #344, with the same change in What differs, so either can be picked:
I have not run this PR's head. Written with Claude Code (Claude Opus 5.5); the comparison was checked against both diffs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sparse::initassigned the new sparse state under theSTATEguard, so the old state was dropped with the guard held. Dropping it releases its resources throughreal::res_release→sparse::forget_buffer, which locksSTATEagain and waits for itself. The old state is now taken out under the guard and dropped after it. Fixes #344What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:replace_unlockedputs the new value in and drops the old one after the guard;inituses it. A unit test replaces a value whoseDroplocks the same mutex, twice, on a thread with a 10 s timeout.Tested
cargo test -p xcl --lib replacing_drops_the_old_value: with the old assignment it fails (deadlock, timeout after 10 s); with the fix it passescargo test --workspace -- --test-threads=4: 677 passed, 0 failed, 41 ignored (lib: 637 passed, 0 failed, 21 ignored)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)Regression run
main:
this PR:
This PR's head ran four times: 1149, 887, 1506 and 1531 frames. The first two runs came before any run of
main. The 887 run fell to 8 presents per 2 s in its last seconds. After that, alternatingmainand PR runs gave 1499 and 1498 frames onmainand 1506 and 1531 on this PR.mainran three times in all, with 1495 to 1499 frames. The low runs were not seen once the runs alternated, and the change only acts whensparse::initruns twice.Not tested
real::init()calls racing.sparse::initonce, so the smoke run checks for regressions and does not reach the fixed path.AI use
🤖 Generated with Claude Code