Repository navigation
test(checksums): pin signed-byte rolling Adler regression fixture - #3636
Merged
Merged
Conversation
Hand-computed (s1, s2) values for inputs dominated by bytes >= 0x80. Guards against any future rolling-checksum change that reverts to unsigned interpretation, even if the parity test reference drifts. Sizes chosen on SSE2/NEON 16-byte and AVX2 32-byte block boundaries plus +/- 1 neighbours. Includes a negative-control test asserting that the unsigned-interpretation digest is visibly different.
4 tasks done
6 tasks
oferchen
added a commit
that referenced
this pull request
May 18, 2026
) Hand-computed (s1, s2) values for inputs dominated by bytes >= 0x80. Guards against any future rolling-checksum change that reverts to unsigned interpretation, even if the parity test reference drifts. Sizes chosen on SSE2/NEON 16-byte and AVX2 32-byte block boundaries plus +/- 1 neighbours. Includes a negative-control test asserting that the unsigned-interpretation digest is visibly different.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
) Hand-computed (s1, s2) values for inputs dominated by bytes >= 0x80. Guards against any future rolling-checksum change that reverts to unsigned interpretation, even if the parity test reference drifts. Sizes chosen on SSE2/NEON 16-byte and AVX2 32-byte block boundaries plus +/- 1 neighbours. Includes a negative-control test asserting that the unsigned-interpretation digest is visibly different.
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
Adds hand-computed
(s1, s2)regression fixtures for the rolling Adler checksum at inputs dominated by bytes>= 0x80.PR #3560 fixed a sign-extension bug where bytes
>= 0x80were treated as unsigned, diverging from upstream'sschar *bufcast (checksum.c:285). The existing parity proptest incrates/checksums/tests/rolling_simd_parity.rscovers this via a self-contained reference, but a corrupted reference would silently mask a regression.This file pins offline-computed expected values that fail loud if the impl reverts to unsigned interpretation, regardless of what the proptest reference does.
What's covered
[0x80, 0x81, 0x82, 0x83]— small scalar path0x80— SSE2/NEON block boundary0xFF— AVX2 block boundary0xC0— AVX2 boundary +1 (tail handling)0x80— smallest signed/unsigned divergence!=the actual digestAll expected values derived from
(byte as i8) as i32summation with& 0xffffapplied only at the end, matching upstreamchecksum.c:285andmatch.c:hash_search().Why now
This regression guard lands ahead of internal matching-pipeline work that touches the rolling-hash hot loop (bithash prefilter, sequential-match heuristic, matched-block pruning). It is purely additive — no production code changes.