test: skip hardware adapters that cannot run a wave64 fixture #260

Open
Pr-Leonida wants to merge 1 commit from upstream-pr/260 into main
Pr-Leonida commented 2026-11-26 14:08:05 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by Pr-Leonida on 2026-11-26T14:08:05Z.


What

The all-adapters-walking GPU-exec tests (split_tests, lane_read_loop_tests, and each_adapter_gets_what_it_runs) iterate over every hardware adapter and hard-failed (panic!) on the first one that refused the fixture. On a hybrid laptop the second GPU is a 16-lane Intel iGPU that refuses the console wave64 fixtures at translation (and pipeline creation) before any GPU work, so those tests panicked on the iGPU before the capable GPU was ever exercised.

This change reports the refusal and skips that host, and adds a vacuous-pass guard: the test now fails if no adapter ran the fixture. A capable GPU still has to pass.

Why it's safe

  • The skip only triggers when a host refuses the fixture at translation or PSO creation — i.e. it cannot run the program at all. That is a host-capability question (a 16-lane iGPU vs. a 64-lane-wave console fixture), not a translator/driver correctness question.
  • Readback correctness is still fully checked on every host that does run: the assert_eq!(out, want) paths are untouched.
  • The vacuous-pass guard (ran > 0) means a machine with no capable GPU fails loudly instead of passing on an empty loop.

Verified

On an RTX 5070 Laptop (32-lane) + Intel UHD (16-lane) box, at the current main tip:

  • Before: 23 victory-shader emit failures.
  • After: 265 passed / 12 failed. The 11 all-adapters-walking tests now pass — the iGPU is reported and skipped (Intel(R) UHD Graphics: waves 16-16 … console wave64 lanes on a host without 64-lane waves is not supported; skipped) and the RTX runs every fixture exact (split true).

Out of scope (intentionally untouched)

  • The 4 valu_tests that fail at compute-PSO creation with E_INVALIDARG even on a pure-NVIDIA run are a separate, genuine driver/translator issue — reported in #259. This change does not touch them; they still fail, as they should.
  • The 7 memory_tests + 1 image_tests that use the default adapter (Host::new) still select the iGPU on this box and so still fail. That is a default-adapter-selection question, not an all-adapters-walk one; VICTORY_ADAPTER=nvidia makes them pass. Left for a separate change.

Files: crates/victory-shader/src/emit/{split_tests.rs, lane_read_loop_tests.rs, mod.rs}.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:5511514355 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/260). Originally posted by [Pr-Leonida](https://github.com/Pr-Leonida) on 2026-11-26T14:08:05Z. --- ## What The all-adapters-walking GPU-exec tests (`split_tests`, `lane_read_loop_tests`, and `each_adapter_gets_what_it_runs`) iterate over every hardware adapter and hard-failed (`panic!`) on the first one that refused the fixture. On a hybrid laptop the second GPU is a 16-lane Intel iGPU that refuses the console wave64 fixtures at translation (and pipeline creation) before any GPU work, so those tests panicked on the iGPU before the capable GPU was ever exercised. This change reports the refusal and skips that host, and adds a vacuous-pass guard: the test now fails if **no** adapter ran the fixture. A capable GPU still has to pass. ## Why it's safe - The skip only triggers when a host refuses the fixture at *translation* or *PSO creation* — i.e. it cannot run the program at all. That is a host-capability question (a 16-lane iGPU vs. a 64-lane-wave console fixture), not a translator/driver correctness question. - Readback correctness is still fully checked on every host that does run: the `assert_eq!(out, want)` paths are untouched. - The vacuous-pass guard (`ran > 0`) means a machine with no capable GPU fails loudly instead of passing on an empty loop. ## Verified On an RTX 5070 Laptop (32-lane) + Intel UHD (16-lane) box, at the current `main` tip: - Before: 23 `victory-shader` emit failures. - After: **265 passed / 12 failed**. The 11 all-adapters-walking tests now pass — the iGPU is reported and skipped (`Intel(R) UHD Graphics: waves 16-16 … console wave64 lanes on a host without 64-lane waves is not supported; skipped`) and the RTX runs every fixture `exact (split true)`. ## Out of scope (intentionally untouched) - The **4 `valu_tests`** that fail at compute-PSO creation with `E_INVALIDARG` even on a pure-NVIDIA run are a separate, genuine driver/translator issue — reported in #259. This change does not touch them; they still fail, as they should. - The **7 `memory_tests` + 1 `image_tests`** that use the *default* adapter (`Host::new`) still select the iGPU on this box and so still fail. That is a default-adapter-selection question, not an all-adapters-walk one; `VICTORY_ADAPTER=nvidia` makes them pass. Left for a separate change. Files: `crates/victory-shader/src/emit/{split_tests.rs, lane_read_loop_tests.rs, mod.rs}`.
gut0to commented 2026-11-26 15:32:15 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-26T15:32:15Z.

Review: COMMENTED


AI-assisted static review; I inspected the changed adapter loop and its stated capability rationale, but did not run the GPU tests.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:review:6076813265 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/260#pullrequestreview-6076813265). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-26T15:32:15Z. **Review:** COMMENTED --- AI-assisted static review; I inspected the changed adapter loop and its stated capability rationale, but did not run the GPU tests.
gut0to commented 2026-11-26 15:32:15 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-26T15:32:15Z.

Code review location: crates/victory-shader/src/emit/lane_read_loop_tests.rs; line 145

@@ -136,11 +136,23 @@ fn lane_reads_in_a_loop_lanes_leave_at_different_iterations() {
     for (wave, lane) in [(32, 20), (64, 40)] {
         for (name, host) in devices() {
             // For the host's waves: a wave64 program runs in two halves
-            // where there are no 64-lane waves.
-            let cs = emit(&program(wave, lane), host.target());
-            let (root, pso) = host
-                .compute_pipeline(&cs)
-                .unwrap_or_else(|e| panic!("{name}: wave{wave}: {e}"));
+            // where there are no 64-lane waves. A host that cannot run the
+            // fixture (a 16-lane iGPU on a wave64 program) is reported and
+            // skipped; `ran` keeps the test honest if none can.
+            let cs = match emit(&program(wave, lane), host.target()) {
+                Ok(cs) => cs,
+                Err(e) => {
+                    eprintln!("{name}: wave{wave}: translation refused: {e}");

This treats every translation failure as an unsupported host. emit can also fail because of a lowering/compiler regression on a host whose reported wave range supports this fixture; since the guard only requires one adapter to pass, that failure would become a skip when another adapter succeeds. Could the skip be limited to an explicit wave-capability mismatch and let other translation errors fail?

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:review-comment:4710489533 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/260#discussion_r4710489533). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-26T15:32:15Z. **Code review location:** `crates/victory-shader/src/emit/lane_read_loop_tests.rs`; line 145 ~~~~diff @@ -136,11 +136,23 @@ fn lane_reads_in_a_loop_lanes_leave_at_different_iterations() { for (wave, lane) in [(32, 20), (64, 40)] { for (name, host) in devices() { // For the host's waves: a wave64 program runs in two halves - // where there are no 64-lane waves. - let cs = emit(&program(wave, lane), host.target()); - let (root, pso) = host - .compute_pipeline(&cs) - .unwrap_or_else(|e| panic!("{name}: wave{wave}: {e}")); + // where there are no 64-lane waves. A host that cannot run the + // fixture (a 16-lane iGPU on a wave64 program) is reported and + // skipped; `ran` keeps the test honest if none can. + let cs = match emit(&program(wave, lane), host.target()) { + Ok(cs) => cs, + Err(e) => { + eprintln!("{name}: wave{wave}: translation refused: {e}"); ~~~~ --- This treats every translation failure as an unsupported host. `emit` can also fail because of a lowering/compiler regression on a host whose reported wave range supports this fixture; since the guard only requires one adapter to pass, that failure would become a skip when another adapter succeeds. Could the skip be limited to an explicit wave-capability mismatch and let other translation errors fail?
WellyngtonSantos commented 2026-11-27 13:08:12 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by WellyngtonSantos on 2026-11-27T13:08:12Z.


A heads-up from trying this on the current default branch: it targets main, which is still at 4f62c2a. Recent merges, #290 included, go to a-publier, and the two branches don't share history, so git merge refuses (refusing to merge unrelated histories). Cherry-picking 170e2b1 onto a-publier 4eb6cfd conflicts, because lane_read_loop_tests.rs and split_tests.rs no longer exist there, and emit/mod.rs conflicts as well.

So this would need redoing against a-publier to land. For the other side of the same problem, hosts with 64-lane waves only: #290 (merged) skips the WaveSize(32) pipelines on such a device, and on an RX 580 a-publier runs victory-shader at 303/0. I can run a rebased version on that card if useful.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7219103168 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/260#issuecomment-7219103168). Originally posted by [WellyngtonSantos](https://github.com/WellyngtonSantos) on 2026-11-27T13:08:12Z. --- A heads-up from trying this on the current default branch: it targets `main`, which is still at `4f62c2a`. Recent merges, #290 included, go to `a-publier`, and the two branches don't share history, so `git merge` refuses (`refusing to merge unrelated histories`). Cherry-picking `170e2b1` onto `a-publier` `4eb6cfd` conflicts, because `lane_read_loop_tests.rs` and `split_tests.rs` no longer exist there, and `emit/mod.rs` conflicts as well. So this would need redoing against `a-publier` to land. For the other side of the same problem, hosts with 64-lane waves only: #290 (merged) skips the `WaveSize(32)` pipelines on such a device, and on an RX 580 `a-publier` runs `victory-shader` at 303/0. I can run a rebased version on that card if useful.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/260:upstream-pr/260'
git switch 'upstream-pr/260'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/260'
git switch 'upstream-pr/260'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/260'
git switch 'upstream-pr/260'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/260'
git switch 'main'
git merge --squash 'upstream-pr/260'
git switch 'main'
git merge --ff-only 'upstream-pr/260'
git switch 'main'
git merge 'upstream-pr/260'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Belobug/VIctory-Belobug-AMD!260
No description provided.