docs: audit SIMD/scalar parity coverage across checksums crate#3393
Merged
docs: audit SIMD/scalar parity coverage across checksums crate#3393
Conversation
a5c172c to
c2d9456
Compare
This was referenced Apr 26, 2026
c2d9456 to
b1a2066
Compare
Document the runtime CPU-feature dispatch ladder for every SIMD-accelerated checksum (rolling, MD4, MD5, SHA-256, CRC32C) directly in the relevant modules so the supported AVX-512 -> AVX2 -> SSE4.1 -> SSSE3 -> SSE2 -> NEON -> scalar fallback chain is discoverable from rustdoc. Add streaming/one-shot parity tests for SHA-256 and CRC32C: a 16 KiB deterministic pseudo-random buffer and a chunk-size sweep, plus the RFC 3720 canonical vectors fed through the streaming wrapper for CRC32C. These guard against regressions in the streaming state machine that the existing one-shot vectors do not catch. Rolling, MD4, and MD5 already have exhaustive RFC + lane-boundary + proptest parity coverage and need no additional tests. No runtime behaviour changes - rustdoc and tests only.
The constants 2654435761 and 2246822519 exceed i32::MAX, so the implicit i32 inference from `0..N` fails type-check on `i.wrapping_mul(...)`. Annotate the range as `0u32..N` so the multiplier and result are unambiguous u32.
b1a2066 to
813f2c5
Compare
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
is_x86_feature_detected!.Per-algorithm gap analysis
rolling::tests::checksum::simd(lane sweeps, proptest, large inputs)simd_parity_tests::md4_simd_parity(RFC 1320 + lane boundaries + proptest + 100 KiB inputs)simd_parity_tests::md5_simd_parity(RFC 1321 + lane boundaries + proptest + 100 KiB inputs)Test plan