Skip to content

Revert the AST fuzzer correctness oracles - #117200

Closed
alexey-milovidov wants to merge 3 commits into
masterfrom
revert-99980-ast-fuzzer-oracle
Closed

alexey-milovidov wants to merge 3 commits into
masterfrom
revert-99980-ast-fuzzer-oracle

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Reverts the server-side AST fuzzer correctness oracles added in #99980: the QueryOracleChecker (TLP / NoREC / DQP metamorphic checks), the experimental ast_fuzzer_oracle setting, the AST_FUZZER_ORACLE_MISMATCH error code, the oracle profile events, oracle_mode in QueryFuzzer, the fatal client exit path in FuzzLoop, and the AST fuzzer (amd_release, oracle) CI job. The generated workflow files were regenerated with python3 -m praktika yaml.

The ColumnAggregateFunction::convertToValues fix that came in the same pull request (insertMergeResultInto instead of insertResultInto) is kept, together with its two regression tests 04275_105742_uniq_state_or_default_rollup_order_by and 04276_105740_finalize_chunk_state_combinator. That fix is independent of the oracle, and reverting it would reintroduce the dangling aggregate state for -OrFill combinators under WITH TOTALS / ROLLUP / CUBE.

Related: #99980

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

...


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

Revert #99980: the `QueryOracleChecker` (TLP / NoREC / DQP metamorphic
oracles), the experimental `ast_fuzzer_oracle` setting, the
`AST_FUZZER_ORACLE_MISMATCH` error code, the oracle-related profile events,
the `oracle_mode` support in `QueryFuzzer`, the client-side fatal exit path in
`FuzzLoop`, and the `AST fuzzer (amd_release, oracle)` CI job.

The `ColumnAggregateFunction::convertToValues` fix that came in the same pull
request (`insertMergeResultInto` instead of `insertResultInto`) is kept, along
with its two regression tests
`04275_105742_uniq_state_or_default_rollup_order_by` and
`04276_105740_finalize_chunk_state_combinator`: they are independent of the
oracle, and reverting them would reintroduce the dangling aggregate state for
`-OrFill` combinators under `WITH TOTALS` / `ROLLUP` / `CUBE`.

The generated workflow files were regenerated with `python3 -m praktika yaml`.

Reverts: #99980

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [66112c5]

Summary: ❌

job_name test_name status info comment
Stress test (amd_tsan) FAIL
ThreadSanitizer (STID: 3538-42a8) FAIL cidb
LLVM Coverage FAIL
Generate LLVM Coverage Diff Report FAIL cidb
Print Uncovered Code FAIL cidb Uncovered code analysis did not run: bash ci/jobs/scripts/generate_diff_coverage_report.sh failed (its output is on the Generate LLVM Coverage Diff Report result).

AI Review

Summary

This PR reverts the server-side AST fuzzer oracle machinery, keeps the independent ColumnAggregateFunction::convertToValues fix, and removes the dedicated CI job. The runtime cleanup looks consistent after the follow-up artifact-upload fix, but the revert is still incomplete on the documentation side: several checked-in autogenerated reference pages continue to advertise the removed setting and profile events.

Findings

⚠️ Majors

  • [src/Core/Settings.cpp:3647] Removing ast_fuzzer_oracle from Settings.cpp without regenerating the checked-in settings reference leaves /reference/settings/session-settings/ast-fuzzer, /reference/settings/beta-and-experimental-features, and the legacy route map still publishing a setting that no longer exists.
    Suggested fix: rerun the settings-doc autogeneration and commit the updated generated outputs.
  • [src/Common/ProfileEvents.cpp:46] The deleted ASTFuzzerOracle* profile events are still listed in the autogenerated system.metric_log and system.query_metric_log docs, so the public reference describes log columns that the server no longer produces.
    Suggested fix: regenerate the autogenerated system-table docs from the updated ProfileEvents.cpp.
Final Verdict

Changes requested.

LLVM Coverage Report

⚠️ No coverage measurement for commit 66112c5: bash ci/jobs/scripts/generate_diff_coverage_report.sh failed (its output is on the Generate LLVM Coverage Diff Report result).

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 30, 2026
Comment thread ci/jobs/ast_fuzzer_job.py Resolved
@clickhouse-gh

clickhouse-gh Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 42 queries analysed

no significant changes detected. K_source=6 K_base=30 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 00a251d0-222f-4766-84ab-ad200f530421
  • MIRAI run: fda89102-c472-4c58-b898-8787e80eaaa7
  • PR check IDs:
    • clickbench_942586_1788382534
    • clickbench_942592_1788382533
    • clickbench_942598_1788382534
    • tpch_adapted_1_official_942608_1788382534
    • tpch_adapted_1_official_942620_1788382534
    • tpch_adapted_1_official_942657_1788382534

@clickhouse-gh

clickhouse-gh Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 66112c5a4 with master 2da63c1b4 (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

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

28 object files changed (-158.07 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Interpreters/executeQuery.cpp.o 1004.31 KiB 979.61 KiB -24.70 KiB (-2.46%)

717 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

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

Symbol sizes
Binary Symbol Master PR Δ
programs/clickhouse __cxx_global_var_init.794 160.62 KiB removed -160.62 KiB (-100.00%)
programs/clickhouse-keeper __cxx_global_var_init.776 new 160.62 KiB +160.62 KiB
programs/clickhouse-keeper __cxx_global_var_init.794 160.62 KiB removed -160.62 KiB (-100.00%)
programs/clickhouse __cxx_global_var_init.776 new 160.62 KiB +160.62 KiB

Job report

@qoega

qoega commented Aug 31, 2026

Copy link
Copy Markdown
Member

#99980 (comment)

…zzer-oracle

Resolve conflicts: master refactored `QueryOracleChecker.cpp` (#117189) after this
branch deleted it; the deletion wins since the whole oracle is being reverted.
The generated workflow files were regenerated with `python3 -m praktika yaml`.
…exit code

The revert also dropped a generic harness improvement from #99980: attaching
`fuzzer.log`, `server.log`, `stderr.log` and the sanitizer artifacts whenever
`fuzzer_exit_code` is non-zero, not only when the job is marked failed. Exit
codes 137 and 143 from the `FUZZ_TIME_LIMIT` timeout wrapper are classified as
successful, so without this the timed-out runs looked like clean green jobs with
no logs to inspect. Restore the `is_failed or fuzzer_exit_code != 0` condition.
Comment thread src/Core/Settings.cpp
@@ -3646,9 +3646,6 @@ The fuzzer accumulates AST fragments from all queries across all sessions, produ
)", EXPERIMENTAL) \
DECLARE(Bool, ast_fuzzer_any_query, false, R"(

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 ast_fuzzer_oracle from the source registration is only half of the revert: the checked-in autogenerated settings docs were not refreshed. At the current head, docs/reference/settings/session-settings/ast-fuzzer.mdx:27-35 still publishes the setting, docs/reference/settings/beta-and-experimental-features.mdx:120-122 still lists it, and docs/_site/customizations/settings-legacy-routes/session-settings.js still routes #ast_fuzzer_oracle to that page. After merge the public docs will advertise a setting that system.settings no longer has. Please rerun the settings-doc autogeneration in this PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵 The residual ast_fuzzer_oracle mentions all live inside autogenerated regions, so they cannot be refreshed from this pull request:

  • docs/reference/settings/session-settings/ast-fuzzer.mdx — the setting block sits between the AUTOGENERATED_START / AUTOGENERATED_END markers (lines 9 and 52).
  • docs/reference/settings/beta-and-experimental-features.mdx — same, markers at lines 46 and 213.
  • docs/_site/customizations/settings-legacy-routes/session-settings.js and docs/snippets/components/SessionSettingsExplorer/SessionSettingsExplorer.jsx are generated site artifacts built from the same source of truth.

Per the project rules, the source of truth is the DECLARE registration in src/Core/Settings.cpp, which this pull request already updates; the generated pages are refreshed by the dedicated documentation autogeneration workflow, and a pull request that touches those regions without the pr-autogenerated-docs label fails the docs check. So no hand edit here — the pages will be regenerated by that workflow.

@@ -44,9 +44,6 @@
M(FailedInsertQuery, "Same as FailedQuery, but only for INSERT queries.", ValueType::Number) \
M(FailedAsyncInsertQuery, "Number of failed ASYNC INSERT queries.", ValueType::Number) \
M(ASTFuzzerQueries, "Number of fuzzed queries attempted by the server-side AST fuzzer.", ValueType::Number) \

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 same doc-regeneration gap exists for the deleted oracle profile events. docs/reference/system-tables/metric_log.mdx:47-50 and docs/reference/system-tables/query_metric_log.mdx:53-56 still list ProfileEvent_ASTFuzzerOracle*, so the public reference would describe log columns that the server no longer produces. Please refresh the autogenerated system-table docs from the updated ProfileEvents.cpp in this PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵 Same situation as the settings docs: docs/reference/system-tables/metric_log.mdx and docs/reference/system-tables/query_metric_log.mdx list the profile-event columns inside an AUTOGENERATED_START / AUTOGENERATED_END region (for metric_log.mdx the markers are at lines 20 and 2144). The source of truth is src/Common/ProfileEvents.cpp, which this pull request updates; the generated tables are refreshed by the documentation autogeneration workflow, and editing them here would fail the docs check without the pr-autogenerated-docs label.

@qoega

qoega commented Sep 10, 2026

Copy link
Copy Markdown
Member

PR does not make sense. It is working quite well

@qoega qoega closed this Sep 10, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants