Skip to content

[Build] Upgrade paimon-vindex-core to 0.6.0 - #1502

Merged
JingsongLi merged 3 commits into
apache:mainfrom
JingsongLi:codex/upgrade-vector-index-060
Nov 23, 2026
Merged

JingsongLi merged 3 commits into
apache:mainfrom
JingsongLi:codex/upgrade-vector-index-060

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Use the published Apache Paimon Vector Index 0.6.0 release in Rust.

Brief change log

  • Bump paimon-vindex-core in the core crate and the C and Python bindings. Refresh Cargo.lock and the generated dependency inventories.
  • Disable the new IVF-Flat partition cache in tests that use file reads to measure list reuse and chunking within a batch. Preserve the result and I/O assertions.
  • Use CentroidRouter for training output, shard assignment, nearest-centroid lookup, and PVROUT01 encoding and decoding. Write the Paimon envelope and native payload in order through the same output stream.

Tests

  • cargo test --locked -p paimon --lib -- vindex:: centroid vindex_index_build_builder — 251 passed, 1 ignored (manual benchmark). Coverage includes Java-written centroid files, joint probing, and Bitmap filtering.
  • cargo check --locked -p paimon-c -p pypaimon_rust
  • cargo check --locked -p paimon-c --tests
  • cargo tree --locked -i paimon-vindex-core resolves the core and both bindings to 0.6.0.
  • cargo deny --locked --all-features check --warn unmaintained advisories licenses
  • python3 scripts/dependencies.py verify
  • python3 scripts/release_licenses.py --check

API and Format

Paimon writes the existing PAIMCENT descriptor and JSON envelope around the library's PVROUT01 payload. The library applies its 0.6.0 router metadata size bound.

Documentation

Regenerated the dependency inventories for the binary distributions.

@XiaoHongbo-Hope

Copy link
Copy Markdown
Contributor

+1

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full diff at head 11917a4 against main (19 files, +108/-175; branch is up to date with main), cross-checked against the published paimon-vector-index v0.6.0 sources (core/src/index/router.rs, core/src/kmeans.rs) and the release notes (RC4, crates.io / Maven Central / PyPI artifacts all live).

Core / generic semantics touched (flagging per review policy):

  • Dependency bump paimon-vindex-core 0.5.0 -> 0.6.0 in the core crate and the C/Python bindings, with Cargo.lock and all generated DEPENDENCIES inventories refreshed consistently.
  • Centroid routing (centroid_index.rs) delegates to the library CentroidRouter: the hand-rolled PVROUT01 encode/decode, nearest/assign scans, and the 512 MiB centers bound are replaced by the library serializer, find_nearest_centroids, assign_centroid, and MAX_SERIALIZED_BYTES. The Paimon PAIMCENT descriptor and JSON envelope are unchanged; envelope and native payload are now written sequentially through one output stream (Vec<Bytes> parts) instead of one concatenated buffer.
  • Training plumbing: train_spilled_model / SpilledVectors::train_router return VectorIndexTraining and the router is built via CentroidRouter::from_training, matching the 0.6.0 trainer API split.
  • Reader tests disable the new 0.6.0 IVF-Flat partition cache (vindex.reader.memory-budget-bytes=0) only in the tests that count file reads to measure within-batch list reuse and chunking; result and I/O assertions are preserved.

What I verified:

  • Wire compatibility: the library serialize/deserialize use the identical PVROUT01 header (magic, LE dimension/nlist/metric, LE f32 centers) that the removed Rust code wrote, so Java-written and previously Rust-written router files load unchanged; the envelope checks (version, shard mode, model ID) and the manifest nlist cross-check are retained. Reading the metric from payload offset 16 after library validation is safe (header is at least 20 bytes and the metric code is validated by the library).
  • Ordering semantics: find_topk_checked sorts by distance then centroid index, identical to the removed total_cmp + index tie-break; cosine queries are normalized before Euclidean coarse assignment, and inner-product routing still uses the L2 training space, as before. Requesting explicit_width.unwrap_or(nlist) nearest centroids returns the full ordered list (nprobe is clamped to nlist), so the widening loop can still slice progressively wider prefixes; zero-width routes skip the call entirely.
  • Non-finite query coordinates and distances still fail loudly through the library validation; the size pre-check before allocation now uses the library bound.
  • The joint-probe test builds its router through real training (VectorIndexTrainer + from_training) and the shared envelope encoder, exercising the same write path as production; Java-written centroid file tests, joint probing, and Bitmap filtering all pass (251 tests per the PR body).

No findings. CI is fully green at this head (15/15 checks).

@JingsongLi
JingsongLi merged commit c4045ac into apache:main Nov 23, 2026
15 checks passed
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.

3 participants