perf(vectors): bump cocoindex 1.0.7→1.0.16; fix mount_table_target API#423
Merged
Conversation
Bump the vector trio to stay current and close an install-drift: a fresh `pip install` resolved to cocoindex 1.0.11 (our lancedb<0.31 cap blocks 1.0.15+, which requires lancedb>=0.34), so dev/CI/new users sat on different versions. Pin cocoindex>=1.0.15 (+ lancedb>=0.34, pyarrow<26, rich<16). cocoindex 1.0.16 removed lancedb.mount_table_target(num_transactions_before_optimize=...): optimize is now inline + stats-driven (_RowHandler._maybe_optimize), so the old background-optimize / Deletes race (lancedb#1504) is gone. Drop the kwarg + the _NUM_TXN_BEFORE_OPTIMIZE disable constant; lance_optimize.py still runs a final serialized compaction. Measured on Shopizer (1210 files / 3475 chunks): bulk reprocess vectors 27.5s→23.5s (~15%). No-change / 1-file increments unchanged. The single- component loop is retained — mount_each was benchmarked and rejected (#380, closed wontfix). Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bump the vector trio (cocoindex 1.0.7 → 1.0.16, cascading to lancedb 0.30 → 0.34, pyarrow 23 → 25, rich 14 → 15) and keep the single-component loop. This is the "cocoindex-bump-only" follow-up that came out of investigating #380 (which was closed as wontfix —
mount_eachwas benchmarked and rejected).Why
cocoindex>=1.0.7,<2+lancedb>=0.25.3,<0.31. Because cocoindex 1.0.15+ requireslancedb>=0.34, a freshpip installtoday resolves to cocoindex 1.0.11, not 1.0.7 — so dev machines (1.0.7), CI, and new users could all sit on different versions. Pinning explicitly forward removes that ambiguity.id, so low-risk, but it's a correctness guard).The required API fix
cocoindex 1.0.16 removed
lancedb.mount_table_target(num_transactions_before_optimize=…). Optimize is now inline + stats-driven (_RowHandler._maybe_optimize/_evaluate_optimize— compacts only when small fragments accumulate, inside the merge_insert commit path). That replaces the old 1.0.7 background asyncio optimize that raced concurrent Deletes (lancedb#1504), which we previously disabled vianum_transactions_before_optimize=10**12.So this PR:
num_transactions_before_optimizekwarg from the 3mount_table_targetcalls and removes the now-unused_NUM_TXN_BEFORE_OPTIMIZEconstant + rewrites its comment.lance_optimize.pydocstring (the race it described is gone; the module still runs a final serialized compaction + scalar/FTS index build — now a harmless double-pass with cocoindex's inline optimize).mount_each(the loop is retained — see perf(vectors): adopt cocoindex native cross-component batching (#2219) when available; revert single-component loop #380).Benchmark (Shopizer, 1210 Java files / 3475 chunks)
(Methodology and the full 3-config attribution — including the rejected
mount_eachvariant — are in the #380 thread.)Test notes
Full local run on cocoindex 1.0.16 (Shopizer-scale fixtures):
test_java_codebase_rag_cli.pytests that exercise the CLI/lifecycle paths.test_lancedb_e2e.py): 2/3 pass. The 1 failure (test_lancedb_ignore_file_reduces_indexed_java_files) is pre-existing — it fails identically on cocoindex 1.0.7 (the.java-codebase-rag/ignoreexclusion isn't applied at the walk matcher; orthogonal to the vector trio).test_mcp_hints.pybut only withJAVA_CODEBASE_RAG_RUN_HEAVY=1, and it is pre-existing — the identical crash reproduces onmaster+ cocoindex 1.0.7 (same test, sameFatal Python error: Segmentation fault). It's a test-env issue (C-extension interaction during the heavy e2e run), not introduced by this bump. Worth filing separately.ruff checkclean;uv pip checkclean (90 packages, no conflicts).🤖 Generated with Claude Code