mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:25:52 +01:00
[PR #1712] tools: add auto fallback to python disassembler in shader_disasm and shader_library #1727
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1727
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1712
Author: @Tortoche
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:feat/shader-disasm-auto-fallback📝 Commits (1)
70315b5tools: add auto fallback to python disassembler in shader_disasm and shader_library📊 Changes
4 files changed (+100 additions, -4 deletions)
View changed files
📝
tests/test_shader_disasm.py(+42 -0)📝
tests/test_shader_library.py(+41 -0)📝
tools/shader_disasm.py(+11 -3)📝
tools/shader_library.py(+6 -1)📄 Description
Claim:
SHADER-DISASM-AUTO-FALLBACK(#1608#issuecomment-7158019367)Findings:
#1608(#1608#issuecomment-7156808927,#1608#issuecomment-7157792566)Related:
#998AI-assisted: yes
Summary
tools/shader_disasm.py:backend="llvm-mc"as the default indisasm()and--backendso FSSM callers and existing tests are unchanged.backend="auto"(and--backend auto): runsllvm-mcfirst; ifbad == 0and output is non-empty, returns it immediately without invokingrdna2_decode. Otherwise runs the pure-Python decoder (rdna2_decode.disasm_bytes) and returns(py_asm, py_bad, "")iffpy_asm.strip()and (not asm.strip()orpy_bad < bad); otherwise returns thellvm-mcresult.main()to runprobe(a.mcpu)whena.backend in ("llvm-mc", "auto").tools/shader_library.py:--backend(choices=("auto", "llvm-mc", "python"),default="auto").make_game.pyis intentionally untouched to stay conflict-free with#1592and#1708.disasm.probe(a.mcpu)upfront beforeThreadPoolExecutorwhenworkis non-empty anda.backend in ("llvm-mc", "auto").backend=a.backendtodisasm.disasm(...)inone(job).tests/test_shader_disasm.py: addedDisasmAutoBackendTest(test_auto_backend_falls_back_to_python_on_invalid_words,test_auto_backend_preserves_clean_llvm_mc_output,test_auto_backend_keeps_llvm_mc_when_python_not_better).tests/test_shader_library.py: addedtest_disasm_auto_falls_back_per_program_without_regressing_clean_programs.Verification
python3 -I scripts/check_no_game_data.py tools/shader_disasm.py tools/shader_library.py tests/test_shader_disasm.py tests/test_shader_library.py-> exit 0python3 -m compileall -q make_game.py tools tests-> exit 0python3 -I tests/test_shader_disasm.py-> Ran 34 tests in 8.384s, OKpython3 -I tests/test_shader_library.py-> Ran 23 tests in 0.215s, OKpython3 -I tests/test_library_shaders_stage.py-> Ran 17 tests in 7.336s, OKpython3 -I tests/test_text_write_line_endings.py-> Ran 3 tests in 15.974s, OKpython3 -I tests/test_ci_registration.py-> Ran 16 tests in 9.878s, OK🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.