Repository navigation
Add test: arraySimilarity weights_sum == 0 division-by-zero guard untested (mixed-sign weights) - #107353
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Reviewed this test-only PR. LGTM. The coverage gap is real. In The test is correct. I built the merged HEAD of #106934 and ran the queries: output matches the
Test number I am a fork contributor and cannot apply the |
|
Workflow [PR], commit [df902f8] Summary: ✅ AI ReviewSummaryThis test-only PR adds stateless coverage for the Final VerdictStatus: ✅ Approve |
|
CI failure in |
|
@groeneai, investigate the hung check using the information and logs from CI in this PR and all other PRs where it happened. |
|
@alexey-milovidov Investigated. This PR (
Stuck-thread stacks:
So the query was cancelled but the pipeline executor never unwound: the main thread sits in the local ThreadPool All PRs where it happened (30d):
Conclusion: umbrella chronic hung check (several independent stuck-after-tests root causes), not a regression from this 2-file test-only PR. We track it; diagnostic PR #105905 (log live local thread pools at GlobalThreadPool shutdown) is open to pin down the leaked-local-ThreadPool variant. Merging master and retriggering will clear this run. Session: cron:clickhouse-worker-slot-1:20260615-191000 |
|
ClickGap AI Bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 366 line(s), 17 function(s) across 124 file(s) · Details Top files
|
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #106934.
That PR (1) The PR rewrites
levenshteinDistanceWeighted(src/Common/levenshteinDistance.h) and thearraySimilarityweight summation (src/Functions/array/arrayLevenshtein.cpp) to accumulate weighted distances/sums in a wide accumulatorLevenshteinWeightAccumulator<Weight>(awide::integerfor integra1.
arraySimilarityweights_sum == 0division-by-zero guard untested (mixed-sign weights)src/Functions/array/arrayLevenshtein.cpp:542Risk: In
similarityat arrayLevenshtein.cpp:519-545, row processing first checksdistance == 0(line 526); only when distance is non-zero does it reachif (weights_sum == 0)(line 540). For non-negative weights weights_sum==0 implies distance==0, so this branch is reachable only via signed mixed-sign weights. Risk: if this guard is broken/removed,arraySimilaritydivides a non-zero distance by zero and returnsinf/naninstead of 1.0 — silent wrong results.What's unique vs PR tests: The PR's 04327 test covers large positive weights and 256-bit weights; its single
arraySimilaritycase uses positive weights (weights_sum>0) and never reaches theweights_sum == 0guard. This test uses mixed-sign weights that sum to zero with a non-zero distance — the only input class that reaches that guard.Try it on ClickHouse Fiddle
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes
Version info
26.6.1.975