Skip to content

vector-gpui: native GPUI client (experiment) - #102

Draft
JSKitty wants to merge 1092 commits into
masterfrom
gpui
Draft

JSKitty wants to merge 1092 commits into
masterfrom
gpui

Conversation

@JSKitty

@JSKitty JSKitty commented Nov 11, 2026

Copy link
Copy Markdown

Requested by JSKitty · project thread

A long-lived experiment branch: Vector drawn natively with GPUI instead of a webview, aiming for exact parity in layout, palette, fonts and features with the Tauri client. It isn't meant to merge any time soon; the PR is here so the diff and discussion stay in one place.

What's in this first cut

  • crates/vector-gpui: its own workspace and lockfile, so it never touches the Tauri client's dependency graph. The only shared-file change is excluding it from crates/Cargo.toml. GPUI is pinned to Zed f8cfc7e.
  • The widescreen shell: window chrome with client-side decorations, the rail (Messages, New Messages, Communities, Collapse, account), the chat list (virtualised uniform_list) and the open chat (virtualised list with date and NEW dividers). The NEW divider stays put while the chat is open.
  • The composer: real text input with selection, clipboard and IME. Enter sends a local echo; the send pipeline isn't wired up yet.
  • Types come straight from vector-core (SerializableChat, SlimProfile, Message). data.rs mirrors the JS derivations (getName, chatPreviewText, timeAgo, unread counts), and each helper names the function it copies.
  • Icons are compiled in from src/icons, so an icon changed in the Tauri client arrives here on the next build. Rubik is cut from the shipped variable font into static weights; Inter is bundled too.

Parity harness (reference/)

capture.mjs boots the real frontend in Chromium through its debug hot-reload path, using mock-tauri.js and the same fixtures.json. It needs no Rust, account or network. It saves a screenshot plus every element's box, font, colour and border. shot.sh renders vector-gpui under Xvfb, and compare.py puts the two side by side with a diff.

On the 1200×760 chat screen, 1.8% of pixels differ by more than 24/255. Most of that is text anti-aliasing; the remaining offsets are about 1px.

Numbers (release build, Linux, software Vulkan)

  • Window on screen 45 ms after launch.
  • About 42 MB of private anonymous memory. Total RSS is 155 MB here, but ~70 MB of that is Mesa's software renderer (libLLVM, lavapipe), which a real GPU driver doesn't load.
  • Binary is 27.8 MB stripped, including 4.4 MB of fonts.

Known gaps

  • Only the widescreen layout so far, not slim or the Centre Console.
  • No live account yet: it reads fixtures, not vector-core's DB or relays.
  • GPUI has no letter-spacing, so the NEW label spaces its letters by hand.
  • Ellipsis truncation differs slightly from CSS: CSS keeps the trailing space before ….

Generated by Claude Code

@JSKitty JSKitty self-assigned this Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

JSKitty commented Nov 11, 2026

Copy link
Copy Markdown
Author

The claude check failed, but the cause isn't this PR. The Claude Code workflow runs on every opened PR, and it stops at its environment validation because ANTHROPIC_API_KEY is empty in the job: no API key, OAuth token or federation rule is set for the repo. The same job failed on the fix-audio-crackling PR 40 minutes earlier for the same reason. This PR doesn't touch .github/, and adding a repo secret is beyond what a PR can do, so there's no fix to port here. It goes green when a maintainer adds ANTHROPIC_API_KEY (or CLAUDE_CODE_OAUTH_TOKEN) to the repository secrets. Alternatively, dropping the bare pull_request trigger from .github/workflows/claude.yml stops it running unasked.


Generated by Claude Code

Comment thread .github/workflows/gpui.yaml Fixed
Comment thread .github/workflows/publish.yaml Fixed

JSKitty commented Nov 13, 2026

Copy link
Copy Markdown
Author

The vector-core failure on b72983b is community::v2::service::tests::a_mint_whose_delivery_lost_a_part_leaves_nobody_out ("the part a relay dropped served nobody"). It comes from master and isn't caused by this PR: the only vector-core file this branch changes is text_color.rs. The test is flaky on master's code: it failed 1 of 6 local runs at the merged master tip. A likely cause is that which recipients end up in the dropped second part depends on iteration order, so sometimes that part holds none of the writers the assertion expects. Leaving it for the master side rather than patching community code on this branch.


Generated by Claude Code

JSKitty commented Nov 14, 2026

Copy link
Copy Markdown
Author

The build (macos-26-intel) failure on 6942f69 has no failed step and no log (the job log returns BlobNotFound), so it looks like the runner was lost rather than a build or test error. That commit is superseded, and CI is running on the current head 3a2d305.


Generated by Claude Code

JSKitty commented Nov 14, 2026

Copy link
Copy Markdown
Author

vector-core on 2560e5b failed in control_sync::a_relay_that_caps_open_sessions_is_never_written_off_and_every_plane_still_compares (its first assert, with 24 concurrent reconciles against an 8-session cap). That commit only touches the vendored GPUI in crates/vector-gpui, and the test and the transport it covers are unchanged from master. It passes 6 out of 6 times locally, so this looks like a timing flake in a master test, not this PR's change.


Generated by Claude Code

JSKitty commented Nov 14, 2026

Copy link
Copy Markdown
Author

build (macos-26-intel) on ce4c294 failed in the Tests step with "The hosted runner lost communication with the server". Build passed, and there is no log (BlobNotFound). This is the same runner loss as on 6942f69, not a code failure. The newer pushes (9b3b16f, e5d3370) run the job again.


Generated by Claude Code

JSKitty commented Nov 15, 2026

Copy link
Copy Markdown
Author

The vector-core test failure on 10ca012 (control_sync::a_relay_that_caps_open_sessions_is_never_written_off_and_every_plane_still_compares) isn't caused by that commit, which only touches crates/vector-gpui (code highlighting). The test hit two "too many open negentropy sessions" refusals under its cap, which looks timing-dependent on a loaded runner. The next push (b9d7ce0) reruns the suite.


Generated by Claude Code

JSKitty commented Nov 15, 2026

Copy link
Copy Markdown
Author

CodeQL's two new high alerts on 752bdc2/56616efd ("Access of invalid pointer", crates/vector-gpui/vendor/gpui_windows/src/platform.rs:1107 and :2001) are in upstream Zed code that came in with the verbatim vendoring of gpui_windows at the pinned rev (a0f3fd0); our only change there is the open dialog's file-type filter. Both dereference a CREDENTIALW that CredReadW just filled: the first after an explicit null check, the second in an upstream test. Neither is reachable with an invalid pointer, so I'm leaving them as they are and not patching upstream code for it.


Generated by Claude Code

JSKitty commented Nov 15, 2026

Copy link
Copy Markdown
Author

The vector-core failure on 7a4ebb0 is community::v2::service::tests::a_mint_whose_delivery_lost_a_part_leaves_nobody_out ("the part a relay dropped served nobody", service.rs:30010), a timing-sensitive relay test. The only vector-core change since the last green run is a defaulted MediaSource::remote() (returns false, used only by the GPUI stream reader), which no community code calls, so this is not from this PR. The next run on 689115a will retry it.


Generated by Claude Code

JSKitty commented Nov 15, 2026

Copy link
Copy Markdown
Author

Windows build on b16933a fails one new test, backend::stream::tests::a_reader_in_two_distant_regions_fetches_each_byte_once: a read there timed out after 45 s, while the test passes on macOS. It is a real intermittent stall in the region-aware stream fetcher (a waiting read that never gets served), not a flake to retry. The single-task fetch loop is being replaced with per-connection tasks, and that change will carry the fix along with a repeated run of this test.


Generated by Claude Code

JSKitty commented Nov 16, 2026

Copy link
Copy Markdown
Author

The vector-core failure on a365815 is community::v2::service::tests::control_sync::a_relay_that_caps_open_sessions_is_never_written_off_and_every_plane_still_compares. It isn't from this commit: a365815 changes only crates/vector-gpui/src/emoji.rs, and the same vector-core code passed on the commit before it (7bbd8ea), so it looks like that test is timing-sensitive on the runner. The other 2893 tests passed.


Generated by Claude Code

JSKitty commented Nov 16, 2026

Copy link
Copy Markdown
Author

The Tests failure on d748a88 is community::v2::service::tests::a_mint_whose_delivery_lost_a_part_leaves_nobody_out in vector-core ("the part a relay dropped served nobody"). It isn't from this push: d748a88 changes only crates/vector-gpui, and the same vector-core tree passed Tests on ba90624 an hour earlier. It looks like a timing-dependent test, so I'm leaving it alone here.


Generated by Claude Code

JSKitty commented Nov 17, 2026

Copy link
Copy Markdown
Author

The build (macos-26-intel) failure on ca099ef is infrastructure, not code: GitHub's annotation says the hosted runner lost communication with the server mid-build, after 75 minutes. The run for the current head (46776a2) is in progress and covers the same code.


Generated by Claude Code

JSKitty commented Nov 17, 2026

Copy link
Copy Markdown
Author

The vector-core failure on 96d65fa (a_sibling_that_wins_the_tie_over_the_held_head_holds_a_mint_back) is a rare flake in master's own test, not this PR: it grinds 1000 random rumors for an id below the held head's and unwraps the find, which comes up empty about 1 run in 1000 when the head's id happens to be small. This branch doesn't touch that file. I've rerun the failed job.


Generated by Claude Code

JSKitty commented Nov 18, 2026

Copy link
Copy Markdown
Author

The red vector-core job on bf4107b is one master test, not this PR's code: control_sync::a_relay_that_caps_open_sessions_is_never_written_off_and_every_plane_still_compares failed the same way on master's own run at 32dcb9a (run 44124478117), and this branch's diff to master doesn't touch community/transport.rs, plane_neg.rs or that test. It passed every one of over 100 local runs, many of them in parallel or pinned to one core.

Likely cause, proposed rather than pushed since it changes core timing: plane_neg::reconcile's CloseGuard sends NEG-CLOSE from a spawned task, while LiveTransport::reconcile drops its neg_permits permit as soon as the call returns. The next waiter can send its NEG-OPEN before those closes reach the socket, so under a starved runtime the relay briefly counts more than NEG_SESSIONS_PER_RELAY sessions and answers "too many open negentropy sessions". Proposed fix: acquire with acquire_owned() and move the permit into CloseGuard, dropping it only after the NEG-CLOSE send_msg completes.


Generated by Claude Code

JSKitty commented Nov 19, 2026

Copy link
Copy Markdown
Author

The red vector-core check on 13a5d1c is a flake that this PR didn't cause. community::v2::service::tests::control_sync::a_relay_that_caps_open_sessions_is_never_written_off_and_every_plane_still_compares failed at control_sync.rs:1740. That commit only touched GPUI dev tooling, and the same check passes on 9248431, which has the same vector-core.


Generated by Claude Code

Comment thread .github/workflows/fdroid.yaml Fixed
A press and hold opens whatever a right click would, before any tooltip,
and the tap it began never fires. A sideways touch pan no longer scrolls a
vertical list, so it is free to be a swipe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetJnzXvEeXAvSsgvs1
The keyboard goes when no field has focus any more, and a dialog's close
button keeps its finger-sized target beside a long title at phone width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetJnzXvEeXAvSsgvs1
The Communities rail, a channel's drawer and the details sheet follow the
finger and settle by fling or distance from wherever they are mid-slide. A
DM or one-channel community swipes right to pull the chat list back over
it, and leaves the chat when let go past halfway. Swipe a message left to
reply, with the chip igniting past the trigger and a spring back short of
it. The system back gesture gives way on the bands these swipes start in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetJnzXvEeXAvSsgvs1
The Actions cache entry that held it was evicted once the repo's caches
passed 10 GB, and Gradle made a new key, so the next APK would not install
over the last. GPUI_ANDROID_DEBUG_KEYSTORE holds it for good; without the
secret the cache still serves, with a warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetJnzXvEeXAvSsgvs1
Leaving a chat for the list, or a Community for a DM, left no chat open, so
the next chat opened inherited the composer: its text and a pending reply
to a message from elsewhere. The composer now remembers whose it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetJnzXvEeXAvSsgvs1
A window at rest draws nothing, so the pictures on screen stopped counting
as used and were dropped from the cache and the atlas. The first redraw
afterwards, a hover included, painted them blank for a frame and loaded
them again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetJnzXvEeXAvSsgvs1
0.6.0-1: Android version code 60001, shown as "v0.6.0 Preview 1".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetJnzXvEeXAvSsgvs1
A packaged build's default fixtures path is the build machine's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetJnzXvEeXAvSsgvs1
claude and others added 30 commits December 2, 2026 15:45
Fast pointer moves over a chat of animated reactions made frames hitch:
held two or more frames' worth, then skipped. Two races, both fed by
the rebuild every hover causes:

- A rebuild moves a record to its due frame; the step then saw nothing
  to do, so a picture on a compositor layer kept its old frame until the
  next boundary. Each layer now remembers the frame it last received
  and is sent any other.
- Re-arming the animation wake replaced a pending wake that had come due
  but not yet run; its task then found itself stale and the step slipped
  up to a frame. A wake at or before the new one now stands, unless it
  is 250 ms overdue (its task taken for dropped).

Fixture channel of 40 messages, 318 animated reactions and animated
avatars, ~42 pointer moves/s for 10 s (M4 Max):
  layers on:  frames held 2x+ 734 -> 0, skipped 1356 -> 0
  layers off: frames held 2x+  99 -> 0, skipped  216 -> 0

Placing layers cost 2.1 ms per hover draw: each copy of a picture
re-read its pixels for opacity. Copies now share the answer, sprites are
found by a hash of where they are drawn, and cover checks visit only the
primitives in the picture's 64 px bands. Now 0.11 ms. On macOS an
unchanged layer is no longer re-set, and the present joins the layers'
transaction only when one came, went or moved.
  CPU while moving, layers on: 18.6% (cfbca80) -> 17.0-19.8%

Diagnostics: devctl `layers` (each animation layered, or why it fell
back, and where), `frametrace` (frame changes, stalls, skips), and
GPUI_MEDIA_CENSUS=1 to log the layer census to stderr in any build.

Pixel parity, layers on vs off, unchanged from cfbca80 (GIF chats of 6
and 20). GPUI lib suite 430 passed; no-video check clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pinned copy is laid out at its section header's exact size, and the
panel clips both ways so its children take the rounded corners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6Resh8tBf22SM91353hY
The sprite shaders filtered straight-alpha texels, so a clear texel's
colour bled a dark fringe into a transparent picture's edge wherever it
was scaled. The compositor layers that show animations on macOS filter
premultiplied, as browsers do, so a layered transparent emoji differed
from the window's drawing of it by up to 64 levels at its edge.

Where the four texels the filter mixes are not all opaque, the Metal,
WGSL and HLSL sprite shaders now mix them premultiplied. Opaque texels
keep the sampler's own result, so opaque pictures are unchanged.

Layers on vs off, frozen frame, fixture chats of animated transparent
emoji (M4 Max): max diff 64 -> 5 (DM), 64 -> 5 (channel). GIF chats of 6
and 20: unchanged (max 7, as cfbca80). glcheck OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The layer census on a channel of animated reactions, inline emoji and
animated avatars found five animations falling back to the window's
drawing, and one is enough to keep the window presenting:

- Inline emoji whose box a neighbouring glyph's raster bounds clipped
  by a pixel. What is drawn over an animation now counts only where
  some frame of it has ink: over pixels clear in every frame (the
  filter's reach of a texel each side included) the window's drawing
  shows through the layer as it would through the picture. Backdrops
  still count everywhere, since they blur what is under them.
- Emoji under the timeline's top fade, whose 40px quad is clear past
  its first 8px but still dithered there. The top and bottom fades are
  now just their 8px; pixels below change by at most 3 levels, only
  in those bands (dither noise over the rows removed).

Fixture channel at rest, 30 s, layers on (M4 Max):
               layered  presents/s  CPU    WindowServer  footprint  GPU pool
  cfbca80      44/49    16.8       7.6%   23%           333 MB     242 MB
  this          49/49     0.0       4.0%   13%           106 MB      15 MB
Emoji DM fixture: 61/63 layered; two inline emoji straddling the header
still fall back (an edge of a fill crosses a scaled frame).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Text-size custom emoji (message text, previews, reply bar, reactions, edit
history) decode once per device-pixel box, with a Lanczos-3 filter over
premultiplied alpha, and their inline box snaps to whole device pixels: each
frame pixel lands on one window pixel, so a layer shows it without scaling.
The picker, shortcode list and jumbo rows keep their larger decodes.
VECTOR_EMOJI_EXACT=0 turns it off.

Layers showing one picture with the same fills share one ring of IOSurfaces:
a frame step writes once, and every copy points at the surface.

A transparent picture under a fill now stays on its layer: the fill is
blended atop the picture, which over the window's own fill composes exactly.

GPUI_MEDIA_CENSUS=1 logs every 10 s what asked for redraws, by code site,
and what holds memory, by subsystem. Counts and sizes only.

Emoji DM fixture: decoded emoji 3.9 -> 0.5 MB, 63/63 animations layered,
presents at rest 11.9 -> 0/s, layer-vs-window parity max 6.
318-reaction channel: surfaces 147 -> 39 (2.3 -> 0.6 MB), frame writes
829 -> 218/s, show_media_frame 8.4 -> 3.6 ms/s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three seconds after the display link pauses, a 1x1 drawable size empties the
layer's pool while the shown surface stays its contents (41.3 -> 13.9 MB of
IOSurface at rest for a 1000x900 window). A frame request restores the size and
takes the first drawable on another thread while GPUI lays out, so the main
thread waits ~0 ms for it. Opt out with VECTOR_SHED_DRAWABLES=0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UI store profiles by field, chats, rosters, nicknames, communities; core's
profiles, chats and interner; relay planes pooled and open. vector-core's
deep-size stats now build in release for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re decoders and the transport

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heap

The build script compiles every en-GB message into a static pattern formatted as
Fluent formats it; packs still resolve through Fluent. VECTOR_I18N_PARSE_ALL=1 parses
the English catalogue as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…freshes

The member list lays out only the rows near the viewport on its first frame
(VECTOR_WINDOWED_ROSTER=0 restores the full build). Community, roster and badge
refreshes notify only when what they show changed (VECTOR_QUIET_EVENTS=0 opts out);
the census names events that still redraw the whole window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion only

ParsedEdition's content and subkind are one shared allocation (EditionText), so the
open memo, held windows and folds point at a single copy. The memo no longer keeps the
rumor and seal (opened again for a re-wrap) and counts what it holds, at 2 MB a
generation. A live control edition takes the held window rather than copying it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A window at rest with animated emoji on compositor layers rendered the whole
window every 30 s to keep the picture caches' use stamps fresh, waking the GPU
and regrowing shed drawables each time (+5 to +21 MB footprint swings).
image_on_screen now counts a picture stepping on screen (tile swapped in, or
on a layer) as shown, so the sweeps keep it without a render.
VECTOR_REST_FULL_DRAW=1 restores the 30 s draw.

Fixture at rest (1200x900, 49 layered emoji), 150 s: before 1 full draw per
30 s, footprint 87.2/92.2 MB alternating; after 0 draws, flat 88.1 MB.
Custom emoji keep all 192 decoded frames: 0 loads, 0 evictions.

Also: memory census shows the element arena (held, used last frame), and a
finished fade returns its end value exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A translucent shadow drawn over an animated emoji pushed it back into the
window's render ("shadow over it"), so every frame it stepped was a GPU frame.
The shadow shader is now evaluated per frame pixel, as quad fills already are,
and baked into the layer's frames as a cover, in draw order with the quads
(shadows before quads at one order). Frames shown scaled still fall back.
The index's shadow reach is the shader's 3 sigma, not 2.
VECTOR_SHADOW_COVERS=0 restores the fallback.

Fixture hover over a reaction (1200x900): of the 8 emoji that fell back, 1 now
stays layered; the rest have the tooltip's text over them, are faded or are
scaled. Layers-on vs window-drawn parity on that emoji: max 2 levels, 13 px
(the window's other layered emoji show max 5 either way). Cover cost: about
80 us per 64x64 device-pixel picture per draw. Math checked against the
shader's (erf within 5e-4; centre 0.999, edge 0.499).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers blend into each frame pixel's colour and keep its alpha, and the window
draws the fill too, so at the layer's opacity o the composite is
c + (1-a)(o·s·S + (1-o·s)·B): the fill over the faded picture, as the window
draws it. The "covered while faded" fallback was never needed.

Fixture hover over a reaction (1200x900): layered under the tooltip's shadow
1 -> 5 of the 8 emoji it reaches. Layers-on vs window-drawn parity on the
faded ones: max 4-6 levels, 13-122 px over 1 (the window's other layered
emoji: max 5-6 either way).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An encrypted account locks after a chosen spell without input (Off, 1, 5,
15, 30 min, 1 h; Off by default), optionally 5 s after the window goes out
of sight (minimised, covered, screen asleep, Android backgrounded), or on
Lock Now. Locking is the account-switch teardown on the same account: keys
zeroized, client, database and decrypted state dropped, GPU images evicted,
back to the PIN screen. While locked a keyless watch says only that
something arrived, now on desktop too.

The lock waits out calls, voice channels, recordings, file prompts (counted
in the GPUI fork), Amber prompts, uploads, encryption changes and open Mini
Apps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6Restqb2twPrtqbj1Rsc
core: kind 1068 polls and kind 1018 votes as sealed Chat Plane rumors.
Votes ride the read address under ADD_REACTIONS, except in a Channel in
Lockdown where only writers vote. One vote per member, latest by ms
wins, votes after endsAt ignored. Votes persist as events rows, so no
migration.

gpui: Poll tile in the + menu (Channels only), Create Poll card (2-8
answers, single or multiple choice, 1/3/7 days or no end), and a poll
card in the timeline that turns to results once you vote or it ends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6Reu2yWE2DZbgorKBobn
Deferred draws marked .overlay() paint into a scene of their own, drawn by
the platform into a small layer above the compositor's animated pictures
(macOS: a CAMetalLayer in the media root, z between the window's pictures
and the overlay's own, sized to what it draws, presented with the
transaction). Animated pictures under a tooltip or toolbar then keep
stepping on their layers with no render; pictures inside the overlay get
layers above it. Only the last overlay draws in priority order go in, and
none when a tooltip, prompt, drag or inspector paints after them; paths,
surfaces and backdrops fall back to the window's drawing. A reused draw
replays from whichever scene it last painted in. Platforms without the
layer draw overlays in the window as before.

Uses: the reaction tooltip and details popup, and the message hover
toolbar (deferred, clipped as in place, only while the overlay is on).
VECTOR_OVERLAY_LAYER=0 turns it off; devctl overlay:0/1 toggles it.

Fixture (1200x900, 51 animated emoji), hovering a reaction:
- GPU frames in 5 s of hover: 99 -> 0 (window draws 99 -> 0)
- footprint while hovering: stays 366 MB -> 374 MB at +0.5 s, 132 MB at
  +4 s, 90 MB at +15 s (the AGX pool and drawables let go mid-hover)
Parity, frozen, overlay+layers vs window-drawn in one run: tooltip and
toolbar regions max 2 levels (vector, cyberpunk, gifverse themes); the
rest of the window shows the usual emoji-layer noise (max 5-8 either way).
Overlay off, the toolbar region matches the previous build exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opens once the card shows results (you voted, it ended, or you can't
vote), so the breakdown doesn't reveal what the bars still hide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6Reu2yWE2DZbgorKBobn
The UI kept a full SlimProfile (17 strings, ~450 B inline) per profile, for
every member of every roster. UiProfile keeps the id, names, avatar and flags
inline and the rest (about, banner, website, nip05, lightning, status) behind
one box made only when any of it is set: 168 B inline, under half. Rare
fields read through accessors; the blocked list and status edits go through
to_slim/status_mut.

Fixture (4013 profiles, each with about, banner and status): UI profiles
3.8 -> 3.6 MB by the census (entries 2.1 -> 1.2 MB, boxed rest +0.8 MB).
Profiles with only a name and picture save ~280 B each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The overlay's CAMetalLayer (two drawables, presented with the transaction)
blocked the main thread in nextDrawable for its 1 s timeout when a tooltip
appeared or moved, freezing everything, and its next frame showed the
previous drawable stretched into the new bounds. The overlay now renders into
an IOSurface (a small ring, one the compositor still reads never reused),
waits for the GPU (well under a millisecond at its size), and sets the plain
CALayer's contents and frame together in the transaction the window's
present joins, actions off: nothing to wait for and nothing to stretch.
A probe counts overlay draws over 20 ms.

Fixture, 24 fast hovers across reaction pills and the toolbar (stall.sh):
- before: overlay draws 6632 ms over 561 (mean 11.8 ms, about six 1 s stalls)
- after: 312 ms over 665 (mean 0.47 ms), none over 20 ms
Shots after each hover show the right tooltip or toolbar, unstretched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new vector-translate crate: Firefox Translations models run by a vendored
fxtranslate (NEON/i8mm and AVX2 kernels picked at run time), a Rust port of
fastText's lid.176 language ID, the pinned model catalogue, and a store that
only installs files whose sha256 matches. Models come from Blossom by hash,
Mozilla's CDN as fallback.

In the app: Translate / Hide Translation in an incoming message's menu, a
card under the message, and Settings > Message Translation to pick the
target language and add or remove languages. Outgoing messages are never
translated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetewSnHme2qMS8Ufo7
…down

ggml keeps its Metal devices in a function's static, torn down at exit, and
asserts there that none of its buffers live. The quit hook freed the cached
Whisper context only if its lock was free, so quitting while a transcription
held it left the buffers alive and exit aborted (SIGABRT in
__cxa_finalize_ranges, ggml-metal-device.m:1040, seen on a real quit).
The quit hook now waits up to 2 s for the transcription to let go, frees
the context and keeps the lock until exit, so one still loading its model
can't start ggml again; if the transcription still runs, the process leaves
with _exit(0) instead of aborting (SQLite's WAL is safe either way).
VECTOR_WHISPER_EXIT_WAIT=0 restores the old hook.

Fixture (devctl whisper: a real transcription, then devctl quit 0.02-0.3 s
into it): old hook 3/3 aborted with the same assert; new hook 0/10.
devctl gains whisper:<file> and quit for this check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
whisper.cpp's abort callback now reads WHISPER_ABORT, which the GPUI quit hook
sets before freeing the context: the pass stops at its next check and lets go
of the lock, so quit neither waits on it nor reaches the _exit fallback.
The same flag is checked on beam retries. (Shared whisper.rs: the Tauri app
gains the flag, unset.)

Fixture, quitting 0.15-0.5 s into a real transcription of a 67 s voice note:
quit took 525-861 ms waiting; 124-136 ms aborting (the same as an idle
quit, 141 ms). No ggml assert in either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GPUI_MEDIA_CENSUS=1 now also counts every main-thread stretch over 20 ms:
frame callbacks with each part's share (frame callbacks, render, layout,
prepaint, paint, the frame-hold wait alone, layer placement, overlay draw,
platform draw, other), foreground tasks by where they were spawned, and
input dispatch. Printed every 10 s of activity with the redraw census;
counts and times only. Off, it costs a bool read per frame.

Fixture, a minute of hovers, flings and chat switches: 1 frame over 20 ms
(20.6 ms, at the first chat open), no long tasks, no slow input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he display's rate

The overlay layer was drawn again at every present while shown, each time
waiting on the GPU and making the window's present join the compositor's
transaction (waitUntilScheduled). It is now drawn only when a hash of its
primitives changes.

The hitch census measures against the display's own frame interval (8.3 ms
at 120 Hz; GPUI_HITCH_MS overrides), counts frames over 2x and 4x, files
each over-budget frame under its largest part, and splits the drawable wait
and the transaction's present wait out of platform draw.

Fixture at 120 Hz, a minute of hovers, flings and switches: frames over 8.3 ms
in the hover windows 11-17 -> 3-5. Flings: over-budget frames are the
drawable wait (display pacing); presented gaps match the oldest baseline
(about 120 fps, p95 11 ms, ~1% missed in both). Chat switches vs that
baseline: worst draw 53 -> 5-6 ms, 0 missed frames in both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The translation replaces the message's text instead of opening a card under
it. A pill after the text names the language it came from; clicking it shows
the original and back. A missing model is offered as one "Get Spanish · 35 MB"
pill, and the privacy note moves into its tooltip and Settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6RetewSnHme2qMS8Ufo7
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.

3 participants