Skip to content

Perf CI: find the performance reference build past master commits that have no MasterCI run - #127365

Merged
Algunenano merged 2 commits into
ClickHouse:masterfrom
groeneai:perf-ci-reference-build-by-sources-digest
Oct 22, 2026
Merged

Algunenano merged 2 commits into
ClickHouse:masterfrom
groeneai:perf-ci-reference-build-by-sources-digest

Conversation

@groeneai

@groeneai groeneai commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #124676

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

Performance Comparison (arm_release, master_head, 3/6) has been red on unrelated PRs since 2026-10-22 05:00 UTC: long_primary_key #0..#2 are 29-51% slower. These runs compared the PR build with the official build instead of the performance reference build (#124676):

INFO: [Build (arm_release_performance_reference)] was skipped at master a6c5f4ab918c656dec6065ef0667b6231f9ec724, its sources are the ones of its parent
WARNING: no performance reference build, the reference is the official build

The lookup goes back only over commits where MasterCI skipped the reference build. The parent ffbc6be09c came in a batched push and has no MasterCI run, so the lookup stopped, although 0ddba953e4, two commits back, has a reference build of the same sources. On current master a build made like a PR build runs this primary key analysis slower than the official build: since 05:00 UTC, 14 of 14 such runs were more than 15% slower.

Now the lookup takes the newest older reference build and uses it only if MasterCI recorded the same sources digest for the job at both commits (digest_jobs in workflow_config_masterci.json, without the last part, which hashes the runner-dependent job config) and the same clickhouse/binary-builder image digest, which the job digest does not include. Commits without a MasterCI run are passed over; a missing record or a failed fetch keeps the official build.

Validation (local, read-only S3): starting at each of the last 40 master commits, on amd and arm, 75 lookups are unchanged and 5 that fell back to the official build now find a matching reference build. Missing or malformed reports, configs and digests fall back to the official build.

Not covered: a batched push where a commit other than the head changed sources while MasterCI skipped the build at the head (26bf52e980) has no reference build with the same sources, so it still uses the official build.

🤖 Generated with Claude Code


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

Version info

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

…t have no MasterCI run

A PR performance run looks for `Build (<arch>_release_performance_reference)`
of the master commit it is tested on, and goes back to an older build only
over commits where MasterCI skipped that job. A commit of a batched push has
no MasterCI run at all, so the walk stopped there and the run was compared
with the official build. On 2026-10-22 that happened for every PR based on
a6c5f4a (its parent ffbc6be has no run), although 0ddba95 two
commits back has a reference build of the same sources. The official build
places the code differently from a PR build, and `long_primary_key` #0..ClickHouse#2
were 29-51% slower in the PR build, red on unrelated PRs.

Prove "same sources" by the praktika digest MasterCI records for the job in
`workflow_config_masterci.json` instead: pass over commits without a
reference build and accept the newest older one only if its digest equals
the one of the first commit with an official build. The last part of the
digest hashes the job config, which includes the docker `--memory` computed
from the Config Workflow runner's RAM, so it differs between runs with the
same sources and is not compared. Any missing or unreadable record keeps the
official fallback.

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 in 1 run) plus my own cold review (2 code nits).

# Sev Finding Verdict Evidence / action
1 ⚠️ Dropping the job-config part of the digest lets a reference built with another job config (command, docker flags, hooks) match (master_job_sources_digest) DISAGREE MasterCI filters jobs by digest_config.include_paths only (ci/praktika/job.py:317-340), which excludes ci/defs/job_configs.py, so a config-only change SKIPs the reference build, as the old lookup already assumed. The config part differs between runs of the same sources (a6c5f4ab91 -1b22, 0ddba953e4 -deb5).
2 💡 A null or one-part digest would compare equal noted, not blocking Not reachable: both reference jobs have digest_config=build_digest_config (ci/defs/job_configs.py:204), and every digest recorded by 21 recent MasterCI runs is <sources>-<config>.
3 💡 When the first commit with an official build has no readable digest, the job log shows only the generic fallback warning noted, not blocking Diagnostics only; the lookup falls back to the official build, as before.

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

Session id: cron:clickhouse-review-slot-9:20261022-091900

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @egor-click, could you review this and add the can be tested label so CI runs? The performance reference build lookup stopped at a batched-push master commit with no MasterCI run and fell back to the official build, which reds long_primary_key on arm; now it accepts an older reference build when MasterCI recorded the same sources digest for the job.

@clickhouse-gh

clickhouse-gh Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e95b3ca]

Summary: ✅


AI Review

Summary

The performance reference lookup can cross master commits without a MasterCI run and reuse an older build when its recorded source and builder-image digests match. The prior builder-image finding is fixed in e95b3ca3feef and its thread is resolved. No new material findings remain; 46 focused checks and live S3 lookups for AMD and ARM passed.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Oct 22, 2026
@Algunenano Algunenano added the can be tested Allows running workflows for external contributors label Oct 22, 2026
@Algunenano Algunenano self-assigned this Oct 22, 2026
Comment thread ci/jobs/performance_tests.py Resolved
…rence build

The praktika job digest does not include the Docker image digest when
`run_in_docker` contains a colon, and `BINARY_DOCKER_COMMAND` does
(`--volume=.:/ClickHouse`). A `clickhouse/binary-builder` change (compiler,
PGO or BOLT profile) therefore leaves the sources digest of the reference
build unchanged, as at ClickHouse#126309: `566499c799d454cd6e24` both at 2a95d09
(image 3480c0dc11) and at b1451e4 (image c815e89709). MasterCI schedules
the reference build after such a change, so the old lookup stopped there,
while matching by sources digest alone could take a reference built with the
previous image whenever the new one is still running or failed.

Compare `digest_dockers["clickhouse/binary-builder"]` of both MasterCI
workflow configs as well; a missing image digest keeps the official build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Oct 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-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). manual approve Manual approve required to run CI 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