Skip to content

VectorIndex::build() infers dimensions from first item without validation #979

Closed

Description

@ajianaz

Problem

vector.rs:251-257 — build() uses items[0].1.len() as dimension but never validates that all items have the same dimension. If items have mismatched lengths, the index silently corrupts or panics at query time.

Fix

Add a validation pass: iterate items and assert/return error if any item.1.len() != dims.

Severity: MAJOR (silent data corruption)

Activity

  1. added
    bug
    scope:core
    on Aug 10, 2026
  2. ajianaz commented on Aug 10, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in #983 (merged to develop)

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

    bugscope:core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions