Skip to content

Add stateless and fuzzer jobs to the WeeklyCFI workflow - #115036

Draft
zlareb1 wants to merge 13 commits into
ClickHouse:masterfrom
zlareb1:ci/cfi-stateless
Draft

zlareb1 wants to merge 13 commits into
ClickHouse:masterfrom
zlareb1:ci/cfi-stateless

Conversation

@zlareb1

@zlareb1 zlareb1 commented Aug 16, 2026 •

Copy link
Copy Markdown
Member

Related: #100419
Related: #112152
Related: #115591

The amd_cfi build is the only test build with ThinLTO enabled — the same compile profile as official release builds — so besides CFI violations the WeeklyCFI workflow also catches ThinLTO-only behavior differences that no other CI job can see (e.g. the __functional frame-name suppression surfaced by test_crash_log and fixed in #112152). This PR broadens the workflow's coverage from build + integration + stress to:

  • Stateless tests (amd_cfi, parallel + amd_cfi, sequential lanes, mirroring amd_debug). clickhouse-test now detects the CFI build from -fsanitize=cfi in the CXX_FLAGS row of system.build_options and exposes a cfi build flag, so a test that genuinely cannot hold in this profile can carry a no-cfi tag (the same generic no-<flag> skip mechanism the sanitizer builds use). No test needs the tag today. CFI is deliberately not treated as a sanitizer: it has near-zero runtime overhead, so tests tagged no-sanitizers still run under CFI — consistent with Do not treat the CFI build as a sanitizer build in the test harnesses #115591, which stopped the test harnesses from misclassifying the CFI build as a sanitizer build.
  • AST fuzzer (amd_cfi): fuzzers assert only on crashes, never on exact query output, so the build profile cannot produce false positives there, and fuzzing reaches virtual-call combinations the curated suites never exercise. Runs against the unmodified CFI binary (no build flag needed).
  • BuzzHouse (amd_cfi_buzzhouse): BuzzHouse needs -DENABLE_BUZZHOUSE=1, which compiles extra sources into clickhouse-client/dbms and would change the whole-program ThinLTO graph of the shared CFI binary. To keep the canary binary identical to the release profile, a separate amd_cfi_buzzhouse build (identical cmake plus the flag) feeds only this lane.

The fuzzer job configs are shared out into _common_ast_fuzzer_job_config / _common_buzz_fuzzer_job_config; the master and PR workflows are unchanged (their generated YAML did not change).

Not added, and why: unit tests (ENABLE_CFI is incompatible with ENABLE_TESTS — ThinLTO is disabled when building tests), performance comparison (it compares against the non-CFI master-head binary, so results are uninterpretable), upgrade/compatibility checks (version and data compatibility are orthogonal to CFI instrumentation), Keeper Jepsen (requires the standalone clickhouse-keeper build, which the CFI build omits).

Validation: the workflow was temporarily switched to a pull_request trigger (same approach as #100419) and all amd_cfi jobs passed (report) — stateless parallel + sequential, integration 4/4, stress, AST fuzzer, and BuzzHouse. The schedule-only trigger (Mondays 03:00 UTC) is restored for merge.

Findings from the validation runs, all filed:

Changelog category (leave one):

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

🤖 Generated with Claude Code


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

zlareb1 and others added 2 commits August 17, 2026 01:40
The amd_cfi build is the only test build with ThinLTO enabled - the same
compile profile as official release builds - so besides CFI violations the
workflow also catches ThinLTO-only behavior differences, like the
__functional frame-name suppression found by test_crash_log and fixed in
PR ClickHouse#112152. Broaden its coverage:

- Stateless tests (parallel + sequential lanes, mirroring amd_debug).
  clickhouse-test now detects the CFI build from -fsanitize=cfi in the
  CXX_FLAGS row of system.build_options, so tests that cannot pass in
  this build profile can carry a no-cfi tag. CFI is deliberately not
  treated as a sanitizer: no-sanitizers tests still run under CFI.
- AST fuzzer and BuzzHouse: they assert only on crashes, never on exact
  query output, so the build profile cannot produce false positives, and
  fuzzing reaches virtual-call combinations curated suites never exercise.

Workflow: https://github.com/ClickHouse/ClickHouse/actions/workflows/weekly_cfi.yml

Co-Authored-By: Claude Fable 5 <[email protected]>
Schedule-only workflows give no PR-time evidence that the new stateless,
AST fuzzer and BuzzHouse jobs work against the `amd_cfi` build. Switch the
event to `Workflow.Event.PULL_REQUEST` so CI on this PR exercises the full
build + test path. Must be reverted to `SCHEDULE` (with `cron_schedules`
and `branches=[BASE_BRANCH]`) before merge.

Same validation approach as in PR ClickHouse#100419 (commits 440167a / 37fe9295685).

Co-Authored-By: Claude Fable 5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1b9be4e]

Summary: ✅


AI Review

Summary

This PR expands WeeklyCFI to cover stateless tests plus AST/BuzzHouse fuzzers, adds a separate amd_cfi_buzzhouse build so the shared CFI canary stays release-profile, and fixes the CFI-vs-sanitizer classification gaps that were blocking some test coverage. The code changes themselves look coherent on the current head, but the exact workflow topology being merged still has no green WeeklyCFI run on that exact tree, so the rollout is missing its final proof.

Tests
  • ⚠️ [ci/workflows/weekly_cfi.py:35] The merged workflow shape still lacks validation on the current head. The only successful WeeklyCFI runs I found were the 2026-08-17 PR-triggered runs for e56a99055e8164ec1a379d737bd7d42cd4e77e78 and baf56e50335c45adf2afb691d0a1ef72f49c8bc6. Later commits changed the topology materially again: 8a0ebe1df17da5008f9837305b2ad3cb0ae3196f split BuzzHouse onto a separate amd_cfi_buzzhouse artifact, b81389a2570222865437ced655d9cc09fa3b9e8a re-enabled the 03150 stateless coverage, 3725a0f804f92b738c81615812fb15a43b6f1e63 added the new clickhouse-test guard, and 1b9be4e90ece2ce2ad9e55a3852ea8d4887b48a7 fixed the integration-side sanitizer probe. Please run WeeklyCFI once on the final tree and update the linked report to that exact SHA.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required action: produce one green WeeklyCFI run for the current head (or update the branch to a commit that already has one) and link that report in the PR.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 16, 2026
@zlareb1
zlareb1 marked this pull request as draft August 16, 2026 20:19
Comment thread ci/defs/job_configs.py Resolved
@clickhouse-gh

clickhouse-gh Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 1b9be4e90 with master 400ba9d99 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 704.52 MiB 701.50 MiB -3.02 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

416 translation units recompiled, 3772 s compile time in total, 416 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×1.08 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +269.0 s (+8%) in total before that adjustment.

Job report

zlareb1 and others added 2 commits August 17, 2026 16:49
Three failures in the first PR validation run
(https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115036&sha=30c47a7d9420ba1e86365979016e7765cbc080da&name_0=WeeklyCFI):

- BuzzHouse (amd_cfi) failed with "Clickhouse was compiled without
  BuzzHouse enabled": add -DENABLE_BUZZHOUSE=1 to the amd_cfi build,
  matching the other fuzzer-carrying builds.
- 03150_trace_log_add_build_id / 03150_trace_log_source_lines fail
  deterministically: symbols and lines in system.trace_log are all-empty
  in the ThinLTO+CFI build, while build_id resolves. This is a regression
  since the 2026-07-14 validation runs of ClickHouse#100419 (toolchain update
  ClickHouse#109864 is the prime suspect), tracked in
  ClickHouse#115122. Tag both tests
  no-cfi until it is fixed.

The third failure, a probabilistic server SIGSEGV in gRPC response
compression under test_grpc_protocol, is a real bug filed as
ClickHouse#115121 - no test change,
it passed on retry.

Co-Authored-By: Claude Fable 5 <[email protected]>
The 03150 tests never passed under the amd_cfi profile (they failed in
the 2026-07-13 validation run of ClickHouse#100419 even after SPLIT_DEBUG_SYMBOLS
was added, before the toolchain update), so issue ClickHouse#115122 is a
longstanding property of the profile, not a regression. See
ClickHouse#115122 for the corrected
analysis.

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread ci/workflows/weekly_cfi.py Resolved
The pull_request trigger was temporary, to validate the new stateless,
AST fuzzer and BuzzHouse jobs on this PR (same approach as in ClickHouse#100419).
Validation completed green on baf56e5: all ten amd_cfi jobs passed,
including Stateless tests (parallel + sequential) with the no-cfi tags,
AST fuzzer, and BuzzHouse after -DENABLE_BUZZHOUSE=1.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115036&sha=baf56e50335c45adf2afb691d0a1ef72f49c8bc6&name_0=WeeklyCFI

Co-Authored-By: Claude Fable 5 <[email protected]>
Let the weekly amd_cfi stateless run show these tests red until
ClickHouse#115122 (empty symbols
and lines in system.trace_log under the ThinLTO+CFI build) is fixed -
a visibly failing weekly job keeps the issue from being forgotten,
and this workflow does not gate PRs. Keep a comment pointing at the
issue. The no-cfi tag mechanism in clickhouse-test stays for tests
that genuinely should not run in that build.

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread ci/jobs/build_clickhouse.py Resolved
zlareb1 and others added 3 commits August 20, 2026 20:18
Review comment on ci/jobs/build_clickhouse.py:34: enabling
-DENABLE_BUZZHOUSE=1 in the shared amd_cfi build changes the
whole-program ThinLTO graph of the binary every WeeklyCFI job consumes
(BuzzHouse compiles extra sources into clickhouse-client/dbms and
alters QueryFuzzer behind #if USE_BUZZHOUSE), so the CFI canary would
no longer approximate the release build profile.

Split it: the amd_cfi build drops ENABLE_BUZZHOUSE and stays a pure
release-profile CFI binary for stateless, integration, stress and the
AST fuzzer (which needs no build flag); a new amd_cfi_buzzhouse build
- identical cmake plus -DENABLE_BUZZHOUSE=1 - feeds only the
BuzzHouse (amd_cfi_buzzhouse) lane.

Co-Authored-By: Claude Fable 5 <[email protected]>
ClickHouse#115591 fixed ClickHouse#115122:
the empty symbols/lines were not a ThinLTO/CFI symbolization problem
but the test harness misclassifying the CFI build as a sanitizer build
(CXX_FLAGS LIKE '%-fsanitize=%' matches -fsanitize=cfi-vcall,...) and
installing trace_log_no_symbolize.xml. Both tests are expected to pass
in the WeeklyCFI stateless lanes now, so the comments are obsolete.

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread tests/clickhouse-test Resolved
zlareb1 and others added 2 commits August 21, 2026 12:49
Review comment on tests/clickhouse-test: the cfi build flag is what
makes the WeeklyCFI stateless lanes meaningful, but WeeklyCFI is
schedule-only, so a regression in the classification would not fail an
ordinary PR run before Monday. Pin it in ci/tests/ (run by the CI tests
job on every PR, whose digest already includes tests/clickhouse-test):
the measured amd_cfi CXX_FLAGS row produces BuildFlags.CFI with
SANITIZED false, a sanitizer row does not produce it, no-cfi skips
under CFI and in no other build, and no-sanitizers keeps running under
CFI. The flag strings mirror test_cfi_not_a_sanitizer_build.py, which
guards the installer and integration-helper predicates the same way.

Co-Authored-By: Claude Fable 5 <[email protected]>
*JobConfigs.cfi_integration_jobs,
*JobConfigs.cfi_stress_job,
*JobConfigs.cfi_ast_fuzzer_job,
*JobConfigs.cfi_buzz_fuzzer_job,

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.

The branch no longer has PR-time evidence for the exact WeeklyCFI topology it introduces. The only green WeeklyCFI report linked in the PR body is for baf56e50335, but the final tree changed materially after that: 8a0ebe1 split BuzzHouse onto a separate amd_cfi_buzzhouse artifact, and b81389a / 3725a0f changed the stateless-CFI path after the temporary pull_request trigger had already been removed.

Because WeeklyCFI is schedule-only again, neither the new Build (amd_cfi_buzzhouse) / BuzzHouse (amd_cfi_buzzhouse) path nor the re-enabled 03150 stateless coverage has a pre-merge run on this exact branch state. I think this still needs one final workflow_dispatch (or another temporary PR-triggered run) and an updated report link before we can treat the expanded weekly coverage as validated.

Comment thread ci/workflows/weekly_cfi.py Resolved
Review comment: the module's private _is_sanitizer_build probed for the
bare -fsanitize= substring, which also matches the CFI build's
-fsanitize=cfi-vcall,cfi-derived-cast, so started_cluster never created
node_smol and test_size_adjustment silently skipped in every
Integration tests (amd_cfi, *) run. Use the -DSANITIZER predicate, the
same one ClickHouseInstance.is_built_with_sanitizer and
tests/config/install.sh use since ClickHouse#115591. The check runs before the
cluster starts, so it cannot reuse the ClickHouseInstance method
directly.

Co-Authored-By: Claude Fable 5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 4, 2026
@zlareb1
zlareb1 marked this pull request as draft October 12, 2026 05:08
auto-merge was automatically disabled October 12, 2026 05:08

Pull request was converted to draft

This branch has not been deployed

No deployments
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant