2026-11-08 · Whisper on a PC’s graphics processor, real speech detection, and Live Translation’s fixes

2026-11-08 · Whisper on a PC’s graphics processor, real speech detection, and Live Translation’s fixes

Context

Kalamu and Live Translation run the same whisper.cpp (whisper-rs 0.16.0, whisper-rs-sys 0.15.0, whisper.cpp 1.8.3) with the same instruction sets and processor check. Comparing the two showed what each could take from the other, and one bug both shared:

Decisions

Speech detection, done by Kalamu

whisper/speech.rs runs whisper-rs’s standalone WhisperVadContext (Silero v5.1.2, the model already downloaded with the first Whisper model) on each window. A window with no speech is not decoded at all. Otherwise its stretches of speech, each widened by 0.2 s and merged where they touch, are joined with 0.1 s of silence between them, as whisper.cpp’s own vad mode does, and every line’s times are mapped back to the recording. Language detection then reads the loudest thirty seconds of speech. If detection fails on a window, the whole window is decoded: it saves work, it must never lose words. The VAD context is loaded once and kept.

Provenance’s vad and vad_model keep their meaning, now true to what happened. Results made before this change say vad: true though their windows were decoded whole; nothing rewrites them, and the cache keeps them.

The abort callback without unsafe

whisper-rs 0.16’s set_abort_callback_safe hands its trampoline a pointer to a Box<dyn FnMut() -> bool> but reads it as the closure’s own type, which is undefined behaviour for a bare closure (Live Translation’s reason for its own unsafe callback) and exactly right when the closure type is Box<dyn FnMut() -> bool>. stop_when always passes that type, with a comment saying why. The box is never freed: a few bytes and one StopSignal handle per window.

whisper.cpp asks the callback after each encoder pass (thirty seconds of audio) and each decoding step, not inside an encoder pass, and language detection is a pass of its own, so the stop signal is also checked after detection. The smoke test stops the sample interview 0.3 s in; it ends after two encoder passes (3.6 s on four cores with Base) rather than after the window (8 s).

Live Translation’s prompt and filters

whisper/text.rs takes Live Translation’s Prompt: the first terms, in the researcher’s order, that fit half the model’s text context less one token, tokenized by the model, given to every window as tokens; and its echo check. Provenance still records initial_prompt before the model is loaded, so the terms offered are cut to 600 characters first and written as before ("A, B."); the tokens are those of the same text whenever it fits, which a list of this length does in the scripts researchers’ names are mostly written in, and the log says so when the tail had to go. Each line also passes the per-line silence check.

Whisper on Windows’ graphics processor, in a helper program

helpers/whisper-vulkan, a workspace member outside crates/ and outside default-members, is whisper.cpp built with Vulkan as a program of its own, shipped beside the app as a sidecar (tauri.ffmpeg.windows-<arch>.conf.json) like llama.cpp’s programs. The app starts it when a piece goes to the graphics processor, sends it the model to load and each window to detect and decode over standard input and output, and keeps it with the model while it is loaded (the janitor releases both after three idle minutes). The decoding parameters and the messages are one file, crates/offline/src/whisper/engine.rs, which the helper includes by path, so a window is decoded the same way wherever it runs.

Builds and CI

The helper needs LunarG’s Vulkan SDK on Windows (.github/actions/vulkan-sdk, the version and hashes llama.yml uses). CI’s Windows x64 lane builds, lints and tests it; the ARM64 and macOS lanes exclude it (--exclude whisper-vulkan); release.yml builds it for both Windows architectures (scripts/build-whisper-vulkan.mjs) before the installer and the MSIX package. Every Rust lane now runs whisper::tests::smoke: the sample interview with the pinned Base model and voice-activity model (cached, checked against their hashes), on Metal on the Mac. The helper’s own smoke test (whisper::tests::vulkan_smoke) was run on Linux on Mesa’s lavapipe, which the helper accepts only with WHISPER_VULKAN_ALLOW_SOFTWARE=1; GitHub’s runners have no graphics processor, so speeds are still to be measured on real ones.

Architecture checkpoint

A new kind of artifact (a helper program in the workspace) and a file past 500 lines called for one.

Consequences