Skip to content

Vector: DDL accepts ternary/opq quantization — search paths reject the codecs they advertise #396

Description

@EnRaiha

Version / build tested against

origin/main @ e235fe5 (2026-09-29)

Deployment mode

Origin — single node (local)

Engine(s) involved

Vector

Summary

CREATE VECTOR INDEX ... quantization='ternary' | 'opq' is accepted by the DDL parser and implied by docs, but no query path serves these codecs: the rerank gating returns RerankError::BadInput, and the ANN path warns 'no match' then proceeds with the actual codec. Advertised capability is unreachable.

Steps to reproduce

CREATE a vector index with quantization = 'ternary' (accepted), then run any search using it — rerank gating errors BadInput; ANN path substitutes silently. (static verification at the pin; runtime repro pending)

Expected behavior

Either the codecs are served end-to-end, or DDL/docs reject them explicitly until implemented.

Actual behavior

Parser/docs advertise; gating rejects (BadInput); ANN warns and substitutes.

What actually happened? (severity facts)

  • Acknowledged/committed data was lost, corrupted, or silently wrong
  • The server crashed, hung, or failed to start
  • A security or isolation boundary was crossed
  • Core functionality is broken with no acceptable workaround
  • A workaround exists (use supported quantizations)

Proposed severity

SEV-3 — Medium: advertised feature unusable; workaround exists.

Reproducibility

Always — every attempt

Last known-good version / commit (if a regression)

(unknown / not a regression)

Environment & logs

Linux x86_64; Verified by static code reading at the pin above; runtime reproduction pending.
Code references:

  • (see prior-art line below)

Before submitting


Additional evidence (origin/main @ e235fe55c)

  • What: parse_quantization accepts "ternary"/"opq" (vector_primary.rs:430-431, listed in VALID_QUANTIZATIONS:21-23); docs/vectors.md and nodedb-codec/README.md list them as tiers. map_collection_quant returns RerankError::BadInput for both (gating.rs:141,147) and quantization_matches maps them to false (vector_search_ann.rs:75).
  • Where: nodedb-sql/src/ddl_ast/parse/vector_primary.rs:426-431; nodedb-vector/src/rerank/gating.rs:141,147; nodedb/src/data/executor/handlers/vector_search_ann.rs:75; docs/vectors.md:18,20,77,141,145; nodedb-codec/README.md:5.
  • Evidence: quotes above.
  • Impact: a user creates a collection/index with quantization='ternary' (accepted at DDL), then a search with the same hint fails with BadInput, or (via the SQL ANN hint path) silently proceeds with a different codec after a warning. The advertised capability is unreachable.
  • Fix (claim direction): remove ternary/opq from the parser grammar and docs until HNSW integration exists, or wire the codecs through end to end.
  • Prior-art: #25 (closed by PR [#27](fix(pgwire): wire quantization params through CREATE/ALTER VECTOR INDEX DDL #27)) made PQ reachable from SQL; it did not cover ternary/opq, which remain parser-accepted but unroutable. No open issue covers it.
    Why: users can declare quantization='ternary'|'opq' in DDL and read docs implying support, but no query path serves the codec (rerank gating returns BadInput; the ANN hint merely warns and proceeds with the actual codec).
    Steps to test: create an index with quantization = 'ternary', run any search -> rerank path errors BadInput (gating.rs); ANN path warns and substitutes. Either back the codecs or reject them at DDL.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions