Skip to content

rdna2spirv: put back the instructions llvm-mc's junk swallowed after a tuple into vcc (SHADER-VCC-TUPLE-RESYNC) - #674

Merged
aslan2142 merged 8 commits into
ProjectLeonida:mainfrom
DadaCap:vcc-tuple-resync
Nov 25, 2026
Merged

aslan2142 merged 8 commits into
ProjectLeonida:mainfrom
DadaCap:vcc-tuple-resync

Conversation

@DadaCap

@DadaCap DadaCap commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: SHADER-VCC-TUPLE-RESYNC (#14 (comment))

Depends on: #596 (its two commits come first here; this pull request is the last commit)

What and why

llvm-mc rejects a scalar tuple that runs into vcc and prints the tuple's second word as junk. #596 decodes the tuple from the blob and drops the junk. But the junk is often longer than that word (an 8-byte exp, for example), so it also covers the instruction after the tuple: an s_mov_b32, an s_waitcnt, a v_fma_f32. Nothing printed that instruction at its own place, so it stayed missing and the program was refused with "fall-through into undecodable words".

restore_vcc_tuples now decodes the words after a restored tuple from the blob, the same way, until the stream is back at an instruction llvm-mc printed there. A word llvm-mc itself rejected, with no junk printed over it, is not taken for swallowed code and stays refused.

Tested

Whole pipeline library (1.0.2.1, own copy), all 2,684 compute programs, llvm-mc 21.1.8, --wave64-emulate, main + #596 without and with this commit:

#596 + this
translated 1,816 2,567
pass spirv-val 1,816 2,567
"fall-through into undecodable words" 833 3

0 programs lost, and the 1,816 modules are byte-identical. What is left: 80 s_load_dword* with a vcc base or destination (#647 has the bases), 18 s_flbit_i32_b64 and 6 s_bitreplicate_b64_b32 (#593), 9 that cannot be re-anchored, 3 fall-throughs, 1 s_sethalt. The 26,503 main-corpus listings have no undecodable words with this disassembler, so this path does not run on them.

  • tests/semantic/test_vcc_tuple_fallback.py: 7 tests pass; the new case is red without the fix, and a second one checks that a rejected word after a tuple is still refused.
  • Whole translator suite: 466 files, 6,115 tests, all pass but test_image_cube_store_glc, which fails here with FileNotFoundError starting an external program, on main too.
  • The tests/test_docs_*.py set, test_text_write_line_endings.py, compileall, check_no_game_data.py: clean.

The new modules are checked by spirv-val only; none was compared with hardware.

GPUs tested: n/a

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🤖 Generated with Claude Code

DadaCap and others added 2 commits November 24, 2026 12:30
…a tuple into vcc

llvm-mc rejects a scalar tuple that runs into vcc and prints the second word as
junk. That junk is often longer than the word, so it also covers the instruction
after the tuple, which stayed missing and refused the program with
'fall-through into undecodable words'. The words after a restored tuple are now
decoded from the blob until the stream is back at a printed instruction.

Pipeline library of 1.0.2.1, 2,684 compute programs: 1,816 -> 2,567 translate
and pass spirv-val; the 1,816 modules are byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trigger337

Copy link
Copy Markdown
Contributor

agent: yes
AI-assisted: yes

Hardware validation on Linux (AMD Radeon RX 6900 XT / RADV Navi 21, Mesa 26.2.5, Vulkan 1.4.333):

  1. Semantic Tests:
    • python3 -m unittest discover -s tests/semantic -p test_vcc_tuple_fallback.py -v: 7/7 passed.
    • Tested recovery of instructions swallowed by llvm-mc junk after tuples, as well as verification that rejected words after tuples stay rejected.
  2. GPU Test Suite (scripts/run_gpu_tests.py):
  3. Repository Checks:
    • scripts/check_no_game_data.py: clean.
    • tests/test_docs_*.py: 47/47 passed.

@qhukz13 qhukz13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the last commit (f605f8a, on top of #596) on Linux, CPU only, no game files.

tests/semantic/test_vcc_tuple_fallback.py: 7 tests OK.

I ran --function restore_vcc_tuples with semantic_mutants from #734 (it adds Python-logic mutations) against that file: 32 of 41 mutants caught. The survivors that touch this commit's new logic:

  • line 17179, starts.add(ins["pc"]) removed: no case checks that the resync stops at an instruction llvm-mc printed (at not in starts), which is the condition the description rests on;
  • line 17176, unplaced = None removed: no case has two separate junk regions, so a junk range running on into the next one is not caught;
  • line 17197, resync = False removed: no case where a decode fails in the middle of a resync and the scan has to drop out of it;
  • line 17184, <= -> <: nothing at the very end of the code range;
  • line 17183, the initial resync = False -> True: nothing starts at code_start inside junk.
    (From #596: line 17189 survives in -> not in and or -> and, so the tests use only one of vcc_lo/vcc_hi; line 17180 survives removing covered.update.)

One question on the resync itself: in resync mode a decoded instruction is accepted when it ends before stop, but nothing checks that it does not run across the start of the next printed instruction (at < s < at + len for some s in starts). Line 17202 then drops every printed instruction that overlaps a restored one, so a misaligned resync would remove a printed instruction silently instead of stopping. Your corpus numbers (0 programs lost, byte-identical modules) suggest it does not happen there, but a check, or a case showing why it cannot, would make that explicit.

Looks right otherwise; the corpus result is a big step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DadaCap

DadaCap commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@qhukz13 thank you, that was a careful read. 6886740 adds tests for the survivors in this commit's logic: starts.add, unplaced = None, resync = False, the initial resync, and <=. Each of the five mutations now fails; I checked them by hand, not with #734. The survivors from #596 are left to that pull request.

On the question: I tried the check (stop when a decoded instruction runs across a printed start), and it breaks a correct case that the test file already has ("12 bytes, then 4" in test_junk_that_swallows_the_next_instructions). The junk after a tuple can end on the first word of an 8-byte instruction. llvm-mc then prints that instruction's literal as an instruction of its own, so the real one legitimately runs across a printed start, and the printed one is the wrong one to keep. test_crosses_a_start_that_is_a_literal_printed_on_its_own now states that.

So there is no local rule that tells the two apart: what keeps the resync in step is that it starts at the end of a restored tuple, which is an instruction boundary, and decodes every word from there. A misaligned step would need a wrong length for one instruction. The evidence that it does not happen is the corpus run, not a proof.

Tests: python -I tests/semantic/test_vcc_tuple_fallback.py, 14 OK. No change to tools/rdna2spirv.py.

AI-assisted (Claude Code, Opus 5.5).

@qhukz13

qhukz13 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Thanks — confirmed on 6886740 with semantic_mutants from #734: test_vcc_tuple_fallback.py passes (14), and --function restore_vcc_tuples now catches 37 of 41; all five survivors from this commit fail now, and the four left (lines 17180 and 17189) are #596's, as you say. The literal-printed-on-its-own case answers my question: crossing a printed start is legitimate there, so a local check would be wrong, and the new test documents it. LGTM.

@Snooozs

Snooozs commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

One case that gets worse with restore_vcc_tuples (this head, and #596's f7a338b too), found with a synthetic listing: a data word that happens to equal the first dword of a vcc-tuple load, skipped by a branch, with real code right after it.

s_mov_b32 s4..s7 (the test's SET_SGPR_V)
s_branch 1                                   ; 01 00 82 bf
<undecodable word 02 19 2c f4>               ; data, = the first dword of LOAD_X8_VCC
v_mov_b32_e32 v10, 7                         ; the branch target, 87 02 14 7e
v_mov_b32_e32 v6, 0x3000
global_store_dword v6, v10, s[0:1]
s_endpgm

The data word is offered to the decoder because it is not covered; it decodes as s_buffer_load_dwordx8 using the target instruction as its second dword, and the target (a matched instruction and a branch target) is then dropped as "printed inside a restored one". In this case it ends as a refusal, not as wrong code, and I do not know whether any library program has such a word. A guard that keeps it out: do not restore an instruction whose later dwords contain the start of a matched instruction that a branch targets (or only offer words reachable by fall-through from the previous instruction).

Otherwise: merged onto main 82a2aab, tests/semantic/test_vcc_tuple_fallback.py is green here (14 tests; #596: 5), and red with main's tools (20 errors; #596: 10). Windows 10 19045, CPython 3.12.10, CPU only, no game files.

AI-assisted (Claude Code); run on that machine.

@madhyn

madhyn commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Independently tested stacking #593 (1ea2ffbca) + #596 (ce98fbefe, f7a338b14) + #674 (f605f8aee, 688674095) + #647 (a4c00f4f4) on our local frame-loop stack (Arch Linux, Wine 11.22, RTX 3060 Ti, retail 1.0.2.1):

  • Semantic unit tests (test_lane_mask_bitreplicate_flbit.py, test_vcc_tuple_fallback.py, test_sload_vcc_base.py): 22/22 passed.
  • Pipeline library translation (rdna2spirv.py --wave64-emulate): translated compute programs increased from 2,528 to 2,632 (all passing spirv-val), eliminating all s_load_dwordx4 operands sgpr vcc, s_flbit_i32_b64, and s_bitreplicate_b64_b32 rejections.
  • Retail 25 s boot (slot 67, DeserializeComputePipelineStateX): no translated compute shader misses dropped from 34 to 0.

AI-assisted: yes

@thesubtleties

Copy link
Copy Markdown
Contributor

Review of 688674095 merged on main 98a977b4: one wrong-value bug in wave64.

restore_vcc_tuples calls rdna2_decode.decode_bytes(...) without wave32=, which defaults to True, so in a wave64 shader a swallowed VOP3 compare comes back with a one-SGPR mask. Reproduction (hand-built listing, spirv_mini_interp, wave64): a vcc tuple 02192cf4000000fa, then v_cmp_gt_u32_e64 s[12:13], 40, v0 swallowed by a junk exp. s13 keeps its old value, and s_bcnt1_i32_b64 s[12:13] gives 0x28 in lane 0 but 8 in lanes 40 and 63, instead of 0x28. Forcing wave32=False at that call makes the compare cases match the intact listing, so passing the shader's wave size should fix it.

Also: this branch contains the commits of #596, and #327's tests pass on it, while #596 and #327 fail some of its tests, so with that fixed it looks like the one to keep of the three.

Not checked: real output of an older llvm-mc (23.1.5 here prints these tuples), or any corpus. No game files. AI-assisted (Claude Code).

@towade

towade commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

checked: 688674095 on the full 1.0.2.1 pipeline library (2,684 compute programs), and its effect on a retail boot. Windows 11 26300, Python 3.15, llvm-mc 21.1.8 (the listings make_game.py writes, gfx1013), spirv-val from Vulkan SDK 1.4.363, --wave64-emulate, 8 shards then --merge. Counts only.

translator translated pass spirv-val
main a28927849 1,685 1,685
+ this PR (includes #596) 2,599 2,599
+ this PR + #985 (2f5b49c4e) 2,608 2,608

None of the 1,685 that main translates is lost, and all of them are byte-identical with this PR and with this PR + #985.

On @thesubtleties' wave64 finding: of the 914 programs this PR adds, 54 are wave64 (index field wave64) and 860 are wave32. So the wave32= default can affect at most those 54 in this library. I haven't checked how many of them have a swallowed VOP3 compare.

Retail. On an AMD Radeon RX 9070 XT, main + #511 (LEONIDA_LAZY_PSO=1) + the open boot pull requests of my ladder on #14 + #469, the title asks device slot 67 for 1,142 pipeline-library compute programs that a main library lacks. With the library from this PR + #985 in the work folder:

main library this PR + #985
of those 1,142, now in the library 0 1,070
slot 67 ... failed lines in the run 1,153 86
no translated compute shader for FSPX lines 1,146 72

The run still ends at the later int3 in the title that I described on #14. One more int3 comes before it now, at another place; I haven't looked at it yet. So this shows the programs are found and created, not that they compute the right thing.

Not run: the semantic suite on this head, and anything on a GPU beyond the boot.

AI-assisted (Claude Code).

…ect branch targets

Do not scan unreachable embedded data words skipped by s_branch or after s_endpgm / s_setpc_b64 in restore_vcc_tuples. Walk only offsets reachable from code_start via matched instructions, fall-through, and direct/folded far branches, and discard any restored instruction whose interior dwords are targeted by a reachable branch.

Fixes the synthetic edge case reported on ProjectLeonida#596 / ProjectLeonida#674 by @Snooozs where an unreachable data word equal to the first dword of an 8-byte vcc-tuple load right before a branch target caused restore_vcc_tuples to swallow the target instruction and fail with 'branch into data'.

Adds regression tests covering: skipped data word before a matched branch target, skipped data word before a vcc-tuple load at the branch target, data word after s_endpgm before a branch target, and fall-through into a data word directly before a branch target.
@Snooozs

Snooozs commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

#596 fixed the skipped-data-word case in 091cd96 (checked: my listing translates again and stores 7). This head still has the older #596 commits and refuses it with branch into data, so rebasing onto #596's current head would pick up the fix, next to the wave64 point above. AI-assisted (Claude Code).

DadaCap and others added 2 commits November 24, 2026 21:09
… for the shader's wave size

ProjectLeonida#596 walks only reachable offsets. The resync after a restored tuple now runs inside that walk, follows swallowed
branches, and drops the rest of a run when a branch targets an instruction's interior. decode_bytes gets the
program's wave size, so a swallowed VOP3 compare writes an SGPR pair in wave64 (reported on ProjectLeonida#674).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DadaCap

DadaCap commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@thesubtleties @Snooozs thank you, both fixed in 30450e0, and bc245e5 merges current main.

Run (Windows 11, CPython 3.14, CPU only):

  • test_vcc_tuple_fallback.py 23 OK. Whole translator suite 471 files, 6,191 tests; only test_image_cube_store_glc fails, with the FileNotFoundError from the description.
  • test_docs_*, test_text_write_line_endings, test_rdna2_decode, compileall, check_no_game_data.py: clean.
  • Pipeline library, 2,684 compute programs, --wave64-emulate, the previous head merged on the same main against this one: 2,647 translated and spirv-val-valid with both, none lost or gained, 3 modules differ, all wave64.

Not run: GPU tests, a boot, and VS/MS/PS library programs. The 3 changed modules were not compared with hardware.

AI-assisted (Claude Code, Opus 5.5).

@Snooozs

Snooozs commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Rechecked bc245e504 merged on main 66d4f5aa3 (clean): my synthetic case (a branch whose target lies inside the swallowed words) now translates and stores 7, and test_vcc_tuple_fallback.py gives 23 OK (Windows 10 19045, CPython 3.12.10, CPU only, no llvm-mc on this PC). I read the new rdna2spirv.py diff too and have nothing further on it.

AI-assisted (Claude Code, Claude Opus 5.5).

jarvixaiassistant-glitch added a commit to jarvixaiassistant-glitch/leonida that referenced this pull request Nov 24, 2026
…ect branch targets

Do not scan unreachable embedded data words skipped by s_branch or after s_endpgm / s_setpc_b64 in restore_vcc_tuples. Walk only offsets reachable from code_start via matched instructions, fall-through, and direct/folded far branches, and discard any restored instruction whose interior dwords are targeted by a reachable branch.

Fixes the synthetic edge case reported on ProjectLeonida#596 / ProjectLeonida#674 by @Snooozs where an unreachable data word equal to the first dword of an 8-byte vcc-tuple load right before a branch target caused restore_vcc_tuples to swallow the target instruction and fail with 'branch into data'.

Adds regression tests covering: skipped data word before a matched branch target, skipped data word before a vcc-tuple load at the branch target, data word after s_endpgm before a branch target, and fall-through into a data word directly before a branch target.
…ve64_masks

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@DadaCap

DadaCap commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (with #1021) into the branch; no force-push.

Two conflicts in tools/rdna2spirv.py, both "keep both sides": restore_vcc_tuples and #1021's widen_wave64_masks were added at the same place, and the wave size of a program without a header or dispatch state stays this branch's marker_wave64(...), followed by main's if g.wave64: widen_wave64_masks(insns). A restored VOP3 compare is already decoded for the shader's wave size, so in wave64 it carries its pair and the widening (which only touches one-register operands) leaves it alone.

On the merged head, Windows 11, CPython, CPU only: python -I scripts/run_semantic_tests.py tests/semantic gives 475 files, 6,217 tests, 1 file failed: test_image_cube_store_glc, which starts llvm-mc and fails the same way on main on this machine. test_vcc_tuple_fallback.py 23 OK, test_wave64_single_sdst.py 3 OK.

Not run: the game corpus on this head, GPU tests.

AI-assisted (Claude Code).

@DadaCap

DadaCap commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Status after #984: this branch conflicts with main in tools/rdna2spirv.py, tests/semantic/test_vcc_tuple_fallback.py and docs/design.md, because #984 brought an earlier version of the same recovery (restore_skipped_instructions, which also takes the DPP compares and the v_dot4_i32_i8 form from the blob).

#1495 already carries this branch's head (686f914b7) merged with that: there restore_vcc_tuples replaces restore_skipped_instructions and a skipped_form helper keeps the two other forms. I tried the merge here as well and it comes to the same decision, so I am not pushing a second resolution of the same three files that could differ from #1495's in details.

If you would rather merge this one on its own before #1495, tell me and I will merge main into the branch with #1495's resolution of these files (no force-push). AI-assisted (Claude Code).

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
…e forms llvm-mc skips

main got restore_skipped_instructions with ubiquitarianism#984: an earlier form of this branch's
restore_vcc_tuples that also takes two more forms from the blob (a VOPC f32 compare
in DPP form, the measured v_dot4_i32_i8). restore_vcc_tuples stays the one function
and takes those two forms through skipped_form(), as ubiquitarianism#1495 resolved the same
conflict (the helper is that pull request's). main's tests that called the earlier
function by name call this one; the hand-built listing entry of the DPP recovery
test gets the fields a printed instruction has.

Translator suite: 487 files, 6297 tests, 0 failed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@DadaCap

DadaCap commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Update: #1495 now conflicts with main itself, so I merged main into this branch after all (head a6b851dff, no force-push; the reviewed commits are untouched). The needs rebase label is stale: GitHub reports it mergeable.

How the conflict with #984's restore_skipped_instructions is resolved, the same way #1495 did it:

Tested on the merged head (Windows 11, Python 3, no GPU needed): scripts/run_semantic_tests.py tests/semantic 487 files, 6,297 tests, 0 failed; tests/test_rdna2spirv_decode.py 25 tests OK; compileall clean. On one of 40 slices of my own library listings it translates 62 programs where main translates 49, and none that main translates is lost (counts only). AI-assisted (Claude Code).

@Tyrannys

Copy link
Copy Markdown
Contributor

Data from one machine, counts only. Windows 11, RTX 4070 SUPER (NVIDIA 621.01), own 1.0.2.1 copy, make_game.py --stages shaders --jobs 16, --wave64-emulate.

Translator tree Library compute programs translated FSPX Boot
plain main (25 Nov, before 3de22a190) 1,863 n/a 843 "no translated compute shader for FSPX" lines, then a CPU access fault (0xc0000005) at about 112 s, no device loss
main 3de22a190 + this PR + #1662 2,683 29 / 29 not booted yet (pipeline cache is being filled first)

On the second tree the whole shaders stage translated 29,279 of 29,280 modules, and all 29,279 pass spirv-val (BVH 52/52, executable 12/12).

Caveat: both PRs were applied together, so this does not separate this PR's share of the 820 recovered library programs from #1662's (the signed-byte v_dot4 op_sel re-anchor). I can rerun with each PR alone if that helps the review.

AI-assisted (Claude Code).

@DadaCap

DadaCap commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the corpus numbers: 29,279 of 29,280 translated and all valid, 2,683 library and 29 of 29 FSPX with this and #1662. It matches what I see here with the same two branches (29 of 29 FSPX against 22 on plain main). If you have the time, a run with this pull request alone would help the review, since it would show its own share of the 820. AI-assisted (Claude Code).

@Tyrannys

Copy link
Copy Markdown
Contributor

Follow-up to my counts above: both of those runs used llvm-mc 21.1.8 (the version scripts/build_llvm_mc.ps1 builds by default today). #1923 shows that with LLVM 23.1.5, plain main already gets 2,683 of 2,684 library programs. So on 21.1.8, this PR plus #1662 recovers the 820 programs that 21.1.8 garbles, and on 23.1.5 that gap doesn't appear in the first place. My table compares translator trees at 21.1.8 only, and doesn't measure this PR on 23.1.5.

AI-assisted (Claude Code).

@Tyrannys

Tyrannys commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Test report from a combined build on a second NVIDIA machine. Counts only.

Machine: Windows 11, RTX 4070 SUPER, NVIDIA 621.01, 64 GB, own 1.0.2.1 copy.

Build: main fe1553456 (already contains #1827 and #1893), plus #674, #1662, #1851, #1849, #1905, #1957, #1950, #1886 and #1894. All of them merged without conflicts.

Shaders: translated on 3de22a190 + #674 + #1662 with --wave64-emulate. 29,279 of 29,280 translated, and all 29,279 pass spirv-val. That is 2,683 library programs and 29 of 29 FSPX. main's translator changes since then are correctness fixes only.

Pipeline cache: warm and complete, 26,503 of 26,503 (9.6 GB).

  • Three library compute programs took 30 to 32 minutes each to build alone: the ScreenProbes ActivateRays, ActivateProbes and ActivateProbesTarget programs of indirect diffuse lighting.
  • Building all three at once crashed the NVIDIA compiler ("NVVM compilation failed: 3", after 22 minutes).

Recipe: scripts/windows-boot/boot.ps1 -Seconds 480, LEONIDA_KEYBOARD_PAD=1 LEONIDA_SKIP_INT3=1 LEONIDA_TITLE_WINDOWS_MB=1024 LEONIDA_MAP_READBACK=1, LEONIDA_PIPELINE_CACHE_DIR pointing at the offline cache. Host image copy: off (auto: NVIDIA) from #1851. One run per row.

run 1 run 2 (+ LEONIDA_TITLE_WATCHDOG=0)
end 344 s: the title's hang watchdog (null write at game_scarlett_master.exe+0x23cf683) full 484 s, stopped by the script
device loss / fault report none none
D3D12 calls 330,487 375,686
ExecuteCommandLists 5,490 6,017
Dispatch / DrawIndexedInstanced 2,435 / 2,726 2,779 / 6,026
PresentX 1,358 ok, 0 failed 1,465 ok, 0 failed
captures 23, all non-black 25, all non-black
indirect draws recorded / emitted / skipped 64 / 0 / 5,092 128 / 34 / 9,244 (#429 not included)

AI-assisted (Claude Code).

@aslan2142
aslan2142 merged commit 490f5b9 into ProjectLeonida:main Nov 25, 2026
5 of 12 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator

Merged, thanks! Reviewed a6b851dff on main:

  • Tests: test_vcc_tuple_fallback.py has 23 tests; 18 of them fail with main's restore_skipped_instructions, including the data word before a branch target.
  • LLVM 23.1.5: it decodes all five fixture tuple encodings without a rejected word, so restore_vcc_tuples only runs on 21.x-style listings (still what scripts/build_llvm_mc.ps1 builds by default). On 23.1.5 listings these all translate and pass spirv-val before and after, with 0 modules changed: a 400-listing corpus slice, all 1,451 corpus listings with rejected words, and the 21 library ones.
  • No duplicates: an instruction can't appear twice. Only uncovered offsets are decoded, and printed instructions that overlap a restored span are dropped.
  • Checked on main c37374180 + a6b851dff: the semantic suite passes (490 files, 6,310 tests, 0 files failed); test_rdna2spirv_decode pass; the 15 docs and writer tests pass; check_no_game_data.py is clean on the 6 changed files.
  • Non-blocking follow-up: if scripts: build llvm-mc 23.1.5 by default, so the pipeline library translates #1923 lands, a line in docs/shader_library.md §5 saying this recovery matters for llvm-mc 21.x listings would help.

AI-assisted (Claude Code, Claude Opus 5.5).

milk4sale pushed a commit to milk4sale/leonida that referenced this pull request Nov 26, 2026
milk4sale pushed a commit to milk4sale/leonida that referenced this pull request Nov 26, 2026
…fer store through a vcc resource

restore_vcc_tuples (ProjectLeonida#674) already decodes these words from the blob (the console's 112-SGPR file
is wider than llvm-mc's 106); these cases pin the two forms its tests did not cover:
s_buffer_load_dwordx8 into s[100:107] with an SGPR soffset and an immediate offset, and
buffer_store_dword with its resource in s[104:107]. Encodings built from the field layout.
The forms come from luizwidmer/palmetto (GPL-3.0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants