Shaders: align GFX10 opcode tables with RDNA2 ISA and add synthetic tests #1301
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1301"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T17:17:11Z.
Summary
Audits all 19 GFX10 opcode tables in \crates/victory-shader/src/gfx10/opcodes.rs\ against AMD's RDNA2 ISA specification and cross-checks synthetic instruction words with LLVM \gfx1030:
Verification
AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by dpalacios69 on 2026-11-24T18:26:35Z.
Independent check on Linux of head
cacb8d2, merged onto currentmain(ffe310e; a fast-forward):cargo test -p victory-shader --lockedpasses (106 passed, 0 failed, 1 ignored). The 10 test(s) it adds run on Linux and pass.cargo clippy -p victory-shader --all-targets -- -D warningsshows nothing of its own, only the two unused-import errors inemit/mod.rsthatmainalready has on Linux. No GPU run. AI-assisted; no game data.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:09:42Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e), cargo test -p victory-shader --locked → 106 passed, 0 failed. Execution/valu tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers lowering/structure/IR unit tests.Aligns the GFX10 opcode tables with the RDNA2 ISA and adds synthetic decode tests: table reachability/unique mnemonics, VOP3 aliases only where a long form exists, older-generation opcodes reserved, fused/signed dot decode, VOP3 interpolation fields, SOPK/VOP2 literal boundaries, buffer widths across split fields. Exactly the kind of table audit the translator needs.
Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-24T23:09:33Z.
This PR (head
cacb8d2) merges cleanly onto the new main (70564ae0) but breaks two of main's new tests there:emit::semantics_tests::arithmetic_matches_the_hardwareandoutput_multipliers_give_positive_zero(RX 6750 XT, Windows 11, Rust 1.98.1 MSVC; 217 passed, 2 failed; main alone 209/209).What they report:
The table renames VOP2 0x006
v_mac_legacy_f32tov_fmac_legacy_f32and VOP3 0x140v_mad_legacy_f32tov_fma_legacy_f32. Those are the RDNA2 names, but the lowering still matches on the old mnemonics, so those instructions stop lowering. The?lines come from encodings the table no longer has. Main's new semantics tests check exactly these instructions against the console's float mode.So after a rebase, the lowering (and the semantics tests' expectations) would need to follow the renames. That includes deciding whether the
fma/fmacnames should lower as fused, which is what the RDNA2 names say and which main's README now calls "fused multiply-adds follow the host GPU".Unit tests only, no game files. AI-assisted (Claude; I ran it on my machine).
Imported from Marvisak/VIctory. Originally posted by zed6000 on 2026-11-25T01:01:51Z.
Measured offline on the title's shaders, as in #1247 (
victory translate --validate --listovershaders.rpf1.0.2.1, dxil.dll 1.8.2502, compared program by program). This PR stops thousands of programs that validate today from translating:ffe310e70564aeOn
70564aethe losses cover every stage: 5,893 pixel, 1,475 compute, 999 mesh and 202 vertex programs.cargo test -p victory-shader --libpasses (130/0 onffe310e), so the synthetic tests don't show it. The title's code uses encodings that the updated tables no longer name, or names differently.The
v_fma_legacy_f32hits suggest that at least one opcode number now maps to a different instruction than before, one the lowering doesn't handle. The "unknown opcode" hits suggest that entries the title relies on were dropped or moved. Before merging, this probably needs a check of which opcode numbers changed meaning against code the title actually runs. The console's GFX10 encodings may not match the RDNA2 ISA document's table in every slot. Offline counts only; no program names or data, per the asset policy.Pull request closed