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

Closed
github-bot wants to merge 1 commit from gh-pr/1900/head into gh-pr/1900/base
Owner

@⁠fiestorra on GitHub · 2026-11-25 00:21 UTC · original
fiestorra:test/dot4-operands-from-user-data → main · +21 −30 · 1 files · 1 commits · closed without merging

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: #1893

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

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-25 00:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/1900) `fiestorra:test/dot4-operands-from-user-data` → `main` · +21 −30 · 1 files · 1 commits · closed without merging **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://git.gtahub.st/github/Marvisak--VIctory/pulls/1893 No game data is involved: an opcode, two constants and test counts. Written with an AI assistant.
On an RDNA1 host the driver folds a constant multiplicand into the dot
instruction's constant form (v_dot4c) and zero-extends that operand's bytes,
so v_dot4_i32_i8 with a literal v_mov operand gives 0x80007FF5 where the
signed product is 0x7FFFFBF5 (#1782, measured on an RX 5700; WARP and
runtime operands agree with the reference everywhere).

That is the driver's, not the lowering's, so what changes here is the test:
its operands reach the shader through the user data of a plain compute
shader, which is the shape a title's shader has when its multiplicands are
computed, and the three cases that used a literal multiplicand now use those
values. An FSPX-shaped program cannot carry them - its user data are the
hardware's own SGPRs - which is why the test had literals in the first place;
its helper goes with the change, and the doc comment says so.

209 passed, 2 ignored on this machine, where both forms agree; the case for
the change is the RDNA1 card in the issue.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:48:05 +00:00
github-bot closed this pull request 2026-11-26 04:48:05 +00:00
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-25 01:44 UTC · original

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.

**@⁠Headache3318** on GitHub · 2026-11-25 01:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7149900918) 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.
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-25 02:10 UTC · original

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.

**@⁠Headache3318** on GitHub · 2026-11-25 02:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7150405457) 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 08:17 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 08:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7156848175) <!-- 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)_
Author
Owner

@⁠sinan-cmyk on GitHub · 2026-11-25 11:38 UTC · original

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).

**@⁠sinan-cmyk** on GitHub · 2026-11-25 11:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7161317270) ### 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).
Author
Owner

@⁠fiestorra on GitHub · 2026-11-25 22:47 UTC · original

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.

**@⁠fiestorra** on GitHub · 2026-11-25 22:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/1900#issuecomment-7176782032) **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

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