-
Notifications
You must be signed in to change notification settings - Fork 21
Add offset in dynamic_bitset #567
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
base: main
Are you sure you want to change the base?
Add offset in dynamic_bitset #567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds offset support to the dynamic_bitset infrastructure to handle array slicing correctly. The changes enable bitset operations to work with a logical offset into the underlying buffer without needing to adjust the buffer pointer.
- Added offset parameter to dynamic_bitset constructors and propagated through the class hierarchy
- Modified bit access operations to account for the offset when indexing into the buffer
- Updated the arrow array schema proxy to use the new offset-aware constructor
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
arrow_array_schema_proxy.cpp | Updated to pass offset parameter when creating dynamic_bitset_view |
dynamic_bitset_view.hpp | Added offset parameter to constructors and forwarded to base class |
dynamic_bitset_base.hpp | Implemented offset storage and applied offset to bit access operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
* | ||
* @return The number of bits offset from the start of the buffer. | ||
*/ | ||
[[nodiscard]] size_t offset() const noexcept; |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The offset()
method declaration is missing implementation. Add the implementation for this method to return m_offset
.
[[nodiscard]] size_t offset() const noexcept; | |
[[nodiscard]] size_t offset() const noexcept | |
{ | |
return m_offset; | |
} |
Copilot uses AI. Check for mistakes.
} | ||
size_type old_block_count = buffer().size(); | ||
const size_type new_block_count = compute_block_count(n); | ||
const size_type new_block_count = compute_block_count(n + m_offset); |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding offset to the size for block count calculation is incorrect. The block count should be based on the actual storage needed for the bits, not the logical size plus offset. This could cause buffer overruns when the offset pushes beyond allocated memory.
const size_type new_block_count = compute_block_count(n + m_offset); | |
const size_type new_block_count = compute_block_count(n); |
Copilot uses AI. Check for mistakes.
No description provided.