Shaders: align GFX10 opcode tables with RDNA2 ISA and add synthetic tests #1301
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1301
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1301/head"
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?
@geiyiliyabumo on GitHub · 2026-11-24 17:17 UTC · original
geiyiliyabumo:test/shader-gfx10-opcodes→main· +388 −129 · 4 files · 1 commits · closed without mergingSummary
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.
@dpalacios69 on GitHub · 2026-11-24 18:26 UTC · original
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.@wwwwwwww3333333 on GitHub · 2026-11-24 23:09 UTC · original
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).
@zed6000 on GitHub · 2026-11-25 01:01 UTC · original
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