Skip to content

Remove tests of the AST fuzzer oracle - #125003

Merged
alexey-milovidov merged 2 commits into
masterfrom
remove-ast-fuzzer-oracle-tests
Oct 10, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
remove-ast-fuzzer-oracle-tests

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Remove the stateless tests that check the AST fuzzer oracle (QueryOracleChecker): 04256_04250_ast_fuzzer_oracle_tlp_aggregate, 05069_limit_after_ast_fuzzer_oracle, 05097_ast_fuzzer_oracle_apply_aggregate, 05099_ast_fuzzer_oracle_view_definition, 05140_oracle_skips_approx_top_k, 05141_oracle_skips_aggregate_aliases, 05344_ast_fuzzer_oracle_tlp_aggregate_parameters. Keep 04658_ast_fuzzer_oracle_tlp_aggregate_counter as one cheap deterministic proof that the oracle still runs.

The oracle is a testing tool, not something users rely on. Several of these tests are no-parallel and run retry loops over fuzzed queries, so they are expensive in the sequential job: 05099_ast_fuzzer_oracle_view_definition takes about 80 s, 05141 about 14 s, 05140 about 10 s (median, Stateless tests (arm_asan_ubsan, azure, sequential)). This job has started hitting its 9000 s timeout on master (7 of 22 runs on 2026-10-09).

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

🤖 Generated with Claude Code


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

Version info

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

These tests check the AST fuzzer oracle, which is a testing tool, not
the server behavior. Several of them are tagged `no-parallel` and use
retry loops, which makes them expensive in the sequential stateless
job: `05099_ast_fuzzer_oracle_view_definition` alone takes about 80
seconds in `Stateless tests (arm_asan_ubsan, azure, sequential)`, and
the job has started hitting its timeout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6e3362e]

Summary: ✅


AI Review

Summary

This PR removes seven stateless regression tests around QueryOracleChecker to shorten the slow sequential job, while keeping 04658_ast_fuzzer_oracle_tlp_aggregate_counter as a cheap proof that checkTLPAggregate still runs. The runtime goal makes sense, but the cut is too deep: the surviving test only exercises one grouped-aggregate counter path, so the PR drops deterministic coverage for several previously-regressed oracle screens and rewrite branches that are still live behind the documented ast_fuzzer_oracle setting in src/Core/Settings.cpp:4143. I’m requesting changes to keep reduced targeted coverage for those distinct branches rather than deleting them outright.

Findings

⚠️ Majors

  • [tests/queries/0_stateless/05099_ast_fuzzer_oracle_view_definition.sh:11] This file is the only deterministic coverage for referencesUnscreenedDefinitionAnywhere in src/Interpreters/QueryOracleChecker.cpp:1001, including the recursive screening of views, stored column expressions, row policies, and IN table operands (src/Interpreters/QueryOracleChecker.cpp:1036, src/Interpreters/QueryOracleChecker.cpp:1060, src/Interpreters/QueryOracleChecker.cpp:1088). After this PR, 04658_ast_fuzzer_oracle_tlp_aggregate_counter still passes even if one of those branches stops screening a non-deterministic stored definition and the oracle starts producing false AST_FUZZER_ORACLE_MISMATCH exceptions again.
    Suggested fix: keep a small deterministic stateless case for at least one stored-definition read path instead of deleting this coverage entirely.
  • [tests/queries/0_stateless/05141_oracle_skips_aggregate_aliases.sh:9] Deleting this companion together with 05140_oracle_skips_approx_top_k.sh removes the only deterministic proof that isOracleUnsafeFunctionName resolves unsafe aggregate aliases at every combinator-stripping stage while still allowing safe aliases through (src/Interpreters/QueryOracleChecker.cpp:253, src/Interpreters/QueryOracleChecker.cpp:279, src/Interpreters/QueryOracleChecker.cpp:292). The remaining 04658 path uses plain count / min / max, so it does not catch regressions that would make medianTDigest, min_byOrNull, StdDev_Pop, or approx_top_count start tripping false oracle mismatches again.
    Suggested fix: keep a reduced alias/approx_top_* probe pair, or fold one unsafe alias and one safe-alias positive control into a cheaper replacement.
  • [tests/queries/0_stateless/05344_ast_fuzzer_oracle_tlp_aggregate_parameters.sql:5] This is the only deterministic regression test for the parameter-preservation path in checkTLPAggregate (src/Interpreters/QueryOracleChecker.cpp:2252) and for the skip on scope-sensitive parameter expressions. 04658 only proves the TLP Aggregate path runs on an unparameterized count / min / max query, so it still passes if a refactor drops the parameter list from aggMerge and quantile*-style aggregates start throwing false AST_FUZZER_ORACLE_MISMATCH exceptions again.
    Suggested fix: keep a reduced parameterized-aggregate case, or fold one parameterized query into the surviving counter-based test.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    • Restore or replace deterministic coverage for the stored-definition screen.
    • Restore or replace deterministic coverage for unsafe aggregate alias / approx_top_* screening.
    • Restore or replace deterministic coverage for parameterized aggState / aggMerge rewrites.

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 9, 2026
@alexey-milovidov alexey-milovidov added the blocker This issue / pr blocks a new release label Oct 9, 2026
Keep one cheap deterministic proof that `QueryOracleChecker::checkTLPAggregate`
still runs, so the `ast_fuzzer_oracle` setting is not left without any test.
The test usually succeeds on its first iteration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125003&sha=91dc673db407c0a891a2f666e5fab26e27637e52&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29 (05210_lightweight_update_materialized_cte_in_ignore, Unknown table expression identifier '_materialized_cte_c_...' with parallel replicas; it has failed on master and many PRs since 2026-10-08) and provide a fix in a separate PR. If the fix is already in progress, link it here.

# that budget. The tag waives that limit and lowers the repeat count. Accepted
# cost: a `--no-long` job skips this test.
#
# A query names relations and columns; reading them evaluates the definitions stored

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.

Removing this file leaves referencesUnscreenedDefinitionAnywhere in src/Interpreters/QueryOracleChecker.cpp:1001 with no deterministic coverage at all. The remaining 04658_ast_fuzzer_oracle_tlp_aggregate_counter only moves ASTFuzzerOracleTLPAggregateChecks on a plain grouped aggregate, so it never exercises the recursive view / stored-column / row-policy / IN table screen here. If one of those branches regresses, ast_fuzzer_oracle goes back to raising false AST_FUZZER_ORACLE_MISMATCH exceptions and we only notice it stochastically from the AST fuzzer job.

Please keep at least one small stateless case for a stored-definition read path instead of deleting this coverage entirely.

# stay put, so no other test may run oracle checks against the same server
# meanwhile.
#
# Companion of 05140_oracle_skips_approx_top_k, which covers the `approx_top_*` family itself.

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.

Deleting this companion together with 05140_oracle_skips_approx_top_k.sh removes the only deterministic proof that isOracleUnsafeFunctionName in src/Interpreters/QueryOracleChecker.cpp:253 still resolves unsafe aggregate aliases at every combinator-stripping stage while allowing safe aliases through. The surviving 04658 path uses plain count / min / max, so it will not catch regressions around spellings like min_byOrNull, StdDev_Pop, or approx_top_count.

Can we keep a reduced alias/approx_top_* probe pair, or fold one unsafe alias and one safe-alias positive control into a cheaper replacement?

-- no-fasttest: SET ast_fuzzer_runs / ast_fuzzer_oracle are EXPERIMENTAL-tier settings and
-- are not allowed when `allow_feature_tier=0` (the Fast test default).
--
-- The TLP Aggregate oracle compares `agg(params)(args)` with `aggMerge(params)(_s)` over

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 is the only deterministic regression test for the parameter-preservation path in checkTLPAggregate (src/Interpreters/QueryOracleChecker.cpp:2252). 04658_ast_fuzzer_oracle_tlp_aggregate_counter only proves that the TLP Aggregate path runs on an unparameterized count / min / max query, so it still passes if a refactor drops the parameter list from aggMerge and quantile*-style aggregates start raising false AST_FUZZER_ORACLE_MISMATCH exceptions again.

Please keep a reduced parameterized-aggregate case, or fold one parameterized aggregate into the surviving counter-based test.

@groeneai

Copy link
Copy Markdown
Collaborator

Not caused by this PR. The fix is #123121 (mine, open).

It is the parallel replicas race from #112642: the initiator's local plan waits for the materialized CTE only in its own branch, so the query sent to the other replicas can start before _materialized_cte_c_* exists, and they throw UNKNOWN_TABLE (query 26 of the test, as in this run). With a slow CTE body that query fails 10 of 10 runs on master and passes 10 of 10 with #123121. Since 2026-10-08 the test failed on 53 PRs and twice on master. #123121 has been waiting for review since 2026-09-30 (requested from @ novikd and @ devcrafter).

@alexey-milovidov alexey-milovidov self-assigned this Oct 10, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 10, 2026
Merged via the queue into master with commit 69ff0c2 Oct 10, 2026
163 checks passed
@alexey-milovidov
alexey-milovidov deleted the remove-ast-fuzzer-oracle-tests branch October 10, 2026 15:35
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 10, 2026
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Oct 10, 2026
…ellation/timeout windows

The job `Stateless tests (arm_asan_ubsan, azure, sequential)` hits its 9000 s timeout.
Remove 32 tests that reproduce narrow windows of the `table_readonly` `ALTER` or of
query cancellation/timeouts with server-global failpoints (median runtime about 457 s in total
in this job). Fold the failpoint-free user-visible checks of
`05212_readonly_storage_policy_toggle_rollback` and
`05235_readonly_toggle_window_source_of_attach_partition` into a new test
`05353_table_readonly_partition_source_and_combined_alter`.

Related: ClickHouse#125003
Related: ClickHouse#125005

Co-Authored-By: Claude Opus 5.5 <[email protected]>
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request Oct 10, 2026
The `Stateless tests (arm_asan_ubsan, azure, sequential)` job hits its
timeout, so move tests out of it when they do not need to be sequential:

- `04040_quota_normalized_query_hash`: suffix the user, role and quotas
  with the database name; strip the suffix from `SHOW CREATE QUOTA`.
- `04820_postgresql_tls_credentials`, `04648_mysql_tls_credentials`:
  suffix the named collection and the database with the database name.
- `03208_wasm_import_export`: suffix the WebAssembly modules and
  functions with the database name.
- `03899_parallel_replicas_custom_key_subquery`,
  `04337_parallel_replicas_scalar_subquery_no_leak`,
  `04313_alter_rename_column_projection_setting_validation`: the logs are
  already filtered by a unique `query_id`.
- `04141_sqlite_where_pushdown_escaping`: the SQLite file is already
  per-database.
- `04538_materialized_view_comment_implicit_alias_message`: uses only
  tables in the test database.

Related: ClickHouse#125003

Co-Authored-By: Claude Opus 5.5 <[email protected]>
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 15, 2026
ClickHouse#125003 removed the stateless tests of the AST fuzzer oracle: it is a testing
tool, and these `no-parallel` tests with retry loops over fuzzed queries are
expensive in the sequential job. This one is the same kind.

Validated locally instead, on the tree merged with master: with master's
`QueryOracleChecker.cpp` the seven probes for the gates this PR changes are
checked 4-14 times in each of 3 runs, so each of those gates still lets the
query through; with this PR all of them are skipped (3 of 3 runs). The four
determinism probes are skipped on both, since ClickHouse#125728 covers them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-fuzzing Fuzzers: BuzzHouse (the query generator in the client), the AST fuzzer (QueryFuzzer), and the lib... and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker This issue / pr blocks a new release comp-fuzzing Fuzzers: BuzzHouse (the query generator in the client), the AST fuzzer (QueryFuzzer), and the lib... pr-not-for-changelog This PR should not be mentioned in the changelog 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