client: start the GPU device and font stack before the first window #420
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!420
Loading…
Reference in a new issue
No description provided.
Delete branch "client/overlap-startup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #402.
What changes
A window launch no longer runs its steps strictly in series.
felis-clientstarts the wgpu instance, adapter and device on a helper thread right after loading its config, before it dials the daemon, and starts font discovery on a second thread once the session is attached.resumedstill creates the window and the surface on the main thread, then takes both results.adapter.is_surface_supported(&surface). wgpu-core 30's surface-awarerequest_adapterfilters the same enumerated list with the sameget_capabilitiestest and then stable-sorts it by device type, so an accepted warm adapter is the one the surface-aware pick would return. A rejected one falls back to that pick.main. A warm font stack is used only if the font inputs still match atresumed(a config reload can land first). Fonts start after the attach, so a launch whose dial fails logs no font warnings.Not taken: overlapping the dial with the event loop and window creation. A warm dial plus attach costs 2 ms on both platforms, and a window built before the dial resolves would appear even when the daemon cannot be reached. Instance cost that scales with the number of installed Vulkan ICDs (35-50 ms on this host) belongs to the system loader and is left alone.
No docs under
docs/describe the startup order, so the only doc change is a CHANGELOG entry.Measurements
Linux (i5-12400F, RTX 3080, niri, NVIDIA ICD pinned through
VK_DRIVER_FILESbecause the userland and kernel module do not match). Startup suite (crossterm.py run startup, with foot as the one comparison leg the harness requires). Base and branch alternate, 10 timed launches after 3 discarded per leg. Adapter confirmed in the log:NVIDIA GeForce RTX 3080.37e998331f63225837e99833621515f3* One base round was dropped because another agent opened a felis window during it (foot's leg rose from 21 to 34 ms).
A cold launch is now about as fast as a warm one: the 30-40 ms daemon hand-off runs while the Vulkan device is being created.
macOS (M4 Max). The console was at the login window, with no user session and the display asleep, so no window could reach the screen and CGWindowList first-window timing was not possible. Instead I timed spawn →
window + surface readyfrom the client's own log, the end of the firstresumedafter which AppKit orders the window in. Base and branch alternate, 10 timed launches after 3 discarded, cold with no daemon, warm with a daemon started outside the launch tree (alive before 10/10 launches). Load 2.1-2.7:37e998331f632258HEAD against
1f632258on the Mac (4 rounds, load 1.9-2.7): no difference. Both builds split into the same 105/121 ms bands, and so does process start: config loads at 19 or 25 ms.The macOS cold/warm inversion in the published figures is a harness artifact (#408) and is out of scope here.
Review
pi (sol), two rounds:
621515f3: the drop now waits at most 2 s. (b) Font warnings could appear before the attach and on launches that never reach a window. Accepted: fonts now start after the attach.resumed. Rejected: both cases need a failure that ends the launch anyway, or a reload inside the roughly 100 ms before the firstresumed. The warning text still describes the configured font correctly. Holding the warnings back would need a tracing capture layer in the renderer.