Shader tests: skip a fixed-wave pipeline the device lane counts rule out #3242

Open
github-bot wants to merge 1 commit from github-bot/gh-3242 into main AGit
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 14:21 UTC · original
zzm1234560621-prog:test/wave-lane-gate → main · +37 −5 · 2 files · 1 commits · open

What

Five synthetic tests (permutes_read_the_lane_named_and_zero_from_lanes_left_out, permutes_mask_high_address_bits_and_divergent_branches, and the three wave64_…/sel_hi siblings) build a pipeline that declares the console's WaveSize and, when creation fails on a hardware adapter, assert that this cannot happen:

let Ok((root, pso)) = host.compute_pipeline(&shader) else {
    assert!(warp, "{label}: no pipeline for a wave of 32");
    eprintln!("{label}: no pipeline for a wave of 32; skipped");
    continue;
};

That assumes every hardware adapter runs 32-lane waves. An Intel UHD (Raptor Lake Xe-LP) reports a 16-lane maximum and fails the test instead of skipping (#1829); WARP and 32-lane parts pass.

How

  • Host::wave_lane_counts() reads D3D12_FEATURE_DATA_D3D12_OPTIONS1's WaveLaneCountMin / WaveLaneCountMax.
  • Host::supports_wave_lanes(n) says whether a pipeline declaring WaveSize(n) can exist on this device. Unknown counts answer true, so creation decides as before.
  • The assertions now accept "the device cannot run that wave" as a reason for creation to have failed. The skip line is unchanged, and the wave64 site asks about 64 lanes rather than 32.

Measured

Intel Arc (Xe-LPG, driver 32.0.101.6127), main 63bcca4 — the query answers 8..32:

TEMPORARY: wave lanes Some((8, 32)), asked 64      (instrumented once, then removed)
hardware: no pipeline for a wave of 64; skipped

so the 32-lane tests still run on hardware here and the 64-lane ones skip, exactly as before. On a part that caps at 16, the 32-lane tests now skip with the reason instead of failing.

cargo test -p victory-shader --lib   295 passed, 7 failed, 3 ignored

— the same seven failures as 63bcca4 on this adapter, since this branch carries only this change. cargo clippy … -D warnings: clean.

Not verified

I cannot reproduce the 16-lane case: the only GPU I have here reports 8..32. The change is written to the reported values rather than observed on a UHD, so it needs that machine (or another ≤16-lane part) to confirm the skip. If someone has one, cargo test -p victory-shader --lib -- permutes_ -- --nocapture prints the lane counts when it skips.

No game files. From #1829 and the Arc baseline in #3196. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 14:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/3242) `zzm1234560621-prog:test/wave-lane-gate` → `main` · +37 −5 · 2 files · 1 commits · open ## What Five synthetic tests (`permutes_read_the_lane_named_and_zero_from_lanes_left_out`, `permutes_mask_high_address_bits_and_divergent_branches`, and the three `wave64_…`/`sel_hi` siblings) build a pipeline that declares the console's `WaveSize` and, when creation fails on a **hardware** adapter, assert that this cannot happen: ```rust let Ok((root, pso)) = host.compute_pipeline(&shader) else { assert!(warp, "{label}: no pipeline for a wave of 32"); eprintln!("{label}: no pipeline for a wave of 32; skipped"); continue; }; ``` That assumes every hardware adapter runs 32-lane waves. An Intel UHD (Raptor Lake Xe-LP) reports a **16-lane maximum** and fails the test instead of skipping (#1829); WARP and 32-lane parts pass. ## How - `Host::wave_lane_counts()` reads `D3D12_FEATURE_DATA_D3D12_OPTIONS1`'s `WaveLaneCountMin` / `WaveLaneCountMax`. - `Host::supports_wave_lanes(n)` says whether a pipeline declaring `WaveSize(n)` can exist on this device. Unknown counts answer `true`, so creation decides as before. - The assertions now accept "the device cannot run that wave" as a reason for creation to have failed. The skip line is unchanged, and the `wave64` site asks about 64 lanes rather than 32. ## Measured Intel Arc (Xe-LPG, driver 32.0.101.6127), `main` `63bcca4` — the query answers **8..32**: ``` TEMPORARY: wave lanes Some((8, 32)), asked 64 (instrumented once, then removed) hardware: no pipeline for a wave of 64; skipped ``` so the 32-lane tests still run on hardware here and the 64-lane ones skip, exactly as before. On a part that caps at 16, the 32-lane tests now skip with the reason instead of failing. ``` cargo test -p victory-shader --lib 295 passed, 7 failed, 3 ignored ``` — the same seven failures as `63bcca4` on this adapter, since this branch carries only this change. `cargo clippy … -D warnings`: clean. ## Not verified I cannot reproduce the 16-lane case: the only GPU I have here reports 8..32. The change is written to the reported values rather than observed on a UHD, so it needs that machine (or another ≤16-lane part) to confirm the skip. If someone has one, `cargo test -p victory-shader --lib -- permutes_ -- --nocapture` prints the lane counts when it skips. _No game files. From #1829 and the Arc baseline in #3196. AI-assisted (Claude)._
Five synthetic tests build a pipeline that declares the console's `WaveSize`
and, when creation fails on a hardware adapter, assert:

    assert!(warp, "{label}: no pipeline for a wave of 32");

That assumes every hardware adapter runs 32-lane waves. It does not hold: an
Intel UHD (Raptor Lake) reports a 16-lane maximum and fails the test instead
of skipping (#1829), while WARP and a 32-lane part pass.

`Host::wave_lane_counts` reads `D3D12_FEATURE_D3D12_OPTIONS1`'s
`WaveLaneCountMin/Max`, and `supports_wave_lanes` answers whether a pipeline
declaring `WaveSize(n)` can be created at all; the assertions now accept "the
device cannot run that wave" as a reason for creation to have failed, and the
skip line still prints. Where the counts cannot be read the answer is `true`,
so creation decides as before.

On the Intel Arc (Xe-LPG) here the counts are **8..32**, so the 32-lane tests
run on hardware as before and the 64-lane ones skip — unchanged; on a part
that caps at 16 the 32-lane tests now skip with the reason instead of
asserting.

cargo test -p victory-shader --lib: 295 passed, 7 failed, 3 ignored — the same
seven as `63bcca4` on this adapter (this branch carries only this change).
cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:27:15 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 14:31 UTC · original · approved these changes

Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP):

  • Querying D3D12_FEATURE_D3D12_OPTIONS1 (WaveLaneCountMin..=WaveLaneCountMax) in Host::wave_lane_counts / supports_wave_lanes cleanly distinguishes unsupported fixed-WaveSize adapters from unexpected pipeline creation failures on wave32-capable hardware.
  • cargo test -p victory-shader --lib emit::synthetic_tests:: -- --test-threads=1 --skip gathers_at_a_level_match_the_hardware (runs both RTX 5090 hardware + WARP): 10 passed, 0 failed (note: gathers_at_a_level_match_the_hardware skipped due to known pre-existing NVIDIA issue #1835/#2317).
  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 14:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/3242#pullrequestreview-6075868418) · **approved these changes** Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP): - Querying D3D12_FEATURE_D3D12_OPTIONS1 (WaveLaneCountMin..=WaveLaneCountMax) in Host::wave_lane_counts / supports_wave_lanes cleanly distinguishes unsupported fixed-WaveSize adapters from unexpected pipeline creation failures on wave32-capable hardware. - cargo test -p victory-shader --lib emit::synthetic_tests:: -- --test-threads=1 --skip gathers_at_a_level_match_the_hardware (runs both RTX 5090 hardware + WARP): 10 passed, 0 failed (note: gathers_at_a_level_match_the_hardware skipped due to known pre-existing NVIDIA issue #1835/#2317). - cargo clippy -p victory-shader --all-targets -- -D warnings: clean. - cargo xtask policy: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 14:51 UTC · original

The reviewers' WARP-only configuration is the one this change helps most, so I ran it: 4 failures → 1 on this branch.

VICTORY_WARP=1 VICTORY_D3D12_WARP=1
cargo test -p victory-shader --lib -- --test-threads=1
test result: FAILED. 301 passed, 1 failed, 3 ignored
failures: emit::synthetic_tests::gathers_at_a_level_match_the_hardware

permutes_read_the_lane_named_and_zero_from_lanes_left_out, permutes_mask_high_address_bits_and_divergent_branches and a_mask_joined_with_data_at_a_uniform_loop_is_its_number are the three that go from failing to skipping: with VICTORY_WARP=1 the "hardware" half of run_cases is a WARP device with warp == false, so assert!(warp, "no pipeline for a wave of 32") was asserting a hardware property of a device that has none. That is the same mistake the 16-lane UHD hits, just from the other direction, and the lane-count query fixes both.

What is left is not wave-size, and not ours by the look of it:

hardware: lane 4 against its gather
left:  [66.0, 67.0, 35.0, 34.0]
right: [65.0, 66.0, 34.0, 33.0]

Every channel is one off, on WARP only — the same test passes on the Intel Arc hardware here, so the model and the hardware agree and WARP is the outlier. That wants its own issue if there is not one already; I have not touched it, and it is the one failure this PR leaves in that configuration.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 14:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/3242#issuecomment-7195436913) The reviewers' WARP-only configuration is the one this change helps most, so I ran it: **4 failures → 1** on this branch. ``` VICTORY_WARP=1 VICTORY_D3D12_WARP=1 cargo test -p victory-shader --lib -- --test-threads=1 test result: FAILED. 301 passed, 1 failed, 3 ignored failures: emit::synthetic_tests::gathers_at_a_level_match_the_hardware ``` `permutes_read_the_lane_named_and_zero_from_lanes_left_out`, `permutes_mask_high_address_bits_and_divergent_branches` and `a_mask_joined_with_data_at_a_uniform_loop_is_its_number` are the three that go from failing to skipping: with `VICTORY_WARP=1` the "hardware" half of `run_cases` is a WARP device with `warp == false`, so `assert!(warp, "no pipeline for a wave of 32")` was asserting a hardware property of a device that has none. That is the same mistake the 16-lane UHD hits, just from the other direction, and the lane-count query fixes both. What is left is **not** wave-size, and not ours by the look of it: ``` hardware: lane 4 against its gather left: [66.0, 67.0, 35.0, 34.0] right: [65.0, 66.0, 34.0, 33.0] ``` Every channel is one off, on WARP only — the same test passes on the Intel Arc hardware here, so the model and the hardware agree and WARP is the outlier. That wants its own issue if there is not one already; I have not touched it, and it is the one failure this PR leaves in that configuration. _No game files. AI-assisted (Claude)._
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3242/head:github-bot/gh-3242'
git switch 'github-bot/gh-3242'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3242'
git switch 'github-bot/gh-3242'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3242'
git switch 'github-bot/gh-3242'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3242'
git switch 'main'
git merge --squash 'github-bot/gh-3242'
git switch 'main'
git merge --ff-only 'github-bot/gh-3242'
git switch 'main'
git merge 'github-bot/gh-3242'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3242
No description provided.