Shader tests: keep dot4 test operands runtime for RDNA1 #1877

Open
n-romanovich wants to merge 2 commits from upstream-pr/1879 into main
n-romanovich commented 2026-11-24 23:59:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by n-romanovich on 2026-11-24T23:59:16Z.


Fixes #1782.

Summary

emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products previously loaded a, b, and acc with v_mov_b32 vN, literal, so drivers without native dot4 (RDNA1) constant-folded signed byte multiplicands >= 0x80 as unsigned.

This adds v0 (tid.x, 0 in the [1, 1, 1] dispatch) to each literal via v_add_nc_u32 so the operands stay runtime values while testing the same v_dot4_i32_i8 / v_dot4c_i32_i8 lowering and opsel / opsel_hi cases.

Testing

  • cargo test -p victory-shader --locked -- fspx_programs_run_with_the_hardwares_dot_products (1 passed, 0 failed)
  • No game data used. AI-assisted.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6593928810 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1879). Originally posted by [n-romanovich](https://github.com/n-romanovich) on 2026-11-24T23:59:16Z. --- Fixes #1782. ### Summary `emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products` previously loaded `a`, `b`, and `acc` with `v_mov_b32 vN, literal`, so drivers without native `dot4` (RDNA1) constant-folded signed byte multiplicands >= `0x80` as unsigned. This adds `v0` (`tid.x`, `0` in the `[1, 1, 1]` dispatch) to each literal via `v_add_nc_u32` so the operands stay runtime values while testing the same `v_dot4_i32_i8` / `v_dot4c_i32_i8` lowering and `opsel` / `opsel_hi` cases. ### Testing - `cargo test -p victory-shader --locked -- fspx_programs_run_with_the_hardwares_dot_products` (1 passed, 0 failed) - No game data used. AI-assisted.
catminou4 commented 2026-11-25 03:02:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:17:11Z.

Review: APPROVED


Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, cargo test -p victory-shader --locked.

144 passed / 0 failed / 2 ignored (baseline-identical). Keeping dot4 operands runtime avoids constant-folding so the RDNA1 path is actually exercised — correct test fix.

<!-- greyfinch-sync:Marvisak/VIctory:review:6050697692 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1879#pullrequestreview-6050697692). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T02:17:11Z. **Review:** APPROVED --- Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f69b, `cargo test -p victory-shader --locked`. 144 passed / 0 failed / 2 ignored (baseline-identical). Keeping dot4 operands runtime avoids constant-folding so the RDNA1 path is actually exercised — correct test fix.
Marvisak commented 2026-11-25 09:06:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:20:07Z.


Automated triage for the maintainers.

Proposed close: already in main. The merge of origin/main into this branch leaves only one change against main: load.clone() becomes load.to_vec() in fspx_programs_run_with_the_hardwares_dot_products (crates/victory-shader/src/emit/valu_tests.rs), and that has no effect. The fix for #1782 is already in main through #1790 (49761f9). That test now makes each operand at run time as a literal plus a word loaded from the zeroed UAV (buffer_load_dword v4 and v_add_nc_u32 vN, literal, v4), which is what this PR set out to do.

CI: passing (check).

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


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7156897553 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1879#issuecomment-7156897553). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T08:20:07Z. --- <!-- victory-triage v1 head=d92dea205fec531b9d9c532c680f1e25e4944b90 verdict=proposed-close at=2026-11-26T01:19:48Z --> Automated triage for the maintainers. **Proposed close: already in main.** The merge of `origin/main` into this branch leaves only one change against `main`: `load.clone()` becomes `load.to_vec()` in `fspx_programs_run_with_the_hardwares_dot_products` (`crates/victory-shader/src/emit/valu_tests.rs`), and that has no effect. The fix for #1782 is already in `main` through #1790 (`49761f9`). That test now makes each operand at run time as a literal plus a word loaded from the zeroed UAV (`buffer_load_dword v4` and `v_add_nc_u32 vN, literal, v4`), which is what this PR set out to do. CI: passing (`check`). 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)_
sinan-cmyk commented 2026-11-25 12:03:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T11:51:11Z.


Offline measurement on a retail dump

Result: no count change against main.

I merged head 5a8fc617 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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7161584211 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1879#issuecomment-7161584211). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-25T11:51:11Z. --- ### Offline measurement on a retail dump **Result: no count change against `main`.** I merged head 5a8fc617 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).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1879:upstream-pr/1879'
git switch 'upstream-pr/1879'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1879'
git switch 'upstream-pr/1879'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1879'
git switch 'upstream-pr/1879'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1879'
git switch 'main'
git merge --squash 'upstream-pr/1879'
git switch 'main'
git merge --ff-only 'upstream-pr/1879'
git switch 'main'
git merge 'upstream-pr/1879'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1877
No description provided.