docs/ui.md: the voice page section (what is on screen, the release guard of Hold to talk, the global push-to-talk key, the properties and callbacks of the slice, what the page costs idle and with a talker at 10 Hz, what was seen against the TeamSpeak 3 and 6 development servers), "What is next" item 3 done, "For the next slices" pruned (the Hold to talk risk, the hotkey's runtime note and the SettingChanged note settled, the tree model's note updated) and what this slice leaves to the chat and stream slices added, the tree section's tables and the settings row brought up to date; the CHANGELOG entry; the spikes report's status; six pictures under docs/ui/ (the larger and the smaller stage, dark and light, the page against a real TeamSpeak 3 talker, a person's card). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
49 KiB
GPUI spikes: go/no-go for the Slint to GPUI migration
Plan section 6, step 1 ("Spikes first"): three spikes on the pinned
gpui-kit, each a crate of the separate workspace spikes/gpui/ (its own
lock; not a member of the root workspace, nothing wired into voelin-ui).
How to rebuild and rerun everything: spikes/gpui/README.md.
Status (2026-10-27). Step 1 is done: all three spikes are a go,
with the conditions under "Settled for step 3". The work was started on
2026-10-25 by an attempt that was interrupted before it committed anything
or measured the video cases; its code was judged and kept (with the changes
listed in "History"), and every figure and check below was run again on
2026-10-27. The review of that day's report found three minors, closed in
the commits after it: nightly clippy is clean (as_chunks in bgra.rs, and
a second lint that the first hid), the video headline says "raw" with the
quiet-window pipeline figure beside it, and the --no-drop row's XDamage
exception is explained (a counter window longer than the case). Step 3
(2026-10-27) rebuilt the three spikes on gpui-kit 0.8.1 of 2026-10-26 and
ran each README's measurement command once: they build, every check passes
and the per-frame cost is 0.8.0's, so the pin is 0.8.1 ("The version to
pin"); the figures on this page are still 0.8.0's, but for the two video
cases the foundation's review ran again on a quiet machine. The same day the
foundation of step 3 landed on phase5/gpui-foundation (items 1 to 4 and 6
of "What step 3's first slice must contain": Rust 1.95, ashpd on async-io,
the voelin-gpui crate with its root entity, the theme with Inter and Lucide,
the cost meter; item 5, the shell, followed the same day, below): what exists,
how to run it and the slices that follow are in docs/ui.md, "The
GPUI front end".
The foundation was reviewed and gated the same day (a Sonnet review, then the
Opus gate: no blocker and no major, six minors), and the minors are closed in
the commits after it: the meter's /proc test waits for a CPU tick instead of
burning 60 ms, zbus runs on async-io alone in every binary (with a test for
the order of ashpd's callers), the lock figures and the Lucide 1.43 credit are
corrected, the slice list points at "Open choices for step 3", and the parity
test sees a second brush or string. The risks the review and the gate left to
the slices that meet them are in docs/ui.md, "For the next slices". Item 5, the
desktop shell, is slice 1 of the step's list and landed on phase5/gpui-shell
(2026-10-27): the store at start (the client's database, the settings with the
UI's keys, the secrets, the default identity), the server rail, the sidebar,
the top bar and the main area as entities that tell the window when what they
show changed (the window then draws every part: gpui-pre 0.3.10 renders every
uncached child view on every frame), the eleven callbacks of bind/servers.rs
as actions through voelin-ui-vm's logic and the engine's commands, the
window's size and position kept in ui.window, the engine-event task in steps
and a tick that draws nothing. What it shows, what it costs idle and what it
leaves to the slices after it are in docs/ui.md, "The desktop shell"; the next
slice is the channel tree and the members. The shell was reviewed and gated the
same day (an Opus gate: no blocker and no major, six minors), and the minors are
closed on phase5/gpui-shell-minors: the records that said the parts draw only
when what they show changed are corrected (a part tells the window, and the
window draws every part, as gpui-pre 0.3.10 renders every uncached child view on
every frame), a window left maximized is maximized again on X11, the pictures
are 1440 by 960, the connect test sends no DNS query, the sequences both front
ends ran are shared in voelin-ui-vm, and the ui.window row is in the
settings table; the gate's four risks of the shell are in docs/ui.md, "For the
next slices". Slice 2, the channel tree and the members panel, landed on
phase5/gpui-tree (2026-10-28): Update.refresh as per-area signals and the
shell's panes cached (the design the shell's review left for it), the pictures
the engine writes again shown and the old copies dropped, the tree over a
virtual list that applies the row operations of voelin-ui-vm's list::diff,
the members panel, the member card and the password prompt, with the folds and
the selection kept per server; what a change costs, figure by figure, is in
docs/ui.md, "The channel tree and the members". The slice was reviewed the same
day (one major and five minors) and the commits after it close them: a channel's
banner is drawn under the surface veil of the Slint tree's BannerPicture, an
avatar under 28 pixels shows one letter, the password prompt ignores an empty
field and closes on Escape, and the ui.tree row of the settings table, the
list of the Bridge's properties and callbacks that the two panes use and some
long lines are corrected in docs/ui.md. Slice 3, the voice page and the call bar,
landed on phase5/gpui-voice (2026-10-28): the page as a cached pane of its own
that takes the main area (its people from the tree model's one build, so a talker
is still one build for three lists), the call bar and the smaller stage kept in
ui.voice_compact, the sidebar's server card with its banner, the voice card's
transmit modes and the volume of a person following the settings, the release
guard of Hold to talk (voice that drops, a window that loses the focus) and the
global push-to-talk key started on the engine's runtime; it was seen against both
development servers with a second client that talks. What it costs and what it
leaves is in docs/ui.md, "The voice page and the call bar". The next slice is the
chat, the composer and emoji.
| Spike | The plan's no-go | Seen (software rendering, see Setup) | Verdict |
|---|---|---|---|
| 1. Video | below 30 fps at 1440p60 with no custom-element way out | img() with the port of video.rs' delivery, raw (frames from memory, no decoder): 42 to 49 fps at 1440p60, 55 to 58 at 1080p60, on lavapipe; with the real VP8 encoder and decoder in the same process (pipeline) 40.8 fps at 1440p60 in a quiet window (the reviewer's run) and 9.6 at a busy one (the pipeline scales with free CPU); cx.drop_image keeps the atlas flat; a new 1440p picture costs GPUI's thread 6 to 7 ms; a persistent texture needs a GPUI change |
go, with a GPU run first in the viewer slice |
| 2. Composer, IME, chat lines | no usable preedit | X11 preedit with fcitx5 and Pinyin works (marked text, candidate window at the caret, commit); emoji at the caret, paste, Ctrl+Enter, TextRuns as StyledText with links all work; Wayland preedit not exercised headless; colour emoji need a one-line GPUI patch |
go |
| 3. Second window | the second window cannot share state or steal the hotkey | one root entity in two windows, both change it, focus, fullscreen and close work, the X11 global hotkey reaches the model while the second window has focus, the preview is one shared RenderImage (+46 % of a core on lavapipe for the second window) |
go |
Before step 3 can start: Rust 1.95 for the client (no gpui-kit builds on
1.94) and the client's ashpd on async-io (GPUI's and the client's ashpd
features cannot be built together); both are under "Settled for step 3", and
both are done (the first two commits of phase5/gpui-foundation).
Setup
Every figure on this page comes from one machine and one software stack:
| Machine | AMD Ryzen 9 7950X3D (16 cores, 32 threads), 61 GiB, NixOS; no GPU was used |
| Display | Xvfb :91, 3840x2160x24, openbox, a private D-Bus bus (spikes/gpui/headless.sh); the Wayland runs on sway's headless backend with its pixman renderer (headless-wayland.sh) |
| Device | Mesa 26.2.5 lavapipe (llvmpipe (LLVM 21.1.8, 256 bits)) through wgpu's Vulkan backend, the only Vulkan driver (VK_DRIVER_FILES = its lvp_icd.x86_64.json); GPUI's log: "Selected GPU adapter: llvmpipe … (Vulkan)" |
| GPUI | gpui-kit 0.8.0 (gpui-pre 0.3.9, gpui-component 0.8.0, gpui-kit-assets 0.8.0) for every figure on this page; the rebuild on 0.8.1 is under "The version to pin" |
| Rust | 1.95.0 (fenix, spikes/gpui/shell.sh); nixpkgs 02c087f3fe67 for the libraries and tools |
| Load | another task's load generator kept the machine busy for part of the day; every run records the load average before and after it (<case>.load), and the tables give it |
A software Vulkan device renders on the CPU: the llvmpipe threads in the
tables below are what a GPU takes over. What it does not take over is said
per spike.
Spike 1: the video path
spikes/gpui/video (README) ports
video.rs' delivery (video.rs:360-480: deliver, FrameSlot, Handoff,
Buffers, Latest) to GPUI: the decoder hands over its newest frame only, a
converter thread turns it into an Arc<RenderImage> (BGRA,
spike_common::bgra::to_bgra, the BGRA twin of convert::to_rgba), the
window takes the newest from the Latest in render, shows it with
img() and drops the one it replaces from every window's atlas
(cx.drop_image). --mode pipeline is Video::demo's source
(LocalPreview with SourceId::Synthetic, the real VP8 encoder and
decoder, in the same process); --mode raw hands I420 frames from memory
(no encoder, no decoder) to the converter at 60 fps, so what is lost is
GPUI's, and "raw" below always means this source; --mode static is the
control: one picture uploaded once, the window repainted every frame.
Buffers' reuse cannot be ported: a RenderImage owns its pixels and
gives no way back to them, so every picture is a new buffer.
Conversion (--bench, one thread, 300 runs; I420 to 32-bit, ms):
| RGBA, reused buffer | BGRA, reused buffer | BGRA, new buffer | BGRA, new buffer as RenderImage |
|
|---|---|---|---|---|
| 1920x1080 | 0.34 | 0.27 | 0.38 | 0.49 |
| 2560x1440 | 0.67 | 0.53 | 0.71 | 0.72 |
BGRA costs what RGBA costs (the same yuv routines with the channels
swapped; a test checks they agree pixel for pixel). In the running
converter a 1440p picture takes 2.0 ms, not 0.7: a new 14 MiB buffer each
time is fresh memory, page faults included, which the reuse video.rs
does today avoids. That is the price of RenderImage, on a thread of its
own.
In the window (Xvfb :91, lavapipe; 70 s per case, the first 10 not
counted; the load average before and after each case; "main" is GPUI's
thread):
| Case | Shown fps (of 60) | CPU, process | llvmpipe | main thread | converter | Memory over 60 s | Load |
|---|---|---|---|---|---|---|---|
| static 1920x1080 | 60.2 (repaints) | 405 % | 391 % | 5.4 % | — | flat (199 MiB) | 40 / 35 |
| static 2560x1440 | 62.0 (repaints) | 727 % | 710 % | 5.0 % | — | flat (230 MiB) | 35 / 28 |
| raw 1920x1080 | 54.6 | 374 % | 345 % | 15.5 % | 6.8 % | flat (361 MiB) | 28 / 34 |
| raw 2560x1440 | 41.9 | 525 % | 477 % | 28.0 % | 11.5 % | within one picture (486 to 501 MiB) | 34 / 34 |
| raw 2560x1440, earlier run | 49.0 | 642 % | 577 % | 39.0 % | 15.1 % | within one picture | 43 / 44 |
| raw 1920x1080, earlier run | 57.6 | 410 % | 376 % | 18.1 % | 7.8 % | flat | 43 / 43 |
| pipeline 1920x1080 (encoded 26.3 fps) | 22.9 | 1085 % | 135 % | 7.1 % | 2.4 % | flat | 34 / 43 |
| pipeline 2560x1440 (encoded 10.8 fps) | 9.6 | 1131 % | 102 % | 9.9 % | 1.9 % | flat | 43 / 53 |
| pipeline 2560x1440, a quiet window (the reviewer's run of 2026-10-27; encoded 50.4 fps, decoded 49.5) | 40.8 (XDamage 41.3) | 1047 % (encoder 454 %) | 476 % | 28.7 % | 9.5 % | flat (499 MiB) | 24 / 31 |
| pipeline 2560x1440, voelin-media's RGBA (encoded 13.3) | 12.5 | 1259 % | 131 % | 12.9 % | 2.2 % | flat | 53 / 61 |
no drop_image, pipeline 2560x1440 at 15 fps, 12 s |
13.9 | 1219 % | 146 % | 17.8 % | 2.3 % | +1.9 GiB in 10 s (827 to 2,816 MiB) | 61 / 45 |
pipeline 1280x720 at 30 fps, 4.6 Mbit/s (Video::demo's settings) |
28.5 (of 29.6 decoded) | 317 % | 79 % | 6.0 % | 1.2 % | flat (253 MiB) | 45 / 36 |
Slint, VOELIN_DEMO_STREAM=1 (the same 720p30 pipeline), 1440x960 window |
window redrawn 58 to 61 times a second (SLINT_DEBUG_PERFORMANCE), X damage 59.9/s |
253 % | — | 6.6 % | 0.9 % | flat (151 MiB) | 36 / 28 |
The X server counted as many content changes of the window (XDamage, from
outside the process) as the spike counted frames shown, within 0.3 fps, in
every case, the --no-drop one included. That case's summary line says
otherwise (13.9 frames shown a second against an XDamage mean of 0.5; the
reviewer's run: 5.0 against 0.1) and the summary is what is off, not the
frames: measure.sh runs damage-count for the 69 s of the 70-second cases
with the first 10 not counted, but this case lasts 12 s with 2 s of warm-up,
so its mean spreads the last two seconds of a window over 59. Second by
second, while the window lived, the X server counted 11 to 16 changes (13.8
on average) against 13.6 frames shown (the reviewer's run: 5.2 against 5.1),
and a re-run with damage-count spike-video 11 2, the case's own length,
gave 6.8 against 7.0 (Xvfb :93, lavapipe, load 43 / 47; the re-run's rate
differs from the table's, and the matched pair is what counts): the frames
shown here were frames the X server saw.
What the figures say:
img()holds 1440p60 above the plan's 30 fps on a software device (raw, frames from memory with no decoder: 42 and 49 fps in two runs, 55 and 58 at 1080p; with the VP8 encoder and decoder in the process, 40.8 fps in a quiet window), with GPUI's thread a quarter to a third busy. The static control repaints the same window at 60 to 62 fps, so what the raw cases lose is the cost of a new picture per frame, not of drawing the window.- The cost of a new picture on GPUI's thread: main-thread CPU per frame
goes from 0.8-0.9 ms (static) to 2.8-3.1 ms at 1080p and 6.7-8.0 ms at
1440p (raw), so a new 1440p picture costs GPUI's thread 6 to 7 ms. In
gpui-pre 0.3.9 that is:
paint_imagemisses the atlas; a 2560x1440 image is larger than an atlas page (1024x1024), sopush_texturecreates a texture for it (device.create_texture),upload_texturecopies the bytes (bytes.to_vec(), 14 MiB) andwrite_texturecopies them again into wgpu's staging memory;drop_imageon the next frame frees the texture (it has no other tile) and the next picture creates one again. drop_imagekeeps the atlas flat: 60 s at 1440p60 stay within one picture's size (14 MiB) of where they started; without it every picture stays in the atlas (lavapipe's textures are process memory: +1.9 GiB in 10 s at 15 fps, 11.6 GiB a minute).- The pipeline cases are bound by CPU contention, the encoder being the largest user, not by GPUI: the synthetic sender's VP8 encoder runs in the same process, takes 450 to 1000 % of the CPU, and kept up with 26 fps at 1080p and 11 at 1440p at the loads of these runs (34 to 53), when the window showed nearly every frame decoded. So the pipeline rows above (22.9 fps at 1080p, 9.6 at 1440p) scale with the free CPU and say more about the machine's load that day than about GPUI: in a quiet window (the reviewer's run, load 24 to 31, not repeated here: the load stayed above 40 while this page was revised) the same 1440p60 case encoded 50.4 fps and decoded 49.5, and the window showed 40.8 (XDamage 41.3) on 1047 % of CPU (encoder 454 %, llvmpipe 476 %, memory flat), in line with the raw case's 42 to 49; at a load of about 100 (104 before, 97 after) the same case showed 2 fps (encoded 2.1). In the client, the encoder runs on the streamer's machine.
- Against Slint, same machine and display (the only rate the demo
stream offers is
StreamerConfig::default()'s 1280x720 at 30 fps; Slint at 1440p60 would need a change invoelin-ui, out of this task's scope): both show the stream at the rate it is decoded (GPUI counted 28.5 of 29.6; Slint's converter thread does the same work, 0.9 % against 1.2 %). Slint's software renderer draws on the app's main thread (6.6 %, the whole process 253 % with the encoder's 238 %); GPUI draws the window through Vulkan, which on lavapipe is 79 % of a core that a GPU takes over. The plan's "35-49 fps at 1440p60" is not a Slint figure: it is the decode rate of a 4-core VM with FFmpeg's VP8 on slice threads (docs/research/stream-fps.md), since fixed in the decoder.
What a real GPU changes. The llvmpipe column (100 % to 710 %) moves to
the GPU, and so does the copy from wgpu's staging memory into the texture.
What stays on the CPU is the converter thread (2 ms a 1440p picture) and
on GPUI's thread the two copies of the picture and the texture's creation
and destruction: the 6 to 7 ms measured here are their upper bound (on lavapipe
the texture's memory is also the process's), which fits a 60 Hz frame
(16.7 ms) at 1440p but leaves little at 4K (four times 1080p's bytes) or
at 144 Hz. A GPU run is the first thing slice 6 (the stream viewer) does.
A custom element with a persistent texture is the way to take those
copies out, and it is not available from outside GPUI on Linux:
Window::paint_surface (a CVPixelBuffer) exists only on macOS and iOS,
and the atlas (PlatformAtlas: get_or_insert_with, remove) has no way to
write new pixels into a tile it keeps. A custom Element can only call
paint_image, which is what img() does. What it costs: a change to
gpui-pre-wgpu (an atlas entry updated in place with write_texture, about
a hundred lines with the renderer's bookkeeping) carried as a
[patch.crates-io] and offered upstream, plus its Windows and macOS
counterparts. Since img() already holds 1440p60 above 30 fps on software
rendering, it is an optimisation for 4K and high refresh rates, not a
condition of the go.
Go. The video path works on img() with the port of today's delivery,
above the plan's threshold at 1440p60 on a software device (raw, frames from
memory with no decoder, 42 to 49 fps; with the VP8 pipeline in the process,
40.8 fps in a quiet window, less when the machine is busy), with a flat
atlas; the conditions are a GPU run in slice 6 and the per-picture cost
above.
Spike 2: composer, IME and chat lines
spikes/gpui/composer (README): a
chat view of sample messages made by voelin-ui-vm and a composer.
Check (drive.sh, ime.sh) |
Result |
|---|---|
Multi-line input: gpui-component's Textarea (TextareaState, auto-grow 1 to 6 rows, placeholder) |
works |
An emoji from the picker (the first 96 of voelin_ui_vm::emoji::archive().category(0)) goes in at the caret (TextareaState::insert): "ab", caret between, picker → "a😀b" |
PASS |
Ctrl+Enter sends without a newline (bound to Send in the Input context after gpui-component's bindings, so its "secondary enter" newline does not come first) |
PASS |
A picture on the clipboard (image/png) becomes an attachment (Textarea::on_paste, ClipboardEntry::Image) |
PASS |
A file's path on the clipboard (text that is the absolute path of an existing file; ExternalPaths for file managers) becomes an attachment |
PASS |
| The message goes with both attachments | PASS |
| A click on a masked link reaches the app with the URL and "masked" (asks first) | PASS |
| X11 preedit with a CJK input method: fcitx5 5.1.23 + Pinyin as the XIM server (on-the-spot), "nihao" typed: the input shows "ni hao" as marked text, the candidate window opens under the caret, Space commits 你好, Ctrl+Enter sends it | PASS (3 checks) |
Wayland preedit (zwp_text_input_v3) with fcitx5 under headless sway |
not exercised (below) |
Chat lines. voelin_ui_vm::chat::line turns BBCode into TextBlocks of
TextRuns (bridge.rs:195); each block is one StyledText with one GPUI
TextRun per TextRun (font, colour, background, underline, strike) inside
InteractiveText, whose clickable ranges are the link runs. Bold, italic,
underline, strike, code (the theme's monospace font on a background),
author colours, quotes, code blocks, lists, bare and masked links, a refused
javascript: link (plain text), CJK through the system's Noto Sans CJK, a
ZWJ sequence (👩💻), a flag (🇫🇷) and jumbo emoji (one to three alone) all
draw as the screenshot shows. The Twemoji archive is not needed for any of
it: TextRun.emoji only says that a run is an emoji.
Colour emoji: a gap, with a one-line fix. With this desktop's font
configuration, the smileys U+1F600 to U+1F640 (😀 😂 😍 🙀, among the most
used emoji) draw in monochrome, the others (🙂 🎉 🙋 👩💻) in colour.
The probe in drive.sh counts the glyphs GPUI draws in colour
(ShapedGlyph::is_emoji) for three lines:
| Line (colour glyphs of the emoji in it) | Emoji runs in Noto Color Emoji | Inter and its fallback chain |
|---|---|---|
a😀b (1 emoji), the system's fonts |
0 | 0 |
😂🙀🙂🎉 (4), the system's fonts |
2 | 2 |
👩💻 (1), the system's fonts |
1 | 1 |
the same three, only the Noto fonts (FONTCONFIG_FILE) |
1, 4, 1 | 1, 4, 1 |
| the same three, the system's fonts, GPUI with the patch below | 1, 4, 1 | 1, 4, 1 |
Three things in GPUI 0.3.9 and cosmic-text 0.19 add up to this:
- A font is only a primary font if it has a glyph for
m(load_familyin gpui-pre-wgpu'scosmic_text_system.rs: "The editor measures layout with the width of 'm'"). Noto Color Emoji has none, so a run whose font is Noto Color Emoji is drawn in GPUI's fallback stack, and aFontFallbackschain that names it silently drops it. - Colour emoji therefore come only from cosmic-text's own fallback list,
which on Unix tries "Noto Sans", "DejaVu Sans", … and "Noto Color
Emoji" last (
common_fallbackin cosmic-text'sfont/fallback/unix.rs). DejaVu Sans has U+1F600 to U+1F640 in monochrome, and nearly every Linux desktop has DejaVu Sans. - A glyph is drawn in colour only from a font whose PostScript name is
NotoColorEmoji(check_is_known_emoji_font, "TODO: Include other common emoji fonts"): by the code, Twemoji or JoyPixels installed as the system's emoji font would draw in monochrome (not tried).
The fix is one line in load_family (gpui-pre-wgpu 0.3.9), letting the
known emoji font through the m test, after which both a run in Noto
Color Emoji and the fallback chain draw every emoji in colour (last row of
the table; the composer's other checks pass with it):
if font.as_swash().charmap().map('m') == 0
&& !allowed_bad_font_names.contains(&postscript_name.as_str())
+ && !check_is_known_emoji_font(&postscript_name)
{
continue;
};
Step 3 carries it as a [patch.crates-io] of gpui-pre-wgpu (and sends
it upstream) before the chat slice, and bundles Noto Color Emoji (OFL,
10.7 MB) so the one font GPUI draws in colour is always there. The spikes'
committed code runs on stock GPUI; the patched run was a scratch build.
Links: a click shorter than a frame is lost. InteractiveText installs
its mouse-up listener in the frame painted after the mouse-down
(elements/text.rs), so a press and release that both arrive before the
next frame never click (the interrupted attempt lost xdotool's plain
click this way; drive.sh holds the button 120 ms). A touchpad tap can be
that short. Step 3 draws links as elements with on_click or fixes the
listener upstream.
IME. GPUI owns the preedit: its X11 backend is an XIM client (on-the-spot,
the preedit drawn in the input as marked text, the candidate window placed at
the caret from the input handler's bounds) and its Wayland backend speaks
zwp_text_input_v3 (preedit string, commit string, the cursor rectangle);
gpui-component's inputs draw the marked range. The app does nothing for it.
On Wayland the preedit could not be exercised headless: under sway's
headless backend with fcitx5 5.1.23's Wayland frontend (input-method-v2)
and wtype's virtual keyboard, GPUI enabled its text input and sent the
cursor rectangle once sway sent zwp_text_input_v3.enter (only after the
seat's focus moved away and back: sway sent none for a text input made
while the window already had focus), but the virtual keyboard's keys went
to the app as plain keys, not through fcitx5's keyboard grab, so no
preedit came (the script stayed in the scratch directory). It needs a real
session (a physical keyboard) on KDE, GNOME or sway.
Go. Every composer and message behaviour the plan asks for works with gpui-component as it is; usable preedit is shown on X11 with a real CJK input method. The emoji gap and the short-click gap are risks with known fixes, not no-gos.
Spike 3: the second window
spikes/gpui/windows (README): a
main window and a Studio-like window opened with cx.open_window
(gpui_kit::open_window, which wraps the view in gpui-component's Root),
both rendering views that cx.observe one root entity Shared.
Check (drive.sh) |
Result |
|---|---|
| Ctrl+O in the main window opens the studio's window | PASS |
| Ctrl+K twice in the studio window: the shared counter is 2 in both windows | PASS |
The global push-to-talk key (F8, voelin_platform::hotkey::HotkeyManager::x11: XInput2 raw events on the root window) held while the studio window has focus reaches the shared model (TALKING in both windows) |
PASS |
| … and its release | PASS |
| F11: the studio window fullscreen (3840x2160) and back | PASS |
| … with its own size back (1000x900) | PASS |
Ctrl+Tab in the studio window: GPUI activates the main window (Window::activate_window) |
PASS |
| Ctrl+K in the main window: the same counter, 3 | PASS |
Alt+F4 on the studio window (the window manager asks it to close): on_window_should_close docks the studio, the app goes on |
PASS |
| The hotkey with the main window active and no studio window | PASS |
| Alt+F4 on the main window ends the app (in 0.1 s) | PASS |
Keys in either window go through GPUI's action dispatch to the window's
focused view and from there to the shared entity; the hotkey's events (a
tokio UnboundedReceiver) are read by a GPUI foreground task, which needs
no tokio reactor, and update the same entity. Neither window can tell where
a change came from, which is what the Studio window of voelin-ui needs.
The preview. GPUI cannot read a window's pixels (no take_snapshot),
so the studio's picture comes from where it comes from today: the engine's
compositor (voelin_media::studio::Studio, one scene of the test pattern,
1920x1080 at 30 fps) and its preview tap at the studio's default 960x540,
15 fps (RGBA). A thread converts each preview frame into one BGRA
RenderImage; the shared entity holds the newest, both windows show the
same Arc with img(), and the one it replaces leaves every window's atlas
(cx.drop_image(old, None)). What it costs (windows/measure.sh, 45 s,
10 s of warm-up):
| Case | CPU, process | llvmpipe | main thread | compositor (engine) | preview conversion | Memory | Load |
|---|---|---|---|---|---|---|---|
| main window with the preview | 100 % | 52 % | 3.4 % | 43 % (voelin-compose 25 %, scaling, the test pattern) |
0.6 % (15 pictures a second) | 278 MiB, flat | 28 / 17 |
| both windows with the preview | 147 % | 97 % | 6.9 % | 39 % | 0.7 % | 304 MiB, flat | 17 / 26 |
| both windows, no compositor | 0.5 % | — | 0.1 % | — | — | 218 MiB, flat | 26 / 40 |
The second window showing the same picture costs about 46 % of a core
here, nearly all of it lavapipe drawing a second 1000x900 window 15 times a
second (a GPU's work), and 26 MiB; the picture is converted once (0.7 %)
and shared by Arc, and dropping the replaced one from every window keeps
memory flat. GPUI draws nothing while nothing changes (0.5 % with both
windows open and no preview).
Go. Both windows share state, both change it, focus moves either way, fullscreen and close behave, and the global hotkey reaches the shared model while the second window has focus (on X11; on Wayland the hotkey is the portal's, see "Dependencies").
Settled for step 3
The version to pin
gpui-kit 0.8.1, exactly (gpui-pre 0.3.10, gpui-component 0.8.1,
gpui-kit-assets 0.8.1; wgpu 30 where 0.8.0 had 29), in the root workspace's
[workspace.dependencies] and in spikes/gpui. The figures on this page were
measured on 0.8.0 (gpui-pre 0.3.9), the version the spikes were built on;
0.8.1 came out on 2026-10-26, a day after, and step 3's first commits rebuilt
the three spikes on it before moving the client to it. A pre-1.0 release may
change any API (the pin is exact for that reason, and gpui-kit pins its
gpui-pre exactly too); upgrades are commits of their own.
What the rebuild on 0.8.1 found (2026-10-27, Xvfb :96 with openbox and
a private D-Bus bus from headless.sh, Mesa 26.2.5 lavapipe through wgpu's
Vulkan backend: "Selected GPU adapter: llvmpipe (LLVM 21.1.8, 256 bits)
(Vulkan)"; Rust 1.95.0; one run of each README's measurement command):
cargo update -p gpui-kit --precise 0.8.1(after=0.8.1inspikes/gpui/Cargo.toml) moves 40 packages of the lock (1,069 entries before, 1,065 after):gpui-kit,gpui-base,gpui-componentandgpui-kit-assets0.8.0 to 0.8.1, the 19gpui-pre*crates 0.3.9 to 0.3.10, wgpu (and its-core,-hal,-typesand-naga-bridge) 29.0.4 to 30.0.1, naga 29 to 30, taffy 0.13 to 0.15,bit-set0.9 to 0.10;gpu-descriptor,gpu-descriptor-typesandhexf-parsego,gpui-pre-ios,naga-typesandobjc2-ui-kitcome. No source change: the three spikes build as they were (release, 8 min 54 s on 32 threads at a load average of 70).- Every check passes: the composer's
drive.sh8 PASS (and the emoji probe),ime.sh3 PASS (X11 preedit with fcitx5 and Pinyin), the windows'drive.sh11 PASS (the second window, focus, fullscreen, the global hotkey with the studio window active, both closes). The composer's screenshot of the sample chat differs from the committed one in 579 of its 900,000 pixels (ImageMagickcompare; by eye, the input's caret). - The video cases cost what they cost on 0.8.0 per frame. The machine was busier than for the 0.8.0 runs (load average 64 to 80 against 28 to 53; another task's builds), so the frame rates are lower and are not the comparison: the CPU a shown frame costs is (the process's CPU in percent of a core divided by the frames shown a second, which is 0.1 core-seconds a frame).
| Case (70 s, 10 not counted) | Shown fps | CPU, process | CPU % per fps shown | Load | 0.8.0's |
|---|---|---|---|---|---|
| static 2560x1440 (repaints) | 22.7 | 259 % (llvmpipe 250) | 11.4 | 71 / 76 | 11.7 (727 % at 62 fps) |
| raw 2560x1440, 60 fps source | 13.4 | 174 % (llvmpipe 149, main 13.7, converter 8.0) | 13.0 | 76 / 64 | 12.5 to 13.1 (525 % at 41.9; 642 % at 49.0) |
The raw case's memory stays flat (493.8 MiB at the start of the steady part,
473.3 at its end), so cx.drop_image keeps the atlas flat on 0.8.1 too; the
negative control without it (nodrop-1440p, 12 s: 2.7 pictures shown a
second at this load) grew by 408 MiB in its 10 s steady part, a 14 MiB
picture for each one shown, where 0.8.0 grew by 1.9 GiB at 13.9 shown a
second. The windows case with both windows open (windows-both, 45 s; the
other two cases were not run) took 123 % of a core, showed the preview 14.4
times of 15 a second, and its memory stayed flat. What the machine's load
hid is the absolute frame rate: the busy machine's table above does not
reproduce the 0.8.0 figures (62 fps static, 42 to 49 raw), only the cost per
frame. The review of the foundation ran the two cases again on a quiet
machine (load average 8 to 12, llvmpipe): static 2560x1440 showed 61 fps
and raw 2560x1440 59.1 fps, so the 1440p60 figures hold on 0.8.1 in
software (the raw case above 0.8.0's range); the first GPU run, in the
viewer slice, still measures the rates on a real device.
- Nothing in the spikes needed a patch for 0.8.1. The one-line emoji patch
(below) is still where it was:
load_familyis unchanged in gpui-pre-wgpu 0.3.10.
Rust 1.95 or newer. No gpui-kit release builds on the Rust 1.94 the
client used before 5ce5c0d: every gpui-pre 0.3.x (0.3.0 to 0.3.10, which every gpui-kit from
0.6.0 to 0.8.1 pins) calls std::hint::cold_path, stable since 1.95.0:
$ TOOLCHAIN=1.94 spikes/gpui/shell.sh sh -c 'cd spikes/gpui && cargo check --locked --ignore-rust-version'
error[E0658]: use of unstable library feature `cold_path`
--> …/gpui-pre-0.3.9/src/profiler.rs:473:13
error[E0658]: use of unstable library feature `cold_path`
--> …/gpui-pre-0.3.9/src/profiler.rs:494:13
error: could not compile `gpui-pre` (lib) due to 2 previous errors
(without --ignore-rust-version cargo stops before that: the workspace says
rust-version = "1.95").
So step 3 starts by moving rust-toolchain.toml to 1.95 (or the stable of
the day) in the root workspace, a change of its own with the usual checks.
The spikes build on 1.95.0 and on nightly 2026-10-24 and pass clippy with
--all-targets -- -D warnings on both. Nightly's clippy has two lints
1.95 does not: chunks_exact_to_as_chunks flagged two chunks_exact(4)
loops in spikes/gpui/common/src/bgra.rs (the packed-RGBA branch and a
test), now as_chunks::<4>() (stable since 1.88); behind them, because
clippy stops at the first crate that fails, for_unbounded_range flagged
the raw source's for n in 0u64.. in spikes/gpui/video/src/main.rs, now
0..=u64::MAX.
Dependencies
- ashpd. GPUI's Linux backend enables ashpd's
async-iofeature; the client'svoelin-media(pipewire: the screen-cast and camera portals) andvoelin-platform(portal: global shortcuts, file chooser, proxy resolver) enabletokio, and ashpd refuses both at once (compile_error!in ashpd 0.13.13). The spikes leave both features out (X11 capture and hotkeys only). Step 3 must move the client's ashpd use toasync-iobeforevoelin-uican depend on gpui-kit with PipeWire capture and the portal hotkey; zbus withasync-ioruns its own I/O thread, so it does not need GPUI's executor. Done: voelin-media'spipewireand voelin-platform'sportalfeatures ask ashpd forasync-io, andvoelin-gpuiholds both (it depends onvoelin-corewithmedia-desktop, which brings PipeWire, and onvoelin-platformwith its portal feature). What zbus 5.19 does with the features (read in its source): withasync-ioandtokioboth compiled in it picks an executor once per connection, tokio when a tokio runtime is current on the thread that builds it andasync-iowith an I/O thread of its own otherwise. ashpd keeps one session connection for the whole process (a static in itsproxy.rs), so the first ashpd caller decides the executor of every later portal call: when a tokio caller builds it first, a laterProxy::newfrom a thread with no runtime (a GPUI foreground task) panics with "there is no reactor running" (get_property("version")sets up zbus's property cache, which callstokio::task::spawn). The move ofe325b65left both compiled in (voelin-platform's notify-rust asked zbus fortokio,z-with-tokio), and the merged binary was safe only because GPUI's colour-scheme call builds the connection before the engine's portal calls do. Fixed (the Opus gate's option a): notify-rust asks forz(async-io), so zbus is compiled withasync-ioalone in every binary, the Slint app's included, and every connection has an I/O thread of its own whoever builds it first (cargo tree -e features -i zbusnamestokionowhere; voelin-platform's own test dependency on zbus isasync-ioas well, since a test binary with both features shows the panic again). Two tests in voelin-platform (tests/proxy.rs, each on a private D-Bus bus) call ashpd from a thread with no tokio runtime and get the answer, the second after a tokio caller built the connection; that one fails with the panic above on the tree before the change. - Size and compile time. In the root workspace, which already carries
Slint's and the codecs' dependencies, the foundation adds 292 entries to
Cargo.lock(218 new names; 279 from gpui-kit, 13 from itstest-supportdev-dependency, which ships in no binary; gpui-kit's are about 195 packages on Linux), and cargo deny needed two licences it had not allowed, 0BSD and CC0-1.0. The spikes' lock has 1,069 packages; the release binaries are 390 to 480 MB with line tables. A full debug build of the workspace with a toolchain it had not built with before (nightly) took 3 min 14 s on the 32 threads at a load average around 90.
The Linux renderer
The plan says "blade: Vulkan"; gpui-pre 0.3.9 renders through wgpu
(gpui-pre-wgpu), which finds Vulkan and GL adapters and takes the first
that passes its configuration test (here: llvmpipe on Vulkan; GL was found
too). Both backends are a go on this machine's software device: X11
(Xvfb with openbox) for every measurement; Wayland (sway's headless
backend, its pixman renderer, a 2560x1440 output) opens the window, draws
it, takes keys (the composer through a virtual keyboard) and enables its
text input. Its frame rate there was low: spike 1's static and raw 1440p
cases showed 15.3 and 13.1 fps at a load average rising from 40 to 148,
where X11 showed 62 and 42 to 49; a rerun with the compositor's own CPU
measured beside it (to tell sway's pixman compositing at 2560x1440 from
GPUI's Wayland path) did not find a quiet machine in time, so the Wayland
frame rate stays an open point for step 3, to be measured on a real
session. What it needs:
- On a real GPU: a Vulkan driver (Mesa RADV, ANV or NVK, NVIDIA's) or
GL as wgpu's fallback; nothing else in the app changes. The rasterising
the tables charge to
llvmpipemoves to the GPU; the per-frame upload of a new picture (spike 1) stays on the CPU's side as two copies of the picture. - Software only (a VM, a remote desktop): lavapipe works and is what these figures measure. A 2560x1440 window repaints at 60 fps with nothing new to upload and at 42 to 49 with a new picture every frame (raw: from memory, no decoder; 41 with the VP8 pipeline in the process, in a quiet window), on 5 to 7 of this CPU's cores; the UI around it costs little (spike 3's windows, 1000x900 and 1200x900, cost half a core each at 15 frames a second).
- X11 needs a window manager for fullscreen, activation and close requests
(openbox here); GPUI asks for XInput 2.4 and logs "Found no xinput mouse
pointers" on Xvfb, harmlessly. On Wayland, GPUI needs a seat (weston's
headless backend has none, so
headless-wayland.shuses sway).
Inter and Lucide
- Inter: the five TTFs the client bundles (
crates/voelin-ui/ui/assets/fonts) go in withcx.text_system().add_fonts(spike_common::fonts) and are used by family name; the screenshots are Inter. Nothing depends on what fontconfig finds for Latin text. - Lucide through
svg(): anAssetSourceserves the client's own 147 Lucide 1.48 SVGs (voelin/<name>.svg, read fromcrates/voelin-ui/ui/assets/icons) before gpui-kit-assets' Lucide 1.43 catalog (icons/<name>.svg, what gpui-component'sIconuses);svg()draws them as masks tinted withtext_color(the composer's emoji and send buttons). Two Lucide versions side by side is the one thing to settle: step 3 serves the client's set under gpui-component's paths (icons/) so both draw the same icons.
The theme against "Theme tokens"
gpui-component's theme (Theme, ThemeColor: about 135 colours; JSON
themes through ThemeRegistry, light and dark) is shadcn's vocabulary;
gpui-base 0.8 adds code-level tokens (radius none/sm/md/lg/xl/full, spacing
xxs to xxl, type xs to xl and mono, shadows, motion 120/180/280 ms). The
client's tokens (docs/ui.md, "Theme tokens") map like this:
ui/theme.slint |
gpui-component | |
|---|---|---|
mode, dark |
ThemeMode, Theme::change, the registry's light and dark themes |
"system" follows the window appearance |
font-scale |
font_size (one base size) |
the eight type sizes scale in the client's code |
bg-app |
background |
|
backdrop (gradient) |
a gradient token (0.8's ThemeToken parses linear-gradient) |
|
bg-rail, surface |
sidebar.background, title_bar.background |
|
surface-2 (cards, inputs) |
secondary.background, group_box.background |
|
surface-3 (hover, menus) |
accent.background, list.hover.background, popover.background |
gpui-component's "accent" is a hover background, not the brand colour |
surface-4 (pressed) |
secondary.active.background |
|
scrim, scrim-light, overlay |
overlay |
one value for three |
border, border-strong, border-popup |
border, input.border, — |
|
glow, glow-width |
ring |
no width |
accent, accent-hover, accent-pressed, on-accent |
primary.background, primary.hover.background, primary.active.background, primary.foreground |
|
accent-soft (selected rows), accent-soft-hover |
list.active.background, table.active.background; — |
|
accent-text (links), name-text |
link.foreground (and hover, active); — |
|
danger, success, warning, info |
danger.background, success.background, warning.background, info.background (with hover, active, foreground) |
|
*-soft, live, live-soft, idle, dnd, offline, gold, meter-* |
— (base.red … base.cyan and their light variants are a palette, not roles) |
|
text, text-muted |
foreground, muted.foreground |
|
text-secondary, text-disabled, icon |
— | |
radius-xs … radius-pill |
radius (6), radius.lg; gpui-base's radius tokens |
five steps against two in JSON |
space-1 … space-8 |
gpui-base's spacing tokens (code, not JSON) | |
font-xs … font-3xl, weights |
gpui-base's type tokens (code) | |
sizes (control-height 36, row-height, rail-width, …) |
— (gpui-component sizes its controls itself: Size::Small/Medium/Large) |
|
fast 120 ms, normal 200 ms |
motion tokens 120/180 ms |
So the theme is two layers: a VoelinTheme global with every token of
theme.slint (the source of truth, light and dark), and on each change the
colours gpui-component's widgets read written into its ThemeColor (about
40 of the 135), so its inputs, lists, menus and dialogs look like ours. A
gpui-component JSON theme file alone cannot carry the presence, live, meter
and size tokens.
What step 3's first slice (the desktop shell) must contain
- The toolchain move to 1.95 and ashpd on
async-io(above), each its own commit with the root workspace's checks. - The GPUI front end's crate (its name to choose; the plan keeps both UIs
as two
[[bin]]s on the sameHostedEngineuntil parity), withgpui-kit = "=0.8.0"or the version the spikes were rebuilt on, and the deny and notices updates for its ~1,000 packages. - The root entity
Entity<AppState>, the engine's events through a GPUI foreground task (spike 3's hotkey task is the pattern), the 1 s tick as abackground_executor().timerloop. VoelinThemewith the two layers above, Inter viaadd_fonts, the client's Lucide set as gpui-component'sicons/.- The shell itself (slice 1 of the plan: ≈13 properties and 11 callbacks of
bind/servers.rs): the server rail, the sidebar, the top bar, empty main area, window state, with screenshots made thedocs/ui.mdway (headless.shhere is the GPUI equivalent of its xvfb recipe). - A meter like
spike_common::meter(CPU by thread group, memory, the app's own counters, once a second) as a development switch, so every later slice can say what it costs.
Not in it: video (slice 6) needs the decision of spike 1's "What a real GPU changes"; emoji need the patch above before the chat slice (4).
Items 1, 2, 3, 4 and 6 are done on phase5/gpui-foundation (2026-10-27), a
commit each (item 1 as two, item 2 as two: the spikes rebuilt on 0.8.1, then
the crate; item 4 with one small follow-up): Rust 1.95.0 and the seven lints
it adds; ashpd on async-io; crates/voelin-gpui
on gpui-kit = "=0.8.1"; the root Entity<AppState> with the engine's events,
the one-second tick and Later; VoelinTheme, Inter and the client's Lucide
set; the meter as VOELIN_METER=1. The crate is named voelin-gpui (binary
voelin-gpui), the choices below stayed as the report leaves them except
those named in docs/ui.md ("The GPUI front end"): the theme's second layer is
written as a ThemeColor mapping (a table there), and the client's Lucide set
is served under gpui-component's icons/ paths. Item 5, the shell, is done on
phase5/gpui-shell (the status paragraph above, docs/ui.md "The desktop
shell"): the screenshots are made the docs/ui.md way
(scripts/gpui-shot.sh under headless.sh), the form that adds a server is the
shell's own until the dialogs slice, and the open choices that remain (video,
emoji, links) are untouched by it.
The risks of plan section 6, against what was seen
| Risk (plan) | Seen |
|---|---|
| Pre-1.0 API churn | Real: 0.8.1 came a week after 0.8.0; gpui-pre pins move in lockstep. Pin exactly, upgrade in commits of their own, rebuild the spikes first. |
| Wayland IME, fractional scaling | X11 preedit works; Wayland's text-input-v3 is implemented by GPUI (enable, cursor rectangle, preedit and commit strings) but was not exercised end to end headless: a check on a real session is part of the chat slice. Fractional scaling not exercised (Xvfb at scale 1, GPUI_X11_SCALE_FACTOR=1). |
| Accessibility weaker than Slint's | GPUI talks to AT-SPI (accesskit_unix, atspi in the tree; "org.a11y.Bus" looked for at start); not exercised. |
| Compile time | 1,069 packages; a full debug build 3 min 14 s on 32 threads under load. |
| New: colour emoji | GPUI draws U+1F600 to U+1F640 from DejaVu Sans in monochrome on most desktops; one-line patch above. |
| New: ashpd features | GPUI and the client's portals cannot share a binary until the client uses async-io. |
| New: short clicks on links | InteractiveText loses a click shorter than a frame. |
| New: video upload cost | Every new picture is a new atlas texture plus two copies (spike 1); a persistent texture needs a GPUI change. |
| New: Rust 1.95 | gpui-kit needs it; the client moved to 1.95.0 in 5ce5c0d (seven lints fixed). |
Open choices for step 3
- Video:
img()as measured here, or the persistent-texture change to gpui-pre-wgpu. The GPU run of the viewer slice decides; the cases that could need it are 4K, high refresh rates and several streams on screen at once (the per-picture cost on GPUI's thread adds up per stream: four 1080p60 tiles would be about 8 ms of every frame on this path). - Emoji: carry the one-line GPUI patch (
[patch.crates-io]ofgpui-pre-wgpu) and send it upstream, or bundle Noto Color Emoji and a font configuration without DejaVu's emoji range (not possible from inside the app: cosmic-text reads the font database, not fontconfig's order). - Icons: the client's Lucide 1.48 set under gpui-component's paths, or gpui-kit-assets' 1.43 catalog with the client's additions.
- Theme: which gpui-component colours the
VoelinThemewrites (about 40) and whether its JSON format is offered to users at all. - Links: elements with
on_clickper link, or a fix ofInteractiveText.
History
An attempt of 2026-10-25 wrote the workspace, the three spikes, their scripts and READMEs, ran the composer, IME and windows scenarios and a few 720p trial runs (at a load average of 100 to 157, so not used here), and was interrupted before it committed anything or measured the video cases. Its work was judged on 2026-10-27, kept, and committed in four pieces (the commit messages say what changed in each); the changes:
shell.shtakes 1.94 and nightly from the pinned fenix (the store paths it named had been garbage-collected); the README's Wayland paragraph (sway, not weston), itscargo fmtcommand (-p, not--all, which takes in the client's crates) and its toolchain lines.- Spike 1:
--mode static(the control: no new pictures) and its two cases inmeasure.sh. - Spike 2: one GPUI text run per
TextRuninstead of highlights (each run its font: emoji, monospace for code, whichfont_family("monospace")did not find); a sample of the smileys DejaVu Sans has; the emoji probe in place of a font probe that printed "?" for every fallback font. - Spike 3: the window's size after a fullscreen toggle logged and checked;
how long the app takes to end;
windows/measure.shin place of README commands that wrote into the current directory.
Nothing was dropped. The 720p trial runs, the 2026-10-25 screenshots and
the extracted gpui-pre crates the attempt used to look for cold_path
stayed in the attempt's scratch directory.
Found while measuring, and fixed in two commits of their own: the headless
scripts did not move XDG_STATE_HOME, so the Slint app's runs (on
2026-10-25, and three on 2026-10-27) wrote their logs into the desktop's
~/.local/state/voelin/logs, whose five rotated files are now all from
these runs; and headless-wayland.sh left every headless sway running
(nixpkgs' wrapper puts sway under a dbus-run-session of its own), which
it now does not.




