Skip to content

Bump croaring to v5.2.2 - #119464

Merged
thevar1able merged 3 commits into
ClickHouse:masterfrom
actueleai:bump-croaring-v5.2.0
Sep 29, 2026
Merged

thevar1able merged 3 commits into
ClickHouse:masterfrom
actueleai:bump-croaring-v5.2.0

Conversation

@actueleai

@actueleai actueleai commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Bump croaring from v5.1.1 to v5.2.2, keeping ClickHouse on the current upstream line.

ClickHouse-side changes

  • contrib/croaring — submodule pointer to v5.1.1.
  • src/AggregateFunctions/AggregateFunctionGroupNumericIndexedVectorDataBSI.h — two BMI2 call sites renamed ASM_SHIFT_RIGHT -> CROARING_ASM_SHIFT_RIGHT; the x86 BMI2 build fails to compile otherwise.

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Update croaring to v5.2.2.


Workflow [PR]
Sync PR [sync-upstream/pr/119464]

Version info

  • Merged into: 26.10.1.952-master (included in 26.10 and later)

Upstream changes between `v5.1.1` and `v5.2.0`:

- Fix a data race in `shared_container_extract_copy`: it now uses the new
  `croaring_refcount_is_unique` helper instead of decrementing the refcount
  and racing with a concurrent reader, and it releases the shared container
  properly on the copy path (RoaringBitmap/CRoaring#877).
- Add set-cardinality methods (`and_cardinality`, `or_cardinality`,
  `andnot_cardinality`, `xor_cardinality`, `intersect`) to `Roaring64Map`
  (RoaringBitmap/CRoaring#875). Purely additive C++ API.
- Documentation updates and CI action bumps.

No ClickHouse-side adaptation is needed: the source file set is unchanged,
so `contrib/croaring-cmake/CMakeLists.txt` stays as is, and the C/C++ API
changes are additive.

Verified that `groupBitmapState` serialization and the bitmap functions
produce byte-identical results against the previous binary over
`UInt8`/`UInt16`/`UInt32`/`UInt64` and the signed types, including
cross-version deserialization of `AggregateFunction(groupBitmap, UInt32)`
states in both directions.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thevar1able thevar1able added the can be tested Allows running workflows for external contributors label Sep 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [fd726a3]

Summary: ✅


AI Review

Summary

This PR updates contrib/croaring to v5.2.2 and fixes the two ClickHouse call sites that still referenced the old ASM_SHIFT_RIGHT macro name. I did not find a correctness regression in the code changes themselves, but the current PR description understates the dependency delta, and the current-head x86 build jobs that exercise the __BMI2__ path are still not finished.

Missing context / blind spots
  • ⚠️ At review time, the current head fd726a3204e9383d365361aa49c11bbb6bc5d0c1 had Style check, Fast test, and Build (arm_tidy) completed successfully, while the relevant amd_* build jobs were still queued or in progress. That leaves the renamed __BMI2__ branch without completed x86 build evidence yet.
Findings

💡 Nits

  • [contrib/croaring:1] The PR body says this bumps croaring from v5.2.0 to v5.2.2, but the actual gitlink change is v5.1.1 -> v5.2.2. Please update the description so the review contract matches the code delta.
Tests
  • ⚠️ Please wait for one of the current-head x86 build jobs such as Build (amd_debug), Build (amd_binary), or Build (amd_asan_ubsan) to complete on fd726a3204e9383d365361aa49c11bbb6bc5d0c1. The only functional ClickHouse-side change is inside the __BMI2__ branch, so the already-finished ARM build does not validate the path this PR changes.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions: update the PR description to reflect the full v5.1.1 -> v5.2.2 submodule bump, and wait for a current-head x86 build to complete so the CROARING_ASM_SHIFT_RIGHT rename is validated on the code path it changes.

LLVM Coverage Report

Measured on commit fd726a3.

Metric Baseline Current Δ
Lines 88.10% 88.10% +0.00%
Functions 91.70% 91.70% +0.00%
Branches 79.50% 79.40% -0.10%

Changed lines: Changed C/C++ lines covered: 8/8 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added pr-build Pull request with build/testing/packaging improvement submodule changed At least one submodule changed in this PR. comp-external-dependencies Third-party deps updates in contrib/, vendored code, and platform base libraries. labels Sep 11, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing fd726a320 with master 19254aa9d (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

94 translation units recompiled, 801 s compile time in total, 94 of them have a recent master baseline.

Job report

actueleai and others added 2 commits September 24, 2026 13:45
Upstream renamed the inline-asm helper macros in `utilasm.h` from
`ASM_*` to `CROARING_ASM_*`; `AggregateFunctionGroupNumericIndexedVectorDataBSI.h`
uses `ASM_SHIFT_RIGHT` in its `__BMI2__` path, so it follows the rename.

The remaining v5.2.1/v5.2.2 changes are internal: AVX2 `_mm256_lddqu_si256`
replaced by `_mm256_loadu_si256`, an ARM32 `vmaxvq_u16` fallback in
`array_container_contains`, a `sys/endian.h` include for FreeBSD, and
renames of the `*_OR_BITSET_CONVERSION_*` build knobs (not set by ClickHouse).
No bitmap serialization changes; `SRCS` in `contrib/croaring-cmake/CMakeLists.txt`
still matches upstream `src/` (22 files).

Co-Authored-By: Claude Code <[email protected]>
@actueleai actueleai changed the title Bump croaring from v5.1.1 to v5.2.0 Bump croaring to v5.2.2 Sep 24, 2026
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Sep 24, 2026
Comment thread contrib/croaring
@@ -1 +1 @@
Subproject commit 342463b31b909737bd6295c69b2f8e0ed9497424
Subproject commit 6ef0aaad28eb6298db5a7022695b290a8fe47e66

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This gitlink moves croaring from 342463b (v5.1.1) to 6ef0aaa (v5.2.2), but the PR body still says "from v5.2.0 to v5.2.2." That understates the review surface: the v5.2.0 hop is part of this diff too, so the PR description should cover the full v5.1.1 -> v5.2.2 delta.

@thevar1able
thevar1able added this pull request to the merge queue Sep 28, 2026
Merged via the queue into ClickHouse:master with commit c5c0149 Sep 29, 2026
340 of 341 checks passed
@thevar1able
thevar1able deleted the bump-croaring-v5.2.0 branch September 29, 2026 00:00
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-external-dependencies Third-party deps updates in contrib/, vendored code, and platform base libraries. manual approve Manual approve required to run CI pr-build Pull request with build/testing/packaging improvement pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants