Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: align buffers in 2.1 files #3101

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

westonpace
Copy link
Contributor

This ensures that all file buffers are aligned to 64 bytes (these are generally 8MiB buffers and so 64 bytes is trivial)

We also ensure that all mini-block chunks are aligned to 8 bytes. This introduced a bit more padding but makes it easier to do things like store offsets into mini-block chunks.

@github-actions github-actions bot added enhancement New feature or request python labels Nov 7, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 80.34188% with 23 lines in your changes missing coverage. Please review.

Project coverage is 77.14%. Comparing base (2d3dd67) to head (f20b9f4).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
rust/lance-file/src/v2/writer.rs 44.44% 2 Missing and 8 partials ⚠️
rust/lance-core/src/utils/bit.rs 66.66% 4 Missing ⚠️
rust/lance-encoding/src/encoder.rs 71.42% 4 Missing ⚠️
rust/lance-file/src/v2/reader.rs 82.60% 1 Missing and 3 partials ⚠️
rust/lance-encoding-datafusion/src/zone.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3101      +/-   ##
==========================================
- Coverage   77.16%   77.14%   -0.02%     
==========================================
  Files         240      240              
  Lines       79764    79833      +69     
  Branches    79764    79833      +69     
==========================================
+ Hits        61548    61586      +38     
- Misses      15071    15082      +11     
- Partials     3145     3165      +20     
Flag Coverage Δ
unittests 77.14% <80.34%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -376,17 +377,26 @@ impl DecodePageTask for DecodeMiniBlockTask {
for chunk in self.chunks.into_iter() {
// We always decode the entire chunk
let buf = chunk.data.into_buffer();
// The first 4 bytes describe the size of the rep/def buffers
// The first 6 bytes describe the size of the remaining buffers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

judging from the compress code, looks like the size of bytes_rep and bytes_def are at the end of the chunk now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, sorry, only the comments in the compress code states that the size of the rep buffer and def buffer are put at the end.

        // Each chunk ends with the size of the rep buffer (2 bytes) and the size of
        // the def buffer (2 bytes).  These are put at the end so as to not disturb
        // the alignment guarantees given to the compressor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I'll clean that up. At one point in this PR they were at the end but then I put them back at the start and didn't repair this comment.

Copy link
Contributor

@broccoliSpicy broccoliSpicy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants