Shader tests: a software adapter (a CI runner's) skips what only GPU hardware does #1752
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!1752
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1752/head"
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?
@BastienRodz on GitHub · 2026-11-24 21:59 UTC · original
BastienRodz:shader-tests/software-adapter→main· +30 −4 · 4 files · 1 commits · closed without mergingWhat's wrong
CI on
main(run 45492970391,windows-latest, no GPU) fails two tests invictory-shader:emit::synthetic_tests::gathers_at_a_level_match_the_hardware:assertion `left == right` failed: hardware: lane 4 against its gather(left: [66.0, 67.0, 35.0, 34.0],right: [65.0, 66.0, 34.0, 33.0])emit::synthetic_tests::permutes_read_the_lane_named_and_zero_from_lanes_left_out:no device ran the permuteOn a runner without a GPU,
Host::new(false)(D3D12CreateDevice(None, ...), adapter 0) gets the Microsoft Basic Render Driver (WARP behind the default adapter). The gather test skipped the hardware-rounding check only when thewarpflag wastrue, so it ran the hardware-only check against WARP. The permute test skipped every device that refused the wave-32 pipeline and then failedassert!(ran > 0, "no device ran the permute")when both adapters were WARP.What the fix does
Host::is_software(&self) -> boolincrates/victory-shader/src/emit/host.rs, querying the device's adapter viaGetAdapterLuid,IDXGIFactory4::EnumAdapterByLuid, andIDXGIAdapter1::GetDesc1, and reportingtruewhenDXGI_ADAPTER_FLAG_SOFTWAREis set orVendorId == 0x1414 && DeviceId == 0x8c.gathers_at_a_level_match_the_hardware(synthetic_tests.rs), skips the "against its gather" rounding assertion whenwarp || host.is_software()instead of onlywarp.permutes_read_the_lane_named_and_zero_from_lanes_left_out(synthetic_tests.rs), printsno device ran the permute; skippedand returns whenran == 0, while keepingassert_eq!(out[0], want, "{label}")for any device that runs the pipeline.warp || host.is_software()check inflow_tests.rsanddiff_tests.rswhere fixed-wave-size pipeline creation errors are skipped on WARP.Tests
cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: passcargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings: passcargo xtask policy: passcargo xwin test -p victory-shader --target x86_64-pc-windows-msvc -- --test-threads=1(Linux host under Wine, no SM 6.6 device):147 passed; 62 failed; 2 ignored(vs146 passed; 63 failed; 2 ignoredonorigin/main;permutes_read_the_lane_named_and_zero_from_lanes_left_outnow skips and passes, while the remaining 62 failures require an SM 6.6 device).windows-latestwith the upstream CI's commands (clippy-D warningswith and without--all-features, thencargo test --workspace --locked): everything passes;victory-shader209 passed, 0 failed, including both tests above: https://github.com/BastienRodz/VIctory/actions/runs/45496058662Not tested: a GPU where
Host::new(false)is real hardware. Behavior on a real hardware adapter is unchanged (host.is_software()isfalse, so every hardware assertion still runs).No game data used. AI-assisted: implemented with Gemini 4 Neon, reviewed and verified with Claude Code.
Related: the same two failures show on the open PRs rebased onto
70564ae(#926, #928).🤖 Generated with Claude Code
@steven-seagull27 on GitHub · 2026-11-24 22:11 UTC · original
Tested
1bf4933on Windows 11 build 26300.10075 with an RTX 5080 (driver 621.24), built-in Windows WARP, and app-local Microsoft WARP 1.0.22. The adapter check identified the RTX as hardware and both WARP drivers as software.The RTX gather failure predates this PR. The unmodified test failed on lane 0 on both the parent (
70564ae) and the PR head (1bf4933): it returned[0, 1, 0, 0]and expected[0, 0, 0, 0]. I used temporary counters to get past the first assertion. The 64 comparisons above cover 32 lanes each for the plain and offset gathers. The separate hardware-only comparison against the native gather also ran on the RTX and differed on 3 of 16 lanes.With WARP 1.0.22, the unmodified permutation test reproduced the failure. Lanes 5, 6, 12, 13, 18, 21, and 22 differed. For example, lane 5 returned
1022and expected1006. With built-in WARP forced for both adapter requests, the test runner reported two passes, but the permutation explicitly loggedno device ran the permute; skipped.@BastienRodz on GitHub · 2026-11-24 22:14 UTC · original
Thanks, that confirms the scope. The adapter check sorts the RTX as hardware and both WARPs as software. The CI runner's case, built-in WARP with no wave-32 pipeline, now skips the permute instead of failing. The other two results are failures this PR leaves exactly as they were, and they look worth an issue of their own each, since they come from
main's new tests on real setups and not from the runner:70564aetoo: lane 0 returns[0, 1, 0, 0]where[0, 0, 0, 0]is expected, and 3 of 16 lanes differ from the native gather;1022where1006is expected).Would you file those with your numbers? You have the setups that reproduce them.
@BastienRodz on GitHub · 2026-11-25 00:46 UTC · original
Superseded by
42363abonmain(the test host refuses a software default adapter, and the permute test skips when only WARP is there), which fixes the same two CI failures. Thanks to steven-seagull27 and DenRakEiw for testing this one.@steven-seagull27 on GitHub · 2026-11-26 01:22 UTC · original
@BastienRodz I filed the executable Wave32 permutation failure as #2949. On current main
63bcca43the RTX 5080 matched 32/32 and WARP 1.0.22 matched 25/32. A native HLSL shader reproduced the exact same seven lanes, including lane 5 returning 1022 for an expected 1006. Built-in WARP skipped before dispatch.The other requested follow-up, the NVIDIA gather mismatch, is already covered by the raw-view fixture changes in #2323 and #2357.
Pull request closed