Repository navigation
AST fuzzer oracle: skip a non-deterministic function passed by name - #125728
Merged
Merged
Conversation
A higher-order function accepts a function by its bare name instead of a lambda, e.g. `arrayMap(generateUUIDv7, arr)`. The name is an `ASTIdentifier`, so `hasNonDeterministicFunctionsImpl`, which only checked `ASTFunction` nodes, did not see it, and the `DQP` oracle compared two runs of `generateUUIDv7` and reported a false mismatch. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=105541&sha=d5628da5fb3950280638fe2bb20b142ff124f6c9&name_0=PR&name_1=AST%20fuzzer%20%28amd_release%2C%20oracle%29 PR: #105541 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Workflow [PR], commit [c006238] Summary: ✅
AI ReviewSummaryThe PR extends Missing context / blind spots
Final VerdictStatus: ✅ Approve. No required code changes identified. |
…racle gate
The fuzzer can replace the bare function name argument with a `{fuzz_param_N:Identifier}`
placeholder. Its name part is empty in the AST that the oracle receives, and the value is
substituted only when the query text runs, so look it up in the query parameters of the
context. An unknown parameter skips the query.
`ASTColumnsApplyTransformer` keeps its function name, parameters and lambda outside of
`children`, so `* APPLY(generateUUIDv7)` and `* APPLY(x -> arrayMap(generateUUIDv7, x))`
were not screened. Check `func_name` and recurse into `parameters` and `lambda`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
groeneai
added a commit
to groeneai/ClickHouse
that referenced
this pull request
Oct 15, 2026
…sm-screen-apply-transformer Conflict in `hasNonDeterministicFunctionsImpl`: ClickHouse#125728 added its own `ASTColumnsApplyTransformer` branch there (checks `func_name`, recurses into `parameters` and `lambda`). Take master's version of that function as is and drop this branch's duplicate (`namesNonDeterministicFunction` and the `hiddenApplyMembers` loop in that walker). `hiddenApplyMembers` stays for the other nine eligibility gates; `hasAsofJoinAnywhere` is now `hasNonDeterministicJoinAnywhere`. 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A higher-order function accepts a function by its bare name instead of a lambda, e.g.
arrayMap(generateUUIDv7, arr). The name is anASTIdentifier, sohasNonDeterministicFunctionsImpl, which only checkedASTFunctionnodes, did not see it. TheDQPoracle then compared two runs ofgenerateUUIDv7and reported a false mismatch:https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=105541&sha=d5628da5fb3950280638fe2bb20b142ff124f6c9&name_0=PR&name_1=AST%20fuzzer%20%28amd_release%2C%20oracle%29
The gate now also checks an unqualified identifier against
FunctionFactoryand the user-defined function factories. A column that happens to share a name with a non-deterministic function only makes the oracle skip one more query, which is safe.Verified on a local server with
ast_fuzzer_runs = 1, ast_fuzzer_oracle = 1, ast_fuzzer_any_query = 1and the query from the report: 6 of 60 runs reportedDQP oracle mismatchwithout the change, and 0 of 60 with it. No stateless test is added, because the oracle only runs on randomly fuzzed queries and could not reproduce this reliably.Related: #105541
Changelog category (leave one):
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/125728]
Version info
26.10.1.2424-master(included in26.10and later)