Skip to content

Run the codecs_t64_select performance queries on a quarter of the rows - #131605

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-codecs-t64-select-shorter
Nov 15, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/perf-codecs-t64-select-shorter

Conversation

@groeneai

@groeneai groeneai commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #129258

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

...

Description

From the #129258 audit: the 16 queries of codecs_t64_select.xml (one T64 case each, SELECT count() FROM (SELECT n FROM loop(t64_select_<case>) WHERE ignore(n) = 0 LIMIT <L>)) have master medians since 2026-11-10 of 0.66-1.37 s on amd (11 above 1 s) and 1.10-2.92 s on arm (all 16).

Each query reads its 100M-row table 5 to 54 times through loop(), and with use_uncompressed_cache = 0 every pass decodes T64 again, so the time is the number of rows decoded.

No existing query number or text changes: 16 queries are disabled and 16 are appended. Queries 0-15 get disabled="1" and are appended as 16-31 with a quarter of their LIMIT. Tables, fills and settings are unchanged, so the per-case LIMIT ratios stay as they were.

Measured locally with perf.py (official master release build, 8 pinned cores, 3 passes running old and new queries side by side): each copy takes 0.25-0.28 of its original's time. Projected onto the CI medians, queries 16-31 take 0.18-0.35 s on amd and 0.29-0.74 s on arm, about 100 s amd and 210 s arm less query time per master perf job. Between the official builds before and after #122442 (the T64 decompression optimisations), the originals are 1.41-3.88 times faster, and each copy keeps 86-103% of its original's speedup. Queries 0-15 did not run in any pass of the final file (system.query_log), and --max-queries 10 samples 10 of 16-31.

Queries 16-31 start a new history (CIDB has only 0-15 for this test). Both servers of a perf run use the PR's file, so this PR's perf report shows no "faster" verdict for this test.

🤖 Generated with Claude Code


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

Version info

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

The 16 queries read their 100M-row one-part table 5.4-53.7 times through
loop() with use_uncompressed_cache = 0, so each pass decodes T64 again and
the query time is the number of rows decoded. MasterCI medians since
2026-11-10: 0.66-1.37 s on amd (11 above 1 s), 1.10-2.92 s on arm (all 16).

Queries 0-15 get disabled="1" (number and text unchanged) and are appended
as 16-31 with LIMIT / 4; tables, fills and settings are unchanged, and every
table is still read by an enabled query.

Local perf.py on the official master release build (8 pinned cores, three
passes with old and new queries side by side): each copy takes 0.251-0.284
of its original's time, projected 0.18-0.35 s on amd and 0.29-0.74 s on arm,
about 100 s amd and 208 s arm less query time per master perf job. On the
official builds of 80f6567 and 8ccea5b (before and after ClickHouse#122442)
the originals are 1.41-3.88 times faster after it and each copy keeps
86-103% of its original's speedup. Only 0-15 ever existed for this test, so
16-31 start a fresh history.

Related: ClickHouse#129258

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

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 1 finding) plus my own cold review (1 nit).

# Sev Finding Verdict Evidence / action
1 ⚠️ Show that the quarter-length copies still measure T64 decompression speed (fixed overhead or noise could hide a speedup) DISAGREE Measured: on the official builds before and after #122442 (sides swapped), the originals are 1.41-3.88x faster and each copy 1.41-3.77x (copy/original speedup ratio 0.94-1.01 for all 16); copies take 0.25-0.28 of the originals' time on one build; local A/A stat_threshold of the copies 0.008-0.041
2 💡 The saving estimate assumes the same number of measured runs per query; CI's adaptive run policy could give a copy up to 7 runs where its original stopped earlier AGREE, noted The saving is stated as "about"; no change

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-11:20261114-120001

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Master medians since 2026-11-10: 11 of 16 queries above 1 s on amd (0.66-1.37 s), all 16 on arm (1.10-2.92 s). Every local pass shows the same queries at 0.59-1.15 s (official master release build, 8 pinned cores, max_threads = 8).
b Root cause explained? Each query reads its 100M-row table 5.4-53.7 times through loop(); with use_uncompressed_cache = 0 every pass decodes T64 again, so the time is the number of rows decoded. Locally a LIMIT/4 copy takes 0.251-0.284 of its original's time (3 passes x 2 servers).
c Fix matches root cause? Yes. Only the LIMIT changes, in appended copies; the originals are disabled, not edited, so no query number or text changes.
d Test intent preserved / new tests added? Yes. Same 16 T64 cases, tables, fills, settings, loop() and ignore(n) = 0. On the official builds before and after #122442 the originals are 1.41-3.88 times faster and each copy keeps 86-103% of its original's speedup. The file is the test; no new test.
e Both directions demonstrated? Old and new queries side by side on one build (3 passes) and on the pre/post #122442 builds (2 passes, sides swapped); the final file runs only 16-31 (system.query_log). CI timing and noise are checked on this PR's perf runs.
f Fix is general across code paths? N/A (no code). All 16 queries of the file get the same change.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (no code). Every T64 case of the file (byte and bit variant, 8-64 bit, prefix, negative, crossing, six/eight byte, sequential, jittered) is kept.
h Backward compatible? (maintainer-approved exception only) Yes. Queries 0-15 keep their number and text (disabled); 16-31 are new (only 0-15 ever existed for this test).
i Invariants and contracts preserved? Yes. 16 enabled queries, so --max-queries 10 still samples 10 (measured: 10 distinct, all in 16-31); every table is still read by an enabled query, so no create, fill or drop changes.

Session id: cron:clickhouse-impl-slot-4:20261114-105900

@clickhouse-gh

clickhouse-gh Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3744b2b]

Summary: ✅


AI Review

Summary

PR #131605, reviewed at 3744b2bac257319c1dc2d1a5e1a2645acaf1408e, shortens the 16 T64 decompression benchmarks by appending queries with one-quarter of each original LIMIT and disabling the originals to preserve historical query identities. No actionable findings. The supplied repeated timings and comparisons across the earlier T64 optimization support the runtime reduction and preserved benchmark sensitivity.

Missing context / blind spots
  • ⚠️ Completed performance CI measurements were unavailable during this review, and benchmarks were not rerun locally. The performance assessment relies on the author's recorded validation; completed CI timings would independently confirm the estimates.
Final Verdict

✅ Approve — no changes requested.

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). labels Nov 14, 2026
@alexey-milovidov alexey-milovidov self-assigned this Nov 15, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 15, 2026
Merged via the queue into ClickHouse:master with commit 30e5a0e Nov 15, 2026
606 of 608 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 15, 2026
@clickhouse-gh clickhouse-gh Bot added comp-codecs Compression/encoding codecs (LZ4/ZSTD/etc.), archive formats (tar/zip/7z), codec selection and IO... and removed comp-testing Test content only (no production code). labels Nov 22, 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-codecs Compression/encoding codecs (LZ4/ZSTD/etc.), archive formats (tar/zip/7z), codec selection and IO... pr-ci 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