Shader tests: dot products take their operands at run time #1789
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1790"
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?
Imported from Marvisak/VIctory. Originally posted by Ingenioeren on 2026-11-24T22:38:57Z.
What
emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_productsloadeda,band the accumulator withv_mov_b32 vN, literal. Now each one isv_add_nc_u32 vN, literal, v4, wherev4comes from abuffer_load_dwordof the zeroed result UAV, so the driver sees run-time values. The cases, the expected values and the ACCC container path are the same as before. Only the test changes; the translator does not.Why
#1782: on an RX 5700 (RDNA1) the driver zero-extends the bytes of a dot4 multiplicand it can treat as a constant. The test then fails with
0x80007FF5(the unsigned dot product) where it should get0x7FFFFBF5. The reporter found that with run-time operands the RX 5700 gives the signed result, and that WARP is right either way. The lowering (dot4AddPacked.i32, opcode 163) is correct, so the test is what has to change. As the issue says, the case with the inline2.0is still a constant, but none of its bytes is0x80or higher.How tested
Windows 11, AMD Radeon RX 6750 XT (RDNA2) and WARP:
cargo test --locked -p victory-shader --lib fspx_programs_run: passes before and after the change.dot4AddPacked.u32(164). The test fails withleft: 2147516405(0x80007FF5), the same value as the RDNA1 report. I reverted that change.cargo test --locked -p victory-shader: 207 passed, 2 failed, 2 ignored. The 2 failures (emit::rect::tests::rectangles_get_their_fourth_cornerandemit::tests::elements_sharing_a_row_keep_their_order, both DXIL validatorunwraps) also fail on a clean70564aeon this machine, so this change doesn't cause them.cargo clippy --locked -p victory-shader --all-targets: no warnings.cargo run -p xtask -- policy --staged: ok.Not tested: RDNA1. I have no RX 5700, so I haven't confirmed that this makes the test pass there. That relies on the reporter's measurements in #1782.
Fixes #1782
AI assistance: prepared with Claude Code, reviewed by Ingenioeren.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:04:16Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
70564ae), cargo test -p victory-shader --locked → 118 passed, 0 failed. GPU execution tests (valu_tests/host) are #[cfg(all(test, windows))] and run only on Windows; macOS covers lowering/structure unit tests.Dot products take operands at run time: keeps the FSPX/dot lowering from folding constants so the GPU test exercises real operand fetch. Test-only change class.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:22:33Z.
Automated triage for the maintainers.
Merge candidate.
fspx_programs_run_with_the_hardwares_dot_products(crates/victory-shader/src/emit/valu_tests.rs) now builds its three operands at run time: each is a literal plus a word loaded from the still-zero UAV. Before, they werev_mov_b32literals, which the RDNA1 driver folds as unsigned bytes (#1782). The test keeps its original operands with negative bytes, so it still covers the signed case. I checked that the hand-encodedbuffer_load_dword v4, off, s[8:11]uses the descriptorfspx_csloads intos[8:11]and the same UAV the result is stored to. Test-only change.#1791 targets the same failure but changes the operands to avoid bytes ≥ 0x80; this PR is the better of the two.
CI: no check runs on the head commit.
Generated by Claude Code