Skip to content

huff0: seed FuzzDecompress1x with real compressed output, exercise Decompress4X - #1208

Merged
klauspost merged 1 commit into
klauspost:masterfrom
honeycombio:lizf.huff0-fuzz-decompress4x
Sep 9, 2026
Merged

klauspost merged 1 commit into
klauspost:masterfrom
honeycombio:lizf.huff0-fuzz-decompress4x

Conversation

@lizthegrey

@lizthegrey lizthegrey commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Small rebase of the still-open #893. Most of that PR has already shipped independently: internal/fuzz.ReturnFromZip is already on master and is used by s2/fuzz_test.go to seed decoder fuzzers from real encoder output, and FuzzCompress already round-trips through Compress1X/Decompress1X/Compress4X/Decompress4X. What's left, and still missing on master:

  • FuzzCompress never seeds testdata/regression.zip (it still exists in huff0/testdata/, just unused).
  • FuzzDecompress1x only ever saw whatever ReadTable happened to accept out of a raw zip, and never exercised Decompress4X at all — unlike the s2 decoder fuzzers, which seed from real compressor output via ReturnFromZip.

This applies that same addCompressed-via-ReturnFromZip pattern to huff0/fuzz_test.go, and adds Decompress4X to the fuzzed paths.

Test plan

  • go build ./..., go vet ./huff0/...
  • go test ./huff0/... (seed corpus + existing tests pass)
  • go test -fuzz=FuzzDecompress1x -fuzztime=20s ./huff0 — no crashes, 112 new coverage-interesting inputs found (confirms the new Decompress4X path is reached)
  • go test -fuzz=FuzzCompress -fuzztime=20s ./huff0 — no crashes, 15 new coverage-interesting inputs found

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded compression and decompression fuzz testing with inputs from existing regression and compressed-data corpora.
    • Added coverage for well-formed compression tables and payloads across supported compression modes.
    • Simplified decompression fuzz execution to exercise decoder behavior regardless of returned errors or output.

…compress4X

Ports the part of klauspost#893 that never shipped: ReturnFromZip already landed
separately and is used by s2's decoder fuzzers the same way. FuzzCompress
already round-trips through Compress4X/Decompress4X; FuzzDecompress1x did
not, and only saw whatever ReadTable happened to accept from a raw zip,
never well-formed tables+payloads from the real encoder.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: daf29f1f-d5f6-413e-90c9-95f282f757ce

📥 Commits

Reviewing files that changed from the base of the PR and between fc272ea and c0bcb54.

📒 Files selected for processing (1)
  • huff0/fuzz_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The fuzz tests add regression corpus seeds for compression and decompression. Decompression seeds use outputs from both Compress1X and Compress4X. The decompression fuzz body now invokes both decoder variants without checking their results.

Changes

Huff0 fuzzing

Layer / File(s) Summary
Corpus seed expansion
huff0/fuzz_test.go
FuzzCompress loads regression.zip outside short mode. FuzzDecompress1x generates seeds with Compress1X and Compress4X from two ZIP corpora.
Decompression execution
huff0/fuzz_test.go
FuzzDecompress1x calls Decompress1X and Decompress4X without early returns for errors or empty output.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to c0bcb

This expands Huff0 fuzz inputs and exercises both decompression variants without changing production behavior. No actionable merge risk is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main changes: seeding FuzzDecompress1x with valid compressed output and exercising Decompress4X. It is specific, concise, and related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@klauspost

Copy link
Copy Markdown
Owner

@lizthegrey I've been wanting to do a larger fuzzing refactor for a while to slim down the base corpus, but have a more complete corpus being opt-in remotely fetched from github for example.

I will see if I can find the bandwidth to throw some tokens at a framework.

@klauspost
klauspost merged commit 5e17c92 into klauspost:master Sep 9, 2026
29 checks passed
@lizthegrey
lizthegrey deleted the lizf.huff0-fuzz-decompress4x branch September 10, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants