tests: use host capabilities for wave64 VALU fixtures #276

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

@⁠KernelSmoker on GitHub · 2026-11-26 18:42 UTC · original
KernelSmoker:codex/fix-nvidia-wave64-test-target → main · +46 −9 · 1 files · 1 commits · open

Summary

The four wave64 VALU tests reported in Belobug/VIctory-Belobug-AMD#259 built their fixture with Target::ANY, even when the selected D3D12 adapter only advertises wave32. This made the tests submit an unsupported wave64 pipeline to NVIDIA instead of asking the translator to apply that host's wave limits.

Build these fixtures using Host::target(). Skip only when translation returns the explicit console wave64 lanes on a host without 64-lane waves capability refusal. Other translation errors still fail, and adapters that accept translation still must create the PSO and pass readback assertions.

Validation

  • cargo check --offline -p victory-shader --tests --target x86_64-pc-windows-gnu — passed; Windows test code type-checks.
  • cargo test --offline -p victory-shader --lib — 196 passed, 0 failed, 6 ignored (Linux CPU suite).
  • No D3D12/GPU test was run here; this change targets test fixture selection and has not been verified on an NVIDIA card.
**@⁠KernelSmoker** on GitHub · 2026-11-26 18:42 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/276) `KernelSmoker:codex/fix-nvidia-wave64-test-target` → `main` · +46 −9 · 1 files · 1 commits · open ## Summary The four wave64 VALU tests reported in Belobug/VIctory-Belobug-AMD#259 built their fixture with `Target::ANY`, even when the selected D3D12 adapter only advertises wave32. This made the tests submit an unsupported wave64 pipeline to NVIDIA instead of asking the translator to apply that host's wave limits. Build these fixtures using `Host::target()`. Skip only when translation returns the explicit `console wave64 lanes on a host without 64-lane waves` capability refusal. Other translation errors still fail, and adapters that accept translation still must create the PSO and pass readback assertions. ## Validation - `cargo check --offline -p victory-shader --tests --target x86_64-pc-windows-gnu` — passed; Windows test code type-checks. - `cargo test --offline -p victory-shader --lib` — 196 passed, 0 failed, 6 ignored (Linux CPU suite). - No D3D12/GPU test was run here; this change targets test fixture selection and has not been verified on an NVIDIA card.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:45:54 +00:00
Author
Owner

@⁠TinkerBell-90 on GitHub · 2026-11-26 19:18 UTC · original

Tested on an RX 9070 XT, but under Linux: Wine 10 + vkd3d-proton 3.1 (with DXVK's dxgi), Mesa 26.0.8 RADV. Not Windows, and nothing was run in game. The D3D12 device reports waves of 32 to 64 lanes here.

  • With this PR at a22c81c, the four tests run and pass on the card; none is skipped. They also pass on main at 4f62c2a.
  • To see the path a 32-lane card takes, I changed build_lanes_cs_for_host locally to use Target { lanes_min: 32, lanes_max: 32 } (what an RTX reports) instead of host.target(). Then scalar_counted_in_a_divergent_loop_read_after_it and scalar_counted_in_nested_divergent_loops translate and pass, but loop_exit_mask_counted_after_the_loop and mask_grown_inside_a_branch_counted_after_it panic at translation:
translation: Unsupported { offset: 0, what: "a wave64 program whose halves exchange lanes (console flow)" }

That is lower::CONSOLE_FLOW, not the "console wave64 lanes on a host without 64-lane waves" refusal the skip matches, so on a 32-lane card two of the four would still fail, at translation instead of at pipeline creation.

build_lanes_cs calls lower::lower once, while the real path (emit_program in emit/mod.rs) answers CONSOLE_FLOW by lowering again with the console structure. With the same retry in the fixture, and the forced 32-lane target, all four translate and pass on the card:

let mut parts = lower::Parts { /* fields as now */ };
let console;
let lowered = match lower::lower(&parts) {
    Err(crate::ShaderError::Unsupported { what, .. }) if what == lower::CONSOLE_FLOW => {
        console = structure::structure_console(&p).map_err(|e| format!("{e:?}"))?;
        parts.st = &console;
        parts.console_cf = true;
        lower::lower(&parts)
    }
    l => l,
}
.map_err(|e| format!("{e:?}"))?;

What the card ran, read from each shader's PSV0 part: the two retried tests declare waves of 32 to 32; the other two declare no wave size, and they also pass with RADV_PERFTEST=cswave32 (compute shaders without a declared size then run in 32-lane waves). So the fixture can likely run on 32-lane cards instead of being skipped there. Not checked on an NVIDIA or Intel card; RADV in 32-lane waves is the closest I have. emit_program also falls back to per_lane_only when the console structure fails; these four did not need it.

AI-assisted.

**@⁠TinkerBell-90** on GitHub · 2026-11-26 19:18 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/276#issuecomment-7201437225) Tested on an RX 9070 XT, but under Linux: Wine 10 + vkd3d-proton 3.1 (with DXVK's dxgi), Mesa 26.0.8 RADV. Not Windows, and nothing was run in game. The D3D12 device reports waves of 32 to 64 lanes here. - With this PR at `a22c81c`, the four tests run and pass on the card; none is skipped. They also pass on `main` at `4f62c2a`. - To see the path a 32-lane card takes, I changed `build_lanes_cs_for_host` locally to use `Target { lanes_min: 32, lanes_max: 32 }` (what an RTX reports) instead of `host.target()`. Then `scalar_counted_in_a_divergent_loop_read_after_it` and `scalar_counted_in_nested_divergent_loops` translate and pass, but `loop_exit_mask_counted_after_the_loop` and `mask_grown_inside_a_branch_counted_after_it` panic at translation: ``` translation: Unsupported { offset: 0, what: "a wave64 program whose halves exchange lanes (console flow)" } ``` That is `lower::CONSOLE_FLOW`, not the "console wave64 lanes on a host without 64-lane waves" refusal the skip matches, so on a 32-lane card two of the four would still fail, at translation instead of at pipeline creation. `build_lanes_cs` calls `lower::lower` once, while the real path (`emit_program` in `emit/mod.rs`) answers `CONSOLE_FLOW` by lowering again with the console structure. With the same retry in the fixture, and the forced 32-lane target, all four translate and pass on the card: ```rust let mut parts = lower::Parts { /* fields as now */ }; let console; let lowered = match lower::lower(&parts) { Err(crate::ShaderError::Unsupported { what, .. }) if what == lower::CONSOLE_FLOW => { console = structure::structure_console(&p).map_err(|e| format!("{e:?}"))?; parts.st = &console; parts.console_cf = true; lower::lower(&parts) } l => l, } .map_err(|e| format!("{e:?}"))?; ``` What the card ran, read from each shader's PSV0 part: the two retried tests declare waves of 32 to 32; the other two declare no wave size, and they also pass with `RADV_PERFTEST=cswave32` (compute shaders without a declared size then run in 32-lane waves). So the fixture can likely run on 32-lane cards instead of being skipped there. Not checked on an NVIDIA or Intel card; RADV in 32-lane waves is the closest I have. `emit_program` also falls back to `per_lane_only` when the console structure fails; these four did not need it. AI-assisted.
Author
Owner

@⁠Aniseto on GitHub · 2026-11-26 22:20 UTC · original

Ran the four wave64 VALU fixtures from issue #259 at a22c81c on a physical NVIDIA 32-lane part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build; VICTORY_D3D12_ADAPTER=NVIDIA.

cargo test -p victory-shader --lib -- loop_exit_mask_counted_after_the_loop mask_grown_inside_a_branch_counted_after_it scalar_counted_in_a_divergent_loop_read_after_it scalar_counted_in_nested_divergent_loops --test-threads=1
0 passed; 4 failed; 0 ignored; 0 measured; 279 filtered out      (exit 101)

All four still fail on this adapter. Two panic at translation with Unsupported { offset: 0, what: "a wave64 program whose halves exchange lanes (console flow)" }; the other two run but count 32/64 iterations where the assertions expect the other half to be included. The thread's prior run was on an RX 9070 XT under Linux/Wine, so this is the first native Windows NVIDIA result. I am reporting the measured failures only, not a review verdict.

Not tested: a retail title, a paired smoke run, the full workspace suite, release profile, AMD and Intel GPUs, native wave64 hosts, Wine, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-26 22:20 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/276#issuecomment-7204579956) Ran the four wave64 VALU fixtures from issue #259 at `a22c81c` on a physical NVIDIA 32-lane part: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build; `VICTORY_D3D12_ADAPTER=NVIDIA`. ``` cargo test -p victory-shader --lib -- loop_exit_mask_counted_after_the_loop mask_grown_inside_a_branch_counted_after_it scalar_counted_in_a_divergent_loop_read_after_it scalar_counted_in_nested_divergent_loops --test-threads=1 0 passed; 4 failed; 0 ignored; 0 measured; 279 filtered out (exit 101) ``` All four still fail on this adapter. Two panic at translation with `Unsupported { offset: 0, what: "a wave64 program whose halves exchange lanes (console flow)" }`; the other two run but count 32/64 iterations where the assertions expect the other half to be included. The thread's prior run was on an RX 9070 XT under Linux/Wine, so this is the first native Windows NVIDIA result. I am reporting the measured failures only, not a review verdict. Not tested: a retail title, a paired smoke run, the full workspace suite, release profile, AMD and Intel GPUs, native wave64 hosts, Wine, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Author
Owner

@⁠upipibi on GitHub · 2026-11-26 23:25 UTC · original

Ampere data point with a base control, adding to Aniseto's RTX 5070 Ti run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, default hardware adapter. Head a22c81c, base 4f62c2a (merge-base with main). No game files used.

cargo test -p victory-shader --lib -- emit::valu_tests::loop_exit_mask_counted_after_the_loop emit::valu_tests::mask_grown_inside_a_branch_counted_after_it emit::valu_tests::scalar_counted_in_a_divergent_loop_read_after_it emit::valu_tests::scalar_counted_in_nested_divergent_loops --test-threads=1 --nocapture

  • Head, 3 runs: 0 passed; 4 failed each time, with no skip line. This is the same as on the 5070 Ti. The two mask tests panic at translation (valu_tests.rs:1441) with the console flow refusal, which the skip doesn't match. scalar_counted_in_a_divergent_loop_read_after_it counts 32 in lanes 0-31 and 64 in lanes 32-63. scalar_counted_in_nested_divergent_loops counts 8 and 16.
  • Base: also 0 passed; 4 failed, but two of them fail differently. The two mask tests fail at compute_pipeline with "The parameter is incorrect." (E_INVALIDARG, valu_tests.rs:1447 and :1526), and the two scalar tests give the same wrong half-wave counts.

So on a 32-lane NVIDIA card, this PR moves the two pipeline failures to translation failures and leaves all four failing. The scalar counts are wrong with or without it. I haven't tried TinkerBell-90's fixture retry with the console structure. Since the two scalar tests already translate here and still count wrong, I'd guess it helps only the two mask tests on this card. Lib suite on both trees: 273 passed; 4 failed; 6 ignored, the same four tests failing.

AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

**@⁠upipibi** on GitHub · 2026-11-26 23:25 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/276#issuecomment-7205534012) Ampere data point with a base control, adding to Aniseto's RTX 5070 Ti run: RTX 3070 8 GB, driver 616.56, Windows 11, debug, default hardware adapter. Head `a22c81c`, base `4f62c2a` (merge-base with main). No game files used. `cargo test -p victory-shader --lib -- emit::valu_tests::loop_exit_mask_counted_after_the_loop emit::valu_tests::mask_grown_inside_a_branch_counted_after_it emit::valu_tests::scalar_counted_in_a_divergent_loop_read_after_it emit::valu_tests::scalar_counted_in_nested_divergent_loops --test-threads=1 --nocapture` - **Head, 3 runs:** `0 passed; 4 failed` each time, with no skip line. This is the same as on the 5070 Ti. The two mask tests panic at translation (valu_tests.rs:1441) with the `console flow` refusal, which the skip doesn't match. `scalar_counted_in_a_divergent_loop_read_after_it` counts 32 in lanes 0-31 and 64 in lanes 32-63. `scalar_counted_in_nested_divergent_loops` counts 8 and 16. - **Base:** also `0 passed; 4 failed`, but two of them fail differently. The two mask tests fail at `compute_pipeline` with "The parameter is incorrect." (E_INVALIDARG, valu_tests.rs:1447 and :1526), and the two scalar tests give the same wrong half-wave counts. So on a 32-lane NVIDIA card, this PR moves the two pipeline failures to translation failures and leaves all four failing. The scalar counts are wrong with or without it. I haven't tried TinkerBell-90's fixture retry with the console structure. Since the two scalar tests already translate here and still count wrong, I'd guess it helps only the two mask tests on this card. Lib suite on both trees: `273 passed; 4 failed; 6 ignored`, the same four tests failing. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Author
Owner

@⁠WellyngtonSantos on GitHub · 2026-11-27 13:08 UTC · original

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 a22c81c onto a-publier 4eb6cfd conflicts in valu_tests.rs, and build_lanes_cs and the console wave64 lanes on a host without 64-lane waves refusal it matches are no longer there.

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.

**@⁠WellyngtonSantos** on GitHub · 2026-11-27 13:08 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/276#issuecomment-7219103704) 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 `a22c81c` onto `a-publier` `4eb6cfd` conflicts in `valu_tests.rs`, and `build_lanes_cs` and the `console wave64 lanes on a host without 64-lane waves` refusal it matches are no longer there. 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.
Author
Owner

@⁠gut0to on GitHub · 2026-11-27 14:37 UTC · original · reviewed

AI-assisted static review (ChatGPT); I traced the error paths but did not run tests.

**@⁠gut0to** on GitHub · 2026-11-27 14:37 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/276#pullrequestreview-6089740048) · **reviewed** AI-assisted static review (ChatGPT); I traced the error paths but did not run tests.
@ -1486,3 +1508,2 @@
];
let shader = build_lanes_cs(&body).unwrap_or_else(|e| panic!("translation: {e}"));
let host = Host::new(false).unwrap();
let Ok(host) = Host::new(false) else {
Author
Owner

@⁠gut0to on GitHub · 2026-11-27 14:37 UTC · original

Could this skip only the expected no-device or unsupported-wave cases and let other Host::new(false) errors fail the test? That constructor also propagates adapter/device creation and feature-query errors, so this let Ok(host) ... else { return; } reports those regressions as a passing “no SM 6.6 hardware” skip. A narrow classification would keep unsupported runners green without masking D3D12 initialization failures.

**@⁠gut0to** on GitHub · 2026-11-27 14:37 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/276#discussion_r4720654891) Could this skip only the expected no-device or unsupported-wave cases and let other `Host::new(false)` errors fail the test? That constructor also propagates adapter/device creation and feature-query errors, so this `let Ok(host) ... else { return; }` reports those regressions as a passing “no SM 6.6 hardware” skip. A narrow classification would keep unsupported runners green without masking D3D12 initialization failures.
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/276/head:github-bot/gh-276'
git switch 'github-bot/gh-276'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-276'
git switch 'github-bot/gh-276'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-276'
git switch 'github-bot/gh-276'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-276'
git switch 'main'
git merge --squash 'github-bot/gh-276'
git switch 'main'
git merge --ff-only 'github-bot/gh-276'
git switch 'main'
git merge 'github-bot/gh-276'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.