Repository navigation
Use dedicated lookup for word predictions - #820
Merged
Merged
Conversation
added 2 commits
September 21, 2026 12:38
Replace runtime SQLite with a reproducible ranked binary lookup loaded once per worker. Validate artifact bounds, references, ordering and checksum; preserve prediction ranking and buffered context safeguards. Retain SQLite only for conversion and parity tests, and verify generated resources in CI.
Measure the packaged worker through Launch Services to preserve Accessibility identity and record startup, batched query time and sampled memory without injecting input.
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.
Replace runtime SQLite prediction queries with a dedicated ranked lookup loaded once in the existing worker. The lookup preserves the same ordered suggestions and buffered-context behaviour; SQLite remains only in conversion and test tooling. The app packages the generated lookup, with version, checksum, bounds, reference and ordering validation.
The conversion tool reproduces the artifact from the original database, and CI checks it on both platforms. Missing or malformed data uses the existing prediction-unavailable state without disabling keyboard typing. No setting, BLE, scan timing or worker deadline changes.
Closes #819.
Validation:
8c49f6f.I would like waterinsertion in TextEdit; buffer-only fixture produced exactwas. Unchanged suggestions retained the selected tile. File bytes were checked after insertion.windowNotFoundAtPositionfor the Parallels window on a secondary display. Worker validation passed, but Windows switch-driven insertion and buffer-only UI tests are not claimed. The user explicitly requested merging with this outstanding limitation on 21 September 2026.Native measurements (startup includes loading and first response, not just database lookup):
Memory metrics differ between platforms. Mac batch timing includes native reads and file polling and is not an individual-query distribution. Windows measurements include native caret reads and IPC. Windows used an optimised development manifest; release packaging is checked by CI.
Reproduce with the packaged app and disposable editor focused:
Raw Mac result:
{"firstResponseMs":730.247625,"firstSuggestionsMs":730.2637919999997,"count":100,"matched":99,"maxSampledRssBytes":147521536,"warmBatchMeanObservedMs":1.5878800505050443,"elapsedMs":928.0670839999993}Raw Windows result:
{"app":"windows-editor","firstResponseFromSpawnMs":1114.4775410000002,"firstSuggestionsFromSpawnMs":1155.8870829999996,"memoryBytes":129069056,"memoryMetric":"peakWorkingSetBytes","successfulSamples":100,"unsupported":1,"failures":0,"fixtureMatches":100,"firstRequestMs":1084.47,"medianMs":16.76,"p95Ms":31.55,"maximumMs":43.25}The initial unsupported response is buffer seeding; subsequent requests returned candidates. No input is injected by these measurement helpers.