Repository navigation
Shader tests: a software adapter (a CI runner's) skips what only GPU hardware does - #1752
BastienRodz wants to merge 1 commit into
Conversation
…hardware does On a GPU-less windows-latest CI runner, Host::new(false) gets the Microsoft Basic Render Driver (WARP behind adapter 0), causing two tests in victory-shader to fail on main: - gathers_at_a_level_match_the_hardware only skipped the hardware gather-rounding check when the warp flag was true, so the "hardware" pass ran it against WARP and failed on lane 4. - permutes_read_the_lane_named_and_zero_from_lanes_left_out skipped each device that refused the wave-32 pipeline and then failed assert!(ran > 0) when both adapters were WARP. Add Host::is_software(&self) to inspect the device's adapter via GetAdapterLuid, IDXGIFactory4::EnumAdapterByLuid, and GetDesc1 (DXGI_ADAPTER_FLAG_SOFTWARE or VendorId 0x1414 / DeviceId 0x8c). Skip the gather-rounding check when warp || host.is_software(), and have the permute test print a skip line and return when no device can run it. Apply the same software-adapter check where flow_tests and diff_tests skip fixed-wave-size pipeline rejections on WARP. Co-Authored-By: Gemini 4 Neon <noreply@google.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested
The RTX gather failure predates this PR. The unmodified test failed on lane 0 on both the parent ( 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 |
|
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
Would you file those with your numbers? You have the setups that reproduce them. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (70564ae, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
cargo test -p victory-shader --lib emit::flow_tests::— passed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok
Clean Host::is_software() guard so software adapters (such as CI WARP runners) skip hardware-only shader tests cleanly. Looks good.
AI-assisted (Gemini 4 Neon).
|
Superseded by |
|
@BastienRodz I filed the executable Wave32 permutation failure as #2949. On current main The other requested follow-up, the NVIDIA gather mismatch, is already covered by the raw-view fixture changes in #2323 and #2357. |
What'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