plugin/zlib: Add zlib implementation using SIMD Adler-32 #29
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 382 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #29"
general
weight: 0.35
pjbgf
Stacked on #28.
Neither
compress/zlibnorklauspost/compress/zliblets callers replace the Adler-32 checksum, as both callhash/adler32directly. To use the SIMD implementation fromgithub.com/go-git/x/simd/adler32, the zlib framing has to be owned here.This adds
plugin/zlib(github.com/go-git/x/plugin/zlib), a zlib (RFC 1950) reader and writer with the same API ascompress/zlib. It usesklauspost/compress/flatefor deflate andsimd/adler32for checksums. It returns thecompress/zliberror values, asklauspost/compress/zlibdoes, soerrors.Ischecks keep working. It works as a drop-in replacement through an import change, andProviderregisters it with go-git's zlib plugin:Benchmarks
Against
klauspost/compress/zlib:| Workload | Change |
| --- | --- |
| Compress and decompress, all platforms tested | 2–17% faster |
| go-git packfile scanning, parsing and encoding (amd64) | 2–7% faster |
| go-git loose objects of 64 KiB and larger (amd64) | 19–29% faster |
The go-git numbers come from the go-git and spinnaker fixture packs. The benchmarks are in
internal/gogitbenchand take-zlib=stdlib|klauspost|simd.Testing
compress/zlibare checked to decode with the other, and headers to match byte for byte at every level.ResetafterClose, andFlush.io.ByteReader, the reader is checked not to read past the end of the stream, as go-git's packfile scanner relies on that.Providerpasses go-git'sValidateProvider.compress/zlib.Behaviour differences from klauspost/compress/zlib
klauspost/compressv1.20.5. Earlier versions accept a dynamic block with no end-of-block code, which RFC 1951 forbids andcompress/zliband C zlib reject. With a matching trailer,klauspost/compress/zlibv1.20.4 returns such a stream as valid data. A regression test covers it.Writerused afterClosereturns errors. Inklauspost/compress/zlib, a secondCloseor aFlushpanics, and aWritereports success without writing. A secondClosehere returns the result of the first and writes nothing more, unlikecompress/zlib, which writes the trailer again.compress/zlibdoes.Dependency on simd
go.modrequiresgithub.com/go-git/x/simdatv0.0.0-20261202164648-e9e62b7cc5c8, the pseudo-version of #28's head commit, with no replace directive. Once simd is tagged, this moves to the tag.Licensing
The reader and writer are derived from Go's
compress/zliband carry Go's BSD licence notice.Generated with Claude Code