Skip to content

fix: merge colliding miniCOIL OOV sparse indices - #881

Merged
joein merged 3 commits into
qdrant:mainfrom
remote-controlled-man:codex/prflow-0b794484f406
Dec 2, 2026
Merged

joein merged 3 commits into
qdrant:mainfrom
remote-controlled-man:codex/prflow-0b794484f406

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

All Submissions:

  • Followed the contributing guidelines.
  • Checked existing issues and pull requests for the same change.

miniCOIL can produce duplicate sparse indices when two distinct out-of-vocabulary words hash to the same coordinate. For example, token49516 and token56101 collide with the current hash mapping. Both document and query conversion currently emit that index twice; Qdrant's in-memory client rejects the vector with ValueError: Indices must be unique.

Accumulate the weights at each OOV coordinate in both conversion paths. Keep the existing hash mapping, first-seen coordinate order, and int32/float32 output types. Noncolliding vocabulary and OOV coordinates retain their existing values.

Validation:

  • 10 offline converter cases pass, covering both conversion paths, reversed collision order, mixed known/OOV words, and empty/filtered inputs.
  • Running the same tests with the original converter gives 4 collision failures and 6 passing controls.
  • A Qdrant in-memory upsert and sparse query using the colliding words now succeed and return the expected dot-product score.
  • Ruff 0.3.4 lint and format checks pass for both changed files.

No model download, ONNX inference, live Qdrant server, or full model/platform suite was exercised locally; those broader checks remain with CI.

Prepared with OpenAI Codex assistance; the stated reproductions and checks were executed locally.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Document and query conversion now store sparse values by index, so each output index appears once. Document conversion sums TF weights when OOV tokens collide. Query conversion assigns a weight of 1.0 to a colliding index. Tests cover collisions, noncolliding coordinates, empty inputs, output dtypes, and MiniCOIL embeddings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to ff76c

This change fixes duplicate sparse indices when distinct out-of-vocabulary words collide, in both document and query conversion. The tests cover the changed behavior, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: merging colliding miniCOIL out-of-vocabulary sparse indices. The raw summary confirms that the converter now accumulates weights at each OOV index so that each index a…
Description check Passed The description states the problem: distinct OOV words hash to the same sparse coordinate, which produces duplicate indices and a Qdrant ValueError. It explains the fix (accumulating weights at each O…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: merging colliding miniCOIL out-of-vocabulary sparse indices. The raw summary confirms that the converter now accumulates weights at each OOV index so that each index appears once in the output. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description states the problem: distinct OOV words hash to the same sparse coordinate, which produces duplicate indices and a Qdrant ValueError. It explains the fix (accumulating weights at each OOV coordinate in both conversion paths) and lists the validation performed. This matches the file-level summaries and the PR objectives.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4e6056ce-8015-4913-b54d-78fbd3c10d1f
Commits

Reviewing files that changed from the base of the PR and between 2c9f2ac and ff76c42.

Files selected for processing: 1

  • tests/test_sparse_vectors_converter.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@joein
joein force-pushed the codex/prflow-0b794484f406 branch from 06b7d9f to c748263 Compare December 2, 2026 15:06
@joein

joein commented Dec 2, 2026

Copy link
Copy Markdown
Member

thanks for addressing this!

@joein
joein merged commit ac9ab5c into qdrant:main Dec 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants