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

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

@⁠compaccount1-coder on GitHub · 2026-11-26 15:02 UTC · original
compaccount1-coder:fix/adapter-number-names → main · +65 −16 · 1 files · 1 commits · open

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

**@⁠compaccount1-coder** on GitHub · 2026-11-26 15:02 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/300) `compaccount1-coder:fix/adapter-number-names` → `main` · +65 −16 · 1 files · 1 commits · open ### 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)
The README offers "a zero-based DXGI index or part of the adapter's name",
but any value that parsed as a number was taken for an index only. With
VICTORY_D3D12_ADAPTER=6700 on a PC with an RX 6700 XT, no adapter has index
6700, so the runtime ended with "matched no hardware adapter" and every GPU
test returned early as if there were no GPU (they passed without running).

A number is now an index where an adapter has it, else part of a name like
any other text. Indexes behave as before, the software adapter is still never
picked (by index or name), and the choice is a plain function with a test
(pick_adapter, no GPU needed).

Tried on an RX 6700 XT + Ryzen 7000 graphics: 6700 and 0 pick the RX 6700 XT,
1 and "radeon(tm)" the integrated one, 4090 and 2 (WARP) nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:03:24 +00:00
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/300/head:github-bot/gh-300'
git switch 'github-bot/gh-300'

Merge

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