Tighten subset ordering contract coverage#179
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Code Review
This pull request documents and tests the behavior of duplicate candidate IDs in subset searches, clarifying that duplicate candidates are scored independently and can produce duplicate hits. It updates documentation across C, Go, Python, and Rust interfaces, and adds assertions in tests and fuzz targets to verify score-descending and document-ID-ascending ordering. A review comment suggests strengthening the tie-breaker assertion in the full-index search fuzz target to require strictly ascending document IDs, as full searches should not return duplicate IDs.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
CI follow-up after the first run:
Local validation after the fix: The AVX512 failure on the same run still appears to be the Intel SDE download 403, not a code regression. |
Review Summary by QodoFix visible RankQuant tie ordering after score offsets and strengthen contract coverage
WalkthroughsDescription• Fix visible RankQuant tie ordering after score offsets applied • Strengthen subset ordering contract coverage with full score-desc/doc-ID-asc assertions • Document duplicate-candidate behavior consistently across all language bindings • Add regression test for centre-offset visible-score tie ordering Diagramflowchart LR
A["Score offset applied<br/>before finalize"] -->|"finalize_with_score_offset_into"| B["Visible-score ties<br/>ordered by row ID"]
B -->|"full contract"| C["Score-desc/<br/>doc-ID-asc ordering"]
D["Fuzz targets &<br/>regression tests"] -->|"assert full ordering"| C
E["Documentation<br/>across bindings"] -->|"clarify duplicate<br/>candidate behavior"| F["Consistent contract<br/>specification"]
File Changes1. fuzz/fuzz_targets/search_rankquant.rs
|
Code Review by Qodo
1. Offset not used for TopK
|
|
Remediated the TopK offset boundary issue in What changed:
Validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ec4897bae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
3064191 to
cf7ae3e
Compare
e2ffc7f to
e34e012
Compare
cf7ae3e to
f92d771
Compare
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
e34e012 to
b0e91a9
Compare
Summary
Review notes
Review remediation found the earlier finalize-only offset approach was insufficient for TopK boundary eviction. The branch now applies the query-constant offset before TopK retention decisions and keeps final sorting on the already-visible score key.
Subset/two-stage duplicate-candidate assertions intentionally allow equal row IDs where duplicate candidates are documented; full-index fuzz assertions require strict doc-id increase on score ties.
Validation
cargo fmt --checkcbindgen ordvec-ffi --config ordvec-ffi/cbindgen.toml --output ordvec-ffi/include/ordvec.h --verifycargo test -p ordvec topk_score_offset_is_part_of_eviction_keycargo test -p ordvec --test determinism_contractcargo test -p ordvec --test index two_stagecargo test -p ordveccargo test -p ordvec-fficargo clippy --manifest-path fuzz/Cargo.toml --all-targets -- -D warningsenv GOCACHE=/tmp/ordvec-go-build go test -count=1 ./...fromordvec-goVIRTUAL_ENV=/home/ndspence/GitHub/ordvec/ordvec-python/.venv PATH=/home/ndspence/GitHub/ordvec/ordvec-python/.venv/bin:$PATH pytest ordvec-python/tests/test_rank_quant.py -qgit diff --check