Repository navigation
Conversation
llvm-mc echoes the whole source line under every "invalid instruction encoding" warning. With the program on one line, stderr grew with warnings x program size: on the pipeline library's compute programs (up to 160 KB, 976 of 2,684 with invalid words) single calls ran for minutes and the set didn't finish in 30 min at 15 jobs. With 32-byte lines it takes 24 s. llvm-mc reads the lines as one byte stream, and whole-word lines keep each warned word on its echoed line, where shader_profile.py reads it. On 600 random carved FSSM blobs (312 invalid words) the disassembly, the invalid-word counts and shader_profile's warned words are identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested acb06c6 on Windows, CPython 3.14.7, CPU only (no GPU, no game files): pass for the formatter and for the profile reader.
I gave I also gave synthetic LLVM warnings at the first word and at the last word of four sequential lines to I did not test the real |
|
Verified on Linux with real llvm-mc (LLVM 23.1.4): merges cleanly into main, |
…ines # Conflicts: # tests/test_shader_disasm.py # tools/shader_disasm.py
|
Merged |
|
Tested
No game files. AI-assisted (Claude Code). |
The fallback read each warning's byte offset from its column, which holds only while the program goes to llvm-mc as one line. ItsNotRexed#4210 splits it into short lines; take the offset from the warning's line and column in the text that was sent, so the splice works with either input layout.
|
Measurement in favour of this, llvm-mc 21.1.8 gfx1013 on Windows: one ~98 KB pipeline-library program took 43 s as one input line and 0.63 s as 64-byte lines, with byte-identical stdout and the same number of invalid-word warnings. Over the library corpus this is the difference between hours and minutes for |
|
Code read (CPU) — Linux, LLVM 18.1.8 ( Tested the premise and the one consumer this can break, since stderr shrinking is only safe if the decode and
Two small notes
Verdict: the change does what it says, the decode is unaffected on synthetic and real input, and the only in-tree consumer still resolves every word. No blocking issues. AI-assisted. |
|
Independent check on Linux, llvm-mc 23.1.5, CPU only, no game data.
Same count of invalid encodings and byte-identical disassembly, so nothing in the output changed; stderr is 53× smaller and the call 26× faster on 2 KiB. On
Nothing to change from my side. |
Claimed in the coordination issue as: #4084 (comment)
What and why
shader_disasm.disasmsent llvm-mc the whole program as one line of hex. llvm-mc echoes the full source line under everyinvalid instruction encodingwarning, so stderr grew with warnings × program size. A large program with some undecodable words took minutes in one call and wrote hundreds of MB that were then copied into the.sfile. I hit this on the 2,684 compute programs of the pipeline library inshaders.rpf: up to 160 KB each, 976 of them with invalid words. The set didn't finish in 30 minutes with 15 jobs.hex_lines()now writes 32 bytes per line. llvm-mc reads the lines as one byte stream, so the decode doesn't change. A line always holds whole words, so each warned word is still on its echoed line, wheretools/shader_profile.py(warning_words) reads it.fspx_unpack.pygets the same change, because it callsshader_disasm.disasm.Tested
shader_profile.warning_wordsresults in 600/600. Instructions that straddle a line break decode the same, also checked with one word per line.python -I tests/test_shader_disasm.py(newtest_input_lines_hold_whole_words),tests/test_shader_profile.pyandtests/test_text_write_line_endings.pypass.scripts/build_llvm_mc.ps1(LLVM 23). No GPU involved.AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (No translator rule.)🤖 Generated with Claude Code