From 1106f43efee58f3b218b9e9d1f0ca65da4b41b72 Mon Sep 17 00:00:00 2001 From: "r4." <192970269+r4tedx@users.noreply.github.com> Date: Tue, 24 Nov 2026 05:18:27 +0200 Subject: [PATCH] Shader tests: run the VALU GPU tests one at a time `cargo test` now and then never finishes: the seven emit::valu_tests that run on the hardware adapter and on WARP start together on the test threads, none of their dispatches completes, and the test binary keeps one core busy until it is killed (the waits spin on the fence). Any other GPU test running at that moment is stuck with them. On an RTX 5070 with a Radeon iGPU, `valu_tests` alone in a loop on main d2a4bae: 3 of 30 runs hang. With `run_cases` behind a process-wide lock: 0 of 60, and the seven tests take under 7 s. The lock is poison-tolerant, so one failing test does not fail the rest. Co-Authored-By: Claude Fable 5.2 --- crates/victory-shader/src/emit/valu_tests.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/victory-shader/src/emit/valu_tests.rs b/crates/victory-shader/src/emit/valu_tests.rs index 1b95ca6..b717c47 100644 --- a/crates/victory-shader/src/emit/valu_tests.rs +++ b/crates/victory-shader/src/emit/valu_tests.rs @@ -166,6 +166,11 @@ fn run_cases( cases: &[[u32; 4]], mut check: impl FnMut(&str, usize, [u32; 4], u32), ) { + // One test at a time: with these tests on the hardware adapter and WARP + // from several test threads at once, now and then none of their + // dispatches ever completes and the test binary hangs. + static ONE_AT_A_TIME: std::sync::Mutex<()> = std::sync::Mutex::new(()); + let _one = ONE_AT_A_TIME.lock().unwrap_or_else(|e| e.into_inner()); let mut ran = 0; for (label, warp) in [("hardware", false), ("warp", true)] { let Ok(host) = Host::new(warp) else {