hex/ios/HEXShared
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 7e4ee0b483
iOS: Speech model in keyboard on by default for English, downloaded only where the keyboard can use it (#2390)
* iOS: Speech model in keyboard on by default for English, downloaded only where the keyboard can use it

What changed
- KeyboardParakeetSettings.isEnabled reads on unless the person turned it off (a stored value
  wins, so a switch turned off stays off). The switch shows off and disabled under 6 GB (isOn).
  When Parakeet is used is unchanged: English (V2) or the Multilingual model's language
  (Ultra), 6 GB or more, not with Two-language dictation, Apple's engine whenever the model
  isn't ready or doesn't fit, never the GPU, one chunk at a time.
- Automatic download (KeyboardParakeetDownload.hold): only for English dictation without
  Two-language dictation or the Multilingual model, once the keyboard has measured its own
  memory limit on this iPhone and it is at least KeyboardParakeetBudget.requiredLimit (the
  keyboard writes footprint + os_proc_available_memory to the App Group at each launch and
  posts a Darwin notification when it changed), on a connection that is neither expensive nor
  constrained (NWPathMonitor: not cellular, a personal hotspot or Low Data Mode), with 2 GB
  free. Checked at launch, when Hex comes to the front, when such a connection returns and
  when the keyboard reports its limit; an automatic download stops when the connection
  becomes expensive (its files resume). Turned on by hand (a stored true, also from the
  builds where it was off by default) it still downloads at once on any connection.
- The row: "For English. Uses about 700 MB, downloaded on Wi-Fi. Until then, the keyboard
  uses Apple's speech recognition." (464 MB download plus the keyboard's 234 MB compiled
  copy), and while it waits: "Downloads after you first use the Hex keyboard", "Downloads on
  Wi-Fi", "Downloads once the iPhone has 2 GB free", "Only for English dictation"; the
  keyboard's statuses are unchanged. Simplified Chinese for all; the old detail string is
  replaced. Still under Experiments.
- Moving a legacy Parakeet folder into the App Group forgets that model's compile record
  (ParakeetCompileRecord.forget): Core ML compiles moved files again (18 s for Ultra on an
  iPhone 17 Pro, measured), which the app showed as "Loading the speech model" with a quick
  estimate. Now V2 says it's optimizing for this iPhone with the first-load estimate, and
  Ultra gets ready beside the engine that dictates, as after its download.
- KeyboardParakeetBudget: one set of numbers for V2 and Ultra (Ultra's transcription rose
  9 MB in Hex's keyboard, under V2's 16 MB); required limit 96 MB for both (was 115 MB for
  Ultra, from the probe keyboard).
- The keyboard's log calls a load cold by its time (5 s or more) instead of a per-iOS-version
  record, which called real recompiles after a re-download "warm"; the record is removed.
- README updated.

Why
- Ryan: Parakeet V2 becomes the default for English dictation in the keyboard in the next
  TestFlight build, without anyone downloading 464 MB for a keyboard that can't use it.

Verified
- Studio simulator (iPhone 17 Pro, iOS 27.2, fresh), on origin/dev 962164fc: xcodebuild test,
  857 tests, 0 failures, 3 skipped. scripts/code-shape.py passes.
- iPhone 17 Pro, iOS 27.2, Release build installed over the previous one: the keyboard wrote
  its limit (177.0 MB) at its first open; the row shows the new detail; the first open after
  the update recompiled V2 (18.2 s, logged cold) and that dictation fell back to Apple's
  engine (0.42 s); switch off deleted the files and dictated with Apple (peak 56 MB, no
  Parakeet log lines); switch on by hand downloaded at once (30 s), the keyboard compiled it
  (15.1 s, cold) and a dictation with Hex force-quit ran on V2 (56 MB before, 71.7 MB peak,
  0.32 s for 9.9 s of audio); the row then said "Ready in the keyboard".
- Not yet on a phone: the automatic download from a never-set switch (needs a fresh install).

* iOS: the warm mic's default waits for the keyboard to load the multilingual model itself

What changed
- KeyboardSelfDictation.dictatesItself ended with KeyboardParakeetSettings.isEnabled ||
  !keyboardOpensHex. Written while isEnabled meant "turned on by hand"; with Speech model in
  keyboard on by default it said the keyboard dictates by itself for everyone whose language
  the Multilingual model takes, before the keyboard had that model loaded, so Keep mic warm
  defaulted to Off and hid while Dictate still opened Hex.
- Now the keyboard dictates that language itself only once it has the multilingual model
  loaded: the keyboard records which model its "ready" state is
  (KeyboardParakeetSettings.setKeyboardState(_:multilingual:), keyboardHasMultilingualModel),
  and dictatesItself asks that instead of the switch.

Why
- People whose language the Multilingual model takes keep their warm mic until the keyboard
  really dictates by itself (#2393's intent), with the switch on by default.

Verified
- KeyboardBridgeTests.testKeepMicWarmDefaultFollowsWhetherTheKeyboardDictatesItself gains the
  cases: on by default with only Hex having the model (15 minutes), the keyboard having V2
  ready (15 minutes), loading the multilingual model (15 minutes), having it ready (Off), and
  the switch turned off (15 minutes); its old assertion "only Hex loads the multilingual
  model" contradicts the old line with the switch unset.
- Studio simulator (iPhone 17 Pro, iOS 27.2, fresh) on this head, rebased on origin/dev
  bd8da457: xcodebuild test, 861 tests, 0 failures, 3 skipped. scripts/code-shape.py passes.

* iOS: the keyboard's Parakeet budget counts the recording at 91 MB, so it needs a 131 MB limit

What changed
- KeyboardParakeetBudget.recordingFootprint 56 MB -> 91 MB, so requiredLimit 96 MB -> 131 MB
  (V2 and Ultra alike). Both the keyboard's load and transcription guards and Hex's automatic
  download (KeyboardParakeetDownload.hold, keyboardTooSmall) use it.

Why
- 56 MB is a first dictation's recording. With the model loaded, over twenty dictations in one
  keyboard process on an iPhone 17 Pro, recordings started at 74.7-78.0 MB through the ninth
  and at 87.9-91.4 MB after (with Apple's speech recognition they stayed at 55.8-56.3 MB), so a
  96 MB requirement let in a keyboard whose limit is barely above what it records at. The
  iPhone 17 Pro's 177 MB still passes.

Verified
- DictationControllerTests: requiredLimit is 131 MB; a 100 MB keyboard neither loads the model
  nor gets it downloaded by itself; the 177 MB cases still pass.
- Studio simulator suite on the rebased head (see the PR).
2026-11-22 12:18:29 -05:00
..
FullKeyboard iOS keyboard: Experiments › Comma and period keys beside the space bar (#2392) 2026-11-22 12:11:21 -05:00
TypingLog iOS keyboard: remove the "Logging" mark; Record typing logs is only the switch (#2382) 2026-11-22 10:50:35 -05:00
AppleIntelligenceCleanupSettings.swift ios: optional Apple Intelligence transcript cleanup (experiment) (#1538) 2026-11-08 08:07:11 -05:00
AppleSpeechModule.swift iOS: a working dictation is never taken away by a guess, and no speech model check sits forever (#2371) 2026-11-22 08:56:10 -05:00
AppleSpeechTwoLanguage.swift iOS: two-language dictation experiment (#2348) 2026-11-22 04:58:27 -05:00
AudioSessionControlling.swift iOS: dictation picks the car's mic in CarPlay, and a warm session never holds call audio (#2179) 2026-11-21 07:21:46 -05:00
CleanupGuard.swift iOS: Clean up what I say keeps names, and is on by default (#2132) 2026-11-21 03:12:53 +00:00
CleanupReconstruction.swift iOS: clean up what I say with an on-device tagger (experiment) (#2023) 2026-11-20 01:29:41 +00:00
CleanupTagger.swift iOS keyboard: stale microphone errors clear, Hex key audio calls leave the main thread, counts read 1, 2, 3 (#2203) 2026-11-21 10:08:42 -05:00
CleanupTokenizer.swift iOS: clean up what I say with an on-device tagger (experiment) (#2023) 2026-11-20 01:29:41 +00:00
CustomVocabularySettings.swift ios: custom vocabulary experiment (#1547) 2026-11-08 12:15:00 -05:00
DictationCorrections.swift ios: learn dictation and typing fixes from edits (Learn how I type) (#2022) 2026-11-20 01:04:58 +00:00
DictationEditInference.swift ios: learn dictation and typing fixes from edits (Learn how I type) (#2022) 2026-11-20 01:04:58 +00:00
DictationEditTracker.swift ios: learn dictation and typing fixes from edits (Learn how I type) (#2022) 2026-11-20 01:04:58 +00:00
DictationLanguage.swift iOS: a working dictation is never taken away by a guess, and no speech model check sits forever (#2371) 2026-11-22 08:56:10 -05:00
DictationLanguageSwitch.swift iOS: add a Greeklish experiment for Greek dictation (#2366) 2026-11-22 08:51:48 -05:00
DictationPipeline.swift iOS: add a Greeklish experiment for Greek dictation (#2366) 2026-11-22 08:51:48 -05:00
DictationTranslation.swift iOS: Apple's on-device recognizer for older iPhones and languages Parakeet can't do, and iOS 18 translation (#2190) 2026-11-21 08:49:11 -05:00
DotScope.swift iOS: a tap after a swiped word starts the next word, and the Metal HUD stays off the home page (#2159) 2026-11-21 07:54:19 +00:00
DotScopeShader.metal fix(ios): eliminate handoff frame stalls and add overlapping ballistic swipe throw (t1153) (#757) 2026-10-31 22:14:22 -07:00
EmptyCapture.swift iOS: fix six TestFlight tester issues (audio error, leaked error text, Live Activity, haptics, capitals, push to talk) (#2035) 2026-11-20 13:21:16 +00:00
FrenchSpacing.swift iOS: French spacing in dictation, and a second language no longer hurts English autocorrect (#2186) 2026-11-21 08:37:33 -05:00
GreeklishRomanizer.swift iOS: add a Greeklish experiment for Greek dictation (#2366) 2026-11-22 08:51:48 -05:00
HexTheme.swift fix(ios): eliminate handoff frame stalls and add overlapping ballistic swipe throw (t1153) (#757) 2026-10-31 22:14:22 -07:00
HinglishLexicon.swift iOS: Hinglish dictation, Hindi in Latin letters (Experiment, off by default) (#2119) 2026-11-21 00:29:24 +00:00
HinglishRomanizer.swift iOS: Hinglish dictation, Hindi in Latin letters (Experiment, off by default) (#2119) 2026-11-21 00:29:24 +00:00
HomeSwipeCue.swift iOS: a tap after a swiped word starts the next word, and the Metal HUD stays off the home page (#2159) 2026-11-21 07:54:19 +00:00
KeyboardBridge.swift iOS: Keep mic warm defaults to Off and hides where the keyboard dictates by itself (#2393) 2026-11-22 11:58:48 -05:00
KeyboardParakeetSettings.swift iOS: Speech model in keyboard on by default for English, downloaded only where the keyboard can use it (#2390) 2026-11-22 12:18:29 -05:00
KeyboardSelfDictation.swift iOS: Speech model in keyboard on by default for English, downloaded only where the keyboard can use it (#2390) 2026-11-22 12:18:29 -05:00
KeyboardsOnScreen.swift iOS keyboard: stop leaking views, capture web views, and emoji indices across shows (#2352) 2026-11-22 06:45:38 -05:00
KeyboardSurface+ViewModel.swift iOS keyboard: remove the "Logging" mark; Record typing logs is only the switch (#2382) 2026-11-22 10:50:35 -05:00
KeyboardSurface.swift iOS keyboard: remove the "Logging" mark; Record typing logs is only the switch (#2382) 2026-11-22 10:50:35 -05:00
KeyboardSwitchGuess.swift iOS: the dictation bar can start dictating by itself (Auto-start: never, on switch, always) (#2267) 2026-11-21 17:08:50 -05:00
MicrophoneChoice.swift iOS: plainer interface wording (copy pass) (#2345) 2026-11-22 03:45:00 -05:00
MultilingualParakeetSettings.swift iOS: the multilingual model experiment never takes dictation away; its download says what it's doing and recovers (#2337) 2026-11-22 02:25:14 -05:00
SpeechModelInstall.swift iOS: a working dictation is never taken away by a guess, and no speech model check sits forever (#2371) 2026-11-22 08:56:10 -05:00
SpeechModelStore.swift iOS: Experiments › Speech model in keyboard: Parakeet in the keyboard, with the app closed (off by default) (#2381) 2026-11-22 10:44:16 -05:00
SpokenCleanupRules.swift iOS keyboard: stale microphone errors clear, Hex key audio calls leave the main thread, counts read 1, 2, 3 (#2203) 2026-11-21 10:08:42 -05:00
SpokenLists.swift iOS: format dictated lists, and write out gonna and wanna (#2131) 2026-11-21 03:01:16 +00:00
SpokenPunctuation.swift iOS: spoken punctuation in dictation (#2198) 2026-11-21 09:31:47 -05:00
TranscriptFormatter.swift iOS dictation: no spaces or stray full stops around Chinese and Japanese; the bar's emoji panel says Back (#2347) 2026-11-22 03:47:53 -05:00
TwoLanguageDictationSettings.swift iOS: two-language dictation experiment (#2348) 2026-11-22 04:58:27 -05:00
TwoLanguageMerge.swift iOS: two-language dictation experiment (#2348) 2026-11-22 04:58:27 -05:00
UserFacingError.swift iOS: fewer paste prompts, and a translate switch in the keyboard (#2134) 2026-11-21 03:24:58 +00:00
VocabularySpelling.swift ios: custom vocabulary experiment (#1547) 2026-11-08 12:15:00 -05:00