Forráskód Böngészése

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 <[email protected]>
r4. 3 napja
szülő
commit
1106f43efe
1 módosított fájl, 5 hozzáadás és 0 törlés
  1. 5 0
      crates/victory-shader/src/emit/valu_tests.rs

+ 5 - 0
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 {