mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #623] [CLOSED] shader_disasm: hand llvm-mc its input in lines of 64 bytes (OLD-10020) #664
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#664
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/623
Author: @jarvixaiassistant-glitch
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:fix/old-10020-shader-disasm-input-lines📝 Commits (1)
0b04572shader_disasm: hand llvm-mc its input in lines of 64 bytes, not one long line📊 Changes
2 files changed (+94 additions, -5 deletions)
View changed files
➕
tests/test_shader_disasm_input_lines.py(+84 -0)📝
tools/shader_disasm.py(+10 -5)📄 Description
Claimed in the coordination issue as: OLD-10020
What and why
Carries forward
old-pr/10020(draft #289) ontomain(21625bca8), preservingbeamdotdev's original commit verbatim perCONTRIBUTING.md:llvm-mc --disassembleintools/shader_disasm.py(disasm()) into lines of 64 bytes ("\n".join(" ".join(f"0x{b:02x}" for b in code[i:i + 64]) for i in range(0, len(code), 64))) instead of a single line.llvm/tools/llvm-mc/Disassembler.cpp):SkipToToken()strips" \t\r\n,"andbyteArrayFromString()accumulates bytes continuously across newlines into a singleByteArray(only[,], or EOF flushprintInsts()), so multi-dword RDNA2 instructions spanning a 64-byte line boundary decode byte-identically while avoidingllvm::SourceMgrquadratic line scanning on long single-line inputs (reported 58.6 s → 0.2 s on a 90 KB shader).tests/test_shader_disasm_input_lines.py(stdlib-only, stubssubprocess.run, nollvm-mcor game data required).b"",bytearray/memoryview, boundary sizes (1, 63, 64, 65, 128, 129), and downstream callers (NO_HARDENING_NEEDED).Tested
All synthetic CPU/stdlib/docs checks on Windows 11 x64, Python 3.12.14, Node v24.19.0 (no game files, no
llvm-mcinstalled locally):python -I tests/test_shader_disasm_input_lines.py -v— 4/4 passedpython -I tests/test_ci_registration.py— 15/15 passedpython -I tests/test_runtime_paths.py— 5/5 passedpython -I scripts/check_no_game_data.py— passed (0 forbidden tracked extensions)python -m compileall -q make_game.py tools tests— passedpython -I tests/test_text_write_line_endings.py,tests/test_report_paths.py,tests/test_i18n_index.py, and alltests/test_docs_*.py— passednode --test tests/test_viewer_streaming.cjs— passedGPUs tested: n/a (CPU disassembler input formatting / unit tests only)
AI-assisted: yes (JARVIX multi-model team: Antigravity + DeepSeek-V4-Pro + NVIDIA NIM Nemotron-3.5-Lightning & Nemotron-3-Ultra-550B)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (N/A —llvm-mcstdin line wrapping only; no shader-translator rule changed.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.