Skip to content

Shaders: honor WARP-only mode in paired tests - #2225

Open
andrewpozdnakov7-jpg wants to merge 3 commits into
Marvisak:mainfrom
andrewpozdnakov7-jpg:test/honor-warp-only-in-shader-tests
Open

andrewpozdnakov7-jpg wants to merge 3 commits into
Marvisak:mainfrom
andrewpozdnakov7-jpg:test/honor-warp-only-in-shader-tests

Conversation

@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor

Change

Paired shader tests now use one adapter selector. With VICTORY_WARP=1, they run the WARP case once. Without the override, they keep both cases and try the hardware adapter first.

Previously the hardware case created WARP when the override was set. The explicit-LOD gather test then used WARP's native gather as its hardware reference, even though the test already accounts for the different rounding on WARP.

Verification

Same gather fixture on 940d32f69b22265690a0b5a15d6ded572ba33baf, with WARP forced. Before, the hardware comparison failed at lane 4. After, WARP executes and both translated gather paths match the expected footprint for all 32 records.

Full shader suite: 244 passed / 3 failed / 3 ignored before, 245 passed / 2 failed / 3 ignored after. The pre-existing lane-permute and edge-flagged mesh tests still fail on this WARP runtime. Strict shader Clippy and staged asset policy passed.

AI-assisted with Codex.

@DenRakEiw DenRakEiw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-shader --lib emit::memory_tests:: — 3 passed, 0 failed on both RTX 5090 hardware and VICTORY_D3D12_WARP=1
  • cargo clippy -p victory-shader --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean test_backends() helper honoring WARP-only mode across paired shader tests. Looks good.

AI-assisted (Gemini 4 Neon).

@andrewpozdnakov7-jpg

andrewpozdnakov7-jpg commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

I checked the remaining lane-permute failure separately. Native DXC HLSL with [WaveSize(32)] and WaveReadLaneAt(1000 + lane, (13 * lane + 5) & 31) reproduces it in the app-local WARP 1.0.22 / Agility 1.620.2 setup. All 32 variable-index reads differed from the expected lane. For example, the request for lane 5 returned 1017 instead of 1005. Applying the same ballot mask produced the same 32 output words as the translated fixture.

A native constant-index broadcast of lane 5 returned 1005, and selecting among 32 constant-index broadcasts returned the expected result for every lane. This isolates the remaining failure to the variable-index WARP shuffle seen by the existing test.

If you reuse the test changes or the native control in another commit, please preserve the original Git author. If you fold them into your own commit, please add:

Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARP-only mode honored in paired shader tests. Tested locally: merged into main 940d32f, cargo test -p victory-shader --locked on macOS arm64 — 144 passed, 0 failed, 2 ignored (Windows-gated hardware tests). Approving.

@kotekompotek

Copy link
Copy Markdown

Checked the env semantics: warp_forced() matches Host::new exactly (v == "1"), so the selector can't diverge — new(false) under VICTORY_WARP=1 does build a second WARP device, making the "hardware" arm run WARP against WARP. Filtering that arm out is the right fix, and routing every paired test through one test_backends() keeps the policy in one place.

@sinan-cmyk

Copy link
Copy Markdown

Offline measurement on a retail dump

Result: no count change against main.

I merged head b3a6869 onto main 940d32f (clean merge) and ran victory translate --validate --list on shaders.rpf (1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result with main program by program (25,889 programs). Validated: 23,918 on main, 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).

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. Thanks for the follow-up. d239815 switches the paired-backend loops main gained to Host::test_backends() (crosslane, memory, stride, synthetic, VALU, waterfall, BVH, diff, flow and mod tests, check in semantics_tests.rs, and the FMad probe); merged with main, the literal [("hardware", false), ("warp", true)] now appears only inside test_backends (emit/host.rs), and warp_forced() is shared with Host::new, so VICTORY_WARP=1 no longer runs WARP under the "hardware" label.

CI: passing.


Generated by Claude Code

@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor Author

I resolved the emit/host.rs merge conflict introduced by #244 in cd5f91f. The branch keeps the original authored commit b3a6869 and the shared WARP device and lock from upstream.

With VICTORY_WARP=1, the same gather fixture fails on 61bfc77 in the hardware-labelled lane 4 comparison in six runs. It passes on cd5f91f in all six. The serial shader suite moved from 271 passed / 5 failed / 3 ignored to 273 passed / 3 failed / 3 ignored. The remaining failures were present on the same upstream base: two WARP lane-permute cases and the edge-flagged triangle case. Strict shader Clippy with and without host support and asset policy passed.

Please preserve the Git author if moving the test changes. If they are folded into another commit, please retain this trailer.

Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com

AI-assisted with Codex. Synthetic shader fixtures on Windows/WARP.

@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor Author

I checked how this branch composes with #2997. The exact #2225 head cd5f91f and #2997 head 92bfec2 merge cleanly on upstream 63bcca4.

Using the same app-local WARP, DXIL validator configuration, and serial shader test command, #2997 alone gives 300 passed, 2 failed, and 3 ignored. The combination gives 301 passed, 1 failed, and 3 ignored. The explicit-LOD gather test is the added pass, and both permutation checks still pass. The existing edge-flagged mesh triangle test reports 0 of 256 lit pixels on both trees with this WARP build.

Please keep my Git author if you move the paired-backend fix. If you fold it into another commit, please include:

Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com

AI-assisted with Codex. Synthetic shader fixtures.

@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor Author

I merged current main 63bcca4 into d239815. I switched the eight remaining paired loops in crosslane, memory, stride, and synthetic tests to Host::test_backends(). Both VALU loops named in the review use the helper on the merged tree. The FMad probe now uses the same helper so forced WARP cannot run under its hardware label either.

With VICTORY_WARP=1 on Windows, the D16 probe requested two hardware-labelled cases plus two WARP cases before and only the two WARP cases after. The FMad probe went from one case with each label to one WARP case. With the override unset, both probes still attempt both backends. The serial app-local WARP run moved from 298 passed / 4 failed / 3 ignored to 299 passed / 3 failed / 3 ignored. The divergent lane-permute test now passes. The two remaining lane-permute failures and the edge-flagged triangle failure were present on the input tree. Strict shader Clippy and asset policy passed.

Please preserve my Git author if you move these test changes. If you fold them into another commit, please include:

Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com

AI-assisted with Codex. Synthetic Windows/WARP tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants