Remove crc dependency#40
Merged
Merged
Conversation
Reduces our dependency graph. Use `crc` only for testing.
There was a problem hiding this comment.
Pull request overview
This PR successfully removes the crc crate from runtime dependencies while maintaining it as a dev dependency for testing. The change reduces the dependency footprint by implementing native table-based CRC calculations.
Key changes:
- Implements native 16-lane lookup table generation for CRC-16, CRC-32, and CRC-64 algorithms
- Adds an
Algorithm<W>struct to define CRC parameters internally, replacing the dependency on thecrccrate's version - Creates a binary utility (
generate-tables) to pre-compute lookup tables - Moves
crcdependency to dev-dependencies for continued testing against reference implementation
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Moves crc from dependencies to dev-dependencies; adds generate-tables binary |
| Cargo.lock | Updates indirect dependency versions (cc, find-msvc-tools, zmij) |
| src/structs.rs | Adds new Algorithm<W> struct to replace external crc::Algorithm |
| src/lib.rs | Changes arch module visibility to public; adds tables module; updates checksum_with_params to use init_algorithm |
| src/consts.rs | Removes imported crc::Algorithm and previously defined CRC algorithm constants |
| src/crc16/consts.rs | Adds 31 Algorithm<u16> constants for all CRC-16 variants |
| src/crc32/consts.rs | Adds 12 Algorithm<u32> constants for all CRC-32 variants |
| src/crc64/consts.rs | Adds 7 Algorithm<u64> constants for all CRC-64 variants |
| src/bin/generate-tables.rs | New binary utility to generate pre-computed lookup tables |
| src/arch/software.rs | Implements native table generation and CRC update functions; adds comprehensive property tests |
| src/arch/x86_64/avx512_vpclmulqdq.rs | Adds Default trait implementation |
| src/arch/x86_64/avx512.rs | Adds Default trait implementation |
| src/arch/aarch64/aes_sha3.rs | Adds Default trait implementation |
| src/test/consts.rs | Adds CRC_64_NVME_CRC constant for testing; updates RUST_CRC64_NVME to use new constant |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The Problem
It's been requested that we reduce our dependency footprint by removing the
crccrate. #32The Solution
Remove the
crccrate.Changes
crcandcrc-catalogfrom the non-dev dependency treecrcfor testing to ensure correct calculationsPlanned version bump
PATCHLinks
crcor make it optional? #32Notes
Dependency tree is getting pretty light now, we should be careful about adding any new non-dev dependencies: