Shader tests: VICTORY_ADAPTER picks the GPU the hardware checks run on #1889
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1889
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1889"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@alexdeliu on GitHub · 2026-11-25 00:10 UTC · original
alexdeliu:feat/test-adapter→main· +48 −0 · 2 files · 2 commits · openHost::newalways takes the default adapter. On a machine with two GPUs (common: an iGPU beside a graphics card, or a laptop's Intel and NVIDIA), the hardware checks invictory-shader's tests can only run on one of them, and testers post results for half their hardware.With
VICTORY_ADAPTER=<n>,Host::newuses DXGI'snth adapter (0 is the default). The first host of a run names the device on stderr. A wrong index says so once and the hardware checks skip, as they do on a machine without a device. When the variable is unset nothing changes. The README's test section gets two lines about it.Tested on one machine with an AMD RX 9070 (RDNA4, adapter 0) and the Ryzen 7700's iGPU (gfx1036, RDNA2, adapter 1), on
main@70564ae:cargo test -p victory-shader --locked --libgives the same result on both adapters: 208 passed, plus the 2 PSV0 tests that fail onmainwith the Windows SDK'sdxil.dll1.7. Those fail without this change too;VICTORY_ADAPTER=1 … -- --nocaptureprintsVICTORY_ADAPTER=1: AMD Radeon(TM) Graphics, andVICTORY_ADAPTER=7printsno such adapter;adapter_index_reads_a_number_or_nothing, covers parsing the variable.This makes RDNA2 and RDNA4 runs of the same commit from one machine routine, for example for #1599 (AMD's i64 compares, which reproduce on both).
AI-assisted (Claude Code).
🤖 Generated with Claude Code
@aycow on GitHub · 2026-11-25 01:22 UTC · original
@fiestorra Upstream CI at
ccfb029passed. I separately selected each adapter in a local selector-only overlay. Both hardware paths executed on AMD Radeon Graphics and RTX 5070 Laptop GPU. WARP still runs the gather oracle, and its fixed Wave32 pipeline is refused as expected.Explicit NVIDIA selection exposed a separate reproducible issue on driver 581.91.
gathers_at_a_level_match_the_hardwareatsynthetic_tests.rs:261returns[0.0, 1.0, 0.0, 0.0]for lane 0 (NaN U) where the CPU oracle expects zeros. Two runs onccfb029and one on42363abwith only the DXGI ordinal changed gave the same result. The NVIDIA permute test passes. The old Windows runner failure was at a different assertion and lane. Sharing here because explicit selection already has coverage in this PR.The AMD iGPU reports 512 MiB dedicated. NVIDIA reports 7.62 GiB and WARP reports zero. A non-software adapter that reports zero dedicated memory would still be excluded by the default filter, and I did not have one to verify. No assertions were changed.
@Marvisak on GitHub · 2026-11-25 01:37 UTC · original · edited 2026-11-25 22:23 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-shader/src/emit/host.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@Headache3318 on GitHub · 2026-11-25 01:41 UTC · original
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
13afa69applied cleanly onto currentmainccfb029.cargo test -p victory-shader --locked: 118 passed, 0 failed, 1 ignored. All tests pass, including the newadapter_index_reads_a_number_or_nothingtest.cargo clippy -p victory-shader --all-targets -- -D warnings: 3 pre-existing errors in test code (fail identically on mainccfb029). The PR introduces no new clippy warnings.Not tested: Windows MSVC build, the title itself. AI-assisted.
@alexdeliu on GitHub · 2026-11-25 04:50 UTC · original
@catminou4 merged
main(940d32f) in as113f280; no force-push. The conflict was with #1911/#1925'shardware_adapterinhost.rs. Both behaviours are kept: with noVICTORY_ADAPTER, the first adapter that is not software and has dedicated memory is used, exactly as onmain.VICTORY_ADAPTER=<n>takes DXGI's adapterninstead, and the first host of a run names it.Rechecked on the RX 9070 + gfx1036 machine:
cargo test -p victory-shader --locked --libgives 246 passed both by default and withVICTORY_ADAPTER=1(AMD Radeon(TM) Graphics), plus the 2 PSV0 testsmainitself fails with the SDK'sdxil.dll1.7;VICTORY_ADAPTER=7printsno such adapter.@sinan-cmyk on GitHub · 2026-11-25 11:43 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
113f280aontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@KainanP on GitHub · 2026-11-25 12:43 UTC · original
Tested head
113f280(identical to a merge ontomain940d32f) on a dual-GPU laptop. DXGI adapter 0 is an RTX 4060 Laptop (driver 610.47 / 32.0.16.1047), 1 is Intel UHD 8086:a78b (31.0.101.5445), 2 is Microsoft Basic Render Driver. Windows 11 26200, Rust 1.98.1 MSVC, no game data. Rancargo test -p victory-shader --lib --locked --no-fail-fast -- --nocaptureonce per setting.hardware_adapter= RTX 4060)VICTORY_ADAPTER=0VICTORY_ADAPTER=0: NVIDIA GeForce RTX 4060 Laptop GPUVICTORY_ADAPTER=1VICTORY_ADAPTER=1: Intel(R) UHD GraphicsVICTORY_ADAPTER=2VICTORY_ADAPTER=2: Microsoft Basic Render DriverVICTORY_ADAPTER=7VICTORY_ADAPTER=7: no such adapter (...)VICTORY_ADAPTER=Intelnot an adapter index)VICTORY_WARP=1VICTORY_WARP=1 VICTORY_ADAPTER=1VICTORY_WARP=1 VICTORY_ADAPTER=IntelThe switch works. With
=1, the Intel UHD result matches whatmain940d32fgave earlier on this same iGPU with a local adapter hook: 239 / 8 / 3, plus this PR's own test = 240 / 8 / 3. The 8 failures are the iGPU's:bvh_tests×3,arithmetic_matches_the_hardware, thestride_testsno-view read,permutes_read_the_lane_named_and_zero_from_lanes_left_out,image_atomics_of_64_bits,fspx_programs_run_with_the_hardwares_dot_products. Unset and=0give the same 3 NVIDIA failures asmain(stride_tests×2,gathers_at_a_level_match_the_hardware).VICTORY_WARP=1takes precedence over the index, as documented.Things worth knowing:
=7, every hardware check skips and the run reports 248 passed / 0 failed. The oneno such adapterline is the only sign, and plaincargo testcaptures it unless a test fails. A typo looks like a clean run. Suggestion: fail with an error instead of skipping whenVICTORY_ADAPTERis set but unusable.adapter_indexis parsed before thewarpbranch, soHost::new(true)returns the same error. With=Intel(or=igpu), no device opens at all, so the 75 tests that need at least one device panic (e.g.check()'sno SM 6.6 deviceassert), even withVICTORY_WARP=1. Parsing the index only on the non-WARP path would keep WARP working.=2here) and runs the hardware-only checks on it. That yields the 2 WARP failureshardware_adapterexists to avoid (the Wave32 permute, gathers). This is acceptable for an opt-in setting, as the triage says.Relation to #2367. No conflict:
git merge-treeis clean for this PR ontomain, #2367 ontomain, and the two together. They touch different files (victory-shader/src/emit/host.rsvsvictory-gpu/src/host.rs), so they are complementary (test host vs title host), not duplicates. But they claim the same variable with different grammars. #2367 documentsVICTORY_ADAPTER=igpu|dgpu|<index>|<name substring>in the README's switch table. Here only an index is accepted, and anything else fails 75 tests (item 2). A user who follows #2367's README and then runscargo test --workspacehits that. Sharing one parser would fix it (victory-gpualready depends onvictory-shaderwithhost), or this PR could accept the same spellings. At minimum, the indices agree: both useEnumAdapters1order.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.