Skip to content

fix: reject invalid MUVERA sizes - #827

Open
AryanRG wants to merge 1 commit into
qdrant:mainfrom
AryanRG:fix/muvera-parameter-validation
Open

AryanRG wants to merge 1 commit into
qdrant:mainfrom
AryanRG:fix/muvera-parameter-validation

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 16, 2026

Copy link
Copy Markdown

Summary

  • reject non-positive input dimensions, projection dimensions, and repetition counts during construction
  • prevent empty encodings and delayed NumPy failures from invalid MUVERA configurations
  • cover each invalid parameter with an offline regression

Validation

  • 59 focused and adjacent tests passed
  • added test passes Ruff lint and format checks
  • changed source passes Ruff after excluding the two findings already present on main
  • git diff --check passed
  • no model downloads were required

All Submissions

  • Followed the Contributing guidelines.
  • Checked open and closed issues and pull requests for the same change.

New-feature and new-model checklist items are not applicable to this bug fix.

@AryanRG
AryanRG requested a review from joein as a code owner October 16, 2026 18:08
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: abf30bfa-ebb6-49b8-b7a2-397934fafc05
📥 Commits

Reviewing files that changed from the base of the PR and between de502ca and 6df6958.

📒 Files selected for processing: 2
  • fastembed/postprocess/muvera.py
  • tests/test_postprocess.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.

📝 Walkthrough

The Muvera constructor now raises ValueError when dim, dim_proj, or r_reps is nonpositive. It retains the existing check that rejects dim_proj values greater than dim. The from_multivector_model documentation lists these validation cases. A parameterized test checks the three nonpositive input cases and their corresponding error messages.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 6df69

Muvera rejects nonpositive dimensions and repetition counts before projection setup. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: rejecting invalid MUVERA sizes.
Description check Passed The description directly explains the MUVERA validation changes, regression coverage, and validation results.
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.
  • Fix all pre-merge checks with AI
✨ 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

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant