Shader tests: keep the FSPX dot4 test off folded constants #1791

Open
github-bot wants to merge 1 commit from github-bot/gh-1791 into main AGit
Owner

@⁠Calvix2k on GitHub · 2026-11-24 22:39 UTC · original
Calvix2k:codex/shader-fspx-dot4-test-1782 → main · +22 −5 · 1 files · 1 commits · open

Fixes #1782.

Summary

On RDNA1 the driver's compiler folds a dot4 constant multiplicand with zero-extended bytes, so the FSPX test's literal operands with bytes ≥ 0x80 produced the unsigned dot product on an RX 5700 even though the DXIL asks for the signed opcode.

  • The FSPX test now uses constant operands whose bytes are all below 0x80, where signed and unsigned folding agree.
  • A new dot4_signed_bytes_with_runtime_operands test feeds the original signed values through build_valu_cs's root constants (run-time operands, not literals), so negative-byte signed coverage remains.

No lowering change: the DXIL was already correct.

Validation

  • Both tests pass on a Radeon RX 7800 XT (RDNA3) via the Agility SDK runtime; WARP skipped at SM 6.2.
  • clippy --all-targets --all-features -D warnings and cargo xtask policy (174 files) pass.
  • RDNA1 hardware is not available here; the issue's reproduction on an RX 5700 is the reference for the folded case.
**@⁠Calvix2k** on GitHub · 2026-11-24 22:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1791) `Calvix2k:codex/shader-fspx-dot4-test-1782` → `main` · +22 −5 · 1 files · 1 commits · open Fixes #1782. ## Summary On RDNA1 the driver's compiler folds a `dot4` constant multiplicand with zero-extended bytes, so the FSPX test's literal operands with bytes ≥ 0x80 produced the unsigned dot product on an RX 5700 even though the DXIL asks for the signed opcode. - The FSPX test now uses constant operands whose bytes are all below 0x80, where signed and unsigned folding agree. - A new `dot4_signed_bytes_with_runtime_operands` test feeds the original signed values through `build_valu_cs`'s root constants (run-time operands, not literals), so negative-byte signed coverage remains. No lowering change: the DXIL was already correct. ## Validation - Both tests pass on a Radeon RX 7800 XT (RDNA3) via the Agility SDK runtime; WARP skipped at SM 6.2. - clippy `--all-targets --all-features -D warnings` and `cargo xtask policy` (174 files) pass. - RDNA1 hardware is not available here; the issue's reproduction on an RX 5700 is the reference for the folded case.
RDNA1's driver folds a dot4 constant multiplicand with zero-extended
bytes, so the FSPX case with bytes >= 0x80 produced the unsigned dot
product on an RX 5700 although the DXIL is correct. Use constant bytes
below 0x80 there, and add a run-time-operand build_valu_cs case with the
original signed bytes so the signed dot product is still covered.

Fixes #1782.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:44 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 22:40 UTC · original

Overlap for the reviewers: #1790 (opened a minute earlier) fixes #1782 in the same test, fspx_programs_run_with_the_hardwares_dot_products in valu_tests.rs, the other way round. It loads a, b and the accumulator through v_add_nc_u32 … v4 from a buffer, so every case, the signed high-byte ones included, reaches the driver at run time. This PR keeps literals but limits them to bytes below 0x80, and adds a separate run-time test for the signed values. Both edit the same function, so only one can merge as is. From reading the two diffs' descriptions and file lists; nothing built.

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-24 22:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1791#issuecomment-7146510090) Overlap for the reviewers: #1790 (opened a minute earlier) fixes #1782 in the same test, `fspx_programs_run_with_the_hardwares_dot_products` in `valu_tests.rs`, the other way round. It loads `a`, `b` and the accumulator through `v_add_nc_u32 … v4` from a buffer, so every case, the signed high-byte ones included, reaches the driver at run time. This PR keeps literals but limits them to bytes below 0x80, and adds a separate run-time test for the signed values. Both edit the same function, so only one can merge as is. From reading the two diffs' descriptions and file lists; nothing built. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:22 UTC · original · edited 2026-11-25 11:21 UTC

Automated triage for the maintainers.

Proposed close: duplicate of #1790. The head is the same as at the earlier note. Both PRs fix #1782 in fspx_programs_run_with_the_hardwares_dot_products (crates/victory-shader/src/emit/valu_tests.rs). #1790 makes the FSPX test's operands run-time values, so the FSPX path keeps its negative-byte coverage. This PR moves the literals below 0x80 and checks negative bytes only in a separate non-FSPX test. #1790 is still open and merges cleanly. This PR also still adds a stray second blank line after the use block.

On your reply: thanks for the RX 7800 XT run. It shows the tests pass on RDNA3, but it doesn't change the overlap with #1790, and RDNA3 is not the RDNA1 case from #1782. If the maintainer prefers this approach, removing the label keeps it open.

CI: check passing.

The PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/1791#issuecomment-7154726632) · edited 2026-11-25 11:21 UTC <!-- victory-triage v1 head=8ec8be9d40eb3bc0db2cc92998b755b13c442e95 verdict=proposed-close at=2026-11-25T11:21:15Z --> Automated triage for the maintainers. **Proposed close: duplicate of #1790.** The head is the same as at the earlier note. Both PRs fix #1782 in `fspx_programs_run_with_the_hardwares_dot_products` (`crates/victory-shader/src/emit/valu_tests.rs`). #1790 makes the FSPX test's operands run-time values, so the FSPX path keeps its negative-byte coverage. This PR moves the literals below 0x80 and checks negative bytes only in a separate non-FSPX test. #1790 is still open and merges cleanly. This PR also still adds a stray second blank line after the `use` block. On your reply: thanks for the RX 7800 XT run. It shows the tests pass on RDNA3, but it doesn't change the overlap with #1790, and RDNA3 is not the RDNA1 case from #1782. If the maintainer prefers this approach, removing the label keeps it open. CI: `check` passing. The PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 10:16 UTC · original

Hardware run on an RX 7800 XT (RDNA3), Windows 10 19045, SM 6.6 via the Agility runtime for the test binaries (#486): victory-shader lib suite 248 passed, 0 failed, 3 ignored, including the FSPX dot4 test this PR changes. The runtime-fed operands are exercised on the card here.

**@⁠Calvix2k** on GitHub · 2026-11-25 10:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1791#issuecomment-7159460327) Hardware run on an **RX 7800 XT (RDNA3), Windows 10 19045**, SM 6.6 via the Agility runtime for the test binaries (#486): `victory-shader` lib suite **248 passed, 0 failed, 3 ignored**, including the FSPX dot4 test this PR changes. The runtime-fed operands are exercised on the card here.
github-bot force-pushed github-bot/gh-1791 from 8ec8be9d40 to 2bd170a558 2026-11-26 13:53:27 +00:00 Compare
Author
Owner

@⁠catminou4 on GitHub · 2026-11-24 23:04 UTC · original · approved these changes

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.

FSPX dot4 test kept off folded constants + dot4_signed_bytes_with_runtime_operands: same anti-folding theme as #1790 — complements it.

**@⁠catminou4** on GitHub · 2026-11-24 23:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/1791#pullrequestreview-6048810181) · **approved these changes** 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. FSPX dot4 test kept off folded constants + dot4_signed_bytes_with_runtime_operands: same anti-folding theme as #1790 — complements it.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1791/head:github-bot/gh-1791'
git switch 'github-bot/gh-1791'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1791'
git switch 'github-bot/gh-1791'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1791'
git switch 'github-bot/gh-1791'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1791'
git switch 'main'
git merge --squash 'github-bot/gh-1791'
git switch 'main'
git merge --ff-only 'github-bot/gh-1791'
git switch 'main'
git merge 'github-bot/gh-1791'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1791
No description provided.