rdna2_decode: decode VOP2 0x06 and VOP3 0x106 as v_mac_legacy_f32 on gfx101* (DECODE-MAC-LEGACY-TARGET) #637
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!637
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/637/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?
@jarvixaiassistant-glitch on GitHub · 2026-11-24 10:40 UTC · original
jarvixaiassistant-glitch:fix/decode-mac-legacy-target→main· +58 −0 · 2 files · 1 commits · merged 2026-11-25 21:22 UTCClaimed in the coordination issue as: DECODE-MAC-LEGACY-TARGET
What and why
tools/rdna2_decode.pyalready maps VOP30x140tov_mad_legacy_f32ongfx101*andv_fma_legacy_f32ongfx103*, but left VOP20x06and VOP30x106unconditionally mapped tov_fmac_legacy_f32even for the defaultmcpu="gfx1013"console target.Per
docs/design.md(GFX10.1/GFX10.3 opcode differences) and LLVM 21VOP2Instructions.td:gfx101*(including consolegfx1013), VOP20x06and VOP30x106arev_mac_legacy_f32(_e32/_e64), whichtools/rdna2spirv.pytranslates.gfx103*(gfx1030/gfx1036), the same encodings are the fusedv_fmac_legacy_f32, whichtools/rdna2spirv.pyintentionally rejects withUnsupported("v_fmac_legacy_f32").Because
tools/rdna2_decode.pyemittedv_fmac_legacy_f32_e32/v_fmac_legacy_f32_e64ongfx1013, translating any console shader containing VOP20x06or VOP30x106throughshader_disasm.py --backend pythonfailed loudly withUnsupported: v_fmac_legacy_f32.This PR:
0x06and VOP30x106tov_mac_legacy_f32whenmcpu.startswith("gfx101"), keepingv_fmac_legacy_f32forgfx103*(mirroring VOP30x140).test_vop2_and_vop3_legacy_mac_fmac_target_and_roundtripintests/test_rdna2_decode.pyverifying both VOP20x06and VOP30x106acrossgfx1013andgfx1030, plus an end-to-end binary →shader_disasm.disasm(..., backend="python")→rdna2spirv.translate→spirv_mini_interptest (2.0 * 2.0 + 4.0 = 8.0).Tested
All synthetic CPU/stdlib/docs/CI checks on Windows 11 x64, Python 3.12.14, Node v24.19.0 (no game files, no
llvm-mcinstalled locally):gfx1013binary with VOP20x06decoded asv_fmac_legacy_f32_e32and raisedUnsupported: v_fmac_legacy_f32inrdna2spirv.translate().python -I tests/test_rdna2_decode.py -v— 20/20 passed (1 skipped:llvm-mcnot installed)gfx10_vop2.txt: 725/725 PASS (was 707/725, 18 mismatches)gfx10_vop3.txt: 6,209/6,209 PASS (was 6,171/6,209, 38 mismatches)python -I tests/test_ci_registration.py— 15/15 passedpython -I tests/test_runtime_paths.py— 5/5 passedpython -I scripts/check_no_game_data.py— passed (0 forbidden tracked extensions)python -m compileall -q make_game.py tools tests— passedpython -I tests/test_text_write_line_endings.py,tests/test_report_paths.py,tests/test_i18n_index.py, and alltests/test_docs_*.py— passednode --test tests/test_viewer_streaming.cjs— passedGPUs tested: n/a (pure-Python ISA binary decoder + CPU SPIR-V interpreter round-trip only)
AI-assisted: yes (JARVIX multi-model team: Antigravity + DeepSeek V4 Flash + NVIDIA NIM Nemotron-3.5-Lightning & Nemotron-3-Ultra-550B)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (N/A — binary ISA decoder target-mnemonic parity with existingdocs/design.mdcontract row; no translator rule changed.)@qhukz13 on GitHub · 2026-11-24 11:50 UTC · original · reviewed
Reviewed on head
2da938a92(Linux, no GPU, no llvm-mc: CPU only). Merges cleanly with currentmain(21625bca8).Checked:
docs/design.md: on gfx1013 VOP2 0x06 and VOP3 0x106 arev_mac_legacy_f32, on gfx103x the fusedv_fmac_legacy_f32. Same shape as the existing VOP3 0x140 rename; the_e64suffix for 0x106 is already forced at line 954, andrdna2spirvtranslatesv_mac_legacy_f32with the destination as the addend.tests/test_rdna2_decode.py(1 skipped, no llvm-mc),tests/test_shader_disasm.py.tools/rdna2_decode.py, run on a full copy of the checkout, all caught: removing the VOP2 rename (1 failure, 1 error), removing the VOP3 rename (1 failure), and widening either rename tostartswith("gfx10")(2 and 1 failures; the gfx1030 subtests catch them).Not checked here: the LLVM disassembler test-vector counts in the description, and how the DPP/SDWA forms of VOP2 0x06 print on gfx101* (the rename also applies to them); both need llvm-mc.
Side note, not for this PR:
tests/test_rdna2_decode.pyalways imports from the repository'stools/and ignoresLEONIDA_TOOLS_DIR, unlike thetests/semanticfiles, so a mutation run that pointsLEONIDA_TOOLS_DIRat a mutated copy reports every mutant as surviving for this file.Looks good to me.
@aslan2142 on GitHub · 2026-11-25 21:22 UTC · original
Merged, thanks! The new test fails on
mainand passes with this. Together with #633 (same file), the translator suite passes.main2bfcb4fe7+2da938a92: the semantic suite passes (491 files, 6,312 tests, 0 files failed);test_rdna2_decodepass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.AI-assisted (Claude Code, Claude Opus 5.5).