Repository navigation
Conversation
d9567f5 to
d2241ba
Compare
…erals 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 (Marvisak#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.
d2241ba to
799f9a2
Compare
|
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
Not tested: Windows MSVC build, the title itself. AI-assisted. |
1 similar comment
|
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
Not tested: Windows MSVC build, the title itself. AI-assisted. |
…rands loaded at run time, not literals Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 3bdccbc on Windows 11, RTX 5070, MSVC:
cargo test -p victory-shader -- --test-threads=1passes 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).
|
Automated triage for the maintainers. Proposed close: duplicate of a better open PR, #1790. Both PRs fix the RDNA1 failure of CI This PR will be closed in 48 hours unless the author pushes a change (for example, one that keeps the Generated by Claude Code |
Offline measurement on a retail dumpResult: no count change against I merged head 799f9a2 onto 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). |
|
Closing: main runs the dot products with run-time operands already Main's Written with an AI assistant. |
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_productsbuilds its program withbuild_valu_cs— a plain compute shader whose four root constants are the case's inputs — and the multiplicands and accumulator reachv_dot4_i32_i8throughv_mov_b32 vN, sNat run time, instead ofv_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-s3are 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 intov_dot4cand 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. Itsfspx_cshelper goes with the change (nothing else used it), and the doc comment says why the program is no longerACCC-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 below0x80) 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-targetswith and without--all-featuresclean under-D warnings;rustfmt --check0 hunks on the file, which is also 0 onmain, 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.