Commit Graph

19 Commits

Author SHA1 Message Date
cddee3f7d2 Count invalid words declared in disassembly headers 2026-11-24 02:56:34 +05:30
108c36ef75 shader_profile: report instruction categories by stage (#6856)
Squash-merged after diff review of PR #6856 - shader_profile: report instruction categories by stage
2026-11-23 09:54:03 -06:00
8eb4721604 docs: correct the shader profiler's default report path 2026-11-22 23:25:04 +00:00
3218515c47 Merge pull request #3269 from shdann 2026-11-22 15:16:21 -05:00
d03f9e63eb shader_profile: report unreadable listings cleanly 2026-11-22 22:57:19 +03:00
3761493209 fix(tools): stabilize shader profile rankings on ties
A filesystem enumeration can change which tied mnemonics appear in the top-12 summary and produce unrelated differences in the JSON report.
2026-11-22 17:55:30 +01:00
86aa9398e5 fix(tools): protect the shader carve index in shader_profile 2026-11-22 17:50:24 +03:00
e7aa5afd81 shader_profile: refuse report paths that overwrite input disassembly files 2026-11-22 17:42:12 +05:30
b093d45d08 shader_profile: take each shader's stage from the carve index
The per-stage report took the stage from the file name's first two characters before an
underscore, but most corpus names carry no stage prefix, so on my 26,503-shader corpus 25,040
(94%) landed under "?" (ps 1,228, vs 225, ms 10, cs 0). shader_carve.py's index.json next to the
disasm folder has every container's stage from its program header, as rdna2spirv.stage_of reads
it; stage_map() now loads it and the name prefix is only the fallback for shaders it doesn't list
(or when there is no readable index).

Real data (counts only), the same 26,503 shaders, main -> this change:
? 25,040 -> 0, ps 1,228 -> 12,101, ms 10 -> 9,282, cs 0 -> 2,689, vs 225 -> 2,236, gs 0 -> 195.

Tests: test_cli_takes_the_stage_from_the_carve_index (main: every listed shader without a prefix
is "?", and a name prefix wins over the index).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:29:04 -03:00
ed572ebbd7 shader_profile: skip non-file .s entries 2026-11-22 04:32:14 -03:00
ae51e74ffb Profile LLVM warning words at their reported columns 2026-11-21 19:08:00 -07:00
906dd402c3 shader_profile.py: a bad source or --out is one line, and --out is checked before the scan
A missing source or a file given as one ended in a traceback from
os.listdir. An --out in a folder that doesn't exist (or that is a
folder itself) failed only after the whole corpus had been profiled,
again as a traceback. The source and the output folder are now checked
first, and a failed write is caught; each case prints one line naming
the path and exits 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:51:41 +01:00
591ecf66b9 shader_profile.py: use the same instruction counts in both reports 2026-11-22 00:13:17 +01:00
d73fa3cab0 tests: shader_profile's --per-shader check goes through run_profile (#263 x #282)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:42:48 -05:00
2442ad124a tests/docs: follow this round's both-side merges (shader_profile test uses #263's run_profile, drop duplicated table rows)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 17:42:27 -05:00
38f17196d3 Merge pull request #282 from Claude
# Conflicts:
#	tools/shader_profile.py
2026-11-21 17:38:22 -05:00
46d3093d61 shader_profile: report per-stage register pressure; add --per-shader
profile_shader() and register_footprint() were only called from the tests.
main() now runs profile_shader() on every shader and adds a "registers"
section to profile.json: per stage, the max and mean VGPR/SGPR count and a
VGPR histogram (<=32/64/128/256). --per-shader also lists each shader's
instruction count and VGPR/SGPR footprint. Existing output is unchanged.

Tested with hand-written disassembly only (tests/test_shader_profile.py).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011jW1LkcxdgoMR14Ng7tzCo
2026-11-21 22:19:36 +00:00
f6bfb13c53 Write valid JSON for shader profiles with no memory operations 2026-11-21 14:11:21 -07:00
85842cc574 test(tools): add test_shader_profile.py and opcode/register profiling in shader_profile.py 2026-11-21 19:02:51 +01:00