Shader tests: dot products take their operands at run time #1790
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!1790
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1790/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?
@Ingenioeren on GitHub · 2026-11-24 22:38 UTC · original
Ingenioeren:fix/1782-dot4-runtime-operands→main· +8 −3 · 1 files · 1 commits · merged 2026-11-25 21:51 UTCWhat
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
fspx_programs_run_with_the_hardwares_dot_productsfails on RDNA1, where the driver folds a constantDot4AddI8Packedoperand as unsigned #1782@Marvisak on GitHub · 2026-11-25 06:22 UTC · original
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
fspx_programs_run_with_the_hardwares_dot_productsfails on RDNA1, where the driver folds a constantDot4AddI8Packedoperand as unsigned #1782