Skip to content

Warn when the perf reference build is older than the tested master - #124592

Merged
Algunenano merged 2 commits into
ClickHouse:masterfrom
Algunenano:perf-stale-reference-warning
Oct 8, 2026
Merged

Algunenano merged 2 commits into
ClickHouse:masterfrom
Algunenano:perf-stale-reference-warning

Conversation

@Algunenano

@Algunenano Algunenano commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

In master_head mode the performance comparison uses as reference the newest master commit that has a published build. When master CI lags behind, that commit is older than the master revision merged into the PR, so every change merged into master in between shows up as a change of the PR, with nothing in the report saying so.

Example: #123552 was merged with master 538719e18bbd but compared against e95690ab45b6, the newest master with a build. Its report lists 2x faster encrypt_decrypt_empty_string queries that come from #124103; every other PR compared against the same reference with #124103 in its merge commit shows the same.

When the reference is not the tested master revision, the job now:

  • shows a "Warnings" table at the top of report.html (not counted as an error) and a "Reference baseline" row in the Praktika result;
  • uploads the warning to perf_run_errors_v1 as a row with test = '(warning)', so performance.ci.clickhouse.com can show it without a schema change.

The warning names both commits and links to the GitHub compare view that lists the commits in between. Since the warning shares the table with run errors, the insert_deduplication_token of report uploads now includes the source file, otherwise the second insert into the same table would be dropped as a duplicate.

Related: #123552
Related: #124103

Changelog category (leave one):

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

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

Version info

  • Merged into: 26.10.1.1866-master (included in 26.10 and later)

The `master_head` perf comparison uses as reference the newest master commit
with a published build. When master CI lags, that commit is older than the
master revision merged into the PR, and every change merged in between shows
up as a change of the PR.

Report this in `report.html`, in the Praktika result and on the performance
dashboard (as a `perf_run_errors_v1` row with `test = '(warning)'`), with a
link that lists the commits in between.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Algunenano
Algunenano requested a review from egor-click October 8, 2026 10:41
@clickhouse-gh

clickhouse-gh Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f646ee3]

Summary: ✅


AI Review

Summary

This PR teaches the performance-comparison job to warn when its master_head baseline is older than the master revision merged into the PR, surfaces that warning in report.html, and uploads it to the dashboard inputs. The direction looks good, but the current implementation still loses that warning on supported --param report reruns, so the report can claim a clean baseline while still comparing against the older cached binary.

Findings

⚠️ Majors

  • [ci/jobs/performance_tests.py:2811] The new warning is computed once from fresh S3 availability and then reused in the report stage. On a rerun that starts at report, the left binary is whatever the earlier install stage already downloaded, but find_prev_build is executed again against current S3 state before stage skipping. If the missing master build appeared in the meantime, reference_warning becomes empty and the rerun drops both the Reference baseline Praktika row and run-warnings.tsv, even though the generated report still compares against the older cached baseline. Persist the selected baseline / warning together with reference-source.txt, or derive the warning from the installed reference binary when resuming after INSTALL_CLICKHOUSE_REFERENCE.
Final Verdict

⚠️ Needs changes before merge: the warning disappears on --param report reruns in exactly the stale-baseline case this PR is trying to surface.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 8, 2026
Comment thread ci/jobs/performance_tests.py Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Oct 8, 2026

@egor-click egor-click 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.

looks reasonable, but maybe this comment is worth addressing, i am not running lots of local runs, so i am not that sure if this is smth that would actually be a problem though

#124592 (comment)

`stale_reference_warning` recovered the selected reference by rereading
`master_track_commits_sha` and looking for the commit in the build URL. That
missed local runs, whose commits come from `local_master_track_commits`, and
depended on the S3 layout that `master_build_links` hides. Return the commits
from the tested master down to the reference from `find_prev_build` instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
reference_warning = stale_reference_warning(reference_chain)

if compare_against_release:
print("It's a comparison against latest release baseline")

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.

On a --param report rerun this flag is recomputed from the current S3 state, not from the reference binary already cached in perf_left. If the original run had to fall back to an older baseline but MasterCI publishes the missing build before the rerun, find_prev_build now returns the newer commit, reference_warning goes empty here, and the rerun silently drops both the Reference baseline Praktika row and run-warnings.tsv even though the report is still comparing against the older binary left on disk.

The install stage already persists reference-source.txt / the actual reference_sha; the warning needs to be derived from that persisted baseline (or stored alongside it) when resuming after INSTALL_CLICKHOUSE_REFERENCE, instead of being recomputed from fresh build availability.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤖 This only affects local resumed runs: CI never passes --param (the job command in ci/defs/job_configs.py is performance_tests.py --test-options "{PARAMETER}"), so every CI run goes through INSTALL_CLICKHOUSE_REFERENCE and computes the warning for the binary it installs. The existing local latest-master warning has the same behavior on a resumed run, so I'm leaving it as is.

@Algunenano
Algunenano added this pull request to the merge queue Oct 8, 2026
Merged via the queue into ClickHouse:master with commit eb43521 Oct 8, 2026
152 checks passed
@Algunenano
Algunenano deleted the perf-stale-reference-warning branch October 8, 2026 21:11
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 8, 2026
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-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