Repository navigation
Move probe_rows of the adaptive aggregator's frozen kernel into an ALWAYS_INLINE member function - #132740
Conversation
…ber function The `probe_rows` generic lambda in the map overload of `Aggregator::executeFrozenImpl` (the probe/staging loop of a block whose records carry aggregate arguments) becomes the `ALWAYS_INLINE` const member function template `Aggregator::collectArgumentMisses`, the counterpart of `collectCombinedMisses`, which already has this shape for records without arguments. Its implicit captures become parameters with the same names, and the outer `emplace_null_key` and `stage_misses` lambdas are passed as callables, as `collectCombinedMisses` takes `stage_misses`. The body is moved as is, except for two edits the move forces: the nested `if constexpr` on `keeps_null_key_slot<LocalMethod>` and `record_places` are merged into one, with the comment explaining why they had to stay apart inside the lambda dropped (in a function template both are template parameters of the same instantiation, so the discarded branch is still never instantiated); and `typename LocalMethod::StateNoCache` is spelled `State`, the deduced type of `local_find_state`. `[[maybe_unused]]` is dropped from `emplace_null_key`, which is now referenced unconditionally. At -O3 the base did not inline the lambda: the object had 56 out-of-line copies (28 map variants x 2 shapes). With `ALWAYS_INLINE` the fix object has no out-of-line `collectArgumentMisses` and 56 inlined instances. No behaviour change. Suggested in ClickHouse#131551 (comment) Requested in ClickHouse#131551 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Shorten the collectArgumentMisses declaration comment to its contract and fix the stale collectCountMisses name in a moved comment (it is collectCombinedMisses). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own review (the same finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261118-173100 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261118-160201 |
|
Workflow [PR], commit [9b8b54c] Summary: ✅
AI ReviewSummaryPR #132740 extracts the adaptive aggregator's argument-record probe loop into Final VerdictStatus: ✅ Approve |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes4 object files changed (-107.45 KiB total), 0 added.
711 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units90 translation units recompiled, 1274 s compile time in total, 90 of them have a recent master baseline. |
CI finish ledger - 9b8b54cEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
The other CIDB Session id: cron:our-pr-ci-monitor:20261118-210024 |
b21e162
…-pack-in-chunks Conflict in `src/Interpreters/AdaptiveAggregation/Producer.cpp`: master moved the argument-miss loop of the frozen kernel into `collectArgumentMisses` (ClickHouse#132740), which takes the find state's type from its argument, so master's side is kept and `executeFrozenImpl` still builds the state type its caller picks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #131551
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Follow-up to the review of #131551: the
probe_rowslambda in the map overload ofAggregator::executeFrozenImplbecomes theALWAYS_INLINEconst member functionAggregator::collectArgumentMisses, the counterpart ofcollectCombinedMissesfor records with aggregate arguments. The body moves as is, except that two nestedif constexprmerge into one. No behaviour change.At
-O3the lambda was compiled out of line (56 copies: 28 key methods x 2 shapes). The new function is inlined in every instantiation (no out-of-line symbol):executeFrozenImplgrows by the inlined loops, and without the copies the kernel's code is 3.6% smaller in total. A release A/B of three frozen-kernel queries (probe bypass, half hits,Nullablekey with NULLs) is within noise: PR / master medians 0.92-1.06 over five interleaved sets, in no consistent direction.Validation: the 67 adaptive aggregator tests pass, 50 times with randomized settings; a scratch mutation shows they reach both shapes of the function.
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/132740]
Version info
26.11.1.2817-master(included in26.11and later)