Repository navigation
Conversation
The six call sites of TEST_LOCK and VRAM_TEST_LOCK took the lock with `.lock().unwrap()`, so one panic while a guard was held poisoned the mutex for the rest of the process and every later test that serialises on it died with `PoisonError` instead of running. The known flake in `placed_title_textures_share_vram_and_preserve_pixels` (xcl-dev#718) therefore reports three failures rather than one: it holds both locks, and `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory` then fail for a reason of their own making. Both pass on their own. Contributors read the trio off a `cargo test` run and look for two bugs that are not there. The cascade is not specific to that flake: any panic under either guard produces it. These statics only serialise tests that share one D3D12 device; they guard no invariant that a panic can leave half-applied, so recovering the guard is right. It is also the form the crate already uses everywhere else for its test locks: ASYNC_TEST_LOCK, ACCESSIBILITY_TEST_LOCK and READING_CB_TEST_LOCK take `.lock().unwrap_or_else(|e| e.into_inner())` at all 41 of their call sites, and so does `vram.rs` itself since 38ea451 (xcl-dev#940), whose `reservable_agrees_with_the_driver` takes VRAM_TEST_LOCK that way two tests above a `d32s8_...` that still panics on it. After this change the crate has 48 recovering call sites and no bare `.unwrap()` on a test lock. Measured on an RTX 5070 Ti (driver 621.01), Windows 11, DXC 1.9.2602.17, with a temporary `panic!()` after the two locks in the placed-textures test to stand in for the flake: on main 47efa2e both `--test-threads=1` and `=4` report 3 failed, 0 passed; with this change both report 1 failed, 2 passed. Only the test that really panics fails, and no `PoisonError` is printed. Note this is the same change as xcl-dev#673, which came first; this one is rebased on current main, where xcl-dev#673's base is 78 commits behind. No test is added: the property is that no call site panics on a poisoned lock, and the only way to show it is to poison a shared static, which would leave the suite in that state for every other test. Assisted-by: Claude Code (Claude Opus 5) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Related observation while verifying: |
|
On the On the access violation — reproduced, on a different card, with a sharp thread boundary.
--test-threads | runs | result
-- | -- | --
1 | 2 | 131 passed, 0 failed, 1 ignored
2 | 2 | 131 passed, 0 failed, 1 ignored
4 | 2 | 131 passed, 0 failed, 1 ignored
5 | 3 | 131 passed, 0 failed, 1 ignored
6 | 3 | 131 passed, 0 failed, 1 ignored
7 | 9 | 131 passed, 0 failed, 1 ignored — 0 faults
8 | 8 | exit code: 0xc0000005, STATUS_ACCESS_VIOLATION — 8 of 8
16 | 2 | 0xc0000005
default (24) | 3 | 0xc0000005
The whole test binary dies; it is not a test reporting a failure. So it is not specific to your RTX 3060 Ti, and not specific to this branch — it is on bare The threshold is sharp rather than load-flaky: 0 faults in 9 runs at 7 threads, 8 faults in 8 runs at 8. That should make it reproducible on the first attempt rather than after a dozen. I looked for a structure sized 8 indexed per thread in Where it dies varies, so it is not one test faulting deterministically: counting completed tests before the fault at 8 threads gives 90, 90 and 118 of 131 over three runs. In all three default-parallelism runs the last line printed before the fault is the same family, xcl: D3D12.X: Wait64BitValueX at 0x… >= 0x677 bridged to GPU queue.Wait (waiter=q0/ty0, prod=qNone/tySome(2); wait-before-signal, after_write64=false) but output is buffered, so the last line printed is not the faulting site. I have no stack: I tried to identify the in-flight tests from Why it is not what this PR hardens. A Not tested: AMD, Linux / Wine, release profile, any retail title (no Xbox GDK files here, so no scripts/smoke.ps1), and I have not caught a stack for the fault. AI use: Claude Code with Claude Opus 5 ran the thread-count matrix and drafted this comment; I checked each figure against the logs before posting. |
|
Closing this as a duplicate: #673 makes the same change and was opened first (the test locks recover from a poisoned mutex). It stays open and is the one that will be reviewed and merged. This says nothing about the quality of the code here. I compared the two diffs; the pair was also found by independent checks in #1607. If this PR covers a case #673 does not, or #673 is closed without being merged, say so and I'll reopen it. A test that is only here is welcome on #673. Thank you for the work. AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this comment; the decision is the maintainer's. |
The six call sites of TEST_LOCK and VRAM_TEST_LOCK took the lock with
.lock().unwrap(), so one panic while a guard was held poisoned the mutex for the rest of the process and every later test that serialises on it died withPoisonErrorinstead of running.The known flake in
placed_title_textures_share_vram_and_preserve_pixels(#718) therefore reports three failures rather than one: it holds both locks, andtransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memorythen fail for a reason of their own making. Both pass on their own. Contributors read the trio off acargo testrun and look for two bugs that are not there. The cascade is not specific to that flake: any panic under either guard produces it.These statics only serialise tests that share one D3D12 device; they guard no invariant that a panic can leave half-applied, so recovering the guard is right. It is also the form the crate already uses everywhere else for its test locks: ASYNC_TEST_LOCK, ACCESSIBILITY_TEST_LOCK and READING_CB_TEST_LOCK take
.lock().unwrap_or_else(|e| e.into_inner())at all 41 of their call sites, and so doesvram.rsitself since 38ea451 (#940), whosereservable_agrees_with_the_drivertakes VRAM_TEST_LOCK that way two tests above ad32s8_...that still panics on it. After this change the crate has 48 recovering call sites and no bare.unwrap()on a test lock.Measured on an RTX 5070 Ti (driver 621.01), Windows 11, DXC 1.9.2602.17, with a temporary
panic!()after the two locks in the placed-textures test to stand in for the flake: on main 47efa2e both--test-threads=1and=4report 3 failed, 0 passed; with this change both report 1 failed, 2 passed. Only the test that really panics fails, and noPoisonErroris printed.Note this is the same change as #673, which came first; this one is rebased on current main, where #673's base is 78 commits behind.
No test is added: the property is that no call site panics on a poisoned lock, and the only way to show it is to poison a shared static, which would leave the suite in that state for every other test.
Assisted-by: Claude Code (Claude Opus 5)
What is in it
Tested
cargo test --workspace -- --test-threads=4: N passed, N failed, N ignored (SKIPPED GPU tests: …)Regression run
main:
PR:
Not tested
AI use