refactor: OrdVec ontology rebrand#7
Conversation
Drop the redundant `Index` suffix from the public substrate types so they read as members of the ordvec family, and flatten the module layout to match: RankIndex -> Rank RankQuantIndex -> RankQuant BitmapIndex -> Bitmap SignBitmapIndex -> SignBitmap MultiBucketBitmapIndex -> MultiBucketBitmap (experimental) RankQuantFastscanIndex -> RankQuantFastscan (doc-hidden) - src/rank_index/ flattened into src/ (the `Rank` index type now lives in rank.rs beside the rank-math primitives). rank_io.rs / sign_bitmap.rs kept. - Deprecated `pub type *Index = *` aliases at the crate root keep external code compiling (with a deprecation warning); all internal code is on the new names (enforced by the -D warnings build). tests/deprecated_aliases.rs proves the aliases still resolve. - Method names and file magics (.tvr/.tvrq/.tvbm/.tvsb) unchanged. - Bump to 0.2.0 + CHANGELOG.
Review Summary by QodoRebrand ordvec ontology: drop Index suffix and flatten module layout for 0.2.0
WalkthroughsDescription• **Ontology rebrand**: Removes redundant Index suffix from all public types for cleaner API vocabulary (RankIndex → Rank, RankQuantIndex → RankQuant, BitmapIndex → Bitmap, SignBitmapIndex → SignBitmap, MultiBucketBitmapIndex → MultiBucketBitmap, RankQuantFastscanIndex → RankQuantFastscan) • **Module flattening**: Collapses src/rank_index/ into src/ root level, consolidating rank-cosine index logic into rank.rs alongside rank-math primitives; test structure reorganized from tests/rank_index/ to tests/index/ • **Backward compatibility**: Provides deprecated pub type *Index = *; aliases at crate root with deprecation warnings; internal code enforced to use new names via -D warnings build flag • **Verification**: Includes new smoke test file tests/deprecated_aliases.rs proving old names still compile; all 80+ tests pass with experimental features • **Version bump**: Incremented to 0.2.0 with comprehensive CHANGELOG entry documenting all breaking changes and migration path • **Documentation updates**: README, RANK_MODES.md, and ALTERNATIVES_CONSIDERED.md updated to reflect new type names and module layout Diagramflowchart LR
A["Old API<br/>RankIndex, RankQuantIndex<br/>BitmapIndex, SignBitmapIndex"] -->|"Rebrand"| B["New API<br/>Rank, RankQuant<br/>Bitmap, SignBitmap"]
C["src/rank_index/<br/>submodules"] -->|"Flatten"| D["src/<br/>root level"]
E["Deprecated aliases<br/>with warnings"] -->|"Backward compat"| F["External code<br/>keeps compiling"]
B --> G["0.2.0 release"]
D --> G
F --> G
File Changes1. examples/bench_rank.rs
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Code Review
This pull request rebrands the ordvec ontology by dropping the Index suffix from core types and renaming the rank_index module to index, while maintaining backward compatibility via deprecated aliases. The Rank struct now directly implements search logic. Feedback suggests optimizing the Spearman correlation calculation by precalculating centred ranks and adopting the more idiomatic copy_within for block moves in swap_remove.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e11f3af444
ℹ️ 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".
The rebrand bumped the package to 0.2.0 but the committed lockfile still recorded ordvec 0.1.0, so cargo publish --dry-run re-resolved and dirtied the working tree (the CI deps gate caught this). Sync the lock to the manifest; cargo build --locked and cargo publish --dry-run are now clean.
- Docs: the flatten removed the `index` module, but CHANGELOG / RANK_MODES / FOLLOWUP still referenced `ordvec::index::…`, `--test rank_index`, the `index.rs` test file, and `src/rank_index/bitmap.rs`. Repointed at the flat layout (qodo + codex findings). - rank.rs: Rank::swap_remove now uses `copy_within` for the block move instead of a manual loop — idiomatic + consistent with RankQuant::swap_remove (gemini). - ci.yml: `cargo publish --dry-run --locked` so the deps gate is deterministic and reports lock/manifest drift clearly instead of re-resolving the index. Deferred (gemini): the Spearman centre-drop optimization — tracked as a follow-up issue (enhancement, not a rebrand fix).
The flatten left a few src/index/ paths and rank_index-module references the
first remediation pass missed:
- RANK_MODES.md: src/index/{quant_kernels,fastscan}.rs -> src/{...}.rs.
- util.rs: 'rank_index family' / 'outside crate::rank_index' / the stale
sibling-module list -> the flat index modules; pub(crate) = crate-internal.
Left as-is (not stale): CHANGELOG's rename description, the rank_index_* test
function names, and the turbovec/src/rank_index.rs provenance note in fastscan.
Addresses the pre-merge review on PR #7 (OrdVec ontology rebrand): - CHANGELOG: narrow the back-compat claim. Root-level *Index aliases are retained as deprecated shims, but the ordvec::rank_index::* module path is removed by the flatten -- an accepted pre-release break (crate unpublished). The aliases are pub type (not pub use); add a Removed section. - rank_io.rs: the module owns four on-disk formats, not three -- add the .tvsb / SignBitmap (TVSB) entry; retitle "rank-mode" -> "ordinal/sign". - lib.rs: crate-root rustdoc said "Three substrate families" but lists four (Rank, RankQuant, Bitmap, SignBitmap). - RANK_MODES.md: fix the README cross-link anchor (#substrate-families -> #ordinal-index-family) after the README heading rename. No code or behaviour change. Gate: fmt + clippy -D warnings clean; tests 80 (default) / 87 (experimental) green.
docs: post-#7 cleanup — rank_io intra-doc links + CLAUDE.md status
OrdVec ontology rebrand
Drops the redundant
Indexsuffix so the public types read as members of theordvecfamily, and flattens the module layout to match. Pre-release polish — done now (private, pre-0.2) so the published vocabulary is clean before the paper points people at it.Public API
ordvec::RankIndexordvec::Rankordvec::RankQuantIndexordvec::RankQuantordvec::BitmapIndexordvec::Bitmapordvec::SignBitmapIndexordvec::SignBitmapordvec::MultiBucketBitmapIndex(experimental)ordvec::MultiBucketBitmapordvec::RankQuantFastscanIndex(doc-hidden)ordvec::RankQuantFastscanCompatibility
Deprecated
pub type *Index = *;aliases at the crate root — code importing the root names (use ordvec::RankIndex;) keeps compiling, with a deprecation warning pointing at the new name. Not preserved: the oldordvec::rank_index::*module path is removed by the flatten, so module-path imports (use ordvec::rank_index::RankQuantIndex;) must move to the crate-root names. That's an accepted pre-release break — the crate is unpublished (0.1.0 → 0.2.0), so there are no crates.io consumers, and the point of the rebrand is to retire that module path before the vocabulary is published. All internal code is on the new names, enforced: the-D warningsbuild fails on any internal use of a deprecated alias.tests/deprecated_aliases.rsproves the root aliases still resolve. (Validated:ordvec::RankIndexemitswarning: use of deprecated type alias ordvec::RankIndex: renamed to Rank.)Module layout
src/rank_index/flattened intosrc/— theRankindex type now lives inrank.rsbeside the rank-math primitives (ordvec::rankmodule +ordvec::Ranktype, the one defensible pair).tests/rank_index/→tests/index/.Deliberately unchanged
search_asymmetric*,top_m_candidates*,new,add,load,write) — already legible..tvr/.tvrq/.tvbm/.tvsb) — persistence formats, not branding; renaming would be pure compatibility harm.rank_io.rskept (not renamed toio.rs): it's the persistence module, not anIndex-branded type, and renaming would churn thefuzz/targets referencingordvec::rank_io::load_*for no ontology gain.Verification
RUSTFLAGS="-D warnings" cargo build(+--features experimental),clippy --all-targets --all-features -- -D warnings,cargo fmt --all --check— all cleancargo test80,--features experimental87 (+ the alias smoke test);cargo +1.89.0 build(MSRV);cargo build --locked*Indexname survives in realsrc/code (only the deprecated aliases, CHANGELOG note, smoke test, and historicaldocs/)0.2.0+ CHANGELOG