NVIDIA / NVIDIA/cuvs

[BUG] Lucene: defer vector-format dependency initialization until use

Open
#2,614 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Cuda
Stars
854
Forks
236
Avg merge
3d 3h
Merged PRs (30d)
62

Description

Problem

Several cuvs-lucene KnnVectorsFormat providers resolve optional/version-specific implementations in eager static initializers. Lucene SPI discovery instantiates registered providers, so one initialization failure can poison unrelated codec resolution with ExceptionInInitializerError.

Proposed change
  • Defer provider and flat-format construction until fieldsReader or fieldsWriter is used.
  • Safely publish cached instances.
  • Preserve the original failure as the cause.
  • Add fresh-JVM SPI enumeration and side-effect-free construction coverage.

Keep public names, defaults, and persisted formats unchanged. In particular, the existing binary-quantized provider must retain its released legacy flat-vector layout until migration support is implemented separately.

Related to #2512.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue points to cuvs-lucene KnnVectorsFormat providers and their fieldsReader/fieldsWriter paths; begin by tracing eager static initialization and Lucene SPI enumeration in a fresh JVM. Done means construction is side-effect-free, failures remain causes, names, defaults, and persisted formats stay unchanged, and coverage exercises SPI enumeration plus both use paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.