From 54544682011e89267ed230e19c064b8ff589a3aa Mon Sep 17 00:00:00 2001 From: Foniass <107039406+Foniass@users.noreply.github.com> Date: Mon, 30 Nov 2026 00:12:22 +0100 Subject: [PATCH] Tests: the stand-in race test keeps the let-go pipeline on its thread concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (#2369) expected the winner's driver pipeline to be released with the last shell. On main the last shell lets it go through late_release (it is held until the queues are past the lists that may bind it), so the test found one reference left and failed on every run. The test now keeps what let_go is given on its thread, as the other stand-in tests do, checks that it is the winner's pipeline, and releases it. Co-Authored-By: Claude Opus 5.5 --- crates/xcl/src/hle/d3d12x/standin.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/xcl/src/hle/d3d12x/standin.rs b/crates/xcl/src/hle/d3d12x/standin.rs index 636617c6c4..ca64d9e88c 100644 --- a/crates/xcl/src/hle/d3d12x/standin.rs +++ b/crates/xcl/src/hle/d3d12x/standin.rs @@ -446,6 +446,8 @@ mod tests { fn concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline() { let (rs, p1, p2, barrier) = (counted(), counted(), counted(), Arc::new(std::sync::Barrier::new(2))); let k = key(rs, 41); + // (the winner's pipeline is let go with the last shell: kept here, not held) + let_go_taken(); let run = |p: usize| { let (b, k) = (barrier.clone(), k.clone()); std::thread::spawn(move || unsafe { let (s, d) = shell(k, || { b.wait(); Ok(p) }).unwrap(); (s as usize, d) }) @@ -456,7 +458,10 @@ mod tests { let (winner, loser) = if d1 == at(p1) { (p1, p2) } else { (p2, p1) }; assert_eq!((refs(winner), refs(loser), refs(rs)), (1, 0, 2)); unsafe { release(s1 as *mut c_void); release(s2 as *mut c_void); } + assert_eq!(let_go_taken(), vec![at(winner)]); + unsafe { unref(at(winner)) }; assert_eq!((refs(p1), refs(p2), refs(rs)), (0, 0, 1)); + LET_GO.with(|l| l.borrow_mut().take()); } #[test]