Skip to content

perf(vector/search): parallelize SegmentFanoutSearcher's per-segment fan-out (#926) - #929

Merged
mosuka merged 1 commit into
mainfrom
perf/926-parallel-segment-fanout
Aug 1, 2026
Merged

perf(vector/search): parallelize SegmentFanoutSearcher's per-segment fan-out (#926)#929
mosuka merged 1 commit into
mainfrom
perf/926-parallel-segment-fanout

Conversation

@mosuka

@mosuka mosuka commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Runs SegmentFanoutSearcher::search's per-segment probes concurrently on native targets (spun off from the #683 triage; rebased on #927/#928, whose shared-basis rescore it parallelizes along with each probe).

Measured win

#683 probe fixture (10 segments, 20k vectors, dim 64, 100 queries, release, best of 3):

ef serial (post-#927) parallel speedup
50 61.1ms 25.4ms 2.4x
100 88.6ms 38.1ms 2.3x
200 128.1ms 54.6ms 2.3x

Recall identical within build-RNG noise. This more than pays back #927's rescore overhead — 25.4ms is ~37% below even the pre-#927 serial baseline (40.1ms). The gap to core count comes from tiered-merge segment-size skew (the largest segment dominates the critical path).

Tests

  • New segment_fanout_parallel_test.rs: repeated identical searches over a multi-segment fixture (stale duplicates + a deletion) return bit-identical results — parallel probing must not leak scheduling nondeterminism into the merged order.
  • Cross-segment correctness under the parallel path is pinned by bug(vector/search): cross-segment scores are not comparable — out-of-range queries clamp to similarity 1.0 per segment #927's segment_score_comparability_test.rs (its brute-force fixture now exercises the concurrent fan-out on native) and the Stage-2 interaction by vector_rerank_engine_test.rs — both green unchanged.
  • Single-segment indexes take the serial branch by construction, so no parallel-overhead regression is possible there.

Verification

  • cargo fmt --check and cargo clippy --all-targets -- -D warnings clean on stable and 1.97.0
  • cargo test -p laurus --lib: 1258 passed; --tests: all 64 binaries ok
  • wasm32 cargo check -p laurus-wasm --target wasm32-unknown-unknown: clean (serial fallback)

Closes #926. Spun off from the #683 triage; depends on #927 (merged as #928).

@mosuka
mosuka merged commit 32433a5 into main Aug 1, 2026
22 checks passed
@mosuka
mosuka deleted the perf/926-parallel-segment-fanout branch August 1, 2026 12:37
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.

perf(vector/search): parallelize SegmentFanoutSearcher's per-segment fan-out

1 participant