Tests: the dot products run with operands loaded at run time, not literals #1898

Closed
fiestorra wants to merge 1 commit from upstream-pr/1900 into main
fiestorra commented 2026-11-25 00:21:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-25T00:21:46Z.


The test no longer needs literals: its operands come from user data now

I took the two things the report settled into a change, because you are right that the translator is not where the fix goes and the test is.

What changes: fspx_programs_run_with_the_hardwares_dot_products builds its program with build_valu_cs — a plain compute shader whose four root constants are the case's inputs — and the multiplicands and accumulator reach v_dot4_i32_i8 through v_mov_b32 vN, sN at run time, instead of v_mov_b32 vN, <literal>. The case inputs are [a, b, acc, 0], so the three literal-multiplicand cases are gone.

Why the operands could not stay literals in an FSPX program: in an ACCC-shaped program the user data are the hardware's own SGPRs (s0-s3 are the thread's ids), so a shader of that shape cannot carry operands at all — it can only name them as literals, which is exactly the form the RDNA1 driver folds into v_dot4c and zero-extends. So the test runs the same instructions with values loaded at run time, which is the shape a title's shader has whenever its multiplicands are computed rather than declared. Its fspx_cs helper goes with the change (nothing else used it), and the doc comment says why the program is no longer ACCC-shaped.

What I could not verify, said plainly: my machine is an RTX 4090, where the literal and run-time forms agree, so here the test passed before and passes after — 209 passed, 2 ignored, unchanged. The evidence that it now passes on RDNA1 is yours to give; the reasoning is your table, where "none" and "accumulator only" are the signed result and every case with a literal multiplicand is not. The inline 2.0 (sel_hi_lo, bytes below 0x80) is untouched and stays a constant, as you said it could.

Recipe: cargo test -p victory-shader --locked --lib (209 passed, 2 ignored); cargo clippy --workspace --all-targets with and without --all-features clean under -D warnings; rustfmt --check 0 hunks on the file, which is also 0 on main, so nothing of the file was reformatted.

Pull request: https://github.com/Marvisak/VIctory/pull/1893

No game data is involved: an opcode, two constants and test counts.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6594214401 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1900). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-25T00:21:46Z. --- **The test no longer needs literals: its operands come from user data now** I took the two things the report settled into a change, because you are right that the translator is not where the fix goes and the test is. **What changes**: `fspx_programs_run_with_the_hardwares_dot_products` builds its program with `build_valu_cs` — a plain compute shader whose four root constants are the case's inputs — and the multiplicands and accumulator reach `v_dot4_i32_i8` through `v_mov_b32 vN, sN` at run time, instead of `v_mov_b32 vN, <literal>`. The case inputs are `[a, b, acc, 0]`, so the three literal-multiplicand cases are gone. **Why the operands could not stay literals in an FSPX program**: in an `ACCC`-shaped program the user data are the hardware's own SGPRs (`s0`-`s3` are the thread's ids), so a shader of that shape cannot carry operands at all — it can only name them as literals, which is exactly the form the RDNA1 driver folds into `v_dot4c` and zero-extends. So the test runs the same instructions with values loaded at run time, which is the shape a title's shader has whenever its multiplicands are computed rather than declared. Its `fspx_cs` helper goes with the change (nothing else used it), and the doc comment says why the program is no longer `ACCC`-shaped. **What I could not verify, said plainly**: my machine is an RTX 4090, where the literal and run-time forms agree, so here the test passed before and passes after — 209 passed, 2 ignored, unchanged. The evidence that it now passes on RDNA1 is yours to give; the reasoning is your table, where "none" and "accumulator only" are the signed result and every case with a literal multiplicand is not. The inline `2.0` (`sel_hi_lo`, bytes below `0x80`) is untouched and stays a constant, as you said it could. Recipe: `cargo test -p victory-shader --locked --lib` (209 passed, 2 ignored); `cargo clippy --workspace --all-targets` with and without `--all-features` clean under `-D warnings`; `rustfmt --check` 0 hunks on the file, which is also 0 on `main`, so nothing of the file was reformatted. Pull request: https://github.com/Marvisak/VIctory/pull/1893 No game data is involved: an opcode, two constants and test counts. Written with an AI assistant.
Headache3318 commented 2026-11-25 02:06:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T01:44:29Z.


Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head 799f9a2 applied cleanly onto current main ccfb029.

  • cargo test -p victory-shader --locked: 144 passed, 0 failed, 2 ignored. All tests pass.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: 4 pre-existing errors in test code (fail identically on main ccfb029). The PR introduces no new clippy warnings.

Not tested: Windows MSVC build, the title itself. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149900918 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7149900918). Originally posted by [Headache3318](https://github.com/Headache3318) on 2026-11-25T01:44:29Z. --- Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head `799f9a2` applied cleanly onto current `main` `ccfb029`. - `cargo test -p victory-shader --locked`: 144 passed, 0 failed, 2 ignored. All tests pass. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: 4 pre-existing errors in test code (fail identically on main `ccfb029`). The PR introduces no new clippy warnings. Not tested: Windows MSVC build, the title itself. AI-assisted.
mercuryVM commented 2026-11-25 03:02:40 +00:00 (Migrated from github.com)

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

Review: APPROVED


Tested 3bdccbca on Windows 11, RTX 5070, MSVC:

  • cargo test -p victory-shader -- --test-threads=1 passes the dot-product test on the head.
  • The 5 failures there (rect corner, two stride tests, row order, gather4 at a level) also fail on main on this host.
  • Merged into our fork together with #1896: the same results, and clippy is clean.

Loading the operands as user data is the right test. With literals, the driver folds them into the dot's constant form, so the test was really checking a driver fold, not the translation. A title's operands are computed at run time, which is what the test now does.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6050621647 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1900#pullrequestreview-6050621647). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-25T02:11:11Z. **Review:** APPROVED --- Tested 3bdccbca on Windows 11, RTX 5070, MSVC: - `cargo test -p victory-shader -- --test-threads=1` passes the dot-product test on the head. - The 5 failures there (rect corner, two stride tests, row order, gather4 at a level) also fail on main on this host. - Merged into our fork together with #1896: the same results, and clippy is clean. Loading the operands as user data is the right test. With literals, the driver folds them into the dot's constant form, so the test was really checking a driver fold, not the translation. A title's operands are computed at run time, which is what the test now does. AI-assisted (Claude Code).
catminou4 commented 2026-11-25 03:02:40 +00:00 (Migrated from github.com)

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

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. Dot-product tests load operands at runtime so the hardware path is exercised rather than constant-folded — same class of fix as #1879, good.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051070482 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1900#pullrequestreview-6051070482). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T02:47:12Z. **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. Dot-product tests load operands at runtime so the hardware path is exercised rather than constant-folded — same class of fix as #1879, good.
Headache3318 commented 2026-11-25 03:03:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T02:10:32Z.


Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head 799f9a2 applied cleanly onto current main ccfb029.

  • cargo test -p victory-shader --locked: 144 passed, 0 failed, 2 ignored. All tests pass.
  • cargo clippy -p victory-shader --all-targets -- -D warnings: 4 pre-existing errors in test code (fail identically on main ccfb029). The PR introduces no new clippy warnings.

Not tested: Windows MSVC build, the title itself. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150405457 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7150405457). Originally posted by [Headache3318](https://github.com/Headache3318) on 2026-11-25T02:10:32Z. --- Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head `799f9a2` applied cleanly onto current `main` `ccfb029`. - `cargo test -p victory-shader --locked`: 144 passed, 0 failed, 2 ignored. All tests pass. - `cargo clippy -p victory-shader --all-targets -- -D warnings`: 4 pre-existing errors in test code (fail identically on main `ccfb029`). The PR introduces no new clippy warnings. Not tested: Windows MSVC build, the title itself. AI-assisted.
Marvisak commented 2026-11-25 09:06:10 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Proposed close: duplicate of a better open PR, #1790. Both PRs fix the RDNA1 failure of emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products (#1782), and both pass on the reporter's RX 5700 (comparison table in #1782). This PR does it by deleting fspx_cs and running the cases through build_valu_cs. The test no longer exercises the ACCC container path its name and purpose refer to. #1790 makes the operands run-time values (v_add_nc_u32 vN, literal, v4 with v4 loaded from the zeroed UAV). It keeps the ACCC program, the cases and the expected values, and its author showed the test still catches a signed/unsigned lowering error.

CI check passes here. The change itself is not wrong. It just covers less than #1790 for the same fix.

This PR will be closed in 48 hours unless the author pushes a change (for example, one that keeps the ACCC path) or a maintainer removes the label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7156848175 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7156848175). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T08:17:40Z. --- <!-- victory-triage v1 head=799f9a22277fcc2a33c945f30e6c62b3f1631567 verdict=proposed-close at=2026-11-25T08:17:33Z --> Automated triage for the maintainers. **Proposed close: duplicate of a better open PR, #1790.** Both PRs fix the RDNA1 failure of `emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products` (#1782), and both pass on the reporter's RX 5700 (comparison table in #1782). This PR does it by deleting `fspx_cs` and running the cases through `build_valu_cs`. The test no longer exercises the `ACCC` container path its name and purpose refer to. #1790 makes the operands run-time values (`v_add_nc_u32 vN, literal, v4` with `v4` loaded from the zeroed UAV). It keeps the `ACCC` program, the cases and the expected values, and its author showed the test still catches a signed/unsigned lowering error. CI `check` passes here. The change itself is not wrong. It just covers less than #1790 for the same fix. This PR will be closed in 48 hours unless the author pushes a change (for example, one that keeps the `ACCC` path) or a maintainer removes the label. --- _Generated by [Claude Code](https://claude.ai/code)_
sinan-cmyk commented 2026-11-25 12:03:51 +00:00 (Migrated from github.com)

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


Offline measurement on a retail dump

Result: no count change against main.

I merged head 799f9a22 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:7161317270 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7161317270). Originally posted by [sinan-cmyk](https://github.com/sinan-cmyk) on 2026-11-25T11:38:53Z. --- ### Offline measurement on a retail dump **Result: no count change against `main`.** I merged head 799f9a22 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).
upstream-sync closed this pull request 2026-11-25 23:03:23 +00:00
fiestorra commented 2026-11-25 23:06:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-25T22:47:02Z.


Closing: main runs the dot products with run-time operands already

Main's 49761f9 ("Shader tests: dot products take their operands at run time", #1790) made the operands a literal plus a word of the zeroed UAV, which is the change this branch proposed, and the comment in main now names the same reason (#1782: the RDNA1 driver zero-extends bytes of a multiplicand it sees as a constant). Nothing left to rebase.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7176782032 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7176782032). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-25T22:47:02Z. --- **Closing: main runs the dot products with run-time operands already** Main's `49761f9` ("Shader tests: dot products take their operands at run time", #1790) made the operands a literal plus a word of the zeroed UAV, which is the change this branch proposed, and the comment in main now names the same reason (#1782: the RDNA1 driver zero-extends bytes of a multiplicand it sees as a constant). Nothing left to rebase. Written with an AI assistant.

Pull request closed

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!1898
No description provided.