Repository navigation
Add CRC64NVME to smithy-checksums - #868
Merged
Merged
Conversation
jonathan343
force-pushed
the
feat/smithy-checksums-crc64nvme
branch
from
October 25, 2026 04:59
aeded0f to
cfcc9f2
Compare
jonathan343
force-pushed
the
feat/smithy-checksums-crc64nvme
branch
from
October 27, 2026 15:47
cfcc9f2 to
82838e3
Compare
jonathan343
force-pushed
the
feat/smithy-checksums-crc64nvme
branch
2 times, most recently
from
October 27, 2026 21:04
fec00fb to
eef1834
Compare
Adds CRC64NVME, the algorithm S3 uses for full-object checksums, backed by
the native extension with a pure-Python fallback, and available through
new("crc64nvme").
CRC64NVME shares the chunked big-integer path with CRC32C, which takes it from about 15 MB/s to about 135 MB/s. Add it to the test that checks that path against a bit-at-a-time CRC around the chunk and tail boundaries.
jonathan343
force-pushed
the
feat/smithy-checksums-crc64nvme
branch
from
October 31, 2026 18:58
eef1834 to
10d040d
Compare
jonathan343
marked this pull request as ready for review
October 31, 2026 19:09
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
S3 uses CRC64NVME for full-object checksums, and it's the algorithm S3 computes when an upload doesn't specify one. This PR adds it to
smithy-checksumsasCRC64NVME, also available throughnew("crc64nvme"). It reuses the native extension and the pure-Python CRC implementation from #867. The native side usescrc-fast'sCrc64Nvme. The pure-Python side reuses the table-driven CRC that CRC32C uses, with the CRC-64/NVME polynomial.Example
The native and pure-Python builds print the same thing:
Testing
The known answers are the CRC-64/NVME check value for
"123456789"and the four 64-bit CRC test cases from the NVMe NVM Command Set specification. Both implementations are also compared against the CRT and against each other:uv run pytest packages/smithy-checksums -k "crc64nvme and (known_answers or matches_crt or native_matches_pure)" --no-cov -qThe chunked pure-Python CRC is also checked against a bit-at-a-time reference CRC across chunk boundaries:
uv run pytest packages/smithy-checksums -k "crc64nvme and chunked_crc_matches_bitwise" --no-cov -qBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.