Skip to content

test: cover weighted RRF scoring and dense-sparse query forwarding - #1600

Open
MIRS571 wants to merge 1 commit into
qdrant:devfrom
MIRS571:codex/test-weighted-rrf
Open

MIRS571 wants to merge 1 commit into
qdrant:devfrom
MIRS571:codex/test-weighted-rrf

Conversation

@MIRS571

@MIRS571 MIRS571 commented Oct 17, 2026

Copy link
Copy Markdown

Summary

Add deterministic offline regression coverage for weighted reciprocal rank fusion. Existing reranking tests exercise unweighted RRF, while conversion fixtures cover serialization of weights but not their effect on scores or their forwarding through a local query.

This is a tests-only contribution; it does not change runtime behavior or claim to fix a newly discovered bug.

  • Check weighted scores and accumulation for overlapping IDs with default/explicit/custom k and result limits.
  • Cover zero weight, an empty source without shifting weight alignment, and too few/too many weights.
  • Exercise the public local query_points API with dense and sparse prefetches. Reversing the source weights reverses their relative ranking; assert exact IDs, approximate scores and payloads.

Expected values follow Qdrant's weighted RRF formula, not the implementation under test. All vectors and ranks are fixed; no model calls or server are needed.

Validation

Python 3.11 on Windows, based on dev at 9f45d24:

  • New cases: 16 passed. Both touched test files: 28 passed.
  • Broader regression: 296 passed with:
    python -m pytest qdrant_client/hybrid/test_reranking.py qdrant_client/local/tests tests/conversions tests/test_in_memory.py tests/test_tracing.py tests/test_response_parsing.py tests/test_common.py -q
    
  • Sensitivity checks (temporary mutations, fully reverted): forcing every source weight to 1 caused 10 new cases to fail; dropping weights at the local query forwarding call caused both new public-API cases to fail.
  • Ruff check, format check (line length 99), applicable pre-commit hooks, and git diff --check passed. Hooks used the repository revisions with a local Python 3.11 interpreter override; the upstream configuration is unchanged.

Live REST/gRPC, the full repository suite and other Python versions were not run. No temporary mutations or private artifacts are included.

Submission checks

  • Targets dev.
  • Repository contribution guidance and PR template checked.
  • Searched all-state PRs for weighted RRF, weights in titles, and fusion tests; no matching coverage contribution found.
  • Tests and local checks pass.

@MIRS571
MIRS571 requested a review from joein as a code owner October 17, 2026 06:44
@netlify

netlify Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit ed2b248
🔍 Latest deploy log https://app.netlify.com/projects/poetic-froyo-8baba7/deploys/6ad3196161bc8e3c0d8ddd1d
😎 Deploy Preview https://deploy-preview-1600--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Oct 17, 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: ccdc20a1-7678-42be-93b2-080bf91f7547
📥 Commits

Reviewing files that changed from the base of the PR and between 9f45d24 and ed2b248.

📒 Files selected for processing: 2
  • qdrant_client/hybrid/test_reranking.py
  • tests/test_in_memory.py

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

📝 Walkthrough

The change adds tests for weighted reciprocal-rank fusion. The tests check scores and ordering across ranking-constant settings, result limits, zero weights, empty sources, and mismatched weight counts. In-memory tests also check weighted fusion of dense and sparse query results, including returned IDs, scores, and payloads.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to ed2b2

The added weighted-fusion tests are consistent with the implementation; no merge-blocking issue was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 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
Description check Passed The description clearly explains the tests for weighted RRF scoring and dense-sparse query forwarding. It includes scope, expected behavior, validation results, and test limitations.
Title check Passed The title concisely and accurately summarizes the main changes: weighted RRF scoring coverage and dense-sparse query forwarding tests.
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.

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