Skip to content

Add NightlyExtendedPerformance: nightly ARM run of all performance test queries and new long tests - #122231

Merged
naushniki merged 48 commits into
masterfrom
feature/issue76548/nightlyBenchmarkRunPR
Oct 16, 2026
Merged

naushniki merged 48 commits into
masterfrom
feature/issue76548/nightlyBenchmarkRunPR

Conversation

@naushniki

@naushniki naushniki commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

PR and master performance runs measure at most 10 sampled queries per test and skip tests tagged long. Nothing measures the full tests/performance corpus or large-scale benchmarks on master. This PR adds a nightly workflow for that, the first long tests, and the harness support they need. It also tightens the error rule of the regular Performance Comparison jobs and fixes the perf tests that were silently broken.

Heads-up for PR authors and CI owners: in Performance Comparison jobs, a query that fails or times out in prewarm on your build is now red (run-error, N errors in the report). Before, it was quietly measured on the reference only, or skipped. Expect also new query names without threshold history in a few fixed tests, and three new tests listed as skipped.

Changes to PR and master CI

These apply to Performance Comparison (<arch>_release, master_head, N/6) unless noted otherwise.

  • Stricter prewarm rule. A prewarm error or timeout on the tested server is now red. Before, it became partial (measured on the reference only), and a failure on both servers was skipped silently; both stayed green. A failure on the reference only is still partial. A shell query that fails on the tested server now skips only that query instead of aborting the test; the job is still red.
  • In query rows of partial queries, the version is now the real server index (1) instead of 0. Partial queries are still left out of the comparison.
  • Both servers load top_level_domains_lists.xml (public_suffix_list). --top_level_domains_path is an absolute path everywhere, including the compare.sh server restarts for confirmation reruns.
  • The perf docker runs with --security-opt seccomp=unconfined, as stateless and integration jobs already do, so io_uring works.
  • The user_files cleanup between tests keeps every entry that exists in db0/user_files (dataset files). Before, it kept only the Iceberg dataset directories.
  • Fixed perf tests. Each of these queries failed or timed out on both servers and was dropped silently; under the new rule it would be red:
    • by the harness changes above: url_hits queries 25 and 27, io_uring, insert_values_with_expressions;
    • add_distinct_to_in_clause (remote instead of a cluster on port 9000), adaptive_aggregation_nullable_keys (column Refresh), date_time_long (toTimeWithFixedDate), nlp (argument order of stem), vector_binary_serialization (analysisOfVarianceMergeState), to_valid_utf8 (aliases for column names with invalid UTF-8);
    • analyzer_nested_function_resolution: depth 1024 exceeds the stack limit and is disabled; a depth-384 query is added;
    • insert_statistics_uniq_v2: no SYSTEM STOP MERGES on the tables that run MATERIALIZE STATISTICS;
    • join_convert_to_fixed_hash_table: max_bytes_before_external_join for grace_hash;
    • sparse_grams: the missing SELECT is added; one query runs on fewer rows to fit the timeout;
    • tpch-join_algorithm-partial_merge: Q4 and Q22 are skipped, so the indexes of later queries shift.
    • Changed query texts and indexes have no threshold history for about a week.
  • calibration, tpch_sf100 and tpcds_sf100 appear as skipped in PR and master reports and in perf_skipped_tests_v1. The new files shift the round-robin shard assignment once.
  • The nightly writes pr_number = 0 rows labelled NightlyExtendedPerformance to the shared perf tables, to checks (check names Performance Comparison (arm_release, master_head, nightly, N/4)), and system logs to CI Logs. Readers that filter only by pr_number = 0 or by check name see these rows, e.g. the per-query history links in the Check Results of ARM jobs (check_name LIKE '%Performance%arm%master_head%'). PR thresholds are not affected: since Add new test workflow NightlyExtendedPerformance (preliminary changes) #123095 they read only MasterCI rows.
  • double_check_perf.py (the double-check-perf-tests skill) reads only PR and MasterCI rows.
  • Local perf.py with a single server treats it as the tested one, so a prewarm failure there now exits with code 1.
  • Of the generated workflow YAML, only .github/workflows/nightly_extended_performance.yml changes.

Risks

  • The stricter prewarm rule could cause flaky reds. Very unlikely: over 30 days of MasterCI (about 1257 runs per arch) it would have added no red job. The only such failure was on a server that died, and that job was already red. The prewarm budget is 180 s; master medians are at most about 5 s.
  • A query that fails on both servers is now red on every run. Very unlikely: every query on this branch succeeded on master on both arches in the last 14 days, except the ones fixed here, and the nightly ran all 6836 queries on ARM. io_uring still depends on the host kernel.
  • CI Logs export: SYSTEM FLUSH DISTRIBUTED of trace_log often fails with MEMORY_LIMIT_EXCEEDED. It happens in master perf jobs without the nightly too, so it is a CI Logs limit. Jobs stay green; only system-log rows are lost, and each flush is bounded by 5 min. If needed, the nightly can stop exporting trace_log.
  • The performance dashboard's master history may include nightly ARM rows, because it selects by pr_number = 0 only. This can make its ARM gate slightly more lenient, never cause a false red. A one-line filter fix is with the dashboard owner.
  • The first scheduled night after the merge fails if the newest published master build predates this PR (no calibration.xml in its tests). Expected, once.
  • No effect on PR thresholds or on other runners: the workflow has its own runner label and no build job, and the generated PR and master workflows are unchanged.

What this PR adds

  • NightlyExtendedPerformance (ci/workflows/nightly_extended_performance.py): daily at 05:13 UTC, ARM only, on its own runner label arm-medium-storage.
  • No build job. The pre-hook ci/jobs/nightly_extended_performance.py --resolve picks binaries that MasterCI already published. Tested: the newest published master Build (arm_release). Reference: the tested binary of the previous nightly (within three nights); without one, the newest master build at least 24 h older.
  • 4 batches cover the whole corpus with perf.py --long: every query, no sampling, calibration first in each batch.
  • New long tests: calibration (a per-host yardstick), tpch_sf100 and tpcds_sf100 (TPC-H and TPC-DS at scale factor 100, loaded from S3, with statistics, final state checked on every run).
  • Red: any error or timeout on the tested side, a non-timeout error in a measured run on either server, a missing binary, dataset or required upload. Not red: reference-only failures (partial) and regressions. Changes do not gate; there are no confirmation reruns.
  • Results go to the existing perf tables with workflow_name = 'NightlyExtendedPerformance', readable on play.clickhouse.com. Each row has the test, query index, display name, metric, old and new values, diff, threshold, architecture, instance type, commit and report link. The workflow docstring has SQL for the slowest and the most regressed queries; perf.py --print-queries prints the query text.
  • tests/performance/README.md documents the suite, how to write and run a long test, and the red/green rules. Rerun with gh workflow run NightlyExtendedPerformance.

Validation

Not in this PR: coming in the next PRs soon

  • A nightly view on the performance dashboard. https://performance.ci.clickhouse.com/runs shows only MasterCI runs today.
  • New long benchmarks.
  • Test queries modelled on the most frequent and heaviest real-world query shapes, on synthetic data (no customer data), as a repeatable method.
  • Documentation and a defined loop for automated analysis of the nightly results: an automated reader of the result tables finds slow queries and proposes fixes, and the next night measures them.
  • An optional run on a coverage build, to find code that no performance test reaches.

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

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

Add the NightlyExtendedPerformance workflow, which runs every performance test query without sampling, including the new long tests calibration, tpch_sf100 and tpcds_sf100, on the latest master ARM build every night and compares it with the previous night's build.

🤖 Generated with Claude Code

Version info

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

Runs without the `nightly` test option or `perf.py --long` are unchanged.

`nightly`: sorted test list, `calibration.xml` first in every batch, all
queries (no sampling), `timeout -k 60` of 3 h per test; a non-zero exit is
red, a missing `teardown-complete` is red and stops the batch; no tests-tree
replacement for `release_base`; rows keyed by the `GIT_HASH` of both
binaries; raw-run, query-metric and test-time uploads are required; no
dashboard or delta gates; `CHPC_NIGHTLY=1` skips `confirm_changes`.
`--reference-path`: use a local reference binary.
`perf.py --long`: per-statement budget from the `max_query_seconds` test
attribute, run loop ends at 3 budgets; a timeout is a censored time, on all
servers `double-timeout`, on the tested server only an error; reference-only
settings, setup or prewarm failures make the query `partial`; `SIGTERM` runs
the `atexit` teardown; `teardown-complete` only when every server is clean.
`clickbench.py --info`: text for the job result.
Threshold query: `pr_number = 0` rows from `MasterCI` only (also in the
`double-check-perf-tests` skill); identical thresholds today.
New `long` tests `calibration`, `tpch_sf100`, `tpcds_sf100`; README section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 25, 2026
…nightlyBenchmarkRunPR

# Conflicts:
#	ci/jobs/performance_tests.py
@clickhouse-gh

clickhouse-gh Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e32fa75]

Summary: ✅


AI Review

Summary

Adds NightlyExtendedPerformance to run the full performance corpus and SF100 benchmarks on published master ARM builds, and makes tested-side query failures fail performance checks. No actionable findings remain in the current code at e32fa75f4ea9b5b1ec2d1822955ba35682bb35e5; prior findings are addressed or do not hold after tracing their callers and callees.

Final Verdict

✅ Approve. No new inline findings.

@clickhouse-gh clickhouse-gh Bot added the pr-build Pull request with build/testing/packaging improvement label Sep 25, 2026
Comment thread tests/performance/scripts/perf.py Resolved
Comment thread ci/jobs/nightly_extended_performance.py Resolved
Comment thread tests/performance/scripts/perf.py Resolved
Comment thread tests/performance/scripts/perf.py Resolved
naushniki and others added 2 commits September 28, 2026 13:18
…nightlyBenchmarkRunPR

# Conflicts:
#	ci/jobs/performance_tests.py
#	tests/performance/scripts/perf.py
With `--long`, `perf.py` prints ordinary `query` rows with the censored time
(completed statements plus the budget) for a query that timed out on all
servers, followed by a `double-timeout` line. `compare.sh` treated those rows
as real samples, so they entered `all-query-metrics.tsv` and the CI database
history as `client_time` values.

`compare.sh` now collects the `double-timeout` lines and excludes those
queries from `query_run_metric_arrays`, the same way `partial` queries are
excluded. The rows stay in the raw output and the job result still shows the
number of double timeouts.

Addresses a review comment on #122231

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

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment thread ci/jobs/nightly_extended_performance.py Resolved
naushniki and others added 7 commits October 2, 2026 17:41
…nightlyBenchmarkRunPR

# Conflicts:
#	.github/workflows/nightly_extended_performance.yml
`UNKNOWN_TABLE` and `UNKNOWN_DATABASE` from a drop leave the server clean on every server, so a failed setup no longer stops the batch.

Run: https://github.com/ClickHouse/ClickHouse/actions/runs/37030092255

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A tested-side error or an asymmetric timeout now prints one `run-error`
line, drops the query's rows and continues; the test exits non-zero at the end.

Run: https://github.com/ClickHouse/ClickHouse/actions/runs/37030092255

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Hold-and-flush once at the end lost most rows of a nightly job. Now the
sends are released and held again after each test; `nightly` runs also
attribute the right server's rows to the tested binary.

https://github.com/ClickHouse/ClickHouse/actions/runs/37030092255

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A single `INSERT` of 2.4M rows timed out in run https://github.com/ClickHouse/ClickHouse/actions/runs/37030092255.
Each chunk has its own deduplication token. PR and master runs are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment thread ci/jobs/nightly_extended_performance.py Resolved
naushniki and others added 7 commits October 13, 2026 22:44
Reverts the `skipped` report of queries failing on every server and removes `double-timeout`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rams` to fit the timeout

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

It blocks the measured `MATERIALIZE STATISTICS` mutations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment thread tests/performance/tpcds_sf100.xml Resolved
… rows in `double_check_perf.py`

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@naushniki naushniki added the pr-performance Pull request with some performance improvements label Oct 14, 2026
Comment thread tests/performance/scripts/perf.py Resolved
@naushniki naushniki changed the title Add the nightly performance harness option and long tests Add NightlyExtendedPerformance: nightly ARM run of all performance test queries and new long tests Oct 15, 2026
@naushniki
naushniki requested a review from egor-click October 16, 2026 08:04
@naushniki
naushniki added this pull request to the merge queue Oct 16, 2026
Merged via the queue into master with commit eb34b17 Oct 16, 2026
186 checks passed
@naushniki
naushniki deleted the feature/issue76548/nightlyBenchmarkRunPR branch October 16, 2026 19:49
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 16, 2026
alexey-milovidov pushed a commit to bacek/ClickHouse that referenced this pull request Oct 19, 2026
…efore measuring

Since 2f07f3f (ClickHouse#122231) `t_materialize_uniq_v2_{i64,f64}` no longer stop
merges, so background merges run while the fill commits its 20 1M-row parts
and keep running during queries #0-#3. Each compared server ends up with its
own layout (CI server logs: 8 servers, 8 layouts, from [6,6,6,1,1] to [20]
million rows). The measured `ALTER ... CLEAR STATISTICS ALL, MATERIALIZE
STATISTICS ALL` runs one single-threaded mutation task per part, so its time
follows the largest part, and the layout lasts the whole job, so the dashboard
confirmation restart reproduces the gap (`confirmed_regression` on unrelated
PRs, e.g. ClickHouse#126296: #4 0.1445 -> 0.1933 s).

Merge both tables into one part in the fill with `OPTIMIZE TABLE ... FINAL
SETTINGS optimize_throw_if_noop = 1` and assert one active part per table with
`throwIf`, as `and_compare_chain_derived.xml` does. Without
`optimize_throw_if_noop` a failed merge assignment only logs and returns
success, leaving a random layout. A table that background merges already
collapsed to one part is still rewritten under FINAL, so the pin never throws
on it. `projection_materialize.xml` measures a mutation over one merged part
the same way and is stable on the same harness.

Validated on the official master release build (26.11.1.120): before, 10
fills gave 5 i64 layouts and a 1.92x spread of #4, and perf.py on two servers
gave right/left 1.249, 0.892, 0.841 in 3 of 5 fills; after, one 20M-row part
per table in 10 of 10 fills, #4/#5 spread 1.029/1.041, and perf.py right/left
within 5% in 5 of 5. Replacing one OPTIMIZE with `SELECT 1` fails the fill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-build Pull request with build/testing/packaging improvement 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