Skip to content

More fuzzing features - #109194

Merged
PedroTadim merged 56 commits into
masterfrom
more-fuzz3
Jul 9, 2026
Merged

PedroTadim merged 56 commits into
masterfrom
more-fuzz3

Conversation

@PedroTadim

@PedroTadim PedroTadim commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

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

Extend BuzzHouse, AST fuzzer and La Casa Del Dolor to cover more SQL surface.

  • BuzzHouse: fuzz hypothetical indexes, Int8 QBit, MODIFY CONSTRAINT, the sparse_grams index and text-index parameters, and more CREATE TABLE options; load input/output formats from system.formats instead of a hardcoded list for easier maintenance.
  • AST fuzzer: fuzz wider integer and floating-point corner cases, and swap more groups of related functions. Also fuzz GROUP BY ALL/LIMIT BY ALL, CROSS/COMMA joins, SAMPLE ... OFFSET, named WINDOW definitions, WITH FILL ... STALENESS, Bool and Array/Tuple/Map literals, stacked aggregate combinators and parametric-aggregate parameters, and ALTER ... MODIFY command mutation.
  • Extend casa_del_dolor, the Spark/data-lake configuration fuzzer. Fuzz more server, Keeper and filesystem-cache settings, and generate harder data (nasty strings, integer/float/decimal extremes, non-finite values in Variant JSON). Widen Iceberg/Delta/Paimon table coverage: more table properties, partition transforms, branch/tag DDL and maintenance procedures (fast_forward, rollback_to_snapshot/_timestamp, Paimon rollback/expire_partitions).
    Prune incompatible option combinations so generated CREATE TABLEs are valid (Paimon first-row merge engine, deletion vectors, snapshot.num-retained min/max; Delta deletion vectors vs incremental symlink manifests; VARIANT forces Parquet; drop unavailable brotli/lzo codecs). Harden the Spark session lifecycle: disk-backed scratch space with a stale-directory sweeper, register tables only after a successful CREATE, and serialize session use.

Version info

  • Merged into: 26.7.1.698 (included in 26.7 and later)

@clickhouse-gh

clickhouse-gh Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0b7832a]

Summary: ❌

job_name test_name status info comment
Unit tests (asan_ubsan) FAIL
ThreadPoolCallbackRunner.DroppedSynchronouslyWhileAttachedToAnotherGroup FAIL cidb IGNORED
AllTests FAIL cidb IGNORED
Unit tests (tsan) FAIL
ThreadPoolCallbackRunner.DroppedSynchronouslyWhileAttachedToAnotherGroup FAIL cidb IGNORED
AllTests FAIL cidb IGNORED
Unit tests (msan) FAIL
ThreadPoolCallbackRunner.DroppedSynchronouslyWhileAttachedToAnotherGroup FAIL cidb IGNORED
AllTests FAIL cidb IGNORED
Unit tests (amd_llvm_coverage) FAIL
ThreadPoolCallbackRunner.DroppedSynchronouslyWhileAttachedToAnotherGroup FAIL cidb IGNORED
AllTests FAIL cidb IGNORED
LLVM Coverage DROPPED IGNORED

AI Review

Summary

This PR expands BuzzHouse, QueryFuzzer, and casa_del_dolor, but the current head still leaves several of the advertised hypothetical-index, text-index, and format round-trip paths either disabled in CI or routed into deterministic unsupported states. I do not think the claimed coverage is being exercised reliably enough yet.

Findings

❌ Blockers

  • [ci/jobs/buzzhouse_job.py:206] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3544466661] max_hypotheticals is still hard-coded to 0, so CI never reaches CREATE HYPOTHETICAL INDEX; EXPLAIN WHATIF can only hit unsupported or "No hypothetical indexes defined" paths.
  • [src/Client/BuzzHouse/Generator/StatementGenerator.cpp:3504-3507] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3518355363] EXPLAIN WHATIF still goes through the generic generateTopSelect path, so it keeps producing joins, FINAL, non-MergeTree reads, and tables with no hypothetical indexes instead of the estimator shape the PR is trying to cover.
  • [src/Common/QueryFuzzer.cpp:2983] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3535123975] The AST fuzzer still injects WhatIf into the shared explain-kind pool, so arbitrary explained queries keep turning into deterministic unsupported EXPLAIN WHATIF statements instead of targeted estimator coverage.
  • [src/Client/BuzzHouse/Generator/StatementGenerator.cpp:3350-3351] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3528464831] CreateHypotheticalIndex is still allowed inside PARALLEL WITH, even though hypothetical indexes live in session state. That keeps the local model and the server-side HypotheticalIndexStore vulnerable to ordering races.
  • [src/Client/BuzzHouse/Generator/SQLTable.cpp:2016-2025] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3521413661] The new text-index coverage still generates arbitrary table expressions for preprocessor / postprocessor, even though the validator only accepts String -> String transforms over the indexed column itself. A noticeable share of the new path still dies in validation instead of exercising build/read.
  • [src/Common/QueryFuzzer.cpp:2069] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3537550386] The text-index wrapper path still pulls isValidASCII / isValidUTF8 from string_case_functions, even though both return UInt8. That turns otherwise valid text indexes into deterministic INCORRECT_QUERY.
  • [src/Common/QueryFuzzer.cpp:2085-2086] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3519138360] positions = 1 is still added without guaranteeing allow_experimental_text_index_positions, so the new text-index coverage continues to spend budget on predictable setting-gate exceptions.
  • [src/Client/BuzzHouse/Generator/SQLQuery.cpp:1121-1123; src/Client/BuzzHouse/Generator/StatementGenerator.cpp:1086-1090] Raw system.formats selection now leaks into the URL round-trip source/sink generators. fc.in_out_formats contains formats like Template and schema-driven formats, but these paths never add format_template_*, format_schema, or similar settings, so many of the new round-trips are guaranteed format exceptions.

⚠️ Majors

  • [src/Client/BuzzHouse/Generator/SQLCatalog.cpp:740-760] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3538818916] File-like engine definitions still sample raw system.formats names, so formats that need extra schema/template settings are chosen without ever generating those settings. That still turns part of the new engine/file-format surface into guaranteed exceptions.
  • [src/Client/BuzzHouse/Generator/SQLExpression.cpp:657-665] [dismissed by author -- https://github.com/More fuzzing features #109194#discussion_r3518855156] ExprAny still occasionally picks IS [NOT] DISTINCT FROM while generateExprIn still chooses quantified subqueries about half the time, but the quantified-subquery rewrite only supports the regular comparison operators. Part of the new ANY / ALL coverage still dies in parsing.
  • [src/Client/BuzzHouse/Generator/QueryOracle.cpp:1047; src/Client/BuzzHouse/Generator/QueryOracle.cpp:1467-1471] The export/import oracle now samples raw fc.out_formats, so non-comparison runs can pick Null, Template, Pretty*, XML, and similar formats that cannot be read back here without extra per-format settings. That path stops round-tripping table data and degrades into guaranteed export/import failures.
Final Verdict

❌ Request changes

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 2, 2026
Comment thread programs/client/FuzzLoop.cpp Resolved
Comment thread src/Common/QueryFuzzer.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

🔴 AI verdict: degradation — 1 query(s) regressed out of 38 analysed

This PR only modifies the BuzzHouse fuzzer and the client/CI plumbing (format handling, hypothetical-index bookkeeping, reconnect logic); it does not touch any server query-execution code that ClickBench exercises. The flagged deltas on Q10, Q16, Q18, Q30, Q32-34 are therefore off-path and best read as run-to-run variance, so they have been downgraded or left as not-sure. Q11's 36% delta is large and consistent enough to clear the automatic trust threshold, so its verdict stands by rule — but with nothing in this change able to affect that query, it should be treated as a measurement artifact and re-checked, not as a real regression.

clickbench

🔴 1 regressed · ⚠️ 7 inconclusive

Flagged queries (8 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
🔴 11 regression 180 245 +36.1% <0.0001 Large, consistent delta so verdict auto-stands, but PR touches only fuzzer/client code — read as measurement artifact
⚠️ 10 not_sure 157 188 +19.8% <0.0001 PR only edits the BuzzHouse fuzzer + client/CI code; the server query-execution path Q10 runs is untouched
⚠️ 16 not_sure 731 806 +10.3% <0.0001 Fuzzer/client-only PR cannot touch Q16's server execution path; 10% shift is off-path run-to-run variance
⚠️ 18 not_sure 1238 1353 +9.3% <0.0001 Off-path: PR changes only the fuzzer/client; noisy measurements (already not_sure)
⚠️ 30 not_sure 269 296 +10.0% <0.0001 Off-path: fuzzer/client-only PR, no server execution change plausible
⚠️ 32 not_sure 1264 1396 +10.5% <0.0001 Off-path: fuzzer/client-only PR; noisy measurements underlie this delta
⚠️ 33 not_sure 1392 1500 +7.8% <0.0001 Off-path: PR touches only fuzzer/client/CI code, not the server path Q33 exercises
⚠️ 34 not_sure 1370 1462 +6.7% <0.0001 Off-path: fuzzer/client-only PR; delta is unrelated to any server code change

q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 8bb10c30-1d3d-49ed-afe5-99c4c7d48dd7
  • MIRAI run: 8519f437-4c7c-4f3d-bbf3-a93d5e4bb662
  • PR check IDs:
    • clickbench_17592_1783546349
    • clickbench_17599_1783546349
    • clickbench_17605_1783546349
    • tpch_adapted_1_official_17611_1783546349
    • tpch_adapted_1_official_17623_1783546349
    • tpch_adapted_1_official_17633_1783546349

Comment thread ci/jobs/buzzhouse_job.py Resolved
@clickhouse-gh

clickhouse-gh Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.90% 85.90% +0.00%
Functions 92.70% 92.70% +0.00%
Branches 78.00% 78.00% +0.00%

Changed lines: Changed C/C++ lines covered: 9/17 (52.94%) · Uncovered code

Full report · Diff report

@PedroTadim
PedroTadim added this pull request to the merge queue Jul 8, 2026
@PedroTadim
PedroTadim removed this pull request from the merge queue due to a manual request Jul 8, 2026
const InFormat iinf = (outIn.contains(outf)) && rg.nextBool()
? outIn.at(outf)
: static_cast<InFormat>((rg.nextLargeNumber() % static_cast<uint32_t>(InFormat_MAX)) + 1);
const String outf = rg.pickRandomly((!this->allow_not_deterministic || rg.nextBool()) ? fc.in_out_formats : fc.out_formats);

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.

This switches the deterministic URL round-trip generator from the old curated outFormats pool to raw system.formats names. fc.in_out_formats now contains formats like Template and schema-driven formats such as Protobuf / CapnProto, but this path never adds format_template_*, format_schema, or similar settings; formatToRead only checks that an input format with the same name exists. Once outf lands on one of those formats, the generated url(...) source is a guaranteed exception instead of exercising the round-trip path.

The same regression exists in src/Client/BuzzHouse/Generator/StatementGenerator.cpp:1086 for the sink-side URL path. Can we keep a self-contained round-trippable allowlist here, or otherwise filter out formats that need extra settings or schema?

}
gen.entries.clear();
ff->set_outformat(rg.pickRandomly(rg.pickRandomly(can_test_oracle_result ? QueryOracle::oracleFormats : outFormats)));
ff->set_format(rg.pickRandomly(can_test_oracle_result ? QueryOracle::oracleFormats : fc.out_formats));

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.

generateExportQuery used to sample from the curated outFormats subset here; switching it to raw fc.out_formats now pulls in output-only or extra-setting formats such as Null, Template, Pretty*, XML, and similar formats that this oracle never configures. generateImportQuery only uses formatToRead to map the format name back, so it still never adds format_template_*, format_schema, or any other per-format settings.

That means a large fraction of non-comparison runs now collapse into guaranteed export/import failures or empty Null exports instead of round-tripping table data. Please keep this on a self-contained readable subset, similar to the old list.

@PedroTadim
PedroTadim added this pull request to the merge queue Jul 9, 2026
Merged via the queue into master with commit bba14df Jul 9, 2026
170 of 175 checks passed
@PedroTadim
PedroTadim deleted the more-fuzz3 branch July 9, 2026 07:42
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 9, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants