akashchamp opened a new pull request, #51310: URL: https://github.com/apache/arrow/pull/51310
Fixes #51289 ### Rationale for this change The callback-based bit-run visitors require callers to route early termination through callback status handling. These ranges allow normal iterator control flow, including breaking once a caller has found the run it needs. ### What changes are included in this PR? - Add `IterateBitRuns`, `IterateSetBitRuns`, and `IterateTwoSetBitRuns` as C++20 input ranges. - Preserve the existing `BitRun` type and introduce `PositionedBitRun` for full bit runs so iterator values expose position, length, and set state. - Cover offsets, null bitmaps, empty inputs, iterator copying and post-increment, and intersections longer than the legacy visitor's internal chunk size. ### Are these changes tested? - `clang-format --dry-run --Werror` and `git diff --check` - Focused `arrow-bit-utility-test --gtest_filter='TestSetBitRunReader.Iterate*'` (3 tests) - Full `arrow-bit-utility-test` (217 tests) and its focused CTest entry - Manual validation with a standalone C++20 program that compared 3,000 randomized bitmap, offset, length, null-bitmap, and early-break cases against independent bit scans. ### Are there any user-facing changes? No public API changes. This adds internal C++ traversal helpers for callers that need iterator control flow. ### AI assistance Assisted-by: Codex AI assistance was used for the initial implementation and regression tests. I reviewed the final code, kept the change scoped to the requested API, and manually validated the behavior above. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
