Tests: VICTORY_ADAPTER picks the hardware adapter by name (and intersect_tests on RDNA4 + RDNA2) #58

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

@⁠alexdeliu on GitHub · 2026-11-25 23:42 UTC · original
alexdeliu:test/adapter-by-name → main · +38 −1 · 1 files · 1 commits · open

On a PC with two GPUs, the default D3D12 device may not be the card you want to test. This adds VICTORY_ADAPTER: the hardware tests' Host::new picks the first adapter whose description contains that text, in any case (for example VICTORY_ADAPTER=9070 or VICTORY_ADAPTER="radeon(tm)"). It prints which adapter it took. VICTORY_WARP=1 and the default device work as before, and an empty value is ignored. If no adapter matches, Host::new returns an error listing the adapters it saw, and the hardware tests skip as they do on a machine without a card.

It is test-side only, one file: crates/victory-shader/src/emit/host.rs.

Why: your ray-test emulation on two more AMD generations

Issues are off here, so I'm putting the results in this PR. They are why I needed the change: this PC has an RX 9070 and a Ryzen 7 7700 iGPU, and the iGPU can't be reached without it.

cargo test --locked -p victory-shader --lib intersect_tests -- --test-threads=1 at 2e01ab4 + this commit, Windows 11, dxil.dll 1.8.2502.11:

adapter intersect_tests
AMD Radeon RX 9070 (RDNA4), driver 32.0.32029.2010 9 passed, 0 failed
AMD Radeon(TM) Graphics, Ryzen 7 7700 iGPU (RDNA2, gfx1036), driver 32.0.21045.29003 9 passed, 0 failed
WARP (VICTORY_WARP=1) 9 passed, 0 failed

The tests that ran:

  • both node tests, 64-bit and 32-bit, in a host buffer and over title memory;
  • the reflected-ray walk through the guest directory;
  • raw guest writes (stores and both atomic forms);
  • the descriptor-of-numbers read;
  • the triangle-id refusal;
  • the WARP ray probe.

So the slab tests, the sorting network and the watertight triangle test agree bit for bit with bvh.rs on RDNA2 and RDNA4 as well as on your 7900 XTX (RDNA3). The iGPU runs undeclared compute as 32-lane waves and the RX 9070 as 64-lane, and both pass.

Whole victory-shader suite at the same head (cargo test --locked -p victory-shader --lib -- --test-threads=1):

adapter result
RX 9070 (VICTORY_ADAPTER=9070) 237 passed, 0 failed, 4 ignored
Ryzen 7 7700 iGPU (VICTORY_ADAPTER="radeon(tm)") 237 passed, 0 failed, 4 ignored
WARP (VICTORY_WARP=1) 234 passed, 3 failed, 4 ignored

The three WARP failures are ds_min_max_f32_order_floats_and_return_the_old_value, v_permlane16_and_x16_read_the_lanes_their_selectors_pick and whole_wave_f64_sum_and_cvt_f32_f64. The WARP path is untouched here, and all three pass on both AMD cards, so they look like WARP's own behaviour rather than anything in this change.

cargo clippy --locked -p victory-shader --all-targets: no warnings in the changed file.

🤖 Generated with Claude Code

**@⁠alexdeliu** on GitHub · 2026-11-25 23:42 UTC · [original](https://github.com/DexNom/VIctory/pull/58) `alexdeliu:test/adapter-by-name` → `main` · +38 −1 · 1 files · 1 commits · open On a PC with two GPUs, the default D3D12 device may not be the card you want to test. This adds `VICTORY_ADAPTER`: the hardware tests' `Host::new` picks the first adapter whose description contains that text, in any case (for example `VICTORY_ADAPTER=9070` or `VICTORY_ADAPTER="radeon(tm)"`). It prints which adapter it took. `VICTORY_WARP=1` and the default device work as before, and an empty value is ignored. If no adapter matches, `Host::new` returns an error listing the adapters it saw, and the hardware tests skip as they do on a machine without a card. It is test-side only, one file: `crates/victory-shader/src/emit/host.rs`. ## Why: your ray-test emulation on two more AMD generations Issues are off here, so I'm putting the results in this PR. They are why I needed the change: this PC has an RX 9070 and a Ryzen 7 7700 iGPU, and the iGPU can't be reached without it. `cargo test --locked -p victory-shader --lib intersect_tests -- --test-threads=1` at `2e01ab4` + this commit, Windows 11, dxil.dll 1.8.2502.11: | adapter | `intersect_tests` | |---|---| | AMD Radeon RX 9070 (RDNA4), driver 32.0.32029.2010 | 9 passed, 0 failed | | AMD Radeon(TM) Graphics, Ryzen 7 7700 iGPU (RDNA2, gfx1036), driver 32.0.21045.29003 | 9 passed, 0 failed | | WARP (`VICTORY_WARP=1`) | 9 passed, 0 failed | The tests that ran: - both node tests, 64-bit and 32-bit, in a host buffer and over title memory; - the reflected-ray walk through the guest directory; - raw guest writes (stores and both atomic forms); - the descriptor-of-numbers read; - the triangle-id refusal; - the WARP ray probe. So the slab tests, the sorting network and the watertight triangle test agree bit for bit with `bvh.rs` on RDNA2 and RDNA4 as well as on your 7900 XTX (RDNA3). The iGPU runs undeclared compute as 32-lane waves and the RX 9070 as 64-lane, and both pass. Whole `victory-shader` suite at the same head (`cargo test --locked -p victory-shader --lib -- --test-threads=1`): | adapter | result | |---|---| | RX 9070 (`VICTORY_ADAPTER=9070`) | 237 passed, 0 failed, 4 ignored | | Ryzen 7 7700 iGPU (`VICTORY_ADAPTER="radeon(tm)"`) | 237 passed, 0 failed, 4 ignored | | WARP (`VICTORY_WARP=1`) | 234 passed, 3 failed, 4 ignored | The three WARP failures are `ds_min_max_f32_order_floats_and_return_the_old_value`, `v_permlane16_and_x16_read_the_lanes_their_selectors_pick` and `whole_wave_f64_sum_and_cvt_f32_f64`. The WARP path is untouched here, and all three pass on both AMD cards, so they look like WARP's own behaviour rather than anything in this change. `cargo clippy --locked -p victory-shader --all-targets`: no warnings in the changed file. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a machine with two GPUs the default device may not be the one under
test. VICTORY_ADAPTER names the adapter by a part of its description
(any case); WARP (VICTORY_WARP=1) and the default are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:32:55 +00:00
Author
Owner

@⁠Yoshi-233 on GitHub · 2026-11-26 03:58 UTC · original

One diagnostic issue I found while checking how to reuse this on a dual-GPU machine: an explicit adapter typo can still produce a green result for the_64_bit_node_test_in_a_host_buffer_matches_the_reference_on_the_card. At 60d0b07, its run helper discards the error from Host::new(false), goes on to run WARP, and only checks ran > 0. That also hides the list of adapters your new error returns. The reflected-ray test has a similar skip path.

A useful Windows negative control, on a machine with working WARP, is:

$env:VICTORY_ADAPTER = "intentionally-no-such-adapter"
cargo test --locked -p victory-shader --lib the_64_bit_node_test_in_a_host_buffer_matches_the_reference_on_the_card -- --nocapture
Remove-Item Env:VICTORY_ADAPTER

I traced this in the PR source on Linux. For explicit hardware selection, could the hardware leg propagate the error when a name was requested, while keeping the automatic skip when no selector was supplied? Then this negative control would fail with the enumerated names, and a green run under an explicit selector would confirm the named device actually participated.

**@⁠Yoshi-233** on GitHub · 2026-11-26 03:58 UTC · [original](https://github.com/DexNom/VIctory/pull/58#issuecomment-7182183739) One diagnostic issue I found while checking how to reuse this on a dual-GPU machine: an explicit adapter typo can still produce a green result for `the_64_bit_node_test_in_a_host_buffer_matches_the_reference_on_the_card`. At `60d0b07`, its `run` helper discards the error from `Host::new(false)`, goes on to run WARP, and only checks `ran > 0`. That also hides the list of adapters your new error returns. The reflected-ray test has a similar skip path. A useful Windows negative control, on a machine with working WARP, is: ```powershell $env:VICTORY_ADAPTER = "intentionally-no-such-adapter" cargo test --locked -p victory-shader --lib the_64_bit_node_test_in_a_host_buffer_matches_the_reference_on_the_card -- --nocapture Remove-Item Env:VICTORY_ADAPTER ``` I traced this in the PR source on Linux. For explicit hardware selection, could the hardware leg propagate the error when a name was requested, while keeping the automatic skip when no selector was supplied? Then this negative control would fail with the enumerated names, and a green run under an explicit selector would confirm the named device actually participated.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/58/head:github-bot/gh-58'
git switch 'github-bot/gh-58'

Merge

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