Repository navigation
feat(embed): one-shot functions, build-time sizes, honest footprint ceilings - #134
Merged
Merged
Conversation
…eilings - `decompress`, `decompressed_len` and `compress` in `deflate`, `zlib` and `gzip` (embed build): slice to slice, the output as the history window, no state kept. Smaller than minizlib's equivalents in code and stack. - `WindowedDecoder<WINDOW>` and `BlockEncoder<BLOCK, TABLE>`: the streaming codecs' sizes picked at build time; `Decoder` and `Encoder` are aliases at the default sizes, so existing code is unchanged. - The streaming decoder leaves out the states of the other containers, and decodes discarded output through a scrap of stack rather than a per-byte branch; the encoder writes through a 32-bit bit buffer and no longer links `memclr` or 64-bit shifts. - tools/footprint/stack.py missed what a prologue reserves after setting up the frame pointer, and `subw`: the decoders' stack was under-reported (88 bytes vs 328 measured). Ceilings are now set from correct figures, and cover the new configurations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deflate/zlib/gzip(embed build):decompress(input, output)(output slice is the history window: no window, no state, ~1.3 KiB stack),decompressed_len(input, max_len),compress(input, table, output)with a caller table of any size.WindowedDecoder<WINDOW>andBlockEncoder<BLOCK, TABLE>;Decoder/Encoderare aliases at the defaults, so existing code is unchanged.memclr8/__aeabi_llsl.stack.pystopped at the frame-pointeraddand missedsubw, under-reporting decoder stack (88 vs 328 bytes). Ceilings re-set from correct figures, new configurations added.Sizes (thumbv7em, opt-level z, LTO) vs minizlib
Test plan
BlockEncoderat many sizes); identical accept/reject on ~64k valid/corrupt/random streamscargo test --features all,cargo test --all-features, embed-only tests (12 new)-D warnings, no_std + thumbv7em buildstools/footprint/check.sh,tools/embed-crosscheck.sh🤖 Generated with Claude Code