Fix decode strategy when splitting a chunk#3
Merged
cfcosta merged 2 commits intocfcosta:mainfrom Jul 29, 2025
Merged
Conversation
Contributor
Author
|
@cfcosta, is this failure of the build being caused by a formatting issue? Below is the log i get from |
Contributor
Author
cfcosta
requested changes
Feb 19, 2025
Owner
cfcosta
left a comment
There was a problem hiding this comment.
very nice! just a little nitpicks.
| } | ||
|
|
||
| #[inline] | ||
| fn nibble_chunck(chunk: &[u8]) -> (u8x16, u8x16) { |
| #[inline] | ||
| fn nibble_chunck(chunk: &[u8]) -> (u8x16, u8x16) { | ||
| let parsed_chunk = u8x32::from_slice(chunk); | ||
| let mut high_bytes_vec: Vec<u8> = vec![]; |
Owner
There was a problem hiding this comment.
Instead of using vec to allocate on the heap, can we just set [u8; X] directly? that way we don't need to allocate memory.
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.

This PR fixes the remainig failing test in CI.
The
encodefunction creates its 2x bytes output by merging 2 vectors of x bytes intercalating the values by if the index is even or odd. However, in thedecodefunction splits the same 2 x bytes vector by just cutting it in half. That difference in strategy on splitting those larger vector seems to be the cause of the failing test.This PR adds new function
nibble_chunkthat splits a larger vector in 2 smaller vectors using the even/odd strategy from theencodefunction.