The carve-index case covered an entry with no stage field only, so a
change of shader_stages' "a non-empty string" test to "a string or
anything truthy" went unseen (review of #882). The case now has an
entry with an empty stage and one with a number, checks shader_stages'
answer for all five, and that the breakdown has one line for them.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The corpus is 26,503 carved containers holding 26,698 tag-0x0D payloads:
195 vertex-shader containers carry two. fssm_unpack.py now prints both
counts and, given the carve index, a line per stage. shader_library.md
records the two counts and why 195 equals the geometry-shader count.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Validate XBCH stored size, cap output by the declared FSSM length, and reject truncated or trailing zlib data. Add synthetic regression coverage for the declared-size ceiling and malformed streams.
Addresses BUILD-342 claimed in #1218.
unpack() checked the decompressed payload's size and that it holds at least a
magic and version, but not the magic itself, so a payload starting "JUNK" was
written as a .fssm and indexed. It is now a ValueError, counted with the
other per-file problems.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main() made <src>/fssm before it listed <src>, so a mistyped source
folder was created, whole path included, and the run then ended with
"no shader unpacked" as if the folder were real. A file given as the
source ended in a NotADirectoryError traceback, and a folder that can't
be listed in a PermissionError one. The source is now checked first: a
missing path, a file or an unlistable folder prints one line naming it
to stderr and exits 2, and nothing is written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>