Skip to content

More fuzzing - #119229

Merged
PedroTadim merged 16 commits into
masterfrom
more-fuzz10
Oct 1, 2026
Merged

PedroTadim merged 16 commits into
masterfrom
more-fuzz10

Conversation

@PedroTadim

@PedroTadim PedroTadim commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

AST fuzzer — CollapsingMergeTree / VersionedCollapsingMergeTree were unreachable, because the engine swap in fuzzTableStorage cannot see the column list; swapEngineToCollapsing runs from fuzzCreateQuery instead, picking a plain Int8 sign and a distinct canBeUsedAsVersion column (naming one column twice is rejected outright). Applied to MV / window-view / TimeSeries inner engines too. TimeSeries gains its own settings block, since it keeps its own settings and never reached the MergeTree one. Hypothetical projections join hypothetical indexes in ASTHypotheticalObjectQuery. New x IN <table> predicates, and the timeSeries*ToGrid family in swapFuncs (minus timeSeriesPredictLinearToGrid, which takes a fifth parameter).

query-fuzzer-tweaks-users.xml — three settings had silently stopped applying after upstream renames: allow_experimental_delta_kernel_rs → allow_delta_kernel_rs, and allow_experimental_time_series_aggregate_functions / _table → enable_time_series_*. Six further allow-flags enabled.

BuzzHouse — CREATE / DROP HYPOTHETICAL PROJECTION, mirroring the index support end to end (grammar, printer, catalog, DROP ALL). max_hypotheticals splits per kind; the CI job had it pinned at randint(0, 0), so hypotheticals of either kind were never generated at all. Plus x IN <table>, ~25 new session settings, four new MergeTree table settings, and distributed_index_analysis_min_indexes_size_to_activate dropped (gone upstream).

casa_del_dolor — two real bugs. No-catalog DeltaLake tables all share spark_catalog, whose test database is created once and whose Hive LOCATION then pins the first table's storage, so later tables on other storage were written where the ClickHouse engine was not looking; the location is now named explicitly. And the Iceberg time-travel instant came from .snapshots.committed_at, but TIMESTAMP AS OF and iceberg_timestamp_ms both resolve through the snapshot log, so after a rollback it could name a time that snapshot was never current — it now comes from .history.made_current_at. On a mismatch both engines' histories are dumped, since the table is normally gone by the time anyone looks.

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):

More fuzzer coverage: Collapsing engines and TimeSeries settings in the AST fuzzer, hypothetical projections in BuzzHouse, DeltaLake location and Iceberg time-travel fixes in casa_del_dolor.


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

Version info

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

@clickhouse-gh

clickhouse-gh Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d90b75e]

Summary: ✅


AI Review

Summary

This PR broadens fuzzing coverage across BuzzHouse, the AST fuzzer, and casa_del_dolor, and the casa_del_dolor fixes themselves look directionally right. I don’t think it is ready as-is, though: the new LIMIT AFTER / LIMIT UNTIL generation in both fuzzers breaks the server’s own range-form contract and turns valid inputs into deterministic parser/planner failures, and two previously raised coverage regressions are still present in the current code.

Missing context / blind spots
  • ⚠️ I did not run a Spark / DeltaLake / Iceberg reproduction locally, so the casa_del_dolor fixes were reviewed from code only.
  • ⚠️ CI context is thin right now: the linked Praktika report only exposed the Build profile diff job, so there is no runtime validation here for the new fuzzing branches.
Findings

⚠️ Majors

  • [src/Client/BuzzHouse/Generator/SQLQuery.cpp:2302] The new BuzzHouse range-limit branch violates the server contract for LIMIT AFTER / LIMIT UNTIL. That form only supports a plain non-negative count and cannot be combined with WITH TIES or OFFSET, but generateLimit still reuses generateLimitExpr, still randomizes with_ties, and generateSelect still adds OFFSET independently. That means the new path now emits shapes like LIMIT -3 WITH TIES AFTER ... and LIMIT AFTER ... OFFSET 1 that fail unconditionally instead of adding coverage.

  • [src/Common/QueryFuzzer.cpp:7132] The AST fuzzer has the same range-limit incompatibility. The new mutation adds LIMIT AFTER / LIMIT UNTIL without clearing an existing limit_with_ties, LIMIT_OFFSET, or an incompatible LIMIT_LENGTH, so corpus queries that were valid before can now be rewritten into guaranteed NOT_IMPLEMENTED / syntax failures as soon as this branch fires.

  • [src/Client/BuzzHouse/Generator/SQLExpression.cpp:572] [dismissed by author -- https://github.com/More fuzzing #119229#discussion_r4137400814] The new x IN <table> branch still picks an arbitrary attached table on the right while the left side is generated independently with width 1..4 at the call site. Whenever the chosen table width differs from the left tuple width, BuzzHouse deterministically dies with NUMBER_OF_COLUMNS_DOESNT_MATCH, so this reduces coverage instead of exercising the table-RHS form.

  • [src/Client/BuzzHouse/Generator/StatementGenerator.h:926] [dismissed by author -- https://github.com/More fuzzing #119229#discussion_r4014867807] CREATE HYPOTHETICAL PROJECTION is still gated only on “MergeTree-family + UUID”, but the server rejects projections on additional table shapes such as UNIQUE KEY tables and tables whose projection-merge mode is incompatible with adding projections. Because the generator does not track those predicates at all, a non-trivial fraction of the new hypothetical-projection path is still spent on deterministic SUPPORT_IS_DISABLED failures rather than real coverage.

Tests
  • Not run locally.
Final Verdict

Needs fixes before merge. The new LIMIT AFTER / LIMIT UNTIL generation regresses both fuzzers into producing server-rejected query shapes, and the two dismissed coverage gaps above are still present in the current code.

LLVM Coverage Report

Measured on commit d90b75e.

Metric Baseline Current Δ
Lines 88.20% 88.20% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 79.60% 79.60% +0.00%

Changed lines: Changed C/C++ lines covered: 0/0 (nothing coverable) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 10, 2026
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing d90b75e2b with master 80508bd5f (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 5ac4352fc; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

3 object files changed (+61.98 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/clickhouse_common_io.dir/Common/QueryFuzzer.cpp.o 1.54 MiB 1.60 MiB +61.98 KiB (+3.94%)

716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

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

Symbol sizes
Binary Symbol Master PR Δ
programs/clickhouse-keeper __cxx_global_var_init.874 new 174.75 KiB +174.75 KiB
programs/clickhouse __cxx_global_var_init.874 new 174.75 KiB +174.75 KiB
programs/clickhouse-keeper __cxx_global_var_init.810 162.25 KiB removed -162.25 KiB (-100.00%)
programs/clickhouse __cxx_global_var_init.810 162.25 KiB removed -162.25 KiB (-100.00%)

Job report

Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
@zlareb1 zlareb1 self-assigned this Sep 21, 2026
BuzzHouse gains coverage for text indexes, regular expressions, hypothetical
projections, time series, the remaining MergeTree engines, parts and
partitions, `LIMIT AFTER`/`UNTIL`, the aggregates and the `IN table` form that
were missing, and a location for Delta Lake tables. The session, table and hot
table settings lists are refreshed against master, which includes dropping
entries whose settings no longer exist.

`QueryFuzzer` is the other half of the change, extending the mutations it
applies while keeping every one of them re-parseable.

Squashed from 25 commits and 16 merges of master; the tree is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread ci/jobs/buzzhouse_job.py Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
@PedroTadim
PedroTadim added this pull request to the merge queue Oct 1, 2026
@PedroTadim

Copy link
Copy Markdown
Member Author

Time to mess up CI again

Merged via the queue into master with commit 067e880 Oct 1, 2026
149 checks passed
@PedroTadim
PedroTadim deleted the more-fuzz10 branch October 1, 2026 08:30
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 1, 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