Skip to content

Fuzzers update (hope CI won't be very red this time) - #115264

Merged
PedroTadim merged 40 commits into
masterfrom
more-fuzz8
Aug 22, 2026
Merged

PedroTadim merged 40 commits into
masterfrom
more-fuzz8

Conversation

@PedroTadim

@PedroTadim PedroTadim commented Aug 18, 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):

  • Some fixes for BuzzHouse in La Casa Del Dolor runs.
  • Better coverage for text index in AST fuzzer.
  • Update date ranges.
  • Fix memory leak in BuzzHouse.
  • Do more table and view definition swaps in AST fuzzer.
  • Use swapped table names in AST fuzzer in more places.

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

@clickhouse-gh

clickhouse-gh Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [abd3a6f]

Summary: ❌

job_name test_name status info comment
AST fuzzer (amd_debug, targeted, old_compatibility) FAIL
Logical error: Block structure mismatch in A stream: different columns: (STID: 0993-2a62) FAIL cidb

AI Review

Summary

This PR broadens the query-fuzzer / casa_del_dolor mutation space around cloned tables, text indexes, settings, and special values. The direction is useful, but several of the new mutations still violate structural contracts and mostly burn coverage on deterministic invalid states, and the PR also removes the only focused regression test for a still-present predicate-flattening guard, so I would request changes.

Missing context / blind spots
  • ⚠️ I could only inspect the PR-level automation comments that exposed the build-profile diff and cloud benchmark summaries. I did not have a full Praktika functional/integration report for commit abd3a6fe82b12ff5fced97226adc118e6e76cab4, so I could not confirm whether this revision already trips these cases in CI.
Findings

⚠️ Majors

  • [src/Common/QueryFuzzer.cpp:2020-2027, 3230-3256] The cloned-table retargeting still keys original_table_name_to_fuzzed by bare table name and later treats the sampled clone name as a complete identity. Cross-database name collisions can therefore rewrite db1.t to db1.t__fuzz_N when only db2.t__fuzz_N exists, and CLONE AS can also sample an incompatible source and clear as_database, turning the new rewrite into deterministic UNKNOWN_TABLE / CLONE AS validation noise. Suggested fix: key the map by full StorageID and restrict CLONE AS sampling to compatible MergeTree siblings while preserving the sampled database together with the table.
  • [src/Common/QueryFuzzer.cpp:1892-1898] [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/115264#discussion_r3823074893] The dictionary-attribute shuffle still violates the source/structure contract for dictionaries that use explicit QUERY. buildDictionaryAttributesConfiguration() reorders dict_struct.attributes, but ExternalQueryBuilder::composeLoadAllQuery() leaves the original QUERY projection order untouched, so the dictionary reads source columns in the old order and wires them into the new attribute order. Suggested fix: keep attribute mutations element-wise unless the source projection is synthesized from the structure, or rewrite the explicit query projection together with the attribute order.
  • [src/Common/QueryFuzzer.cpp:2557-2577, 2790-2804] [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/115264#discussion_r3805282995] The preprocessor / postprocessor generator still samples isValidASCII / isValidUTF8 from string_case_functions, but text index validators require String -> String transforms. These two functions return UInt8, so the new branches frequently fail validation at index creation instead of exercising preprocessor/postprocessor behavior. Suggested fix: use a String-only function pool for preprocessor / postprocessor or filter out non-String results before building the equals(...) AST.
  • [src/Common/QueryFuzzer.cpp:1535-1543, 2787-2788, 6832-6840] [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/115264#discussion_r3821610869] support_phrase_search = 1 is still not kept consistent with allow_experimental_text_index_phrase_search. The storage pass only injects the MergeTree setting opportunistically, and the later generic ASTSetQuery mutation can flip an existing setting back to 0 after the text-index mutation has already produced support_phrase_search = 1, so the rewritten DDL deterministically throws SUPPORT_IS_DISABLED. Suggested fix: whenever a text index carries support_phrase_search = 1, pin the table setting to 1 and exclude that specific setting from later value fuzzing.
  • [src/Common/QueryFuzzer.cpp:6408-6437] [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/115264#discussion_r3823074899] The new FROM permutation path still ignores dependency order between JOIN / ARRAY JOIN elements. Reordering the suffix or only swapping table expressions can move a join ahead of the aliases referenced by its ON clause, or move an ARRAY JOIN ahead of the table that defines its columns, collapsing the mutation into deterministic UNKNOWN_IDENTIFIER / invalid-join noise. Suggested fix: only reorder dependency-free chains such as pure comma / CROSS JOINs, or compute alias dependencies and skip elements that reference non-first aliases.
  • [tests/queries/0_stateless/04651_fuzzer_degenerate_logical_predicate.sql:1-17, src/Common/QueryFuzzer.cpp:4377-4384] [dismissed by author -- https://github.com/ClickHouse/ClickHouse/pull/115264#discussion_r3806980169] This PR deletes the only focused stateless regression test for degenerate logical calls even though the guarded code path in extractPredicates is still present. Because the surrounding predicate-fuzzing logic changes substantially in the same PR, dropping that test makes it easy to reintroduce the old server-side exception without any targeted coverage catching it. Suggested fix: keep this test or replace it with an equivalent stateless regression that exercises and() / and(and()) through the same callers.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions: fix the cloned-table identity rewrite, keep text-index mutations consistent with their validators/settings, stop breaking explicit-QUERY dictionaries and dependent FROM chains, and restore focused regression coverage for degenerate logical predicates.

LLVM Coverage Report

Metric Baseline Current Δ
Lines 87.10% 87.00% -0.10%
Functions 91.90% 91.90% +0.00%
Branches 79.40% 79.30% -0.10%

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 Aug 18, 2026
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
Comment thread src/Common/QueryFuzzer.cpp Resolved
auto original_name = getOriginalTableName(table_id.getTableName());
auto it = original_table_name_to_fuzzed.find(original_name);
if (it != original_table_name_to_fuzzed.end() && !it->second.empty())
const auto new_table_name = pickFuzzedTableName(table_id.getTableName());

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.

pickFuzzedTableName now returns only the table component, but the new CREATE ... AS / CLONE AS retargeting later in fuzzCreateQuery consumes that as if it were a full source identity: it picks a random live clone name, assigns it to create.as_table, and clears as_database (src/Common/QueryFuzzer.cpp:2021-2027). That means a source from another database is rewritten as an unqualified name that resolves in the current DB, and CLONE AS can also land on a non-MergeTree or different-key source that InterpreterCreateQuery rejects (src/Interpreters/InterpreterCreateQuery.cpp:884-917, 2985-3000).

Could this helper return a full StorageID (or otherwise preserve database + table together), and have the CLONE AS path sample only from compatible MergeTree siblings?

@PedroTadim
PedroTadim added this pull request to the merge queue Aug 22, 2026
Merged via the queue into master with commit 252a1fb Aug 22, 2026
175 of 177 checks passed
@PedroTadim
PedroTadim deleted the more-fuzz8 branch August 22, 2026 18:08
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 22, 2026
nickitat added a commit that referenced this pull request Aug 31, 2026
An input which has finished cannot send more chunks of a bucket, so it
does not have to be past the bucket for the bucket to be pushed. Taking
it into account kept a bucket until the end of the query when a source
ended right on it, although every input which can still send something
had moved past it. An input port reports itself finished only when it has
no data left on it, so nothing of the bucket is lost.

Reported by review of #115264.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
nickitat added a commit that referenced this pull request Aug 31, 2026
`GroupingAggregatedTransform::prepare` takes the ports whose edge has
changed, `ExecutingGraph::updateNode` collects them from the changed
edges alone. The driver of the test reported every input on every call,
so the transform saw a waiting port without data and dropped it from the
waiting set, although the real executor stays in `NeedData` until that
port really changes. The reproduction relied on that: it pushed the
bucket in a state which does not happen in a pipeline.

Report only the ports which were really given a chunk or finished. The
reproduction is a producer which postponed buckets 6 and 7 and resolves
them in order now, and never sends anything above 7, so `current_bucket`
stays behind the bucket which is pushed.

Reported by review of #115264.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BAZjq1jL3wNACqVQzocPoT
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