Skip to content

Live text: show what a dictation has said so far beside the HUD (live-text experiment) - #324

Merged
thdxr merged 3 commits into
anomalyco:devfrom
ElliottH:live-dictation-text
Oct 29, 2026
Merged

thdxr merged 3 commits into
anomalyco:devfrom
ElliottH:live-dictation-text

Conversation

@ElliottH

Copy link
Copy Markdown
Contributor

Summary

Adds a live-text experiment: while you hold the shortcut, a hotkey dictation on a streaming model (Parakeet Unified English on a GPU) shows what you've said so far as one click-through line just past the recording HUD. The newest words stay in view, with "…" cutting the start. The line is provisional and only ever shown. The paste, History and Paste Last are unchanged. With the experiment off, nothing changes.

  • Engine (transcription_engine.rs): each dictation stream gets its own partial slot and publishes the model's stable and tentative text after every feed. A failed or interrupted stream clears it. /streams now uses the same slot type.
  • Capture (dictation.rs, live_text.rs): DictationCapture::report_live_text, called by the macOS, Linux and Windows capture loops, shows the recording's text through a live_text::Publisher. The recording owns that publisher, so every ending (release, Escape, a short tap, a lost microphone) hides the line, and an older recording never clears a newer one's text.
  • UI (rune_ui/live_text.rs): one Rune overlay shared by every OS, prewarmed so macOS never reveals the previous dictation's words. Each host says where its HUD is:
    • macOS: beside the plate its HUD placed (hud_placement::beside_plate), on the pointer's screen.
    • Linux and Windows: past the plate rune_hud draws, on the primary display.
    • With the HUD hidden: in the HUD's place at the top.
  • Docs: the AGENTS.md streaming invariant now reads "Nothing pastes or reaches the focused app before the final text", and says live text may show in Hex's own HUD. The feature map gains dictate.live-text, its checks and its observed verification.

Measurements

On Apple Silicon (Metal), replaying speech through metal_stream_tracks_offline_transcription with live text on:

  • Text arrives in about 1 s steps, roughly 1–2 s behind speech.
  • The stable text is never rewritten. Parakeet's buffered settings produce no tentative text.
  • Final text and release latency are unchanged.

Pre-existing defect found while testing (not fixed here)

After a pause longer than the model's 5.6 s left context, the stream can drop the next sentence's first word, for example "successfully. I now" becoming "successfully now". Whether it happens depends on where speech resumes within an 80 ms encoder frame. NeMo's reference buffered streaming drops the word on the same audio, so this is the model's behaviour, not transcribe.cpp's. The details are in the feature map. A fix is being prepared separately.

Test plan

  • scripts/check on macOS: fmt, clippy, and all tests (1,794 passed). New tests cover:
    • the engine's per-stream partials;
    • capture lifetime;
    • publisher ownership;
    • the plate's layout;
    • beside_plate geometry (Below, Bottom, menu bar, notch).
  • Check Linux and Check Windows on the fork: Linux, Windows.
  • By hand on an M3 Pro, in Hex Test.app with a physical microphone:
    • the line follows the HUD;
    • three dictations in a row show no stale text;
    • a very short dictation never leaves the line up;
    • the HUD at the bottom puts the line above it;
    • a hidden HUD puts the line at the top.
  • Not verified: a second display, Dot scope placements, and real Linux and Windows desktops.

🤖 Generated with Claude Code

…-text experiment)

With the `live-text` experiment on, a hotkey dictation on a streaming model
(Parakeet Unified English on a GPU) shows its text as you speak: one
click-through line just past the recording HUD, growing with the words and
then keeping the newest in view behind "…". It is provisional and only ever
shown; the paste is unchanged.

- Engine: a dictation stream gets its own partial slot and publishes the
  model's stable and tentative text after each feed; a failed or
  interrupted stream clears it. `/streams` shares the same slot type.
- Capture: `DictationCapture::report_live_text`, called by the macOS, Linux,
  and Windows capture loops, shows the recording's text through its
  `live_text::Publisher`. The recording owns it, so every ending (release,
  Escape, a short tap, a lost microphone) hides the line, and an older
  recording never clears a newer one's text.
- UI: one Rune overlay shared by every OS, prewarmed so macOS never reveals
  the previous dictation's words, placed where `rune_hud` last showed the
  HUD: on macOS just past the plate it placed (`hud_placement::beside_plate`)
  on the pointer's screen, on Linux and Windows past its centred plate on
  the primary display, and with the HUD hidden in its place at the top.
- AGENTS.md: "Nothing pastes or reaches the focused app before the final
  text" now says live text may show in Hex's own HUD.

Measured on Apple Silicon (Metal): text arrives in ~1 s steps, about
1–2 s behind speech, with no change to the final text or release latency.
Checked by hand on an M3 Pro (see the feature map); Linux and Windows are
built only by CI.

The feature map also records a pre-existing defect found while testing:
after a pause longer than the model's 5.6 s left context, the stream can
drop the first word of the next sentence. NeMo's reference buffered
streaming drops it on the same audio, so it is the model's behaviour, not
transcribe.cpp's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ElliottH
ElliottH force-pushed the live-dictation-text branch from 2a92b67 to c567c6d Compare October 29, 2026 01:29
@thdxr
thdxr merged commit 3ae9d10 into anomalyco:dev Oct 29, 2026
@thdxr

thdxr commented Oct 29, 2026

Copy link
Copy Markdown
Member

Merged, thank you @ElliottH! This was a really thorough PR: per-stream partials, recording-owned publishers so stale text can't leak, and the measurements. I merged dev in (it went cleanly after the Rune HUD landed) and allowed the macOS-only Spot::Global on Linux/Windows so -D warnings stays clean. It ships behind the live-text experiment. Thanks also for writing up the dropped-first-word-after-a-pause behavior; we'll look out for the separate fix.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@ElliottH
ElliottH deleted the live-dictation-text branch October 29, 2026 01:36
thdxr added a commit that referenced this pull request Oct 29, 2026
…) (#367)

A buffered Parakeet stream can drop the first word after a pause longer
than its 5.6 s left context (#324). The engine now feeds a dictation
stream only the first 2.5 s and last 0.3 s of each pause; the clip and
its offline fallback are unchanged.

Co-authored-by: ElliottH <[email protected]>
@thdxr

thdxr commented Oct 31, 2026

Copy link
Copy Markdown
Member

Thanks @ElliottH for building Live text, it's still in Hex.

To keep Hex simple for new users, unproven features now live in Settings › Labs, off by default. To keep using it, turn on Live text there, or run hex labs on live-text. Get the latest build at https://github.com/anomalyco/hex#install-hex.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants