You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: merge colliding miniCOIL OOV sparse indices - #881
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.
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
miniCOIL can produce duplicate sparse indices when two distinct out-of-vocabulary words hash to the same coordinate. For example,
token49516andtoken56101collide with the current hash mapping. Both document and query conversion currently emit that index twice; Qdrant's in-memory client rejects the vector withValueError: 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:
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.