Skip to content

fix(vector/index): segmented search/merge dedup, sealed-segment deletes, PQ min-train policy (#634 PR-2) #880

Description

@mosuka

PR-2 of the #634 segment-per-commit campaign (inert — fixes correctness holes in the unwired segmented machinery).

Scope

  • Newest-segment-wins dedup in multi-segment search: cross-segment duplicates of the same doc_id currently double-count (segmented_field.rs:500-521 does entry.score += hit.score)
  • Wire merge dedup: merge_vectors (newest-wins) is dead code (merge_engine.rs:245-266) — connect it to merge_segments
  • Sealed-segment deletes: SegmentedVectorField::delete_document silently no-ops for docs in sealed segments — route through the global DeletionBitmap + persist_deletions + set has_deletions on covering segments
  • PQ policy: k-means on a tiny segment is meaningless — min-train guard (small segments stay Scalar8Bit/f32), PQ trained at merge time from the lossless f32 sidecar (enhancement(vector/hnsw): merged-segment rerank sidecar is rebuilt from dequantized int8, not the source sidecars' original f32 #795)

Acceptance criteria

  • Red/green test per fix (disabling each fix fails its test)
  • WAL-replay-shaped same-doc_id upsert across segments returns the newest version exactly once
  • Sealed-segment delete is search-invisible after flush and survives merge

Refs #634

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions