Repository navigation
Conversation
…rr (BUILD-3020) disasm() was joining all bytes of a shader program into one space-separated line before feeding llvm-mc. When llvm-mc encounters an invalid instruction, it echoes the entire input line in the error message. For large programs (the pipeline library), this caused gigabytes of stderr output. Changed to feed one dword (instruction) per line instead: each invalid instruction now echoes only ~15 characters instead of the entire program. For a 10KB shader with 100 invalid words: 5.1 MB -> 1.5 KB (~3400x reduction). All 29 existing tests in test_shader_disasm.py pass. No game files, no GPU needed. Found by Jadiac5. AI-assisted.
Grimkeh
left a comment
There was a problem hiding this comment.
Independent Linux CPU review (5e67de97)
What changed: shader_disasm feeds llvm-mc one dword per line to avoid gigabyte stderr (BUILD-3020).
Checked: Diff review (+8/-1 in tools/shader_disasm.py); no dedicated unit test in the PR.
Looks like a sensible llvm-mc input-shape fix; no game files.
|
Independent Linux A/B on On both targets, a 10,884-byte mixed-width stream with 32 bad dwords went from 2,640,219 to 2,420 bytes of diagnostics, with identical assembly and all 32 errors still counted. I also wrapped the smaller one-error fixture in a synthetic FSSM header and ran The comment could say “one 32-bit word per input line” since a machine instruction can span multiple lines. The real LLVM run confirms that 8- and 12-byte instructions still decode across those boundaries. Synthetic inputs only. AI-assisted (Codex). |
|
Independent Linux review of
Minor non-blocking nit:
LGTM. AI-assisted: yes. |
|
checked: #89165e67de9 | with:
AI-assisted. |
Claimed in the coordination issue as: BUILD-3020
Depends on: none
What and why
shader_disasm.disasm()was joining all bytes of a shader program into one space-separated line before feeding llvm-mc. When llvm-mc encounters an invalid instruction, it echoes the entire input line in the error message. For large programs (especially the pipeline library), this caused gigabytes of stderr output that stalled the disassembly on its own error messages.Changed to feed one dword (4-byte instruction) per line instead: each invalid instruction now echoes only ~15 characters instead of the entire program.
Tested
For a 10KB shader with 100 invalid words: 5.1 MB ? 1.5 KB error output (~3400x reduction).
All 29 existing tests in
tests/test_shader_disasm.pypass. No game files, no GPU needed-synthetic test only.Tested on Windows 11 Pro with Python 3.14.2.
Found by
Jadiac5.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed.