Repository navigation
refactor(embed): the code model is the only embedding; the vector signal is off without it - #755
Merged
Merged
Conversation
…nal is off without it Remove the hashing and pretrained backends, the pretrained-embed feature, the vendored nomic token table and its extraction script. brain.embedding is auto or off. A zero query or symbol vector no longer panics vecq. Closes #751.
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.
What
src/embed/tokens.rs,token_vocab.rs, thepretrained-embedfeature, the 31 MBvendored/nomic/table,scripts/extract_code_tokens.pyand the vector weights table.Backendis nowPotionorOff. When the model is not available (offline before the first download,CORA_EMBED_OFFLINE=1,brain.embedding: off) no vectors are built,cora brainanswers from keyword and call-graph signals, and saysvector signal is off (the code embedding model is not available).brain.embeddingisautooroff.potionstill loads (=auto);hashingandpretrainedload, meanautoand print one warning.THIRD_PARTY.md(now the potion model) and the changelog updated.Why
Measured on 1,639 queries, the fallbacks were neutral on this repository and harmful elsewhere (down to -0.09 MRR@10) when fused with keyword search; the code model is the only embedding that helps. Keeping them cost maintenance, a build feature and 31 MB of vendored data for a signal that is better off than weak. Closes #751.
Testing
cargo fmt --all -- --check,cargo clippy --all-targets --features tree-sitter -- -D warnings,cargo test --features tree-sitterpass locally.embedding: offbuilds nothing;embedding: hashingwarns and still uses the model. Unit tests for the off warning and for zero and non-finite vectors.Generated by Claude Code