Repository navigation
Collect performance query coverage and select PR performance tests - #129327
Conversation
Add separate instrumented shards to `NightlyCoverage`. Reuse `perf.py` to collect setup, first execution, repeated execution, and teardown coverage, with expanded-query hashes and snapshot manifests. Export source coverage through the existing CIDB coverage pipeline; do not publish performance measurements from instrumented runs. Context: #129176 #129303
|
Workflow [PR], commit [2cb79be] Summary: ✅
AI ReviewSummaryThis PR collects performance-query coverage separately from timings and uses it to select whole performance tests. It adds balanced coverage shards, validated recovery, prior-failure retention, and architecture-specific routing between selected and full-suite runs. No actionable findings remain at Final VerdictStatus: ✅ Approve |
Add a `suite=performance` input to `NightlyCoverage`, keeping the per-test instrumented build and all eight performance coverage shards. Scheduled runs and `suite=all` keep the full coverage workflow. #129327
All eight shards timed out while rewriting the 100M-row hits dataset with LLVM instrumentation, before the test batch started. Attach the existing parts and rename `datasets.hits_v1` to `test.hits`, like the PGO collector. Record the dataset layout in the snapshot manifest. Keep the release-binary timing job's data preparation unchanged. #129327 https://github.com/ClickHouse/ClickHouse/actions/runs/41868661430
Give instrumented setup and fill statements a 30-minute execution limit. Set the client socket timeout above both setup and benchmark statement limits, allowing the server to report timeouts. Keep benchmark query budgets and ordinary performance comparison behavior unchanged. The coverage shard exceeded the normal 300-second limit while filling 100 million rows for `array_index_low_cardinality_strings.xml`. https://github.com/ClickHouse/ClickHouse/actions/runs/41882280734/job/126764987340 #129327
Run each query once under `first` and once under `warm`. Let large XML files use the remaining collection budget instead of stopping after one hour. Keep the six-hour shard limit and twenty-minute export reserve. Validated collector behavior, dispatch selection, generated workflows, and assignment of all 808 eligible XML files exactly once. Related: #129327 CI: https://github.com/ClickHouse/ClickHouse/actions/runs/41893002522 CI: https://github.com/ClickHouse/ClickHouse/actions/runs/41882280734/job/126764987340
Add the optional `performance_shards` dispatch input so a corrected branch revision can retry missing coverage without repeating successful shards. Validate the requested shard numbers and keep scheduled collection unchanged. Increase the coverage runner's default SQL statement budget to 30 minutes. The six-hour shard limit and 20-minute export reserve remain in force. Validated 17 collector tests, eight dispatch tests, generated workflows, lint and diff checks. Real collection must confirm the longer query limit. Related: #129327 CI: https://github.com/ClickHouse/ClickHouse/actions/runs/41918941469/job/126887932781 CI: https://github.com/ClickHouse/ClickHouse/actions/runs/41918941469/job/126887933123 CI: https://github.com/ClickHouse/ClickHouse/actions/runs/41882280734/job/126764987340
Remove the colon-space from the performance shard description so the workflow generator emits a valid YAML scalar. Validate generated YAML with the repository yamllint configuration and parse its dispatch inputs. #129327 https://github.com/ClickHouse/ClickHouse/actions/runs/41943349973/job/126970098798 https://github.com/ClickHouse/ClickHouse/actions/runs/41882280734/job/126764987340
Restore validated whole-test artifacts from an explicit earlier workflow SHA, retaining source/binary identity and per-test provenance. Interrupted XML tests restart from setup; incomplete shards still cannot publish coverage. Allow an explicit twelve-hour manual recovery budget for large XML files while keeping the scheduled collector at six hours and preserving all sixteen shard assignments and first-plus-one-warm execution. Retain completed Result records and per-test wall time when a later test fails. Related: #129327 https://github.com/ClickHouse/ClickHouse/actions/runs/41918941469 https://github.com/ClickHouse/ClickHouse/actions/runs/41882280734/job/126764987340
Require an immutable coverage artifact URL and unpacked SHA256 when resuming. Verify the binary before fixture setup so normal build-cache selection cannot change the executable used for saved coverage. CI: https://github.com/ClickHouse/ClickHouse/actions/runs/42009599761
Partition only the original shard assignment, verify its pinned archive, and restore complete whole tests into their assigned recovery slots. Preserve normal scheduled sharding and require all recovery manifests before treating the source shard as complete. CI: https://github.com/ClickHouse/ClickHouse/actions/runs/42042533306/job/127297514435 PR: #129327
Assign every eligible whole XML by longest-first measured collection cost. Admit new tests with explicit estimates, invalidate weights for changed inputs, and support refreshing weights from complete compatible manifests. Remove one-off split recovery and raise the default collection budget to twelve hours: `string_sort.xml` alone measured 6h36m51s. Preserve first-plus-one warm collection, generic pinned resume and explicit phase completeness. #129327 https://github.com/ClickHouse/ClickHouse/actions/runs/41918941469 https://github.com/ClickHouse/ClickHouse/actions/runs/42195391179
Reuse the shared selectors with query-only XML ownership, the approved 300-owner cutoff, header rule and fixed 196-test set. Run every query in selected XMLs on six shards; full-run labels use eight existing-style shards. Validate completed coverage identities before selecting and publish reasons. Temporarily allow the implementation branch as a PR target for the requested stacked CI validation; remove that target after validation. Related: #129327 Coverage validation: https://github.com/ClickHouse/ClickHouse/actions/runs/42269560085
Keep the updated review-thread CI gate and apply the performance six/eight shard decision before `ci-force-all`. Regenerate and lint the workflows. Related: #129327 Coverage validation: https://github.com/ClickHouse/ClickHouse/actions/runs/42269560085
Read performance query identities and execution errors in their published formats, and export blocking dashboard verdicts for subsequent selections. Assemble complete coverage from compatible successful shard attempts while preserving exact manifest binding, freshness and phase validation. Related: #129327 Related: #129861 CI: https://github.com/ClickHouse/ClickHouse/actions/runs/42322389618 Coverage validation: https://github.com/ClickHouse/ClickHouse/actions/runs/42269560085
Choose the six- or eight-shard performance family in a PR configuration pre-hook so `ci-force-all` cannot bypass the mutual exclusion. Remove the temporary stacked-PR workflow target; validation continues against master. Validated with the generated YAML, repository yamllint configuration and 10 focused routing/selection checks. The preceding implementation passed all six selected performance shards with complete query publication. #129327 https://github.com/ClickHouse/ClickHouse/actions/runs/42326271407 #129861 https://github.com/ClickHouse/ClickHouse/actions/runs/42269560085
Keep the original `ColumnSparse::indexImpl` change and the three new query expansions. Use the completed main implementation and the normal master reference-build path. Related: #129327 Related: #129861 Previous execution: https://github.com/ClickHouse/ClickHouse/actions/runs/42324990414 Validated implementation: https://github.com/ClickHouse/ClickHouse/actions/runs/42326271407
Resolve the generated `finish_workflow.needs` conflicts using the updated Praktika YAML generator. Preserve the existing performance job definitions, including all 16 coverage shards and the six/eight execution shard families. Validated generated YAML with the repository yamllint configuration, parsed workflow equivalence, and the existing focused execution checks. Related: #129327 Previous validation: https://github.com/ClickHouse/ClickHouse/actions/runs/42337451902
|
attempt 1 failed due to stale coverage, latest manually triggered coverage collection workflow just finished and attempt 2 should be successful |
Submodules, build files, compiler images, the performance harness and fixtures, server configuration and setting defaults. Related: #129327 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
I added a commit, "Run the full performance suite for changes coverage cannot see". Some changes affect performance without touching any covered source line. Right now the selector finds no tests for them, so the PR is measured only on the fixed set:
For these,
|
Include `src/Core/Defines.h` so changes to constants used by setting defaults request the full ARM suite. Keep AMD on coverage selection and enable its selected jobs for the same automatic requests. Preserve the full-suite override on both architectures for `ci-force-all`. Related: #129327 Review: #129327 (comment)
Pass the GitHub Actions job token to PR performance jobs with read-only contents, pull-request and Actions permissions. Keep the token in the job command environment so parent report publication uses its existing auth. This prevents source mapping from using the anonymous GitHub API quota. Related: ClickHouse#129327 CI failure: https://github.com/ClickHouse/ClickHouse/actions/runs/43119319956/job/130914755090
🕵️♂️ Collect code coverage for performance queries and use it to choose whole performance test files for each PR. Setup, first execution, one warm execution and teardown have separate coverage records. Instrumented timings never enter the performance comparison tables.
The stateless selector (250-test cap) and integration selector (100-test cap) run independently. Their selected tests are combined without another cap, keeping each selector's existing protection rules. It also includes changed or uncovered tests, previous failures, a fixed set of 196 tests, and tests using changed headers covered by at most 300 tests. Only query execution coverage selects tests; setup and teardown still execute. Regions covered by more than 300 tests are ignored. Missing source mappings are reported explicitly.
Ordinary PRs use six shards per enabled architecture and run every query in each selected file. The
pr-performancelabel runs all test files on eight ARM shards; AMD keeps coverage selection on six shards. Build inputs, performance harness/fixture/server configuration changes, setting-default changes and changes tosrc/Core/Defines.hautomatically use the same ARM-full/AMD-selected routing and enable both architectures. Theci-force-alllabel runs the full suite on eight shards per architecture. Full runs retain the existing query sampling. Other job gates and Iceberg configurations are preserved.The coverage collection was verified against actual CIDB rows: 808 eligible XML files, 7,132 queries, 15,880 phase identities and 155,093,308 coverage rows. All 16 assignments were complete and disjoint. Jobs took 5h17m–6h33m and used 93.4 runner-hours in total. Long and shell tests were explicitly excluded.
Collection validation: https://github.com/ClickHouse/ClickHouse/actions/runs/42269560085
Full CI passed at
50d2df0f10f024ebba0a449043ffaff6ad4e1168, including all 12 performance jobs. Its six ordinary performance jobs ran 234 files and all 1,361 queries on both binaries, taking 29m58s–43m56s and 3.66 runner-hours in total. CIDB contains 1,360 accepted comparisons; one comparison did not reproduce after restart and was omitted by the existing confirmation logic. Its raw measurements remain published.Main PR CI: https://github.com/ClickHouse/ClickHouse/actions/runs/42337451902
The separate validation PR also passed full CI at
2d107d687be52547993a6ce2d713418a5881b413. It targets master and includes a small C++ optimization plus an added query. Without either full-suite label, it selected 241 of 823 files and ran all 1,666 queries, including all three new query expansions and every query in 18 files containing more than ten queries. All six ordinary performance jobs passed in 28m01s–57m47s, using 3.905 runner-hours. There were no missing queries or unexplained publication losses.Execution validation: https://github.com/ClickHouse/ClickHouse/actions/runs/42339482393
Related: #129861
Related: #129176
Related: #129303
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Collect per-query performance coverage, balance its 16 shards using instrumented runtimes, and select performance tests from PR code changes.
Workflow [PR]
Sync PR [sync-upstream/pr/129327]
Version info
26.11.1.1952-master(included in26.11and later)