shaders: validate disassembly listing completeness and report refused shader names (DISASM-VALIDATE-COMPLETE) #2646
Closed
matinsanei wants to merge 5 commits from
upstream-pr/2646 into main
pull from: upstream-pr/2646
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
ProjectLeonida/mandy!2646
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2646"
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?
Imported from ubiquitarianism/leonida. Originally posted by matinsanei on 2026-11-29T21:06:05Z.
Resolves #2539.
Covers coordination item
DISASM-VALIDATE-COMPLETE.Summary
When building with parallel jobs, an interrupted disassembler or pipe truncation could leave incomplete disassembly files in
<work>/shaders/dxbc/disasm/. Previously:tools/shader_disasm.pydid not check whether the disassembly listing was completely written before publishing withos.replace.--skip-existingandmake_game.py'sdisassembly_listings(dxbc)only verifiedst_size > 0, thus treating truncated.sfiles as valid.ERROR: shaders: the translation index holds 26502 of the 26503 carved shaders (1 branch without encoding)(#2539).tools/rdna2spirv.pyonly tallied reason counts inwhy, omitting the names of the failing shaders, making it difficult to locate which shader among thousands was refused.Changes
tools/shader_disasm.py:is_complete_listing()checking that.sfiles end with a newline and contains_endpgm(optionally attempting Python fallback before publishing).--skip-existingre-disassembles incomplete listings instead of skipping them.make_game.py:disassembly_listings()now usesis_complete_disassembly_listing(). Truncated or incomplete files are excluded, triggering automatic repair indisassembly_statusbefore translation.tools/rdna2spirv.py:1 branch without encoding (@ped_standard_...)).test_is_complete_listing_rejects_truncated_listingsintests/test_shader_disasm.py.test_finished_disassembly_repairs_a_truncated_listingintests/test_shader_stage_resume.py.Verification
python -m unittest tests/test_shader_disasm.py(35 tests OK)python -m unittest tests/test_shader_stage_resume.py(48 tests OK)python -I tests/test_text_write_line_endings.py(3 tests OK)python -I scripts/check_no_game_data.py(clean)Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-29T21:06:15Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T21:42:40Z.
I reproduced a completeness gap at
00966ec84(GitHub merge7c9e340ed) with a four-instruction synthetic fixture. The three listed suites passed (35 disassembler tests, 48 resume tests, 3 line-ending tests).MEASURED. The fixture uses
s_cbranch_scc1 1,s_endpgm,s_branch 0, ands_endpgm. Real LLVM 23.1.5 decoded the full range and the result translated and passedspirv-val. Cutting immediately after the firsts_endpgm, or keeping the laters_branch 0without its encoding and ending the line, leaves an incomplete listing. Both completeness checks accepted both cuts.--skip-existingreturnedreused: 1and left the file unchanged in each case. Translation refusedbranch target outside codeand produced zero valid modules.MEASURED, fresh publication. A zero-exit mock LLVM returned that same three-instruction stdout prefix without a trailing newline. With empty stderr, the Python fallback repaired it and the shader passed
spirv-val. Adding only a message on stderr made the current producer publish the incomplete listing asclean: 1. The diagnostic footer supplied the newline, the firsts_endpgmsupplied the token, and translation again produced zero valid modules.Checking the decoder output before appending diagnostics would close the second path. The cache check also needs evidence that decoding reached the expected end of the code range, since a cut just after an earlier real
s_endpgmcan end on a complete instruction and line. Cache check · Publication orderSynthetic fixture only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by matinsanei on 2026-11-29T21:57:12Z.
Thanks for the thorough reproduction and review! Both gaps are fixed in
aba6c9a06:tools/shader_disasm.py):one()now validates the decoder'sasmoutput withis_complete_asm(asm, expected_bytes=end - start)before writing the file or appending the; --- llvm-mc messages ---footer, sostderroutput can no longer mask a truncatedasmor missing trailing newline.tools/shader_disasm.py,make_game.py):is_complete_listing()andis_complete_disassembly_listing()now parse thecode 0x...0x...range from the header and verify that the total decoded bytes from; encoding: [...]and.longentries match the expected range length (catching cuts after an earliers_endpgmor lines missing encodings), while ignoring the; --- llvm-mc messages ---footer.Added regression tests in
tests/test_shader_disasm.pycovering all three cases (cut after an earliers_endpgm, missing; encoding:, and truncatedasmwith anllvm-mcstderr footer).Verified locally:
python3 -m unittest tests/test_shader_disasm.py tests/test_shader_stage_resume.py tests/test_text_write_line_endings.py(86 tests OK)Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T22:02:25Z.
Thanks for following up. On exact
aba6c9a06(GitHub mergeeba99aa70), all three damaged listings from the earlier probe were repaired on resume, including the cut after the firsts_endpgmand the newline-terminated branch without an encoding. The mock LLVM stdout/stderr case also fell back to a complete listing. Each output translated and passedspirv-val. The three focused suites passed again (86 tests).MEASURED, new regression with real LLVM 23.1.5. A hand-made 12-byte program has
s_branch 1, one unreachable0xffffffffdword, ands_endpgm. LLVM prints the two valid instructions (8 encoded bytes) and the warning for the skipped dword at input line 2. Onmain060c47160, the listing keeps that warning, translates 1/1 withspirv-val, and is reused. The PR treats the same 8 encoded bytes as truncated, uses the Python fallback, and publishes a listing without the LLVM warning. The resulting translation refusess_endpgmat0x12c, producing 0/1 valid modules, and--skip-existingregenerates it on every run.Control. The PR translator still produces 1/1 valid modules when handed the original LLVM listing directly. Both new cache checks reject that known-good listing. Counting the explicitly skipped, in-range words from
invalid_offsets(err)alongside the encoding coverage would preserve the complete LLVM output and the offsets the translator needs. Completeness check · Existing warning-offset parserSynthetic fixture only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by matinsanei on 2026-11-29T22:05:13Z.
Good catch! Fixed in
6b9768b2e:is_complete_asm(),is_complete_listing(), andis_complete_disassembly_listing()now count the explicitly skipped, in-range 4-byte words parsed frominvalid_offsets(err)(and the; --- llvm-mc messages ---footer) alongside the; encoding: [...]/.longbyte coverage.tests/test_shader_disasm.pyfor a 12-byte listing with a skipped invalid dword in thellvm-mcstderr footer.Verified locally:
python3 -m unittest tests/test_shader_disasm.py tests/test_shader_stage_resume.py tests/test_text_write_line_endings.py(86 tests OK)Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T22:10:37Z.
Confirmed on
6b9768b2e(GitHub mergeb3133c8c2onto32b9f4a3e) with LLVM 23.1.5. The default LLVM path now produces a listing and validated SPIR-V byte-identical to main's for the skipped-word fixture. The<stdin>:2:1warning is preserved,--skip-existingreportsreused: 1, and the make_game stage also counts the listing as complete.The three truncation cases and the mock decoder with the warning footer still regenerate clean output and pass
spirv-val. The three focused suites passed 86/86. Synthetic fixtures only. AI-assisted with OpenAI Codex.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-29T22:49:33Z.
Verified on
main452d1d1b6(Windows, Python 3.13), and there is a decision to make before merging it.It applies and works:
The idea is the one the title says:
is_complete_asm()intools/shader_disasm.pychecks that a listing ends with a newline, containss_endpgm, and covers the byte range, and the caller retries or reports instead of continuing with half a listing.The decision: #2553 ("reject and retry truncated disassembly listing") is a second, independent solution to the same problem, and the two overlap on four files:
is_complete_asm(asm, expected_bytes, skipped_bytes)- a predicate, in placelisting_is_complete/listing_file_is_completefrom a newtools/shader_stage_manifest.py, plusTRUNCATED_RETRY_ATTEMPTS = 3, a failure journal and a lockmake_game.py,tools/rdna2spirv.py,tools/shader_disasm.py,tests/test_shader_disasm.py,tests/test_shader_stage_resume.pySo they are not duplicates - they are two designs for one fix - and merging both would mean two retry mechanisms and a conflict in the five shared files. One of them should be chosen and the other closed, rather than merged in sequence.
Which one is a maintainer's call. What I can add: #2646's is the smaller change (205 lines, no new module, no threading), #2553's keeps a manifest with per-stage completion state and retries at the stage level. If the pipeline needs to resume across runs, #2553's manifest is the one that records that; if the failure only needs to be detected and retried in place, #2646 does it with a predicate.
Not tested: the title's real workload - a genuinely truncated listing produced by the driver - since no disassembly of the game's shaders is available here; the tests exercise the synthetic fixtures.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T23:03:43Z.
I compared
6b9768b2and #2553aee75f00on452d1d1b6, with LLVM 23.1.5 and synthetic inputs. #2646 merged cleanly. #2553 has a conflict intests/test_make_game_dry_run.py, outside the code and tests exercised here. Every case below was repeated three times.s_endpgm. #2553 published and reused that prefix. #2646's fallback published the full 16-byte listing, byte-identical to the complete control.<stdin>:2:1diagnostic. With the Python backend, #2646 rejected the same input. After a simulated short LLVM response, #2646 returnedinvalid wordsand published the Python fallback, but both its own cache checker andmake_game.disassembly_listings()rejected the file. A real--skip-existingrun decoded it again.s_endpgmfrom0x130to0x12cin the parser. The fallback needs to carry the offsets through publication and reuse.disasm.donereusable when the directory also contains a truncated.sfile absent from the unpack index. Current main invalidates resume in that case. The translator's directory scan still visited the extra file. Checking observed stems before filtering incomplete listings would preserve that safeguard.Synthetic fixtures only. AI-assisted with OpenAI Codex.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T05:26:53Z.
Independent verification on this machine (Windows 11, Python 3.13.14), and the negative control bites.
1. It applies.
merge-treeclean; the three commits cherry-pick ontomain1d22590b9without a conflict. Five files,205 insertions(+), 7 deletions(-).2. Its tests pass:
3. The negative control fails on
main's tools - with the PR's tests andmake_game.py,tools/rdna2spirv.pyandtools/shader_disasm.pyreverted:So the completeness check and the truncation repair are both absent on
mainand present with the change.4. The wider surface it touches did not regress:
What I did not test: the real corpus. The change decides when a disassembly listing is "complete" and when a shader is refused, and the synthetic listings in the tests are the only evidence here; a run over the 26,503 translated shaders would say whether the new rule refuses anything that used to translate. On this machine that is the shaders stage, which needs the game files and
llvm-mc.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T16:41:25Z.
Independent check on Windows (not the author), at
3ee23637f.tests/test_shader_disasm.py: 35 passedtests/test_shader_stage_resume.py: 48 passedtests/test_make_game_empty_translation.py: 20 passedEnvironment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10, llvm-mc 21.1.8.
No failures in the disassembly completeness/resume paths this touches.
AI-assisted: yes (opencode).
Imported from ubiquitarianism/leonida. Originally posted by matinsanei on 2026-12-01T07:17:50Z.
Addressed the remaining points from your comparison in
3ee23637fanddc3acde5f:make_game.py):disassembly_listings()now returnsNoneif any.sfile indisasm/is incomplete (even if absent from the unpack index), preservingmain's resume invalidation safeguard.tools/rdna2_decode.py,tools/shader_disasm.py): Addeddisasm_bytes_with_diagnostics()so bothbackend="python"and the fallback emit<stdin>:<line>:1: warning: invalid instruction encodingdiagnostics for skipped invalid dwords, keeping the byte offsets intact forrdna2spirv.pyand cache reuse.Verified locally (
86tests OK acrosstest_shader_disasm.py,test_shader_stage_resume.py, andtest_text_write_line_endings.py).Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:33:24Z.
Review: CHANGES_REQUESTED
Reviewed the diff against
main(competing duplicate of#2553for#2539):make_game.py:1393andtools/shader_disasm.py:312special-case"completed listing"and"synthetic listing"inside production completeness validation instead of updating test fixtures.is_complete_disassembly_listing(make_game.py:1379-1414) duplicatesis_complete_listing(tools/shader_disasm.py:322-349); a single shared helper (e.g. intools/shader_stage_manifest.py) avoids drift.tools/shader_disasm.py:368-378callsrdna2_decode.disasm_bytesand then immediately callsrdna2_decode.disasm_bytes_with_diagnosticsa second time wheneverbad != 0.checkandlinux-python-and-viewerare currently red.Please address these issues and coordinate with
#2553.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:48:52Z.
Closing this PR in favor of #2553, which is the original claim (
SHADERS-DISASM-TRUNCATED-CHECK) and the cleaner fix for#2539(truncated disassembly listings and unnamed shader refusals).Side-by-side comparison:
#2646special-cases test fixture strings ("completed listing"and"synthetic listing") directly inside production completeness checks (make_game.pyandtools/shader_disasm.py), whereas#2553updates the affected test fixtures directly.#2646duplicates completeness validation betweenmake_game.py(is_complete_disassembly_listing) andtools/shader_disasm.py(is_complete_listing/is_complete_asm), while#2553centralizeslisting_is_complete/listing_file_is_completeintools/shader_stage_manifest.py.#2646still requires"s_endpgm" in body(rejecting valid listings whose final instruction consumess_endpgmbytes as a literal) and invokesrdna2_decode.disasm_bytesfollowed immediately bydisasm_bytes_with_diagnostics(double-decoding) wheneverbad != 0.#2553validates full selected byte-range coverage (encoded_bytes + invalid_words * 4 == expected_bytes), handles trailing-literals_endpgm, validates observed vs. complete stems in_disassembly_inventory, uses bounded retries across bothllvm-mcandautomodes, and publishes viareplace_retry.#2553adds broader regression coverage (+265lines intests/test_shader_disasm.py,+38intests/test_shader_stage_resume.py,+24intests/test_rdna2spirv_cli.py).Thanks
@matinsaneifor the work and follow-up fixes on this issue.(AI-assisted review.)
Pull request closed