hex/docs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 44da50a07a
Android keyboard: Adaptive touch (Labs, off by default) (#2790)
* Android typing: Adaptive touch's averages, labels and guarded decoder hook (not wired to the keys yet)

What: the core of Labs › Keyboard › Adaptive touch for Hex for Android, ported
from iPhone's Experiment (#2146), behind nothing yet: no setting, storage or
keyboard wiring reads it in this commit.

- typing/AdaptiveTouchModel.kt: TouchPlane (a letters page's keycaps, touch
  cells, rows and pitch, hashed into a plane key) and AdaptiveTouchModel with
  iPhone's numbers: 4 rotating bins of 200 labelled taps, 8 contexts of up to
  40 keys, priors 20 / 50 / 40, offsets within 0.3 keycap moving at most 0.05
  per promotion, in use only after 400 labels over 3 sessions. Always 23,588
  bytes, with its own magic ("HXAA"); no letters, words, times or tap order.
- typing/AdaptiveTouchLabels.kt: iPhone's label rules (words that stood,
  same-length picks, words kept over a fix, erased letters retyped as a
  neighbour; never an autocorrection), plus untapped() for held accents.
- typing/AdaptiveTouch.kt: the learner: a personal KeyGrid for the decoder,
  the per-axis fit check that falls back to the drawn centres, two grips per
  key plane, the label events, and save and reset hooks.
- TypingWord keeps each tap read on the drawn keys beside the personal one.
  Space corrects a word only when the drawn centres would correct it too, and
  puts in their reading unless the personal one also clears their margin;
  joins, and the word kept for the next one's revision, read the drawn taps.
  Without Adaptive touch both lists hold the same taps.
- SpatialDecoder: KeyGrid carries the plane and keeps the drawn bottom row
  when centres move; replaces() (iOS TypingDecoder.replaces) scores one
  reading against the spelling as typed.

Why: a tester asked for iPhone's adaptive touch on Android. The guard is
stricter than iPhone's: in the typing gate its margin check alone let a
reading the drawn centres never consider change a correctly typed word ("sun"
to "su" in Spanish, "Mary" to "Matt" in Bokmål).

Verified on the Studio's host JVM (quality-gate.py, next commit's
--adaptive): the gate's report for all six layouts is the same as dev
786451f00's, field for field (de, it and nb fail there too), and with
Adaptive touch on but before it has learned, every output is the same, item
for item. Off-centre typists: see the next commit.

* Typing gate: --adaptive checks Adaptive touch with off-centre typists

What: quality-gate.py --adaptive, and the Replay options behind it, measure
Labs › Keyboard › Adaptive touch per layout, against the same input with it
off. Replay's --gate takes --adaptive learn|monitor|frozen, --sessions,
--typist T1|T1m|T2|T3, --profile-in, --profile-out and --unguarded; it drives
Adaptive touch as the keyboard does (each letter typed, each word finished
with what autocorrect did, a field per sentence) and reports on stderr when
the personal centres were in use. Its replay geometry gains Adaptive touch's
key plane.

- A: on but before it has learned, the gate's whole input comes out the same.
- B: three typists aim off the centres the same way every time (T1 low and
  right, T2 thumbs inward, T3 an aim per key), typing the 2,000 noisy
  sentences in order with it learning; word errors in the second thousand.
- C: each learned profile, frozen, changes no more correctly typed words, on
  the centres or on the typist's aim, and the critical cases pass.
- D: learned on T1, typed with T1's aim mirrored: no word broken while the
  old centres are still in use; also after the fallback and without it.

Why: the held-out taps are drawn per tap from a population's offsets, with no
aim of their own, so the gate as it was could not show Adaptive touch help or
hurt. The README section has the table.

Verified on the Studio's host JVM at the previous commit: A holds in all six
layouts and the gate's own numbers are unchanged. B (word errors, off -> on):
T1 -0.9 to -3.1%, T2 -0.9 to -4.4%, T3 -0.4 to -1.2% except French +1.4%
(436 -> 442); without the guard 6-22% fewer for T1 and T2. C never higher.
D: 1 word in German before the fallback, 0 elsewhere (71-179 without it).
--adaptive exits 1 for German (D) and French (T3) on these bars.

* Typing gate: Adaptive touch's grip-change bar, and its numbers on dev with Portuguese

What: D in quality-gate.py --adaptive now asks that the old centres fall back
within three sentences and break at most 2% of what they break with no
fallback, instead of no word at all before the fallback. The README says why,
with German's one word as the example, and its table is rerun on dev
5d977b5ed with Portuguese, the seventh layout.

Why: the fallback needs about 16 labels, two sentences, before it can act, so
"zero" only ever held by luck: German broke 1 word where no fallback breaks
179. The coordinator agreed the bar.

Verified on the Studio's host JVM (Gradle --no-daemon) on this branch rebased
on 5d977b5ed: quality-gate.py all gives dev's report field for field in all
seven layouts (de, it and nb fail there too). --adaptive: A identical in all
seven; B T1 0.9-4.4% fewer word errors, T2 0.9-4.4% (Portuguese 10.2%), T3
0.4-1.2% (Portuguese 4.3%) except French, 436 -> 442, which fails B, with
French's held-out taps 415 -> 422; C never higher; D passes in all seven
(German 1 word before the fallback against 179 without it).

* Android keyboard: Labs › Keyboard › Adaptive touch, wired to the keys (off by default)

What: the keyboard now runs Adaptive touch when its Labs switch is on.
- KeyPlaneView hands the decoder its key plane (each letter's keycap, touch
  cell and row; the width in 10 dp steps, orientation and number row name
  it) and says when a touch slid onto its key (a slide from shift or ?123, a
  swipe that came back as a tap).
- KeyboardEngine: a session per field; letters, held accents, delete,
  space, marks, Return, picks and undoing a fix tell Adaptive touch what
  became of each word, and the cursor moving, pastes, swipes, dictation and
  pads forget what was in hand. It learns only in a field that takes
  corrections and lets Hex learn, with Autocorrect and Spatial autocorrect on
  and the layout's own model; never in a password, email, web address or
  no-learning field. The decoder reads your centres wherever the lab is on.
- AdaptiveTouchStore keeps the averages as one Base64 value in their own
  private SharedPreferences, "adaptiveTouch" (23,588 bytes as a table, under
  32 KB as text, never more; allowBackup is off), saved every 400 labels and
  when the keyboard hides, shared by the keyboard and Settings in one process.
- Settings › Labs › Keyboard: Adaptive touch, with "Learning: n of 400 taps"
  or "Active, using your own key centres" under it, and Reset touch learning
  behind a confirmation while anything is stored, lab on or off. Delete what
  Hex learned clears it too. Every string in English and Simplified Chinese,
  the wording Ryan approved.
- AdaptiveTouchTest (the one new test file, approved): what teaches it, the
  evidence floor, the grip fallback, key planes apart, the table and reset,
  untrained typing exactly as without it, and that your centres never
  correct a word the drawn ones leave alone.
- docs/features: the Android Labs entry.

Why: a tester asked for iPhone's adaptive touch on Android; Ryan approved it
as a Labs switch knowing the gate shows 1-4% fewer word errors for typists
who aim off the centres.

Off, the keyboard makes no learner, reads no table and types exactly as
before. Verified on the Studio (host JVM, Gradle --no-daemon, -x
prepareSpeechModel): testDebugUnitTest passes, 310 tests with
AdaptiveTouchTest's 11; scripts/code-shape.py --check has no hard problems.
Not yet tried on an emulator or a device.

* Privacy: say what Adaptive touch keeps, in the Android policy and on the site

What: android/play/policy/privacy-policy.txt › What stays on your phone, and
the Android section's "What Hex keeps" in site/src/iphone.ts: with Adaptive
touch on in Labs, Hex keeps for each letter key an average of where taps land
on it, in a table of fixed size (under 32 KB) on the phone only; no letters,
words or order of taps; never sent; nothing learned from password, email or
web address fields. Turning it off stops the learning but keeps the averages
until Reset touch learning or Delete what Hex learned removes them.

Why: the lab (previous commit) stores a new kind of learned data, and the
policy and the site say what Hex keeps on the phone, as #2772 did for Learn
from my fixes. Both texts are English only; the date stays November 24, 2026.

Checked against the code: AdaptiveTouchStore keeps one "model" value in the
private "adaptiveTouch" SharedPreferences (AdaptiveTouchModel.BYTES = 23,588
bytes, Base64), learning runs only where KeyboardEngine.teacher allows, and
both Reset touch learning and Delete what Hex learned call
AdaptiveTouchStore.clear(). Site: bun run build --mode production, then bun
test, 25 pass; the built privacy page carries the sentence.

* docs: Adaptive touch on the emulator

What: the Android Labs entry for Labs › Keyboard › Adaptive touch now says
what the emulator check showed, in place of "not yet tried on an emulator".

Why: the coordinator asked for the functional emulator step before the
pull request leaves draft.

Verified on the Studio's API 35 Pixel 8 emulator (hex-touch-vogel, port
5890, now shut down), the debug build of 8ac05c2fa, reading the table back
through run-as after each step: words left as typed taught 10 weak labels,
a same-length pick 5 picked, what was typed tapped over the fix 5 strong, an
undone fix 3 strong, a retyped neighbour 1 strong and 3 weak; password and
no-suggestion fields taught nothing; Reset touch learning and Delete what
Hex learned each removed the table; landscape, the number row and AZERTY
made their own contexts; with the switch off nothing learned and Reset
stayed reachable. Active was reached by seeding the table, as
AdaptiveTouchTest does. Time per letter not measured yet.
2026-11-24 20:00:42 -05:00
..
features Android keyboard: Adaptive touch (Labs, off by default) (#2790) 2026-11-24 20:00:42 -05:00
images docs: describe speech models and features in readme (#1869) 2026-11-15 18:27:36 -05:00
plans reload personal config when imported .js files change (#1856) 2026-11-15 10:46:47 -05:00
releases docs(release): correct the 3.4.0 notes and add upgrade steps for Windows and Hyprland (t1510) (#1672) 2026-11-10 18:14:30 -08:00
research Add agent marker and drop internal references (#702) 2026-10-31 18:30:32 -07:00
specs docs: the Hex words file (.hexwords), version 1, with shared cases (#2776) 2026-11-24 18:47:38 -05:00
cli.md feat(meetings): launch polish for the capsules, Calls sheet, and Meetings pane (#2769) 2026-11-24 15:17:13 -08:00
design-system.md refactor(rune_ui): add unified design tokens, shared modal shell, and ratcheted lint (#2762) 2026-11-24 13:34:15 -08:00
downloads.md ci: read release secrets from aws secrets manager (#1606) 2026-11-09 15:18:26 -05:00
linux.md fix(linux): keep the RemoteDesktop paste session open on KDE (#2508) (#2510) 2026-11-23 04:12:01 -05:00
nix.md docs: nix install is linux only (#1582) 2026-11-09 05:11:35 -05:00
opencode-compatibility.md prefer a wsl opencode service when the lab is on (#2112) 2026-11-20 19:14:28 -05:00
perf.md docs(perf): strobe prints times in microseconds (#1718) 2026-11-12 05:43:43 -06:00
README.md docs: the Hex words file (.hexwords), version 1, with shared cases (#2776) 2026-11-24 18:47:38 -05:00
releasing.md windows: sign the setup engine so smart app control can run setup (#1987) 2026-11-19 02:38:03 -05:00
streams.md meetings: discard recordings with no speech (#2553) 2026-11-23 13:48:42 -05:00
test-builds.md windows: sign the setup engine so smart app control can run setup (#1987) 2026-11-19 02:38:03 -05:00
transcript-cli.md meetings: delete a finished meeting from the CLI (#2223) (#2225) 2026-11-21 11:23:51 -08:00
windows-signing.md windows: sign the setup engine so smart app control can run setup (#1987) 2026-11-19 02:38:03 -05:00
windows.md add hungarian as an interface language (#2671) 2026-11-24 06:41:08 -05:00

Project Documentation

Start with the document for your task. Plans and archived prototypes do not override shipped behavior.

User Guides

  • ../README.md: install and use Hex on macOS, Windows, and Linux.
  • windows.md: Windows x64 and ARM64 beta requirements, installation, and source builds.
  • linux.md: Linux X11 and native Wayland beta requirements and installation.
  • nix.md: Nix packaging for Linux, development, and per-user autostart.
  • ../ios/README.md: build and test the iOS prototype.
  • ../sdk/typescript/README.md: use the public TypeScript transcription SDK with an explicitly supplied native helper.

Engineering Reference

  • ../AGENTS.md: architecture, invariants, development commands, and diagnostics. This is the implementation authority.
  • ../ROADMAP.md: prioritized product and engineering work.
  • design-system.md: Rune + rune-kit + OpenCode theme components, Hex pieces, copy rules, and --snap scene verification.
  • features/README.md: existing user-facing capabilities, entry points, available verification, and gaps; detailed dictation and recovery maps.
  • perf.md: strobe benchmarks, the cases that drive the window through its accessibility tree, and how a benchmarked copy of Hex stays isolated.
  • downloads.md: public download paths, R2 custom domains, GitHub release mirrors, and network recovery.
  • opencode-compatibility.md: audited OpenCode V2 source and CLI baseline, integration contract, and validation limits.
  • plans/personal-commands.md: shipped personal command contract and remaining lifecycle work.
  • plans/quickjs.md: why and how configs run in embedded QuickJS instead of Bun, with size and latency measurements.
  • specs/local-transcription-service.md: implemented macOS local-service protocol and lifecycle guarantees.
  • specs/hex-words.md: the Hex words file (.hexwords) that carries vocabulary and word replacements between the desktop, iPhone and Android apps, with shared cases in tests/fixtures/hex-words.

Architecture Decisions And Active Plans

When a plan disagrees with AGENTS.md about shipped behavior, update the plan.

Research And Archives

Releases

releases/ contains version-specific release notes and drafts. ../release-notes/ contains legacy inputs from versions 2.0.0 through 2.0.9. Published notes and the SDK changelog describe their release, not current behavior; preserve them as historical records. A draft note is not evidence that its release has been published.