docs/ui.md: "For the next slices", the risks of the gate and the review; the report's quiet-machine figures

The risks the Opus gate and the review of the foundation left to the slices
that meet them, each with where it sits in the code: the engine-event task
drains its channel without yielding, the tick notifies the root every second,
voelin-platform's hotkey portal calls tokio::spawn (start it on the engine's
runtime as Slint's GlobalPtt::start does), PortalCapture::stop closes the
portal session only inside a tokio runtime, gpui-component's ThemeRegistry
observer overwrites VoelinTheme's mapping on any registry change, the parity
test and build.rs read crates/voelin-ui/ui (they move at step 9), system
mode's first frame is Light until the colour-scheme portal answers, the gate's
deviations from the report's mapping table (bg-rail not mapped, one scrim for
three, gpui-base's non-colour tokens not written), and the close grace not
seen end to end until a slice opens sessions.

docs/design/gpui-spikes.md: "the 1440p60 figures were not reproduced on
0.8.1" now carries the review's quiet-machine re-run of the two cases (static
61 fps, raw 59.1 fps, load average 8 to 12, llvmpipe).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-27 12:31:05 +03:00
1 parent 5c94b15820
commit e5f8821f67
2 files changed
+62 -3

No files matched your search

+7 -3
View File
@@ -419,9 +419,13 @@ Vulkan backend: "Selected GPU adapter: llvmpipe (LLVM 21.1.8, 256 bits)
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 1440p60 figures above (42 to 49 fps
raw) were not reproduced on 0.8.1**, only the cost per frame was; the first
GPU run, in the viewer slice, measures the rates.
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_family` is unchanged in gpui-pre-wgpu
0.3.10.
+55
View File
@@ -1166,6 +1166,61 @@ entries); the in-window keys as GPUI key bindings and the global ones through
`async-io`); and last the removal of Slint (`build.rs`, `ui/`,
`voelin-android`, `LicenseRef-Slint` of `deny.toml` and `about.toml`).
### For the next slices
What the foundation's review and the Opus gate (2026-10-27) found and left to
the slices that meet it; none of it is a defect of what exists today.
- **The engine-event task drains its channel without yielding** (`app.rs`,
`while let Some(event) = events.recv().await`): a burst of events (a server's
first sync) keeps the receiver ready, so the loop handles them back to back
without returning to GPUI's executor (a tokio receiver is cooperative only
inside a tokio runtime), and the window waits for the whole burst. The shell
slice takes what is queued in one go (`try_recv` after the first event, one
`update`, one `cx.notify()`) or yields between events.
- **The tick notifies the root every second** (`AppState::tick`), which draws
the window once a second whether or not anything changed. Notify only on a
change once the shell shows more than the uptime (the line of state moves
with it today, and it is how the loop is seen to run).
- **The hotkey portal calls `tokio::spawn`** (`voelin-platform`,
`hotkey/portal.rs`, `PortalBackend::new`): it panics where no tokio runtime
is current, and a GPUI foreground task has none. The GPUI front end starts
the hotkey task on the engine's runtime (`runtime.spawn(...)`), as the Slint
front end's `GlobalPtt::start(runtime, ...)` does, not from a foreground task.
- **`PortalCapture::stop` closes the portal session only inside a tokio
runtime** (`voelin-media`, `capture/portal.rs`: `Handle::try_current()`;
elsewhere the session closes only with the connection). Stop a capture inside
the engine's runtime, not on GPUI's thread.
- **gpui-component's `ThemeRegistry` observer overwrites `VoelinTheme`'s
mapping:** any change of the registry (loading JSON themes, `watch_dir`) runs
`Theme::change(mode, None, cx)` on the active theme, which puts the registered
theme's colours over the `ThemeColor` the second layer wrote. A slice that
offers JSON themes or watches a theme directory re-applies `VoelinTheme`
after the registry changed.
- **The parity test and `build.rs` read `crates/voelin-ui/ui`** (`theme.slint`
through `include_str!`, the icons directory), and `fonts.rs` the Inter files
there: they move with step 9, when Slint goes (the icons and fonts to this
crate, `tokens.rs` as the source of truth, the parity test removed).
- **System mode's first frame is Light** until the colour-scheme portal answers
(`cx.window_appearance()` before the window exists; `set_system_appearance`
follows the answer): a dark desktop sees a light frame at start. The shell
slice, which reads the settings, can start from the last resolved mode.
- **The gate's deviations from the mapping table** of the report ("The theme
against Theme tokens"): `bg-rail` is not mapped (the report has it with
`surface` on `sidebar.background`; the sidebar takes `surface` and the shell
reads `bg-rail` from `VoelinTheme`), one scrim stands for three (`scrim`,
`scrim-light` and `overlay` are three values in `theme.slint`; gpui-component's
`overlay` gets `scrim`), and gpui-base's non-colour tokens (radii, spacing,
type, shadows, motion) are not written: gpui-base 0.8.1 has no storage to
write them to, so those live in `VoelinTheme::metrics` only.
- **The close grace is not seen end to end** until a slice opens sessions:
`run()` waits `CLOSE_GRACE` (500 ms) for the engine to send the closes only
when the window's close found sessions to close, and the binary opens none
yet (the unit test counts the closes `shutdown` sends, and the engine ignores
a close for a session it never opened). The first slice that opens a session
checks against a server that no ghost client stays behind after the window is
closed.
## Limits
- No drop shadows or blur (the software renderer draws none): glows are