Repository navigation
rdna2spirv/fspx_unpack/make_game: direct binary RDNA2 decode backend (#1901) - #2323
SweatierKey wants to merge 5 commits into
Conversation
fe39b8e to
ca692f6
Compare
|
Tested
The default stays llvm-mc as described, so this lands zero behavioural change for existing setups while the AI-assisted (ZCode agent): builds and runs executed by a coding agent on this machine. |
|
Tested ca692f6 on AMD Radeon RX 9070 XT (RADV GFX1201) and the Ryzen 7 9800X3D iGPU (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.2.6, Linux 7.3.4: pass, no regressions.
No game files. AI-assisted. |
8060b70 to
d9e792c
Compare
d9e792c to
5e517fb
Compare
|
Tested Runtime and test programs built from this head (MSVC 14.51, Ninja, RelWithDebInfo), native Windows
The failure is For The GPU suite (default AI-assisted (Claude Code); I checked the results. |
5e517fb to
1487c0f
Compare
|
Thank you @zneel for the RX 9070 XT GPU check and for pinpointing that exact SDWA inline-constant mismatch on Fixed in the base decoder PR #2038 (
|
1487c0f to
f4ae9bd
Compare
|
Tested 6dcbcbd merged onto main 561b65a on Apple M4, macOS 27.2.1, Python 3.15.2 and 3.12.16, llvm-mc 23.1.6: needs changes (a small fix: the direct path decodes with a different target than the text path)
AI-assisted. |
Depends on: ItsNotRexed#5688 at 31ba693. Windows CPU: both focused tests and compileall passed. Re-ran both ItsNotRexed#2323 input paths at 6dcbcbd with local refusal recording on all 29 cached programs. spirv-val confirmed 18 retained and 11 newly validated identities, with no missing identities or regressions. The legacy run had 11 missing results, all explicit refusals in the updated listing run. No raw package or GPU. AI-assisted.
6dcbcbd to
039bdbb
Compare
|
Thanks @sovljanskii for the thorough corpus parity check (415/415 + 1,473/1,473 byte-identical, 758,098/758,098 instructions matched) and catching the
Verified locally on
|
|
Tested 039bdbb on Intel Arc A770 (DG2), Mesa ANV 25.2.8, Ubuntu 24.04 / Linux 7.0, llvm-mc 21.1.8: pass, compared with
|
…-mc -disassemble fails to round-trip SDWA float inline constants
…ncodings in direct binary decode
…code=gfx1030) and harden tests
039bdbb to
2e2aa51
Compare
|
FSPX backend comparison at the current head 2e2aa51 (base
( The two differing pairs (programs 01 and 08) differ because of the wave size the listing is decoded with, not because of the decoder's spelling.
Which form is right depends on how the translator reads a wave32-printed mask operand in a wave64 program. That is the convention every FSSM listing and the llvm-mc FSPX path use today, and the one the semantic tests were written against. Either pass Counts and instruction classes only, nothing from the package leaves my machine. AI-assisted (Claude Code). |
|
Tested 2e2aa51 on AMD Radeon RX 6800 (RDNA2 gfx1030, AMD 26.11.2, Windows 11): pass Trial merge of
AI-assisted (Claude Code). |
|
Follow-up to the wave-size question in #2323 (comment): a synthetic semantic case supports keeping the dispatch-state wave size. PR head was still The following wholly synthetic wave64 program was assembled with s_mov_b32 s9, 0
v_cmp_eq_i32_e64 s[8:9], v0, 40
s_bcnt1_i32_b64 s10, s[8:9]
v_mov_b32_e32 v4, s10
v_lshlrev_b32_e32 v5, 2, v0
buffer_store_dword v4, v5, s[0:3], 0 offen
s_endpgmOne active comparison bit means every lane must store 1. Results from the existing native-wave and emulated-workgroup CPU interpreters agree:
This demonstrates that forcing Python to wave32 for listing parity can lose an upper-half mask bit. It is not whole-program GPU equivalence evidence. A separate existing LLVM21 text-path issue explains another differing shared translation: the existing synthetic Private aggregate check at the same main pin: LLVM21 listings translate and validate 18/29 FSPX programs; Python listings using dispatch-state wave size translate and validate 29/29, with zero undecodable words. No game code or data is included here. No GPU test was run for this report. |
|
So the PR's compute state matches main's own on both vendors — the failing rows are main's, not this change's. Honest gap: main's full |
|
Tested
One note: on |
Depends on #2038 (stacked on
rdna2-direct-decoder). Completes the pure-Python RDNA2 decode integration for #1901 (claim: #1902 (comment)).What this adds
tools/rdna2spirv.py: addsdecode_binary_file()sotranslate()and the CLI accept native.fssmandfspx/*.codebinaries directly (decoding straight intoshader_irviatools/rdna2_decode.pywithout spawningllvm-mcor writing/parsing.stext files). Direct decode preserves exact byte PCs across embedded undecodable data words, skipping thesame_encodingre-anchoring scan and pruning unreachable data viafold_far_branches+reachable_code.tools/fspx_unpack.py: adds--backend {llvm-mc,python}(defaultllvm-mc) forwardingwave32toshader_disasm.disasm(), enabling zero-llvm-mcdisassembly of all FSPX shaders including thev_dot4_i32_i8 op_sel:[0,1,0] op_sel_hi:[1,0,1]wordsllvm-mcrejects.make_game.py: adds--disasm-backend {llvm-mc,python}(defaultllvm-mc). Under--disasm-backend python,preflight()does not requirellvm-mc,disasm.donerecords a SHA-256 fingerprint ofrdna2_decode.py+rdna2_isa_tables.py, andshaders()passes--backend pythontoshader_disasm.py.Verification
python3 -m unittest tests/test_rdna2_direct_translate.py -v: 4/4 OK (direct.fssmand.codetranslation matches the.stext path byte-for-byte, embedded data word pruning,fspx_unpack --disasm --backend pythondecodesv_dot4_i32_i8 op_selwith 0 invalid words,make_game.py preflightsucceeds withoutllvm-mc,spirv-val --target-env vulkan1.2clean).python3 -m unittest tests/test_rdna2_decode.py tests/test_fspx_unpack.py tests/test_shader_disasm.py tests/test_text_write_line_endings.py: 45/45 OK.AI-assisted.