Repository navigation
Add negative-case tests for the Quantized vector codec - #111084
alexey-milovidov merged 1 commit into
Conversation
Internal second-model review — adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 findings; bounded: 1 full pass + 1 fix round + 1 delta recheck).
Severity: ❌ blocker / Session id: cron:clickhouse-author-slot-0:20260720-131501 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-0:20260720-131501 |
|
cc @shankar-iyer — could you review this? It adds the negative-case coverage requested by @ egor-click on #108565: the Quantized vector codec's DDL type rejection (non-Array and non-float-element columns, codec chaining) and write-time length check, plus an Array(BFloat16) two-stage-vs-exact case for the coarse-storage scenario. Test-only. |
|
Workflow [PR], commit [68374b6] Summary: ✅ AI ReviewSummaryThe current diff adds one new stateless test, Missing context / blind spots
Final Verdict✅ No inline review findings on the current code. After updating the PR description to match the one-test diff, this looks ready from a code-review standpoint. |
| @@ -0,0 +1,81 @@ | |||
| -- Tags: no-parallel-replicas | |||
There was a problem hiding this comment.
This is a strange test. It does run statements but we are not testing an edge case here. In fact, what is asserted here (scan result of a brute-force scan on a bf16 column equals the scan result of a 2-step scan against br16 column with int8 quantization) is actually numerically unstable. Suggest to remove the entire test.
|
@groeneai Make a docs PR which adds the Quantized codec to https://clickhouse.com/docs/sql-reference/statements/create/table#encryption-codecs. |
Cover the Quantized(...) codec error surface (feature added in ClickHouse#108565), requested by egor-click: - 02354_vector_search_quantize_codec_negative.sql: DDL-time ILLEGAL_COLUMN for non-Array and non-float-element columns, DDL-time BAD_ARGUMENTS for chaining with a compression codec, and write-time SIZES_OF_ARRAYS_DONT_MATCH for a vector length that differs from the declared dimensions. Co-Authored-By: Claude Opus 4.8 <[email protected]>
38d49ed to
68374b6
Compare
|
Done, thanks.
|
…antize-codec-negative-tests Add negative-case tests for the Quantized vector codec
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Adds negative-case coverage for the
Quantized(...)vector column codec (#108565), requested by @egor-click on that PR. Test-only, no source change.Two new stateless tests:
02354_vector_search_quantize_codec_negative.sql: the codec's error surface, all SQL-observable.ILLEGAL_COLUMN: the codec is only valid onArray(Float32|Float64|BFloat16), so a non-Array column,Array(Int32),Array(String),Array(Nullable(Float32))andArray(LowCardinality(Float32))are rejected atCREATE TABLE.BAD_ARGUMENTS:Quantized(...)is a NONE-category codec and cannot be chained with a compression codec.SIZES_OF_ARRAYS_DONT_MATCH: a vector whose length differs from the declareddimensions(short, empty, or a mixed-length block) is rejected onINSERT.02354_vector_search_quantize_codec_bf16_precision.sql: storesArray(BFloat16)and runs the two-stagevector_search_use_quantized_codespath. This covers the coarse-storage case (the existing two-stage tests all storeArray(Float32)): the shortlist is rescored against the stored BFloat16 vectors, so the final top-k still matches an exact BFloat16 brute-force scan.Version info
26.8.1.136(included in26.8and later)