Conversation
std.compress.inflate implements rfc 1951 in about 250 lines of pith: an lsb-first bit reader, canonical huffman decoding by the first-code walk (a few comparisons per symbol, no decode tables to build), the dynamic-tree run-length machinery, and lz77 back-reference copies from the output window. gzip.decompress routes every block type through it — stored, fixed huffman, dynamic huffman — and verifies the crc32 and length trailer, so files produced by other tools now read correctly. verified against system gzip at levels 1, 6, and 9: a 200KB source file decompresses byte-identical, and random binary round-trips. a committed gzip -9 fixture pins interop in the test suite, and logscan's golden check now hands the tool a real system-gzip file on every ci run instead of a pith-written one. the honest remainder is documented in limitations: compress() still writes stored blocks, so pith-written archives are larger than their input. the compressor is the other half of the project.
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
std.compress.inflate: rfc 1951 in ~250 lines of pith — lsb-first bit reader, canonical huffman decoding via the first-code walk (no decode tables), dynamic-tree run-length machinery, lz77 back-reference copies.gzip.decompressroutes all three block types through it with crc32 + length trailer verification — files from other tools now read correctly, closing the documented interop gap.verification
gzip -9fixture pins interop in the suitehonest remainder
compress()still writes stored blocks (pith-written archives exceed their input) — documented in limitations; the compressor is the other half of the project.what was tested
full suite green (all four golden checks, logscan now on real gzip), fixed point byte-identical, seed refreshed, fmt + doc gates clean.