Repository navigation
GH-53945: [C++] std::bit_width in ALP compression fails to compile with CRAN's macOS 11.3 SDK - #53946
Conversation
|
@github-actions crossbow submit test-r-macos-as-cran |
There was a problem hiding this comment.
🟢 Approval recommended
The focused refactor preserves existing calculations, reuses the established compatibility fallback, and adds targeted coverage with no identified blocking issues.
0 open findings
What changed in this PR
Fixes ALP compilation with CRAN’s macOS 11.3 SDK by centralizing the existing bit-width compatibility fallback.
Changes:
- Adds
bit_util::BitWidthand reuses it across Arrow and Parquet. - Tests unsigned boundary values and compile-time evaluation.
| File | Description |
|---|---|
| cpp/src/parquet/encoder.cc | Uses the helper for delta bit widths. |
| cpp/src/parquet/chunker_internal.cc | Uses the helper for chunk masks. |
| cpp/src/arrow/util/rle_encoding_test.cc | Uses the helper in round-trip tests. |
| cpp/src/arrow/util/bit_util.h | Adds the compatibility helper and updates Log2. |
| cpp/src/arrow/util/bit_util_test.cc | Adds helper coverage. |
| cpp/src/arrow/util/alp/alp_compression.cc | Replaces incompatible bit-width calls. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Revision: 30307d4 Submitted crossbow builds: ursacomputing/crossbow @ actions-1e99b7a881
|
|
@github-actions crossbow submit test-r-macos-as-cran |
|
Revision: 896343c Submitted crossbow builds: ursacomputing/crossbow @ actions-bffabff8ca
|
|
@wgtmac - mind giving this a quick look over? |
|
|
||
| // Returns ceil(log2(x)). | ||
| static inline int Log2(uint64_t x) { | ||
| // DCHECK_GT(x, 0); |
…w2-guard The BitWidth and HasSingleBit helpers added in apache#53946 replaced four of the five guard sites, so only the two guards in bit_util.h still need the new macro. Signed-off-by: 1fanwang <1fannnw@gmail.com>
Rationale for this change
CI failures for CRAN macOS
What changes are included in this PR?
Use helper function which works on CRAN macOS in new code + refactor existing stuff
Are these changes tested?
Yup
Are there any user-facing changes?
Nope
Was AI used for this PR?
I generated the code with Claude Fable 5.1 and did adversarial reviews with Opus 5.5 and also asked some questions about why we were moving things into different files and if we had too many tests, resulting in trimming them down.
PR code and description written by:
Reviewed before submission by: