Skip to content

Add stateless tests for uncovered code paths (llvm coverage smoke test) - #117922

Merged
alexey-milovidov merged 13 commits into
masterfrom
abakharew/llvm-agent-smoke-test
Sep 13, 2026
Merged

alexey-milovidov merged 13 commits into
masterfrom
abakharew/llvm-agent-smoke-test

Conversation

@alexbakharew

@alexbakharew alexbakharew commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Test-only PR: close measured coverage gaps found via the public llvm coverage reports.

Every addition targets lines with zero hits in the master coverage report and was verified under the llvm-coverage-instrumented CI build: the run of only the new queries executes every targeted line (per-line hit counts in the table).

16 existing tests extended, append-only. Existing queries and their expected output are untouched — each old .reference is a byte-identical prefix of the new one:

Extended test New coverage Lines hit
01388_multi_if_optimization OptimizeIfChains.cpp via enable_analyzer=0 34/34
01271_optimize_arithmetic_operations_in_aggr_func_long ArithmeticOperationsInAgrFuncOptimize.cpp via enable_analyzer=0 30/30
01623_constraints_column_swap SubstituteColumnOptimizer.cpp (PREWHERE/HAVING paths) 56/58
02931_rewrite_sum_column_and_constant RewriteSumFunctionWithSumAndCountVisitor.cpp legacy path 8/8
02366_explain_query_tree SortNode dump: DESC, NULLS FIRST/LAST, WITH FILL/STALENESS 18/18
01470_columns_transformers Matcher/ColumnTransformer toAST paths, invalid-regex error 19/19
04202_cte_with_sample TableExpressionModifiers::dump with SAMPLE OFFSET 2/2
03355_join_to_in_optimization 5 guard early-returns in convertJoinToIn.cpp 11/11
04122_serialization_time64_formats SerializationTime (non-64) JSON/CSV 9/9
04133_group_array_variants groupArrayInsertAt guard/error branches 15/15
04112_bson_nullable_array_read_rollback BSON type-name/unknown-type error paths 25/25
03823_optimize_dry_run_projections system.projection_parts(_columns) untouched columns measured
03521_system_unicode notation column: 4/5/6-hex paths 16/16
04205_field_visitor_convert_to_number_ubsan_103817 FieldVisitorConvertToNumber error branches, inf/nan 14/14
03227_distinct_dynamic_types_json_paths all-NULL input + -Merge combinator round-trip 15/22
02381_compress_marks_and_primary_key use_streaming_marks_compression streaming path 25/26

4 new test files (no existing test covers these features):

New test Target Lines hit
05067_serialization_interval_json_csv SerializationInterval JSON/CSV (host is a .j2 template — kept standalone) 28/28
05079_parse_aggregate_function_typed_param parseFieldFromCastedLiteral: ::Type casts inside AggregateFunction type specs 18/18
05082_field_visitor_dump_rare_types FieldVisitorDump rare Field types 8/8
05084_libdeflate_inflating_read_buffer_gaps (sh) gzip FEXTRA/FCOMMENT/FHCRC header extensions 22/22

Projected effect (example): MergeTreeMarksLoader.cpp goes from 76.6% (187/244) to ~84.4% line coverage.

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.9.1.1371 (included in 26.9 and later)

12 tests targeting lines with zero hits in the master llvm coverage
report, each verified against the instrumented coverage build so that
every targeted line is actually executed by the new test:

- 05056: MergeTreeMarksLoader streaming marks compression (19/19 lines)
- 05059-05061: legacy AST-path optimizers, enable_analyzer=0 (34/34, 30/30, +2 files)
- 05062-05064: Analyzer SortNode/Matchers/TableExpressionModifiers
- 05065: convertJoinToIn guard conditions (6/6)
- 05066-05067: SerializationTime/Interval JSON+CSV formats (24/24, 28/28)
- 05068-05069: Dynamic-type distinct + groupArrayInsertAt guards (41/41, 15/15)

Co-Authored-By: Claude Fable 5 <[email protected]>
@alexbakharew alexbakharew added the ci-force-all Do not skip any jobs when running label Sep 3, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dd6aca0]

Summary: ✅


AI Review

Summary

This PR folds a batch of llvm-coverage smoke tests into existing stateless files and slightly widens the extra-baseline search in the differential-coverage job. The direct EXPLAIN-based checks mostly look fine, but several of the merged coverage probes still stay green when the branch they claim to cover stops running, so the PR does not yet prove the advertised coverage gaps are closed.

Findings

⚠️ Majors

  • [tests/queries/0_stateless/02381_compress_marks_and_primary_key.sql:65-87] The three "baseline" reads still do not force the plain marks loader. use_streaming_marks_compression is randomized in stateless runs, so the unannotated control query can still take the streaming path, and even when it does not, loadMarksSync serves the second read from MarkCache::getOrSet after the first streaming read has already populated the cache. The file can therefore stay green while the non-streaming loader never runs, or while a plain-loader bug is masked by warm cached marks. Suggested fix: pin the control side with SETTINGS use_streaming_marks_compression = 0 (or add no-random-settings) and drop the mark cache before each control read.
  • [tests/queries/0_stateless/01623_constraints_column_swap.sql:81-91] The SubstituteColumnOptimizer block still uses rows where a = b for every record and then checks only result-equivalent queries. If the optimizer stops rewriting b to a, the WHERE, PREWHERE, and HAVING queries still return the same reference, so the claimed legacy-path coverage can disappear silently. Suggested fix: assert the rewritten form with EXPLAIN, or use deliberately inconsistent ASSUME data the way 01622_constraints_simple_optimization.sql does.
  • [tests/queries/0_stateless/03355_join_to_in_optimization.sql:108-142] The guard cases only assert that CreatingSets is absent. That does not prove the guarded join path is still present: a future planner change that removes or rewrites the join earlier will keep all five checks green while the tryConvertJoinToIn early-return branches stop executing. Suggested fix: pair each negative CreatingSets assertion with a positive Join% assertion, as in 03918_convert_join_to_in_arrayjoin_dangling.sql.
  • [tests/queries/0_stateless/04112_bson_nullable_array_read_rollback.sql:77-111] The new BSON helper coverage only checks ILLEGAL_COLUMN, but getBSONTypeName and getBSONBinarySubtypeName affect only the exception text. A refactor that throws the same code earlier, or stops formatting the BSON type/subtype name, leaves the file green while those helpers lose coverage again. Suggested fix: capture representative message substrings such as BSON Double, BSON Document, and BSON Binary subtype UUID in a .sh test or another stderr-visible harness.
  • [tests/queries/0_stateless/05079_parse_aggregate_function_typed_param.sql:17-70] Several cast-width branches are still observationally collapsed: Decimal32/Decimal128/Decimal256 all round-trip to the same AggregateFunction(quantile('0.5'), Float64), Int64 and UInt64 share the same output, and all four Int128/UInt128/Int256/UInt256 cases collapse to AggregateFunction(quantile('1'), Float64). A wrong dispatch among those parseFieldFromCastedLiteral arms will therefore keep this test green while the targeted branch loses coverage. Suggested fix: use boundary values that only fit the intended width/signedness, or another assertion that makes the chosen cast width observable.
  • [tests/queries/0_stateless/05082_field_visitor_dump_rare_types.sql:44] LIKE '%Map_%,%' still does not pin the map-entry separator branch in FieldVisitorDump::operator(Map). A single map entry already contains commas inside Tuple_(key, value), and the surrounding EXPLAIN line also contains commas, so the pattern can match even if the inter-entry ", " emission disappears. Suggested fix: assert a more specific dumped shape such as Map_(Tuple_(Int64_1, 'a'), Tuple_(Int64_2, 'b')), or any other pattern that can only appear when the separator between entries is emitted.
Final Verdict

⚠️ Needs changes before merge. Several coverage additions still do not make the claimed uncovered branches observable, so the PR's main contract is not proven yet.

LLVM Coverage Report

Measured on commit dd6aca0.

Metric Baseline Current Δ
Lines 89.00% 89.00% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 81.30% 81.40% +0.10%

Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage).

Newly covered: +818 lines in 75 files (-162 lines lost coverage) · Details

Full report

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Sep 3, 2026
@alexbakharew alexbakharew added ci-coverage and removed ci-force-all Do not skip any jobs when running labels Sep 3, 2026

-- b is substituted with a (a is in the primary key → cheaper)
-- Verify substitution happened: result is correct and the query executes without errors
SELECT a, b FROM t_subst_legacy WHERE b = 42;

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 block never makes SubstituteColumnOptimizer observable. Because every inserted row already satisfies a = b, the SELECT, WHERE, PREWHERE, and HAVING queries here all return the same reference whether b gets rewritten to a or the optimizer never runs at all, so the targeted branches can silently lose coverage. Please add an assertion on the rewritten form (EXPLAIN/plan output), or use deliberately inconsistent ASSUME data the way 01622_constraints_simple_optimization.sql does.

Comment on lines +20 to +46
SELECT countIf(explain LIKE '%CreatingSets%') = 0 AS guard_non_hash_algo
FROM (EXPLAIN description = 0
SELECT t1.a FROM (SELECT 1::UInt64 AS a) t1 INNER JOIN (SELECT 1::UInt64 AS a) t2 ON t1.a = t2.a
SETTINGS join_algorithm = 'partial_merge', serialize_query_plan = 0);

-- Guard lines 159-160: LEFT SEMI JOIN has strictness=semi (neither Any nor All) -> blocked.
SELECT countIf(explain LIKE '%CreatingSets%') = 0 AS guard_semi_strictness
FROM (EXPLAIN description = 0
SELECT t1.a FROM (SELECT 1::UInt64 AS a) t1 LEFT SEMI JOIN (SELECT 1::UInt64 AS a) t2 ON t1.a = t2.a
SETTINGS serialize_query_plan = 0);

-- Guard lines 163-164: LEFT JOIN has kind=left (not inner) -> blocked.
SELECT countIf(explain LIKE '%CreatingSets%') = 0 AS guard_left_kind
FROM (EXPLAIN description = 0
SELECT t1.a FROM (SELECT 1::UInt64 AS a) t1 LEFT JOIN (SELECT 1::UInt64 AS a) t2 ON t1.a = t2.a
SETTINGS serialize_query_plan = 0);

-- Guard lines 175-176: IS NOT DISTINCT FROM produces NullSafeEquals (op != Equals) -> blocked.
SELECT countIf(explain LIKE '%CreatingSets%') = 0 AS guard_null_safe_eq
FROM (EXPLAIN description = 0
SELECT t1.a FROM (SELECT 1::UInt64 AS a) t1 INNER JOIN (SELECT 1::UInt64 AS a) t2 ON t1.a IS NOT DISTINCT FROM t2.a
SETTINGS serialize_query_plan = 0);

-- Guard lines 190-191: SELECT includes a column from the right-side table -> blocked.
SELECT countIf(explain LIKE '%CreatingSets%') = 0 AS guard_right_output
FROM (EXPLAIN description = 0
SELECT t1.a, t2.b FROM (SELECT 1::UInt64 AS a) t1 INNER JOIN (SELECT 1::UInt64 AS a, 2::UInt64 AS b) t2 ON t1.a = t2.a

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.

countIf(explain LIKE '%CreatingSets%') = 0 only proves that the rewrite did not materialize a CreatingSets step. It does not prove that the guarded Join path stayed in the plan, so a future planner change that removes or rewrites the join earlier would keep all five queries green while these tryConvertJoinToIn early-return branches stop being exercised. 03918_convert_join_to_in_arrayjoin_dangling.sql pins both sides of that contract by checking Join stays and CreatingSets disappears; please add the same positive Join% assertion here for each guard case.

The old-analyzer stateless shards force enable_analyzer=0, which broke
5 tests that relied on the default:
- 05062/05063/05064/05065: target analyzer-path code (EXPLAIN QUERY
  TREE, convertJoinToIn) — pin SET enable_analyzer = 1 explicitly.
- 05069: groupArrayInsertAt()(args) with an empty parameter list throws
  BAD_ARGUMENTS on the old path before the argument type check is
  reached — drop the empty parens; error codes now identical (43, 128)
  in both modes.

Co-Authored-By: Claude Fable 5 <[email protected]>

-- Baseline without streaming (must match)
SYSTEM DROP MARK CACHE;
SELECT count(), sum(a) FROM wide_adaptive;

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 three "baseline without streaming" queries here inherit the randomized use_streaming_marks_compression session default. In stateless runs that setting is fuzzed, so these baselines can silently execute the same streaming path as the preceding query and stop checking equivalence against the non-streaming implementation. Please pin the baseline side with SETTINGS use_streaming_marks_compression = 0 (or SET use_streaming_marks_compression = 0 around each baseline block).

Each targets zero-hit lines from the master llvm coverage report and is
verified against the instrumented build (all targeted lines executed):

- 05076: BSONTypes.cpp error messages for invalid BSON types (25/25)
- 05077: system.projection_parts with missing-column parts
- 05078: system.unicode notation columns
- 05079: aggregate-function parameters as CAST-typed literals (18/18)
- 05082: FieldVisitorDump rare Field types (8/8)
- 05083: FieldVisitorConvertToNumber error branches, inf/nan guard (14/14)
- 05084: gzip FEXTRA/FCOMMENT/FHCRC header extensions in
  LibdeflateInflatingReadBuffer, shell test crafting binary gzip (22/22)

Co-Authored-By: Claude Fable 5 <[email protected]>
scanhex12 pushed a commit to aaron276h/ClickHouse that referenced this pull request Sep 4, 2026
On a tests-only PR forced with the ci-coverage label (or a
CI-scripts-only PR touching the coverage pipeline), the LLVM Coverage
job merged the profiles and generated the full report, but skipped the
whole comparison against master: differential report, uncovered code
analysis, PR comment, and CI DB row all bailed with no_cpp_changes.
The per-changed-line analysis is indeed impossible there, but the
global comparison is not: the binary is identical to master, so any
difference in hit counts is exactly what the new tests add.

In the no_cpp_changes outcome the job now:
- compares total line/function/branch coverage against the master
  baseline (base_llvm_coverage.info is already downloaded there);
- runs a new 'Newly Covered Lines' analysis
  (ci/jobs/scripts/newly_covered_lines.py) reporting lines with 0 hits
  on master and >0 hits now, and lines that lost coverage, with the
  detailed per-file report attached as a log artifact;
- posts the PR comment and the CI DB row with these numbers, with a
  'Newly covered' line instead of the 'Changed lines' one.

No degradation gate in this mode: with an unchanged binary a drop can
only be baseline noise, never a regression of the PR.

Validated on the real tracefiles of
https://s3.amazonaws.com/clickhouse-test-reports/PRs/117922/687dc08d3f9fbc0a8fe6f97fef3ee953598b60a9/pr/llvm_coverage/job.log
(PR ClickHouse#117922): 1303 newly
covered lines in 252 files, topped by the exact files its 12 new tests
target; 1.9 s and 190 MB RSS on two 438 MB tracefiles.

Co-Authored-By: Claude Fable 5 <[email protected]>
unhex('13000000' || '05' || '76616C00' || '04000000' || '08' || '00010203' || '00')); -- { serverError UNKNOWN_TYPE }

-- getBSONTypeName(DOUBLE): Float64 written as BSON Double, read into IPv6 column
SELECT * FROM format('BSONEachRow', 'val IPv6',

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 two UNKNOWN_TYPE cases above are fine because getBSONType / getBSONBinarySubtype are themselves the throw sites. Starting here, though, every check only asserts ILLEGAL_COLUMN, while the lines this block claims to cover (getBSONTypeName / getBSONBinarySubtypeName) affect only the exception text. A future refactor that throws the same code earlier, or keeps ILLEGAL_COLUMN but stops formatting the BSON type/subtype name, will leave this file green while those helpers lose coverage again.

Please capture at least one representative message substring for each family (for example BSON Double, BSON Document, BSON Binary subtype UUID) in a .sh test, or otherwise surface the exception text so the test actually distinguishes these helper calls from a generic ILLEGAL_COLUMN.

-- 7. Map with multiple entries: exercises the comma-separator branch in Map dump.
-- FieldVisitorDump.cpp:95-96: the second and later entries prepend ", ".
-- The output is "Map_(Tuple_(...), Tuple_(...))" with a comma between entries.
SELECT countIf(explain LIKE '%Map_%,%') > 0 AS found

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.

LIKE '%Map_%,%' does not actually pin the if (it != x.begin()) wb << ", "; branch in FieldVisitorDump::operator(Map). Even if the separator between map entries disappeared, this still matches because a single map entry already contains commas inside Tuple_(key, value), and the surrounding EXPLAIN line contains additional commas after the dump. So the test can stay green while lines 95-96 stop running.

Please assert a more specific dumped shape, for example a substring like Map_(Tuple_(Int64_1, 'a'), Tuple_(Int64_2, 'b')), or any other pattern that can only appear when the inter-entry , is emitted.

pull Bot pushed a commit to AnotherGenZ/ClickHouse that referenced this pull request Sep 7, 2026
Against a single master baseline, the tests-only coverage report counts
lines that fire only occasionally on master (background/async code) as
transitions. On PR 117922 that meant 955 'lost coverage' lines and an
inflated newly-covered count, all noise.

The diff script now downloads up to 3 extra older master baselines, but
only in the no_cpp_changes outcome (a tests-only PR forced with the
ci-coverage label, or a coverage-pipeline PR), so C++ PRs pay nothing.
newly_covered_lines.py requires every comparable baseline to agree: a
line is newly covered only if it has 0 hits in all of them, and lost
only if it has >0 hits in all of them.

Extra baselines come from older master commits whose source can differ
from the PR's merge base, shifting line numbers. Instead of resurrecting
the git-diff remapping, a baseline votes on a file only when its
instrumented DA line set for that file is identical to the current
run's: the line set comes from the static coverage mapping, so equal
sets mean the file did not change in between; unequal sets make that
baseline abstain for that file.

The dead slot-2..6 extraction loop is removed: it belonged to the LBC
cross-validation deleted in 080b086 and had no consumer since.

Validation on the real tracefiles of
https://s3.amazonaws.com/clickhouse-test-reports/PRs/117922/687dc08d3f9fbc0a8fe6f97fef3ee953598b60a9/pr/llvm_coverage/job.log
(PR ClickHouse#117922), with 3 extra
real master baselines: newly covered 1303 -> 680 lines, lost coverage
955 -> 156 lines, while every genuinely targeted file keeps its exact
count (SubstituteColumnOptimizer.cpp 158, OptimizeIfChains.cpp 34, ...).
4.8 s and 460 MB RSS for four 438 MB tracefiles.

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment on lines +10 to +70
-- Decimal32 (line 74): float literal cast to Decimal32; hits the else-branch in
-- convertFieldTo<Decimal32> (non-String, non-Decimal source converted via text).
DROP TABLE IF EXISTS t_pfl_05079;
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(0.5::Decimal32(1)), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- Decimal128 (line 78)
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(0.5::Decimal128(1)), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- Decimal256 (line 80)
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(0.5::Decimal256(1)), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- Bool (line 83): UInt64 literal cast to Bool; hits the else-branch in convertFieldTo<bool>
-- (not already Bool, not String -> convert via FieldVisitorToString).
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(0::Bool), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- Float64 (line 85): Float64 literal cast to Float64; hits the same-type branch in
-- convertFieldTo<Float64> (src is already Float64, returned unchanged).
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(0.5::Float64), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- String (line 87): quantile does not accept a String parameter.
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile('0.5'::String), Float64))
ENGINE = Memory; -- { serverError CANNOT_CONVERT_TYPE }

-- Int64 (line 90): UInt64 literal cast to Int64; hits the else-branch in convertFieldTo<Int64>.
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(1::Int64), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- UInt64 (line 92): UInt64 literal cast to UInt64; hits the same-type branch.
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(1::UInt64), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- Int128 (line 94)
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(1::Int128), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- UInt128 (line 96)
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(1::UInt128), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- Int256 (line 98)
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(1::Int256), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';
DROP TABLE t_pfl_05079;

-- UInt256 (line 100)
CREATE TABLE t_pfl_05079 (s AggregateFunction(quantile(1::UInt256), Float64)) ENGINE = Memory;
SELECT type FROM system.columns WHERE database = currentDatabase() AND table = 't_pfl_05079';

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.

system.columns.type does not actually distinguish several of the branches this file claims to cover. 0.5::Decimal32(1), 0.5::Decimal128(1), and 0.5::Decimal256(1) all round-trip as AggregateFunction(quantile('0.5'), Float64); 1::Int64 and 1::UInt64 both become AggregateFunction(quantile(1), Float64); and all four big-int cases become AggregateFunction(quantile('1'), Float64).

A future refactor that routes one width or signedness through the wrong parseFieldFromCastedLiteral arm would leave this file green while the targeted dispatch branch loses coverage. Please use boundary values that only fit the intended width/signedness (for example values outside Int64/UInt64 for the 128-bit cases, and values that separate Decimal32 from wider decimal widths), or add some other assertion that makes the chosen cast width observable.

alexbakharew and others added 2 commits September 9, 2026 22:15
A duplication audit found 15 of the new tests target features that
already have a dedicated test file, and one (05068) duplicated
03227_distinct_dynamic_types_json_paths. Rework per review guidance:

- Append each test's queries to the existing feature test. Existing
  queries and their expected output are untouched: every old .reference
  is a byte-identical prefix of the new one (verified for all 32 files).
- Delete the 15 standalone overlap tests and the duplicate 05068.
- Keep 05067 standalone: its host is a .j2 template, excluded from
  append-only rework.
- Keep 05079, 05082, 05084: no existing test covers those features.
- Re-measured every merge under the llvm-coverage-instrumented build;
  targeted-line hits match the original standalone tests.

Co-Authored-By: Claude Fable 5 <[email protected]>
The style check requires a no-parallel tag for SYSTEM DROP. The drops
are unnecessary: each streaming SELECT is the first read of a freshly
created table, so its marks are loaded cold either way.

Co-Authored-By: Claude Fable 5 <[email protected]>
ENGINE = MergeTree ORDER BY a;
INSERT INTO t_stream_wide_adaptive SELECT number, toString(number) FROM numbers(10000);
SELECT count(), sum(a) FROM t_stream_wide_adaptive SETTINGS use_streaming_marks_compression = 1;
SELECT count(), sum(a) FROM t_stream_wide_adaptive;

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 control query here is no longer independent from the use_streaming_marks_compression = 1 read above. MergeTreeMarksLoader::loadMarksSync goes through MarkCache::getOrSet, so after the first SELECT the decoded marks are already cached; this "baseline" reuses the same cached marks instead of calling the non-streaming loader at all. That means a streaming-only decode bug, or a regression in the plain loader hidden behind a warm cache, would still leave both queries green.

Please restore SYSTEM DROP MARK CACHE before each baseline read (and likewise in the other two sections) so the non-streaming side actually reloads marks from disk.

- 04133: the merge reintroduced groupArrayInsertAt()(...) with an empty
  parameter list, which the old analyzer rejects with BAD_ARGUMENTS
  before the argument type check. Drop the empty parens (same fix as
  the original standalone test). Verified: codes 43/128 in both modes.
- 04112: formatRow(... AS val) loses the alias on the old analyzer, so
  the BSON field is skipped as unknown and the ILLEGAL_COLUMN
  assertions never fire. Pin SET enable_analyzer = 1 at the start of
  the appended block. Verified: code 44 with the pin, silent success
  without it (reproduces the CI failure).

05054_nullable_key_todate_monotonicity also fails on this shard, but it
fails on 13 other PRs in the same shard this week — pre-existing
upstream issue, unrelated to this PR.

Co-Authored-By: Claude Fable 5 <[email protected]>

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok.

But we prepare adding new tests instead of modifying old ones. Reason - better analytics on test history.

@alexey-milovidov alexey-milovidov self-assigned this Sep 13, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 13, 2026
Merged via the queue into master with commit 0416298 Sep 13, 2026
174 checks passed
@alexey-milovidov
alexey-milovidov deleted the abakharew/llvm-agent-smoke-test branch September 13, 2026 07:26
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-testing Test content only (no production code). 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