Skip to content

Test that filtered multi-partition CAGRA search returns k neighbors for selective filters - #2967

Open
bdice wants to merge 1 commit into
NVIDIA:mainfrom
bdice:cagra-multi-partition-selective-filter-test
Open

bdice wants to merge 1 commit into
NVIDIA:mainfrom
bdice:cagra-multi-partition-selective-filter-test

Conversation

@bdice

@bdice bdice commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Adds AnnCagraMultiPartition.SelectiveFilterReturnsKNeighbors, a regression test for the multi-partition filtering-rate derivation added in #2582. Four partitions each keep ~4% of their rows; MULTI_CTA search with itopk_size = k must return k neighbors for every query, with recall >= 0.95. Without the rate derivation, 9-13 of 500 queries came back short at recall 0.92 (see #2799 and #2783).

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/cuvs
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: f18fd9a
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: fceec6d4-e963-43cd-bb84-55e9fbec91fd
Commits

Reviewing files that changed from the base of the PR and between f18fd9a and 4cebe58.

Files selected for processing: 1
  • cpp/tests/neighbors/ann_cagra/test_float_uint32_t.cu

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

📝 Summary

Summary by CodeRabbit

  • Tests
    • Expanded coverage for filtered nearest-neighbor searches across multiple partitions, checking that searches return the requested number of results and meet a minimum recall threshold. This helps verify result quality and consistency when only a subset of records is eligible.

Adds a test helper that builds four CAGRA partitions, applies per-partition filters, and runs filtered MULTI_CTA search. The test checks that all queries return k neighbors and that recall is at least 0.95.

Changes: Filtered multi-partition search

Layer / File(s) Summary
Build and validate filtered search
cpp/tests/neighbors/ann_cagra/test_float_uint32_t.cu
The helper builds four 500-row partitions and retains rows whose local index is divisible by 24. It runs filtered MULTI_CTA search, checks returned indices and filters, and computes recall against exact top-k results. The test asserts that no query returns fewer than k neighbors and that recall is at least 0.95.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related PRs

  • NVIDIA/cuvs#2956: Updates CAGRA recall checks and uses MULTI_CTA for small-query cases; this PR also tests MULTI_CTA behavior in filtered multi-partition search.

Suggested reviewers: cjnolet, achirkin

Merge Risk: Minimal · up to 4cebe

The duplicate-neighbor concern does not block merging. No actionable risk remains beyond normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: adding a regression test for filtered multi-partition CAGRA search.
Description check Passed The description directly explains the added regression test, its filtering scenario, expected behavior, recall threshold, and related issue context.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@bdice bdice mentioned this pull request Oct 29, 2026
16 of 22 tasks
rapids-bot Bot pushed a commit that referenced this pull request Oct 29, 2026
Caps topK in `TestCuVSGaps.testVectorSearchWithAlternatingDocuments` at the number of documents with vectors. Only even-numbered documents have vectors, so the test failed deterministically for seeds that index fewer vectors than topK (e.g. `BBE2A1CCC7772A7F`: 53 vectors, topK 59). #2709 fixed the same issue for the HNSW gaps test.

This PR originally also fixed the filtering rate in multi-partition CAGRA search (#2736). #2582 has since fixed that on `main`, and the regression test moved to #2967. Reproduction and verification: #2785 (see #2783).

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Igor Motov (https://github.com/imotov)

URL: #2799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cpp improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants