Skip to content

fix: retain IVF-RQ batch parallelism and parse release TOML - #125

Merged
JingsongLi merged 1 commit into
apache:mainfrom
JingsongLi:codex/fix-stream-parallelism-release-toml
Nov 16, 2026
Merged

JingsongLi merged 1 commit into
apache:mainfrom
JingsongLi:codex/fix-stream-parallelism-release-toml

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Follow-up to #123.

Oversized IVF-RQ lists changed batch scans from parallel query execution to a single worker. The release preflight could also mistake a version example inside multiline TOML text for the actual Python project version.

Changes

  • Share each streamed IVF-RQ chunk across active query workers for top-K and range search. Keep heaps and statistics exclusive to each query, preserve error propagation, and avoid payload copies or duplicate reads.
  • Parse the actual TOML project version with tomllib/tomli, including comments and quoted values, rather than matching text with a regex. Install tomli conditionally for the Python 3.9 CI checks.
  • Add regressions for multiline README version examples, valid TOML quoting/comments, and parallel streaming scans. Use condition-variable coordination to make the worker check deterministic.

Validation

  • cargo test --workspace --no-fail-fast: 738 passed, 2 existing ignored.
  • Release/tool tests on real Python 3.9 and Python 3.13: 28 passed on each.
  • Clippy with warnings denied, Rust formatting, license headers, and binary legal inventory passed.
  • A synthetic partition above 64 MiB now uses four Rayon workers while sharing the same bounded reads. The new branch is tree-identical to the locally tested fixes.

@github-actions

Copy link
Copy Markdown

Benchmark run · success · attempt 1

Vector index benchmark

🟢 No alerts (5/5 indexes)

Index Recall@10 (Δ) Single QPS Δ Batch QPS Δ Status
IVF_FLAT 100.00% (+0.00 pp) -0.2% -0.0% 🟢 OK
IVF_SQ 99.26% (+0.00 pp) -1.0% -1.0% 🟢 OK
IVF_PQ 46.60% (+0.00 pp) -0.4% -0.1% 🟢 OK
IVF_RQ 90.91% (+0.00 pp) -2.5% -6.5% 🟢 OK
DISKANN 77.18% (+0.00 pp) -1.6% -1.8% 🟢 OK

🟡 QPS ↓ >10% or Recall ↓ >1pp · 🔴 QPS ↓ >20% or Recall ↓ >3pp. Advisory only; QPS is measured after warmup.

Absolute metrics & environment

Medians, base → PR. QPS is timed after warmup; P95 uses the first warm sweep.

Index Single QPS Batch QPS P95 (µs) Build (ms) Process RSS (MiB) Size (MiB)
IVF_FLAT 77,968.55 → 77,796.96 90,304.26 → 90,287.02 16.04 → 16.12 24.00 → 25.00 19.87 → 19.87 2.47 → 2.47
IVF_SQ 62,865.24 → 62,267.01 118,307.95 → 117,115.18 17.95 → 18.12 18.00 → 18.00 19.87 → 19.87 0.67 → 0.67
IVF_PQ 16,520.56 → 16,458.38 135,155.62 → 135,076.23 74.72 → 74.19 191.50 → 190.00 19.87 → 19.87 0.17 → 0.17
IVF_RQ 11,349.08 → 11,067.68 48,831.32 → 45,638.58 106.36 → 108.56 32.00 → 32.50 19.96 → 19.96 0.52 → 0.52
DISKANN 10,371.69 → 10,201.65 19,982.56 → 19,621.57 116.58 → 118.39 1,089.00 → 1,087.50 19.96 → 19.96 3.22 → 3.22

Base c2758d91d5a6f3de907ca92c80bfab9e54c50064 · PR merge 34a65886792c7d61d3758817046312dd5c2fb1e8
rustc 1.100.0 (0ef1bc386 2026-11-09) · Linux-7.0.0-1017-azure-x86_64-with-glibc2.39 · AMD EPYC 7763 64-Core Processor
6 samples/version/index, alternating execution order; 2 threads; 10k × 64D vectors; 2,048 queries; ≥1s per timed mode.
RSS is the process lifetime peak up to build completion, including dataset/ground truth.
Raw CSVs, sample ranges, workload settings and logs are in the workflow artifact.

@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.

LGTM. Reviewed head 281a3566f016726ddfd0c52715cfad09b49eb41a.

The streamed chunk remains shared and read-only while each top-K query retains exclusive access to its heap and statistics. Range-search workers propagate errors through try_for_each before advancing to the next chunk. The release preflight now reads the actual TOML project version; the Python 3.9 CI job installs the backport, and the release-preflight workflow uses Python 3.12 with built-in tomllib.

Independent validation:

  • cargo test --locked --workspace --no-fail-fast: 738 passed, 2 ignored.
  • Tool/release unit tests on Python 3.10: 28 passed.
  • Formatting, Clippy with warnings denied, source license headers, and binary legal inventory checks passed.
  • An additional temporary regression used a 67,714,854-byte list with the default streaming limits. Top-K and range results matched the full-read path; four Rayon workers participated. One-worker and four-worker streaming runs used the same 344 read calls across both searches, with a maximum request of 712,704 bytes.
  • An additional temporary regression confirmed that an invalid factor in a later streamed chunk propagates InvalidData from parallel range search.

No blocking issues found.

@JingsongLi
JingsongLi merged commit b8736bb into apache:main Nov 16, 2026
10 checks passed
JingsongLi added a commit that referenced this pull request Nov 16, 2026
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.

2 participants