Repository navigation
rdna2spirv: restore the dot4 inline op_sel_hi under exact re-anchoring too (SHADER-FSPX-DOT4-EXACT) - #1862
rdna2spirv: restore the dot4 inline op_sel_hi under exact re-anchoring too (SHADER-FSPX-DOT4-EXACT)#1862Coderlord wants to merge 1 commit into
Conversation
…g too (SHADER-FSPX-DOT4-EXACT) A listing whose undecodable words sit at offsets its llvm-mc messages name is re-anchored exactly (ProjectLeonida#984's invalid_at). That branch tried the v_fma_mix literal restores but not restore_dot4_inline_sel, which the search branch and check_printed_encodings both try, so a v_dot4_i32_i8 whose src1 is a replicated inline integer (llvm-mc prints op_sel_hi[1] set where the program's word has it clear) was marked normalized and the program refused as "reachable instruction with normalized encoding". llvm-mc 23.1.6 names every rejected word, so two of the 29 FSPX programs of the FidelityFX DLL took that branch and did not translate (27 of 29). The title then had no pipeline for one of them at the start of the story, and the DLL read through the missing object (an access violation at amd_fidelityfx_upscaler_xbox.dll+0x65ff, 50 s after the first-run setup, native Windows, RTX 5080). With the restore the FSPX step translates 29 of 29, all passing spirv-val. test_rdna2spirv_decode: a listing with one rejected word at a known offset after s_endpgm and a dot4 printed with the default op_sel_hi translates (it raised before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested merged onto AI-assisted (Claude). |
|
Confirmed on a second machine, tools of
Counts only, no game data. AI-assisted (Claude Code). |
|
Tested on RTX 3080 Ti / Windows 11 / NVIDIA 616.64: this takes the FidelityFX FSPX set from 27 to 29 ( |
|
Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
(AI-assisted test run; output checked by hand.) |
|
Independent check on this PR — RTX 3080 Ti (616.64), Windows 11, LLVM 23.1.5 (the repo's documented llvm-mc; MSYS2).
The next stop is not this PR: after ~216 s, AI-assisted. |
|
Heads-up for review: this overlaps #1662 (SHADER-DOT4-SEL-EXACT-ANCHOR, claimed in #1608 at 07:3x today, opened 07:29). Both add the same repair: AI-assisted (Claude Code). |
|
Small addition for llvm-mc 21.1.8 users (Windows 11, llvm-mc 21.1.8 under WSL): the 22 -> 24 reported above for 21.1.8 was on an older main. On current main (
Counts only, no game data. AI-assisted: yes (Claude Code ran the translation and the tests) |
|
Note: #2138 (RT-BOOT-COMBINED, open) carries #1495's AI-assisted (Claude Code, Claude Opus 5.5). |
|
Thanks for this! Closing as a duplicate of #1662, merged as AI-assisted (Claude Code, Claude Opus 5.5). |
…re_dot4_inline_sel The general rule from #1495 (dot4_op_sel_fields / restore_dot4_op_sel, ported from luizwidmer/palmetto) took the stored op_sel/op_sel_hi of any v_dot4_i32_i8 that llvm-mc printed with the defaults. That translated op_sel 0 / op_sel_hi 5 with a VGPR second source, a word #1317's test_fspx_dot4_op_sel_disasm.py (case (0, 5)) requires to stay refused: only op_sel 2 / op_sel_hi 5 was measured on gfx1036. The translator suite failed there. Resolve it on the measured side: - drop dot4_op_sel_fields and restore_dot4_op_sel; - keep main's restore_dot4_inline_sel (#984) and its three call sites: the clean-listing check, the forward re-anchor search, and the exact re-anchor window #1662 added today. The general rule does not cover only those cases, so it cannot replace them; - tests/semantic/test_dot4_printed_op_sel.py now checks that the inline-integer form is restored in a clean listing and on re-anchoring, and that op_sel_hi 5 with a VGPR S1, op_sel 1 / op_sel_hi 6, op_sel_hi 4 and a non-default S2 half stay refused; - docs/design.md "Signed-byte dot products" states how each form was confirmed (hardware for op_sel 2 / op_sel_hi 5, a corpus count for the inline-integer form, refused otherwise); docs/fspx.md follows. This also settles the #1662 / #1862 overlap: #1662's call site stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed in the coordination issue as: SHADER-FSPX-DOT4-EXACT (#1608 (comment))
What and why
A listing whose undecodable words sit at offsets its llvm-mc messages name is re-anchored exactly
(
invalid_at, from #984). That branch oftranslatetried thev_fma_mixliteral restores but notrestore_dot4_inline_sel, which the forward-search branch andcheck_printed_encodingsboth try. So av_dot4_i32_i8whose src1 is a replicated inline integer (llvm-mc printsop_sel_hi[1]set where the program'sword has it clear) was marked normalized, and the whole program was refused as "reachable instruction with
normalized encoding".
llvm-mc 23.1.6 names every word it rejects, so two of the 29 FSPX programs of the FidelityFX DLL take that branch and
did not translate. The title then has no pipeline for one of them, and the DLL reads through the missing object
(an access violation at
amd_fidelityfx_upscaler_xbox.dll+0x65ff, about 50 s after the first-run setup isconfirmed, native Windows). The fix is one condition: the exact branch tries
restore_dot4_inline_selbefore theliteral restores, as the other two paths do.
Tested
rdna2spirv.py <work>/shaders/fspx/disasm --no-asm --wave64-emulate) with llvm-mc 23.1.6 (conda-forgellvm-tools): 27 of 29 translated and passing spirv-val onmain98c2f77, 29 of 29 with this change.The other 6 FSPX programs with rejected words (the dot4 forms [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD) #984 recovers) translate either way.
python -I tests/test_rdna2spirv_decode.py: 26 tests OK. The newtest_exact_anchoring_restores_dot4_inline_sel(one rejected word at a known offset afters_endpgm, a dot4printed with the default op_sel_hi) passes with the change and fails without it with "reachable instruction with
normalized encoding".
mained94fbe + d3d12: import a slot-133 buffer at any offset in its page (RT-SLOT133-IMPORT-OFFSET) #1768): without this change the processdied 50 s after the first-run setup was confirmed, in
amd_fidelityfx_upscaler_xbox.dll+0x65ff(a read at0x10), right after the runtime logged "no translated compute shader for FSPX" for one of the two programs and
refused its pipeline (
E_INVALIDARG). With the 29 retranslated, the next boot logged no missing FSPX programand did not fault in the DLL; it went on to a later, unrelated stop (a lost device about 75 s into the session).
GPUs tested: NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 Pro 26300
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: anexisting restore applied in one more branch, no new rule)