VICTORY_D3D12_ADAPTER: a model number (6700, 4090) names its card instead of matching no index #300

Open
compaccount1-coder wants to merge 1 commit from upstream-pr/300 into main
compaccount1-coder commented 2026-11-26 15:02:20 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by compaccount1-coder on 2026-11-26T15:02:20Z.


What and why

The README says VICTORY_D3D12_ADAPTER takes "a zero-based DXGI index or part of the adapter's name", but adapter_matches treated any value that parses as a number as an index only. A card's model number is the obvious part of its name to type, and it never matched:

  • VICTORY_D3D12_ADAPTER=6700 on a PC with an RX 6700 XT: no adapter has index 6700, so create_preferred_device returns VICTORY_D3D12_ADAPTER=6700 matched no hardware adapter and the run ends.
  • In the test suites it is quieter: host() comes back None, and every GPU test returns early as if there were no GPU. They pass without having run. That is how I found it: a failing GPU test passed with 6700, in 0.01 s.

The same goes for 4090, 3080, 5070, 9070 and so on.

The change

A number is an index where an adapter has it, and otherwise part of a name like any other text. The choice is now a plain function, pick_adapter, over the adapters DXGI lists, so it can be tested without a GPU.

  • Indexes behave as before (0, 1, ...).
  • The software adapter is still never picked, by index or by name. Its index now gives the same "matched no hardware adapter" error as before, rather than falling through to a name match.
  • The README's wording now holds as written, so it needs no change.

Tested

  • an_explicit_adapter_matches_an_index_or_name was rewritten for pick_adapter. It keeps the old cases (index, name, empty, case) and adds the software adapter by index and by name, plus model numbers on a laptop and a desktop list.
  • On a real PC (RX 6700 XT + Ryzen 7000 graphics, Windows 11): 6700 and 0 pick the RX 6700 XT (the GPU tests run on it), 1 and radeon(tm) the integrated GPU, and 4090 and 2 (WARP) nothing.
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings is clean. Only this file changes.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6629433927 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/300). Originally posted by [compaccount1-coder](https://github.com/compaccount1-coder) on 2026-11-26T15:02:20Z. --- ### What and why The README says `VICTORY_D3D12_ADAPTER` takes "a zero-based DXGI index or part of the adapter's name", but `adapter_matches` treated any value that parses as a number as an index only. A card's model number is the obvious part of its name to type, and it never matched: - `VICTORY_D3D12_ADAPTER=6700` on a PC with an RX 6700 XT: no adapter has index 6700, so `create_preferred_device` returns `VICTORY_D3D12_ADAPTER=6700 matched no hardware adapter` and the run ends. - In the test suites it is quieter: `host()` comes back `None`, and every GPU test returns early as if there were no GPU. They *pass* without having run. That is how I found it: a failing GPU test passed with `6700`, in 0.01 s. The same goes for `4090`, `3080`, `5070`, `9070` and so on. ### The change A number is an index where an adapter has it, and otherwise part of a name like any other text. The choice is now a plain function, `pick_adapter`, over the adapters DXGI lists, so it can be tested without a GPU. - Indexes behave as before (`0`, `1`, ...). - The software adapter is still never picked, by index or by name. Its index now gives the same "matched no hardware adapter" error as before, rather than falling through to a name match. - The README's wording now holds as written, so it needs no change. ### Tested - `an_explicit_adapter_matches_an_index_or_name` was rewritten for `pick_adapter`. It keeps the old cases (index, name, empty, case) and adds the software adapter by index and by name, plus model numbers on a laptop and a desktop list. - On a real PC (RX 6700 XT + Ryzen 7000 graphics, Windows 11): `6700` and `0` pick the RX 6700 XT (the GPU tests run on it), `1` and `radeon(tm)` the integrated GPU, and `4090` and `2` (WARP) nothing. - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings` is clean. Only this file changes. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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/300:upstream-pr/300'
git switch 'upstream-pr/300'

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/300'
git switch 'upstream-pr/300'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/300'
git switch 'upstream-pr/300'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/300'
git switch 'main'
git merge --squash 'upstream-pr/300'
git switch 'main'
git merge --ff-only 'upstream-pr/300'
git switch 'main'
git merge 'upstream-pr/300'
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
avatarmanz/VIctory-7900XTX!300
No description provided.