perf: speed up semantic index preparation - #10
Merged
aldegad merged 2 commits intoAug 12, 2026
Conversation
thisisjun786
marked this pull request as ready for review
August 10, 2026 02:42
aldegad
requested changes
Aug 11, 2026
aldegad
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the focused indexing work. The implementation and the pinned local checks look good. Before merge, please remove docs/superpowers/plans/2026-08-10-katok-index-bulk-loader.md, rebase onto the latest main, and rerun the repository CI. The submitted change should contain the implementation, tests, and user-facing documentation only.
aldegad
force-pushed
the
codex/katok-index-bulk-loader
branch
from
August 12, 2026 06:58
e475e7e to
6ee94e7
Compare
aldegad
approved these changes
Aug 12, 2026
aldegad
left a comment
Collaborator
There was a problem hiding this comment.
Requested changes are complete: the repository-only plan document is gone, the branch is rebuilt directly on the latest main, and the pinned CI workflow passes. I also verified the atomic semantic generation and stale/orphan recovery contracts against the new bulk preparation path using synthetic fixtures only.
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
COUNT(*)instead of materializing every chunk through the N+1 hydration pathWhy
katok indexpreviously calledall_chunks()only to computecandidate_chunks. Each chunk was then hydrated through several point queries, so index startup scaled as multiple SQLite reads per micro-chunk before any semantic output was written. Parent windows and stored vector metadata also used point-query loops.The implementation keeps SQLite single-connection and single-writer behavior, loads immutable snapshots in bulk, and uses Rayon only after the data is owned in memory.
Verification
cargo +1.91.0 fmt --all -- --check- passedcargo +1.91.0 clippy --all-targets -- -D warnings- passedKATOK_EMBEDDER=local-test cargo +1.91.0 test --all-targets- passed, 170 testscargo +1.91.0 publish --dry-run- passed; upload correctly aborted because this was a dry runpython3 scripts/verify_release_config.py- passed31572087100- passedSynthetic benchmark
All measurements used generated rows and a temporary synthetic SQLite archive. No KakaoTalk archive or message content was used.
upstream/mainmedians across three runs: 51,461 / 54,340 / 55,572 usPrivacy boundary
Tests and benchmarks use synthetic fixtures only. No real KakaoTalk database, messages, semantic documents, embeddings, or derived private data are included in this branch.