Skip to content

Revert "Generate the fuzzer dictionary from a release binary instead … - #113649

Open
rienath wants to merge 2 commits into
masterfrom
revert-111025-fuzz-dict-generate-from-binary
Open

Revert "Generate the fuzzer dictionary from a release binary instead …#113649
rienath wants to merge 2 commits into
masterfrom
revert-111025-fuzz-dict-generate-from-binary

Conversation

@rienath

@rienath rienath commented Aug 6, 2026

Copy link
Copy Markdown
Member

…of committing it"

It breaks fuzzers, see #111025 (comment)

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

@clickhouse-gh

clickhouse-gh Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [402753f]

Summary:


AI Review

Summary

This PR reverts the release-binary-based fuzzer dictionary generation and goes back to committing the fuzzing dictionaries and corpus inputs in-tree. That rollback still leaves three correctness gaps in the fuzzing pipeline: the arm_fuzzers cache key no longer covers the files it packages, the codegen_select_fuzzer grammar regeneration no longer tracks its real inputs in incremental builds, and the committed dictionary snapshot is already internally inconsistent. I would request changes before merge.

Findings

⚠️ Majors

  • [tests/fuzz/build.sh:4, tests/fuzz/build.sh:14, ci/defs/job_configs.py:34] The reverted pipeline makes the ARM_FUZZERS artifact depend on tests/fuzz/*.dict, tests/fuzz/*.options, and the repacked tests/queries/0_stateless/*.sql corpus again, but the shared build digest no longer hashes either tree. A commit that changes the dictionary, an .options file, or the seed corpus can now cache-hit an older arm_fuzzers artifact, so NightlyFuzzers silently fuzzes the previous revision's inputs instead of the current one.
    Suggested fix: restore an arm_fuzzers-only digest override that adds ./tests/fuzz/ and ./tests/queries/0_stateless/ to the build cache key.

  • [src/Parsers/fuzzers/codegen_fuzzer/CMakeLists.txt:20-31] The reverted add_custom_command for clickhouse.g has no DEPENDS edge on tests/fuzz/all.dict, update.sh, or clickhouse-template.g. After the first successful build, ninja has no reason to rerun the generator when any of those inputs changes, so incremental trees can keep stale clickhouse.g / out.cpp and codegen_select_fuzzer lags behind the committed dictionary.
    Suggested fix: add explicit DEPENDS entries for the committed dictionary and the local generator inputs used by update.sh.

  • [tests/fuzz/dictionaries/keywords.dict:542, tests/fuzz/all.dict:753-754] The committed dictionary snapshot is internally inconsistent: keywords.dict contains "STALENESS", but all.dict omits it even though tests/fuzz/update_dict.sh defines all.dict as the sorted union of the component dictionaries. Because the fuzzers consume all.dict, this keyword is missing from the real fuzz input set already in this PR.
    Suggested fix: regenerate tests/fuzz/all.dict from the committed component dictionaries and keep the snapshot in sync in the same commit.

Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions: restore the arm_fuzzers cache-key extension, add proper DEPENDS for the codegen_select_fuzzer grammar generation, and regenerate tests/fuzz/all.dict so it matches the committed component dictionaries.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Aug 6, 2026
Comment thread tests/fuzz/build.sh

# copy fuzzer options
# copy fuzzer options and dictionaries
cp $SRC/tests/fuzz/*.dict $OUT/

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 copy makes the arm_fuzzers artifact depend on tests/fuzz/*.dict again, and the seed corpus ZIPs below still depend on tests/queries/0_stateless/*.sql, but the revert simultaneously deletes the special_build_jobs digest override in ci/defs/job_configs.py. The shared build digest does not hash either tree, so a commit that changes all.dict, a .options file, or the seed corpus can now cache-hit an older ARM_FUZZERS artifact and NightlyFuzzers will fuzz the previous revision's inputs.

I think we need to keep the arm_fuzzers-only digest extension even if we revert the binary-generation part.

"${CURRENT_DIR_IN_BINARY}/clickhouse.g"
COMMAND ./update.sh "${CURRENT_DIR_IN_BINARY}/codegen.dict"
DEPENDS "${CURRENT_DIR_IN_BINARY}/codegen.dict"
COMMAND ./update.sh "${ClickHouse_SOURCE_DIR}/tests/fuzz/all.dict"

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 reverted rule lost its DEPENDS edge entirely. After the first build, ninja has no reason to rerun ./update.sh when tests/fuzz/all.dict changes, so clickhouse.g and the generated out.cpp can stay stale in an incremental tree and codegen_select_fuzzer silently lags behind the committed dictionary.

If we go back to a checked-in all.dict, this command still needs an explicit DEPENDS on that file, and preferably on update.sh and clickhouse-template.g too.

"WITH ADMIN OPTION"
"WITH CHECK"
"WITH FILL"
"STALENESS"

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 checked-in dictionary set is already inconsistent here: tests/fuzz/update_dict.sh defines all.dict as the sort -u merge of the component dictionaries, but keywords.dict now contains "STALENESS" while tests/fuzz/all.dict jumps from "START TRANSACTION" to "STATISTICS" and never includes it. The parser fuzzers only consume all.dict via their .options files, so this keyword is silently missing from the actual fuzz input set. Please regenerate all.dict from the committed pieces (or drop the extra token if it is not supposed to be fuzzed).

@clickhouse-gh

clickhouse-gh Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 36 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: c4de7a2e-31ff-4d39-bc83-3e19279d4a3a
  • MIRAI run: f5ab508b-2d4d-4b11-86d6-25a5497ca052
  • PR check IDs:
    • clickbench_167863_1786108500
    • clickbench_167869_1786108500
    • clickbench_167881_1786108500
    • tpch_adapted_1_official_167900_1786108500
    • tpch_adapted_1_official_167921_1786108500
    • tpch_adapted_1_official_167936_1786108501

@rienath
rienath added this pull request to the merge queue Aug 7, 2026
@rienath
rienath removed this pull request from the merge queue due to a manual request Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant