Skip to content

Avoid per-row virtual calls and stack frames in several hot paths - #131078

Merged
nickitat merged 20 commits into
masterfrom
reduce-per-row-call-overhead
Nov 19, 2026
Merged

nickitat merged 20 commits into
masterfrom
reduce-per-row-call-overhead

Conversation

@nickitat

@nickitat nickitat commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Performance Improvement

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

Faster randomString, boundingRatio, array and arrayReverse of complex types, skipping of fields in TabSeparated-like formats, the ODBCDriver2 and JSONEachRow output formats, and reading of compact parts with small granules.


Related: #130510

Several hot loops paid for a virtual call, or for setting up a stack frame, on every row or value. That is cheap on x86, but it costs noticeably more with branch protection on AArch64: BTI makes indirect branches into guarded pages more expensive, and with PAC every non-leaf call signs and authenticates its return address. They were the regressions found in the performance tests of the branch protection PR (#130510), which will be stacked on this one. All of them are faster without branch protection too.

  • randomString: read a constant length once instead of through two virtual calls per row.
  • boundingRatio: without GROUP BY, convert the arguments to Float64 in chunks with one type dispatch per chunk, and update a local copy of the state.
  • arrayReverse of tuples, maps and arrays of arrays: reverse each tuple field with the typed kernels, and copy nested arrays by ranges instead of a virtual insertFrom per element. array of arrays: fill the offsets directly and copy the nested data by ranges. Neither needs memory beyond the result.
  • Skipping fields of escaped text formats: no stack frame per field (the Escaped case is a tail call, and the end of a short field is found inline).
  • ODBCDriver2 output: one WriteBuffer for all the values instead of creating and finalizing one per value.
  • JSONEachRow output: each row and field delimiter is a single write, so the delimiter functions need no stack frame.
  • Reading MergeTree parts: the average value size hint is looked up (by stream name, for every granule of every substream) only for values of variable size, the only ones that use it.

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

Version info

  • Merged into: 26.11.1.2889-master (included in 26.11 and later)

nickitat and others added 6 commits November 12, 2026 14:55
With BTI enforced, an indirect branch into a guarded page costs extra on
Graviton4, so the two per-row virtual calls of these functions made the
`bounding_ratio` and `random_string` performance tests about 19% slower
(`ColumnConst::getUInt` -> `ColumnVector::getUInt`, `IColumn::getFloat64`).
The code itself was not the cause: the same binary with the BTI property
cleared (no enforcement) was as fast as one built without branch protection.

- `randomString`: read a constant length once instead of per row.
- `boundingRatio`: without GROUP BY, convert the arguments to Float64 in
  chunks with one type dispatch per chunk, and update a local copy of the
  state. Other argument types, `-If` and GROUP BY keep the per-row `add`.

Graviton4, perf.py against master (both servers pinned to 16 cores),
two runs: `random_string` -43%, `bounding_ratio` -15%.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The generic paths of both functions (any element type without a specialized
implementation, e.g. arrays of arrays) called `IColumn::insertFrom` per
element, and `ColumnArray::insertFrom` makes one more virtual call into the
nested column. Gather the elements with one `IColumn::index` call instead.

Graviton4, best of 5, old vs new: `array_reverse_generic` 0.509 s -> 0.344 s,
`complex_array_creation` 0.158 s -> 0.089 s. They were among the queries
slower with BTI (an indirect branch into a guarded page costs more).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`HashedDictionary::blockToAttributes` read every attribute value with a virtual
`IColumn::get` into a `Field`. For a numeric attribute whose column has the
attribute type (possibly `Nullable`), read the values and the null map
directly. Other attributes keep the `Field` path.

Graviton4, `SYSTEM RELOAD DICTIONARY` of a `SPARSE_HASHED` dictionary with
5M keys, best of 5: 0.514 s -> 0.338 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The generic path gathered the elements with `IColumn::index` and copied the
gathered column into the result. Use it as the result's elements instead,
including the null map of `Nullable`, which `index` handles as well.

Graviton4, best of 5: arrays of arrays (`array_reverse_generic #7`)
0.340 s -> 0.319 s, arrays of tuples (#6) 0.076 s -> 0.073 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Skipping a field of an escaped text format went through two non-leaf
functions per field, each saving and, with pointer authentication, signing
and authenticating its return address: the `Escaped` case of
`skipFieldByEscapingRule` only tail-calls `readEscapedStringInto`, and
`readEscapedStringIntoImpl` called `find_first_symbols` even for a field of
one or two bytes. Make the `Escaped` case a plain tail call, and find the end
of a short field inline, calling the original loop only for longer fields
and escape sequences.

Graviton4, `SELECT WatchID` from 100000 rows of a `test.hits`-shaped file,
best of 5: `CustomSeparatedWithNames` 0.221 s -> 0.167 s,
`TabSeparatedWithNames` 0.193 s -> 0.166 s (`formats_columns_sampling #1` was
24% slower with PAC on Graviton4, whose QARMA5 authentication stalls `ret`).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`ODBCDriver2BlockOutputFormat` created, finalized and destroyed a
`WriteBufferFromString` for every value, which costs more than formatting a
number - and with pointer authentication every one of those small calls signs
and authenticates its return address. Restart one `WriteBufferFromOwnString`
per chunk instead.

Graviton4, `INSERT INTO File(ODBCDriver2, '/dev/null') SELECT number FROM
numbers(10000000)` with one thread, best of 5: 0.378 s -> 0.150 s
(`number_formatting_formats #10` was 16% slower in the ARM performance
comparison). The output is byte-identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2f6a25d]

Summary: ✅


AI Review

Summary

Reviewed PR #131078 at 2f6a25d635d0817ea883d8bb6b4db38751ef5763. The changes reduce per-row calls and buffer setup in array functions, boundingRatio, randomString, text formats, and MergeTree reads. No actionable findings remain. The four previous memory findings are addressed; both new stateless tests pass at this head, and the commit messages include focused before/after performance measurements.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-performance Pull request with some performance improvements label Nov 12, 2026
@Algunenano Algunenano self-assigned this Nov 12, 2026
@nickitat
nickitat added this pull request to stack #131079 November 12, 2026 14:59
@clickhouse-gh clickhouse-gh Bot added the comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. label Nov 12, 2026
Comment thread src/Functions/array/arrayReverse.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 2f6a25d63 with master 30ff53fe8 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 1d9af504a; 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.

Object file sizes

11 object files changed (+56.57 KiB total), 0 added.

Object file Master PR Δ
src/Functions/array/CMakeFiles/clickhouse_functions_array.dir/arrayReverse.cpp.o 250.23 KiB 280.76 KiB +30.53 KiB (+12.20%)

716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

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

Job report

nickitat and others added 2 commits November 12, 2026 16:27
`IColumn::index` of an array column makes an index entry for every element of
every nested array, so the generic paths took several times the memory of the
data for long nested arrays (`arrayReverse` of one array of 10M bytes:
32.6 MiB -> 102.5 MiB peak). Copy arrays by ranges instead: `arrayReverse`
gathers through `Tuple`, `Map` and `Nullable` and copies the arrays inside
them by ranges, and copies columns of dynamic structure element by element;
`array` fills the offsets of array elements directly and copies their data by
ranges, and is back to `insertFrom` per element for other types.

Graviton4, best of 5, vs the code before these changes: arrays of arrays in
`arrayReverse` 0.509 s -> 0.380 s, `[[zero], [zero]]` 0.158 s -> 0.126 s.
Both queries of the new test fail with `max_memory_usage = '64Mi'` with the
`index` version.

#131078 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Functions/array/arrayReverse.cpp Resolved
`Variant(Array(UInt8), String)` has no dynamic structure, so it reached
`IColumn::index`, and `ColumnVariant::index` indexes its array alternative
with an index entry per element. Any column not handled by the range copies
that contains an array is now copied element by element, as before.

#131078 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Functions/array/arrayReverse.cpp Resolved
The gather index took 8 bytes per element, several times the data of narrow
types (`Array(Tuple(UInt8))` of 10M elements: 19.7 MiB -> 96 MiB peak). Drop
it: reverse each tuple field and the nested array of a map with the typed
kernels, copy the nested arrays of arrays of arrays by ranges in reverse order,
and keep `insertFrom` per element for other types, as before.

Graviton4, best of 5, master -> new: arrays of `(x, x)` 0.547 s -> 0.016 s,
of `(toUInt8(x), toString(x))` 0.759 s -> 0.170 s, of `[x, x]`
0.465 s -> 0.442 s, of `map(x, [x])` 0.385 s -> 0.360 s.

#131078 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nickitat
nickitat marked this pull request as ready for review November 13, 2026 15:51
…-overhead

# Conflicts:
#	src/Dictionaries/HashedDictionary.h
@clickhouse-gh clickhouse-gh Bot added comp-functions Built-in SQL function implementations + function infrastructure. comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. and removed comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. comp-functions Built-in SQL function implementations + function infrastructure. labels Nov 13, 2026
@clickhouse-gh clickhouse-gh Bot added comp-functions Built-in SQL function implementations + function infrastructure. comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. and removed comp-functions Built-in SQL function implementations + function infrastructure. comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. labels Nov 13, 2026
`writeRowEndDelimiter` and the other delimiters wrote two pieces, so the
first `writeSlow` call was not a tail call and the functions needed a stack
frame; with PAC on AArch64 that is a signed return address per row.

Graviton4, PAC + BTI build, `json_key_formatting` before -> after: #0
0.526 s -> 0.498 s, #1 0.529 s -> 0.498 s, #2 0.968 s -> 0.936 s; CI master
without branch protection: 0.495 s, 0.498 s, 0.916 s. Output of all
`JSONEachRow`-family formats is unchanged, with and without pretty printing
and `output_format_json_array_of_rows`.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130510&sha=latest&name_0=PR
#130510

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Functions/array/arrayReverse.cpp Resolved
@clickhouse-gh clickhouse-gh Bot added comp-functions Built-in SQL function implementations + function infrastructure. and removed comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. labels Nov 15, 2026
nickitat and others added 2 commits November 15, 2026 20:46
`ColumnArray::reserve(n)` also reserves `n` values in its data, so reversing
arrays of a million empty `Array(FixedString(128))` reserved 122 MiB for
values that do not exist. `prepareForSquashing` reserves each descendant by
the size of the corresponding source column.

#131078 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`deserializeBinaryBulkWithMultipleStreams` called both hint callbacks for every
substream of every granule. Each call builds the stream name, hashes it and
looks it up twice, but only `String` uses the hint. Compact parts read a
granule at a time, so with small granules this was a large part of reading.

Graviton4, PAC + BTI build, before -> after: `SELECT sum(x)` over the
`parallel_index` table (`index_granularity = 4`, compact parts, one thread)
1.68-1.77 s -> 1.47-1.50 s, `parallel_index` #0 0.125-0.139 s ->
0.111-0.124 s, string and array columns of a compact part 0.632 s -> 0.511 s.
Results are unchanged for compact and wide parts of `String`, `Nullable`,
`Array`, `LowCardinality`, `FixedString`, `Map` and `Tuple` columns.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130510&sha=13e24739511aa82b59d66aa4e4df27f37100ac16&name_0=PR&name_1=Performance%20Comparison%20(arm_release%2C%20master_head%2C%208%2F8)
#130510

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@clickhouse-gh clickhouse-gh Bot left a comment

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.

AI review approves this commit, see the AI Review comment.

@Algunenano Algunenano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work. I've reviewed the changes per commit (seemed way simpler than as a whole) and didn't see anything strange (or it was explained in the commit message), so please go ahead 🚀

The test inserts into 20 files in `user_files` and kills the inserts, but
never removes the files. The targeted check of this PR repeats the test 33
times with a new database each time: its killed inserts wrote 58 GiB of files
that stayed on disk, and the runner ran out of space (`errno: 28`), failing
unrelated tests.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=131078&sha=latest&name_0=PR
#131078

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nickitat
nickitat added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit a9b98ba Nov 19, 2026
196 checks passed
@nickitat
nickitat deleted the reduce-per-row-call-overhead branch November 19, 2026 21:17
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 19, 2026
AbinMadathil07 added a commit to AbinMadathil07/ClickHouse that referenced this pull request Nov 20, 2026
* Keep the dictionary and bloom filter cases of five more Parquet tests live

These tests compare values only, so they kept passing when a random
setting removed the encoding or the index their case is about:

- 05406: a random `output_format_parquet_max_dictionary_size` of 0, 1
  or 1024 writes the dictionary round trip without a dictionary, and
  `output_format_parquet_use_alp_encoding = 1` writes float columns
  without one at any size, so the case that the dictionary keeps zero,
  negative zero and NaNs with different payloads apart tested nothing.
  Bound the dictionary size to at least 1 MiB and pin ALP off.
- 04646: the two cases of the exact dictionary filter need a
  dictionary page and the dictionary pruning pass, which a high
  watermark of 1 byte or 1 MiB skips. Bound both, as in 05055.
- 02735: 1M distinct values must grow the dictionary past its 1 MiB
  limit. With 0 no dictionary is tried, and with 1 or 1024 the writer
  drops it within the first two batches, so bound it to at least 1 MiB.
- 04097: the bloom filter prefetch regression needs a bloom filter
  written with the default bits per value and read with push-down.
- 04545: it also covers the page index path, which needs a page index.

The other Parquet tests either set these settings on their writes and
reads, assert the encodings, the bloom filters or the pruning, or do
not depend on them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: release only own bucket locks, detect empty batches independently of commit limits

With `parallel_inserts` each streaming task has its own processor and commits independently,
but `FileIterator::releaseFinishedBuckets` released the finished bucket holders of all processors.
A holder is finished when its source reaches the end, before the insert of that source completes,
so a commit of one task could release the bucket lock of another task whose insert was still running,
letting another replica take the bucket and process later files before the first insert failed.
Now `releaseFinishedBuckets` takes the processors of the batch which has just been committed.

`ProcessingProgress::processed_files` is counted only when `max_processed_files_before_commit` is set,
so with that limit disabled and a row or byte limit enabled, a batch which processed files looked empty:
the consumption cycle ended after every batch and the backlog was drained one batch per poll.
Now a separate `acquired_files` counter, maintained regardless of the commit limits, is used to detect
empty batches, to guard the reset of the batch size override, and as the size of a failed batch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Document the musl Rust target in the build guide

The default Linux x86_64 and aarch64 build links against musl now, and
`contrib/corrosion-cmake` selects the matching `*-unknown-linux-musl`
Rust target. `rustup` installs only the `*-unknown-linux-gnu` target, so
following the guide made `cmake` fail with
`Target x86_64-unknown-linux-musl is not installed for toolchain`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* GPU aggregation: remove `GPUAggregatingStep`, one `canAggregateOnDevice`, fixes of the AI review

- No `GPUAggregatingStep` in `src/Processors/QueryPlan` in this pull request.
- `canAggregateOnDevice` replaces `canReduceOnDevice`, `canGroupByOnDevice`, `canGroupByReduceOnDevice` and their `OrThrow` variants.
- `streaming_groupby` is closed into parts before a group could count past a `cudf::size_type`.
- No `avg` of `Float32`, which cuDF sums in `Float32`; no `min` or `max` of floats, as cuDF does not skip a `NaN` like ClickHouse.
- Exceptions of cuDF, rmm and libstdc++ are never destroyed (`keepCurrentException`): their base destructors bind to those of libc++.
- `ColumnUploadPipe::takeDeviceColumn` makes the next buffer in place, as the buffers have no assignment.

Related: ClickHouse#132443

* GPU aggregation: no gtest in this pull request

Related: ClickHouse#132443

* Bump `musl` to fix `AI_ADDRCONFIG` lookups on loopback-only hosts

Fork commits `f255b5c8` and `ff1ab367` gave `getaddrinfo` glibc's
`AI_ADDRCONFIG` semantics. On a host with no non-loopback address, they
dropped both address families and returned `EAI_NODATA` for every name.
`DNSResolver` always passes `AI_ADDRCONFIG`, so `clickhouse-client`
could not resolve `localhost` under `docker run --network none`,
`unshare -n` or systemd `PrivateNetwork=yes`. As in glibc, an
`AF_UNSPEC` lookup is now not narrowed when neither family is
configured.

The bump also brings in ClickHouse/musl#20 (symbol sizes for asm
functions).

ClickHouse/musl#21

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix the `contrib/llvm-project` pin to the real tip of `ClickHouse/release-23.x`

The merge of master pinned `55541575edec5a8d4bb94faf4a66e30d8b4e7a66`, which
does not exist: only the 12-character prefix matches the real merge commit of
ClickHouse/llvm-project#161. `Config Workflow` failed
to fetch it:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=132795&sha=b50187317c6de5b87b22060d147f749bc4b35535&name_0=PR&name_1=Config%20Workflow

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: list adbcBridge under Go, Rust, Java and C# in the third-party client libraries

* GPU aggregation: far fewer comments, one `catch` in `guarded`, no slices in `streaming_groupby`

- `guarded` catches once and keeps the exception of the device libraries from being destroyed in one line; the messages are read by `messageOfDeviceException`.
- `StreamingPartials` takes a batch as it is, and closes before `streaming_groupby` could count past a `cudf::size_type`.

Related: ClickHouse#132443

* Look up the `geoDistance` tables once per block

`distance` is called for every row, and since the tables are built on first use, every access to them went through the initialization guard of the local static in `impl`. `run` now takes the reference once and passes it to `distance`.

Address review: ClickHouse#126791 (comment) (thread on `src/Functions/greatCircleDistance.cpp`)

Co-Authored-By: Claude <[email protected]>

* Docs: describe the Protobuf framing ClickPipes expects with AWS Glue

* Use `VectorWithMemoryTracking` for the lazy Arrow type table

The style check that came with the merge of `master` forbids plain `std::vector` in `src/Processors/Formats`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=46136c021aceb2c4ed4368a0a1a9f3ba214be6a8&name_0=PR&name_1=Style%20check
PR: ClickHouse#126791

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Mark the `geoDistance` table lookups `[[nodiscard]]`

`clang-tidy` asks for it (`modernize-use-nodiscard`) since they became `const` members.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=384918398089744c9929f936ac283fbf88622246&name_0=PR&name_1=Build%20%28arm_tidy%2C%202%2F4%29
PR: ClickHouse#126791

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Let gdb pass the `system.stack_trace` signal of the musl server in fuzzer jobs

The gdb script took the number of `SIGRTMIN` from the shell of the fuzzer
image, which is linked with glibc: 34. The server is a static musl binary since
ClickHouse#109239, and its `SIGRTMIN` is 35,
so gdb stopped the server on the first read of `system.stack_trace`, dumped
all threads and detached. Handle both numbers.

Co-Authored-By: Claude <[email protected]>

* Pin 05829 to query-based parallel replicas

`Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel)`
sets `parallel_replicas_plan_based = 1` in the server profile. The test pins every
other parallel-replicas setting, so in that job only its implementation changes:
plan-based parallel replicas cannot match the shipped plan to the single-node plan
(`Cannot find step with matching hash ... in single-node plan`; the local plan has
one `Expression` under `Aggregating` where the single-node plan has two), so the
first run collects no statistics and the second never switches to the plan with
parallel replicas: `05829_apply 0` in every master run of the job.

Pin query-based parallel replicas, as 91d6019 did for 05175 (same class,
ClickHouse#131450), so the test keeps
checking the set transplant of ClickHouse#132659 in that job too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update PGO+BOLT toolchain to 51fdb0b

* Adapt new code from `master` to the removed `CPUFlagsCache` and the `STACK_TRACE_SERVICE_SIGNAL` macro

`gtest_memchr_strlen_page_boundary.cpp` used `CPUFlagsCache`, which this branch removed; it calls the `have*` functions instead, which is all `CPUFlagsCache` did (once, in a static initializer).

`clickhouse_fuzzer.cpp` qualified `STACK_TRACE_SERVICE_SIGNAL` with `DB::`, which does not work now that it is a macro.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=876eaabafb0dc84ddaae5134998fb9d140634297&name_0=PR&name_1=Build%20%28amd_debug%29
PR: ClickHouse#126791

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Run the EXPLAIN checks of 05137_join_fixed_string_zero_bytes_runtime_filter without parallel replicas

Under plan-based parallel replicas, ReadFromParallelReplicasStep sets its
step description to a multi-line dump of the shipped plan fragment
(header and description, no actions), truncated at
query_plan_max_step_description_length = 500, and EXPLAIN prints every
line of it as a row. The fragment contains the build side's
BuildRuntimeFilter step. With enable_parallel_blocks_marshalling = 1 the
fragment's top BlocksMarshalling step pushes that line past the cut; with
0, which the runner draws in about 5% of runs, it fits, and the test's
LIKE filter matches one row more than the reference.

The EXPLAIN checks assert the single-node plan shape, so run only them
with enable_parallel_replicas = 0 in their own SETTINGS, as ClickHouse#128527 does.
The result queries keep whatever the job sets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin the Top-K limit in 05100_autopr_gate_lazy_read

`clickhouse-test` randomizes `query_plan_max_limit_for_top_k_optimization`
over [0, 1, 10, 100, 1000, 100000]. At 0 (no limit) or 100000, Top-K takes
the test's `ORDER BY ord LIMIT 10000` and adds `__topKFilter(ord)` to the
read's PREWHERE. Plan-based parallel replicas keeps such a read local
(`mergeTreeReadCanBeShipped`), so automatic parallel replicas finds no read
on the other replicas, skips the query and collects no statistics, and the
`05100_lazy_large_scan` row turns from 1 to 0 in
`Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel)`.

Pin the limit to its default, as 801dfec did for 05055. The product
limitation is ClickHouse#131858.

Locally, with `parallel_replicas_plan_based=1` and the limit at 0 or 100000:
5/5 FAIL before, 5/5 OK after, 5/5 FAIL again with only the new `SET`
removed. Fully randomized plan-based runs: 6/50 FAIL before, 50/50 OK after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin 05628 and 05043 to query-based parallel replicas

Both tests failed in `Stateless tests (arm_binary, ParallelReplicas, plan-based,
s3 storage, parallel)`, the job ClickHouse#128413 added, whenever the randomizer drew
`query_plan_merge_filters = 0` (05628) or `query_plan_remove_unused_columns = 0`
(05043), each about 5% of runs. With `parallel_replicas_plan_based = 1`,
automatic parallel replicas then cannot match the probe plan to the single-node
plan (`Cannot find step with matching hash ... in single-node plan`,
`AutoParallelReplicasPlansNotComparable = 1`) and returns before the cost model
and before collecting statistics, so 05628's "declined after the cost model"
check and 05043's "still a candidate" check read 0. That is the open
plan-based gap ClickHouse#131450.

The tests are about query-based automatic parallel replicas, so pin that
implementation, the same way 91d6019 pinned 05175 for ClickHouse#131450. The pin is
a no-op in every job where plan-based parallel replicas is already off.

Related: ClickHouse#131450

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Retry a failed notary submission request and wait longer in Sign macOS binary

`notarize` ran `rcodesign notary-submit --wait --max-wait-seconds 1800` once.
rcodesign does not retry the create-submission POST, so one Apple gateway 502
on it failed the job, and its wait gave up at 1800 s although the job has a
3600 s timeout and the other steps take at most 39 s. Both leave the release
commit without a signed `clickhouse-macos.zip` until the job is re-run by hand.

Retry the command up to 5 times, but only when stderr carries the
`POST https://appstoreconnect.apple.com/notary/v2/submissions` line. rcodesign
prints it only in the error of a failed create-submission request (the request
log line is debug-level), i.e. before the upload and before any wait, so a retry
costs about 30 s at most and never starts a second wait. A failed poll, a failed
upload, the wait limit and an Invalid verdict print no such line and stay
single-attempt. Matching on the 5xx text instead would also catch a 5xx on a
poll late in the wait and resubmit, which does not fit the job timeout.

Raise the wait limit to 3000 s: 39 s of earlier steps + 30 s of retries + 3000 s
+ upload and one poll is about 3115 s, under the 3600 s timeout, so the
`finally` that removes the notary key from the reused workspace still runs.

Failures:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=8f7ca0110849149ecd80a33dc2691ad0e0bb36c1&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=c2ea85cb077899bcc31505a53bb11b9dc34e803d&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=53e154ba93c524095e4cfb9957fa35e206086684&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: sync Cloud API reference from the OpenAPI spec

* Docs: regenerate reference documentation from source

* Fix the number of read streams in test `05830_distributed_plan_squashing_before_exchange`

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* Return NULL from `conv` for a non-finite float masked by NULL

`FunctionConv` inherited `canBeExecutedOnDefaultArguments = true`, so the default implementation for
`Nullable` arguments passed the nested values of NULL rows to `executeImpl`. Since a non-finite float now
throws, `conv(nullIf(x, inf), 10, 10)` and `conv(if(isNaN(x), NULL, x), 10, 10)` failed with
`BAD_ARGUMENTS` instead of returning NULL for those rows, as did a non-finite number on a row with a NULL
base. Rows with a NULL argument are now skipped before execution. Non-NULL `nan` and `inf` still throw.

The override is byte-identical to the one ClickHouse#122356 added on master, so the two merge cleanly.

PR: ClickHouse#132662

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix the HTTP interface link in the `Protobuf` format documentation

ClickHouse#122644 moved the HTTP interface page from `/concepts/features/interfaces/http`
to `/concepts/features/connect-to-clickhouse/protocols/http` and updated the
`#insert-protobuf` link in the generated `docs/reference/formats/Protobuf/Protobuf.mdx`,
but not in its source, the `Protobuf` format documentation here. The nightly
docs regeneration (ClickHouse#132899) therefore restores the old path, and the offline
link check (`lychee_check.py --mode links`) cannot resolve the fragment through
the redirect, because the redirect's destination is a directory `index.mdx`:

    [./reference/formats/Protobuf/Protobuf.mdx]:
    [ERROR] concepts/features/interfaces/http#insert-protobuf (at 347:27) | Cannot find fragment

Make the same change in the source, as ClickHouse#122644 did for the Prometheus links in
`StorageTimeSeries.cpp`. The regenerated `Protobuf.mdx` is then identical to the
one on master. Validated by regenerating the docs with `autogenerate_docs.py
--write` from a master binary with and without the change and running the
link check: 1 error (the one above) without, 0 with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* GPU aggregation: the `avg` of unsigned integers divides a `UInt64` sum; `absorbPart` keeps the originals until the copies are done on an exception too

Related: ClickHouse#132443

* GPU aggregation: `CudfGroupBy.cu` rewritten to be readable

The same algorithm: `Partials`, `PartitionedPartials`, `StreamingPartials`, `GroupBy` with a `Strategy` chosen by the first
batch, the filter in `applyFilter`. No checks that `viewOf` and the lane already make, no branch for keys with nulls of an
undecided batch, which are compacted.

Related: ClickHouse#132443

* GPU aggregation: `waitFor` in `GPUTypes.cuh`, next to `checkCuda`, as it is not of `CudfGroupBy`

Related: ClickHouse#132443

* GPU aggregation: every entry point of `CudfGroupBy` and `CudfReduction` is `guarded`

What rmm, cuDF and libstdc++ throw outside of the calls to cuDF, as the growth of a buffer or a copy of a column, does not leave
the island either: an exception of libstdc++ is not safe to format by ClickHouse.

Related: ClickHouse#132443

* GPU aggregation: `CudfGroupBy` is a class, not an interface of one implementation; masks are `DeviceBitmask`

- `CudfGroupBy` holds a `cudf_group_by::GroupBy` as `CudfReduction` holds its state, and its methods are `guarded` calls of it;
  no `createCudfGroupBy`, no `dynamic_cast` in `absorbPart`.
- The masks of the rows a filter keeps are a `DeviceBitmask` of their words and rows, not a pointer.

Related: ClickHouse#132443

* Inline the liveness check of window aggregate states

`checkCreated` was not inlined, so every row paid for a call with a full frame. Inline the test and keep only the throw out of line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: update Cloud API rate limits and describe 429 responses

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* GPU aggregation: the stream of a `HAVING` is drained on an exception too, as the caller holds its kernel only for the call

Related: ClickHouse#132443

* Remove the files left behind by `02366_cancel_write_into_file`

The test inserts into 20 files in `user_files` and kills the inserts, but
never removes the files. The targeted check of this PR repeats the test 33
times with a new database each time: its killed inserts wrote 58 GiB of files
that stayed on disk, and the runner ran out of space (`errno: 28`), failing
unrelated tests.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=131078&sha=latest&name_0=PR
ClickHouse#131078

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Randomise adaptive compression in stateless/stress tests

* AI review: require an exact verdict line and parse it leniently

The review prompt now asks for an exact `Status: <verdict>` line. `_review_approves` falls back to the whole `Final Verdict` section when that line is missing, so a bare `✅ Approve` no longer dismisses the approval.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin two UNIQUE KEY tests to query-based parallel replicas

With `parallel_replicas_plan_based = 1`, a read of a `UNIQUE KEY` table is
shipped and `ReadFromMergeTree::serialize` throws `SUPPORT_IS_DISABLED`
(ClickHouse#128534). `04161_unique_key_insert_duplicate` and
`05493_unique_key_disk_without_append` read such a table only through
`count()`, so in the plan-based job they fail only when the runner draws
`optimize_trivial_count_query = 0` (5% of runs) and pass otherwise.

The plan-based blacklist is checked strictly (the job does not run with
`--autopr`), so listing them would report `NOT_FAILED` on most runs, as it
did for 04161 on ClickHouse#128413. Pin them to query-based parallel replicas
instead, the way 91d6019 did for 05175. ClickHouse#128534 stays open for
plan-based support of `UNIQUE KEY` reads.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=6ade2c8d6b94ea04a0c7b0259825529aceac0fd8&name_0=MasterCI&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20plan-based%2C%20s3%20storage%2C%20parallel%29

Related: ClickHouse#128534

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Drop unneeded no-parallel tags from seven stateless tests

* Update version_date.tsv and changelogs after v26.10.7.24-stable

* Disable Keeper fault injection in `05770_streaming_queries_replicated_cursors`

An injected Keeper fault after a block number is allocated makes the insert
retry with a new block number, so the block numbers and the cursors in the
test become nondeterministic.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=131817&sha=latest&name_0=PR&name_1=Fast%20test
ClickHouse#131817

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Disable adaptive codecs where they're not needed

* Docs: restore `Language clients` navigation

Remove the duplicate `integrations/language-clients/index` entry from the Concepts navigation. Mintlify then selects the dedicated `Language clients` navigation for the page.

Related: ClickHouse#124471

* Pack tuples of fixed-size values into the keys of the radix partitioned `uniqExact`

A tuple whose elements have a fixed size of 1, 2, 4, 8 or 16 bytes and fit into 16 bytes, `Nullable` ones
included, is packed into one key as `packFixedBatch` packs the keys of `GROUP BY`, instead of being hashed
with `SipHash` per row. A `Nullable` element is its null flag, normalized to 0 or 1, and its value, zero for
NULL. Values of 16 bytes are routed by `routeValues`, without branches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Hash the other values of the radix partitioned `uniqExact` several rows at a time

The values that are hashed with `updateHashWithValue` (tuples of strings, `Nullable` and wider values) get
the same `hash128` from `HashedJoinKey`, which hashes many rows at once with the vectorized `SipHash`. The
rows that repeat the previous one are skipped before they are hashed (`HashedJoinKey::markRepeatedRows`),
and the types it cannot hash in batches keep the per-row path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update version_date.tsv and changelogs after v26.8.41.14-lts

* Keep each `-iquote` paired with its directory when building musl

CMake de-duplicates compile options, so only the first "-iquote" was kept
and the other two directories became stray input files. Use `SHELL:` to
keep each flag and path together.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Add PromQL tests flaky with plan-based parallel replicas to the plan-based blacklist

A plan-based parallel replica cannot find the tags collected by
`timeSeriesStoreTags`, so `timeSeriesIdToGroup` throws `Unknown identifier`
when a remote replica reads part of the table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Push `empty` and `notEmpty` of a `String` column down into the Vortex scan

`optimize_empty_string_comparisons` rewrites `s = ''` and `s != ''` into
`empty(s)` and `notEmpty(s)` before the filter reaches `ReadFromFile`, and
`VortexExpressionConverter` had no handler for them, so the conjunct was dropped:
the scan decoded and converted every row of the column, and only ClickHouse
filtered it. Now they become `s = ''` and `s != ''` in the scan, which is exact in
any position; arrays, maps and UUIDs stay with ClickHouse.

ClickBench on one `hits.vortex`, 36 cores, hot run: Q10 228 -> 123 ms,
Q12 331 -> 242 ms, Q24 368 -> 212 ms, Q31 499 -> 393 ms.

https://benchmark.clickhouse.com/#system=-&type=-&machine=-ca4e|6t|ae-|ca2|6ax|cgle|6ale|3al&cluster_size=-&opensource=-&hardware=+c&tuned=+n&storage=+vr&category=-&metric=combined&best=no&queries=-

* Sync `src/Core/ServerSettings.cpp` from private repository

* Do not pack the `LowCardinality` elements of a tuple in the radix partitioned `uniqExact`

A `LowCardinality` type forwards the size of its values, but its column holds indexes into a dictionary,
so packing it read the indexes as values and counted wrong. Such tuples are hashed. The test also covers
runs of equal rows longer than a batch of hashing, with NULLs and floats.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Allocate the buffers for the rows to skip exactly

`resize_fill` rounds the allocation up to a power of two, which doubles a buffer of 65536 rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Add tuples to the performance test of the radix partitioned `uniqExact`

Packed fixed-size tuples, `Nullable` or not, and tuples hashed several rows at a time, with strings or wider
than 16 bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix `HTTPResponseParser.MatchesPocoForEverySplit` for `MalformedMessageException`

The test compared the class of the exception with the one of the legacy
`HTTPResponse::read`, which throws `MessageException` where the parser now
throws its subclass `MalformedMessageException`. Compare them as the same
class, and check the distinction between a malformed and a truncated response
in a new test `MalformedIsNotTruncated`.

Also update the comments after the merge of master, where a header that exceeds
a limit throws `HTTPHeaderLimitException` and is reported as `LIMIT_EXCEEDED`.

Address review: ClickHouse#132117 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Update version_date.tsv and changelogs after v26.9.33.10-stable

* Address review: skip all fresh-`CREATE` validations of `DataLakeCatalog` when replaying stored metadata

The `auth_header` check, the `allow_database_*` gates, and the strict
settings parsing in `loadFromQuery` ran before the recovery predicate, so a
previously valid definition replayed as `CREATE` with
`isRecoveryFromStoredMetadata` could still throw and block startup. Compute
the predicate first and treat such a replay like `ATTACH` everywhere.
A forbidden header is still never sent: `RestCatalog::validateAuthHeaders`
rejects it before the first request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Add a test for obsolete access types and their group membership

`REVOKE SYSTEM` and `REVOKE ALL` must also remove a grant of the obsolete
`SYSTEM RELOAD MODEL` privilege.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin blocks marshalling for the EXPLAIN checks of 05137, blacklist it for plan-based

The checks pass with query-based parallel replicas, so keep parallel replicas on.

ClickHouse#132869 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: update clickhousectl pages for clickhousectl 0.6.0

Use the new `cloud clickhouse` and `local clickhouse` command names, fix
statements that changed in 0.6.0 (project-root discovery, Query API keys,
Postgres no longer Beta, organization errors, exit codes) and cover the
new commands and flags.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Address review: reject repeated grouping-set keys and the memory-bound grouping-sets merge

A deserialized `MergingAggregated` step with grouping sets now refuses an input in which a key occurs more
than once (the output header and `makeCreatingMissingKeysForGroupingSetDAG` take keys by name), and the
memory-bound merge with grouping sets, which threw a `LOGICAL_ERROR` in `transformPipeline`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Revert "Detect MemorySanitizer and UndefinedBehaviorSanitizer reports in integration tests"

* Fix nightly changelog job hanging in `changelog.py`'s `git fetch --tags`

The `Prepare changelog` job of the `Nightly` workflow has failed every night
since 2026-11-03, so ClickHouse#126190
stopped receiving updates after 2026-11-02. The generation step is killed by
`GENERATE_TIMEOUT_SEC` (40 minutes) while `changelog.py` sits in
`Fetching all tags`.

That fetch runs in the `clickhouse/style-test` container. `actions/checkout`
keeps the credentials in a separate file included via
`includeIf.gitdir:<host path>/.git`, which does not match `/wd/.git` in the
container, so the fetch is unauthenticated and uses the default refspec. It
was already 16 minutes on 2026-11-02 and is redundant: `prepare_repo` has
fetched the master history and the tags just before.

Add `--no-fetch` to `changelog.py` (it refuses a shallow repository instead of
fetching) and use it in the nightly job.

https://github.com/ClickHouse/ClickHouse/actions/runs/44444590723
https://github.com/ClickHouse/ClickHouse/actions/runs/41566219634

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin `enable_adaptive_codec_selection = 0` in `05293_autopr_statistics_plan_based`

The cost model works off estimated compressed bytes, and adaptive codec selection,
now randomized in stateless tests, changes them, so the second run stops adopting
parallel replicas. The sibling `05262` was already pinned the same way.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129544&sha=10b2b5fe60611b692e06c8babb025f3cc4dbebca&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
PR: ClickHouse#129544

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 52da073)

* Up-sync critical files from ClickHouse-private master 5dfd845349c2b0a11b24b335ea1a0ac0006b6eed

* Docs: regenerate `Protobuf` HTTP interface link

Regenerate the `Protobuf` format page after the source documentation update in ClickHouse#132918.

ClickHouse#132899

* Pin `parallel_replicas_plan_based = 0` for the reads without the privilege in `02346`

ClickHouse#133090
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=115581&sha=2b81f2df5a513b9465dd994ca03e16aea6db2158&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20plan-based%2C%20s3%20storage%2C%20parallel%29
ClickHouse#115581

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin the dictionary size in 05829_parquet_array_over_many_pages

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Up-sync critical files from ClickHouse-private master d5e43de9252801cefdbd7fbc02460438c2815b66

* Update autogenerated version to 26.12.1.1 and contributors

* Sync MergeTreeSettings.h from private: declare isSystemDatabaseForDisks

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Document the PARTITION BY clause of INSERT INTO FUNCTION

The parser accepts an optional `PARTITION BY expr` after the table function of
`INSERT INTO [TABLE] FUNCTION`, before the column list, and the file and object
storage table functions use it for partitioned writes, but the `INSERT INTO`
reference page never mentioned it.

Add the clause to the syntax of the "Inserting using a Table Function" and
`RETURNING` sections and to the structured syntax, and add a short
"Partitioned writes" subsection with a runnable `file()` example that links to
the per-function partitioned-write sections.

The page docs/reference/statements/insert-into.mdx is generated from
ParserInsertQuery::getDocumentation() by the nightly docs regeneration, so only
the source registration changes here.

Closes: ClickHouse#132930

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Mark `JoinStep::clone` `[[nodiscard]]` to satisfy `clang-tidy`

The `arm_tidy` build failed with `modernize-use-nodiscard`:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130374&sha=317ff1c910b87d28e30b261588ee6636cceb871a&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29
PR: ClickHouse#130374

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin the randomized Parquet settings in 05833_parquet_prewhere_edge_cases

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Pin the randomized Parquet settings in 05835_parquet_nullable_tuple_read_memory

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Make test_status_counts fail with the reload's own error

`metrics_during_load` ran `SYSTEM RELOAD DICTIONARY d_slow` in a
`threading.Thread` and only joined it. A thread's exception reaches only
`threading.excepthook`, so a failed reload before the poll saw the
in-progress status was retried as a timing miss (ending in the misleading
"the metrics were never computed while d_slow was LOADING"), and in the
LOADED_AND_RELOADING check a failed reload kept the dictionary LOADED, so
its sample was accepted and the test passed with only a thread warning.

Run the reload through `ThreadPoolExecutor.submit` and call
`future.result()` on both exits of the helper, the early return and after
the sample, so a failed reload raises its own error before a sample is
retried or accepted. `result()` waits like `join()`, and the executor's
`shutdown(wait=True)` still waits for the reload when the main thread
raises. Retries, assertions and the `d_fail` part are unchanged.

Follow-up to ClickHouse#132816, as suggested in
ClickHouse#132816 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Parse JSON documents in place in JSON functions instead of copying each row

* Use a per-database user name in `05836_obsolete_access_type_grants`

The test used a fixed user name, so concurrent runs in the flaky check
created, granted to, and dropped the same user, failing with `UNKNOWN_ROLE`.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123854&sha=6f09c63c7c931c9e0e02bedc03c8675a14f27dee&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29
ClickHouse#123854

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* WIP: support Array(Int8) and Array(UInt8) in the Quantized codec

Temporary commit, not built or tested yet.

- `ColumnsDescription`: accept `Int8`/`UInt8` elements, reject methods
  `int8` and `prefix` with format `int8` for them.
- `SerializationQuantizedVector`: read `Int8`/`UInt8` vectors; for
  `rabitq`/`turboquant`, `UInt8` elements are shifted by -128.
- Planner: accept integer reference literals and shift the reference
  vector the same way for `UInt8` columns.
- Docs updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Use the `rabitq`/`turboquant` codes for `L2Distance`, add tests for byte vectors

`rabitq` and `turboquant` estimate only the cosine distance. For an
`L2Distance` query, the shortlist is now ranked by the cosine estimate and
the result is rescored by the exact `L2Distance`, instead of falling back to
the exact scan. The returned distances are exact; the recall depends on how
much the vector norms vary.

Measured on 300k vectors of Dino10B (1024-d, `UInt8`, L2), 300 queries,
recall@10 against exact L2 at fetch multiplier 1/5/10/50:
`rabitq` 0.69/0.98/0.99/1.00, `turboquant` 0.74/0.99/1.00/1.00
(with the `UInt8` shift; without it `rabitq` gets 0.11/0.27/0.35/0.59).

Also fix a `-Wdouble-promotion` error in the `UInt8` shift of the reference
vector, and add test `02354_vector_search_quantize_codec_int8_uint8`.

Dataset: https://swannbessa.github.io/blog/dino10b/

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Shorten the comment on `QUANTIZED_CODEC_UINT8_SHIFT`

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Fix `clang-tidy` in `gtest_join_step_clone`: do not ignore the `[[nodiscard]]` result of `clone`

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130374&sha=8388bd749944f4f99fc8324968cb38dc32f2a462&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29
ClickHouse#130374

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Docs: regenerate reference documentation from source

* docs: sync upstream clickhouse-operator docs updates (v1alpha2 deprecations)

---------

Co-authored-by: Nikita Fomichev <[email protected]>
Co-authored-by: Groene AI <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Alexey Milovidov <[email protected]>
Co-authored-by: Nikolai Kochetov <[email protected]>
Co-authored-by: Konstantin Bogdanov <[email protected]>
Co-authored-by: Konstantin Vedernikov <[email protected]>
Co-authored-by: singhpratech <[email protected]>
Co-authored-by: Julia Kartseva <[email protected]>
Co-authored-by: Mark Dawson <[email protected]>
Co-authored-by: Konstantin Bogdanov <[email protected]>
Co-authored-by: Nihal Z. Miaji <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: robot-clickhouse <[email protected]>
Co-authored-by: Pedro Ferreira <[email protected]>
Co-authored-by: Alexander Gololobov <[email protected]>
Co-authored-by: Nikolai Ovchinnikov <[email protected]>
Co-authored-by: Matheus Nerone <[email protected]>
Co-authored-by: Igor Nikonov <[email protected]>
Co-authored-by: Raúl Marín <[email protected]>
Co-authored-by: Shaun Struwig <[email protected]>
Co-authored-by: Raúl Marín <[email protected]>
Co-authored-by: Murphy <[email protected]>
Co-authored-by: Alex Kalmakov <[email protected]>
Co-authored-by: Nikita Taranov <[email protected]>
Co-authored-by: rienath <[email protected]>
Co-authored-by: Kirill Kopienko <[email protected]>
Co-authored-by: Nikita Taranov <[email protected]>
Co-authored-by: Konstantin Vedernikov <[email protected]>
Co-authored-by: Antonio Andelic <[email protected]>
Co-authored-by: Yaroslav Briukhovetskyi <[email protected]>
Co-authored-by: Azat Khuzhin <[email protected]>
Co-authored-by: Pavel Kruglov <[email protected]>
Co-authored-by: Maksim Dergousov <[email protected]>
Co-authored-by: Nikolay Degterinsky <[email protected]>
Co-authored-by: Anton Popov <[email protected]>
Co-authored-by: Alexei Fedotov <[email protected]>
Co-authored-by: János Benjamin Antal <[email protected]>
Co-authored-by: AlexF <[email protected]>
Co-authored-by: Igor Nikonov <[email protected]>
Co-authored-by: Alasdair Brown <[email protected]>
Co-authored-by: Dominic Tran <[email protected]>
Co-authored-by: clickhouse-cloud-ci[bot] <333021140+clickhouse-cloud-ci[bot]@users.noreply.github.com>
Co-authored-by: Shaohua Wang <[email protected]>
Co-authored-by: Daniel Lemire <[email protected]>
Co-authored-by: Shankar Iyer <[email protected]>
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-functions Built-in SQL function implementations + function infrastructure. pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants