feat(neural): wire the LSTM engine into candidates (opt-in)#33
Open
mkpoli wants to merge 1 commit into
Open
Conversation
Adds suggestions.engine = "ngram" (default) | "neural". When neural is selected and the model is bundled, the candidate window is driven by the LSTM with full recent-sentence context; otherwise (and as a fallback when the model is absent) the n-gram engine is used unchanged. Opt-in default means the shipped experience can't regress. - config: Engine enum + suggestions.engine (default Ngram). - text_service: committed_words — a sliding window (≤40) of recent committed words, the neural engine's context; cleared on deactivation. - composition: commit() appends to it; refresh_candidates() streams the LSTM over BOS + the window, ranks prefix completions by full-context logits, and builds the list via CandidateList::from_words. Falls back to n-gram if global() is None. - candidates: from_words(typed, completions, max) constructor (+ test). - neural: bos() accessor. Clippy -D warnings clean (Windows target); candidate + from_words tests green via host harness.⚠️ Needs a Windows run to verify the in-IME behaviour and per-keystroke latency. The neural KSR win (+7 over n-gram) is proven offline; this lands the on-device path to realize it.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
The final deployment step — puts the proven neural model on the on-device path.
Adds
suggestions.engine = "ngram"(default) |"neural". Withneuralselected and the model bundled, the candidate window is driven by the LSTM with full recent-sentence context; otherwise — and as a fallback when the model is absent — the n-gram engine runs unchanged. Opt-in default ⇒ the shipped experience can't regress.config:Engineenum +suggestions.engine.text_service:committed_words— a sliding window (≤40) of recent committed words (the neural context); cleared on deactivation.composition:commit()appends to it;refresh_candidates()streams the LSTM overBOS + window, ranks prefix completions by full-context logits, builds the list viaCandidateList::from_words; falls back to n-gram ifneural::global()isNone.candidates:from_words(...)constructor (+ test).neural:bos().Clippy
-D warningsclean (Windows target); candidate/from_wordstests green via host harness.Stack:
feat/neural-export(int8 lstm.bin) →feat/neural-rs(module) → this. Merge in that order. Note: this addssuggestions.engine; when it lands alongside the self-documenting-config PR (#32),to_documented_toml+ its test must be updated to include the new field (trivial follow-up).