Windows platform: fixes from a downstream app (live resize, startup flash, path-texture memory, DirectWrite fast path) + gpui-kit pulls two cores
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- backend-api-design, desktop, performance
Direzione di ricerca
Start by comparing the downstream Windows platform patches described here with gpui-fast-windows 0.1.13; the issue does not name repository files for most changes. The proposals span dependency features, window resizing and startup, path texture allocation, DirectWrite layout, and device creation, so first identify which changes maintainers want to pursue. For any accepted change, add focused coverage where possible and compare behavior or measurements with the stated downstream results.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi! We ship a Windows desktop app (mail/calendar client) on gpui + gpui-kit and maintain a small patch set on the Windows platform crate. We are now evaluating gpui-fast and checked our patches against gpui-fast-windows 0.1.13. Below are the ones that do not seem to be covered yet. Measurements were taken on gpui-pre-windows 0.3.9 (Zed's platform), Intel iGPU, 144 Hz monitor. All are Apache-2.0 and we'd be glad to send PRs — please tell us which ones you'd accept and in what shape.
- gpui-kit with gpui-fast still links gpui-pre (packaging)
In gpui-kit 0.7.3 and 0.9.0, and in gpui-base 0.9.0, gpui (= gpui-pre) and gpui_platform are non-optional dependencies, even when the gpui-fast feature is enabled. As a result, cargo tree -i gpui-pre shows both cores, and gpui-pre-windows 0.3.9 alongside gpui-fast-windows.
This also caps the gpui-fast version: gpui-pre 0.3.9 pins gpui-pre-collections =0.3.9, while gpui-fast 0.1.12 / 0.1.13 require =0.3.10 / =0.3.11, so an app on gpui-kit 0.7.3 cannot go above gpui-fast 0.1.11 at all. (Separately, cocoa pinned by gpui-pre-macos prevented holding gpui-fast at 0.1.7 to match a vendored platform snapshot.)
Ask: make gpui-pre / gpui_platform optional and enabled only without gpui-fast. - Live resize: content lags the window edge, black strip in the new area
Inside the modal size-move loop the frame for the new size is drawn on the loop timer (~15.6 ms) or on a deferred WM_PAINT, so content trails the border and newly exposed area is black.
Fix: during the size-move loop, draw and present synchronously on WM_SIZE; window swap chain with DXGI_SCALING_STRETCH. (We also default DirectComposition off for opaque windows, behind an env var — probably not for upstream since you rely on composition.) - Resize background: black class brush instead of the app background
WM_ERASEBKGND paints with the class brush (black). We fill with the background color of the previous frame (first full-window opaque quad = root bg), black only before the first frame. - Black window on startup (80–200 ms → 0)
Before the first Present the window shows the black class brush. We keep the window cloaked (DWMWA_CLOAK) from creation until the first frame is finished by the GPU and picked up by DWM (query event + DwmFlush after Present; uncloaking right after Present still showed one black vsync). Measured with Windows Graphics Capture: 80–200 ms of black window → 0. - Path intermediate textures are always allocated (~33 MB per window on iGPU)
The plain and 4× MSAA path intermediate textures (window-sized, 5 surfaces) are created per window: ~33 MB at 1600×1000, ~17 MB at 1025×850. On integrated GPUs this is process memory, and textures released on resize are returned lazily by the driver: peaks of +55…+115 MB while resizing. Most frames have no paths (rounded corners, borders and shadows are quads).
Fix: create them on the first frame that has paths, drop them on resize. Pixel test: draw a path via render_to_image before/after resize. This touches fast/frame.rs / rounded_clip.rs, which take path_intermediate_* directly — we have an adaptation (PathTargets::of -> Option, created in draw_batches). - DirectWrite fast path for layout_line (40 µs → 5 µs per line)
layout_line creates IDWriteTextFormat + IDWriteTextLayout for every new line: 40–100 µs. For simple lines (ASCII, Latin-1, Cyrillic, punctuation) we build the run from a per-(font, size) glyph table; anything with ligatures, contextual substitutions or kerning (detected by parsing GSUB/GPOS/kern) falls back to the old path. Output is bit-identical to the old path on a test corpus; ~5 µs vs ~40 µs per line. Matters for long scrolling lists with fresh text every frame. - (minor) GPUI_FORCE_WARP=1
Create the device on EnumWarpAdapter (also after device loss). Useful for VMs/RDP and for reproducing driver-specific issues.
Notes
Demand-driven frames: we had the same fix (idle CPU 3.0 % → 0.0 %, vsync thread wakeups 158/s → 1–3/s) and see you have frame_schedule.rs in 0.1.13 — great; we'll report numbers on your version after our benchmark.
We also backported your DrawState, change-only GlobalParams updates and gradient dithering into our gpui-pre-windows patch. In our scrolling benchmark (50k-message list, 5 alternating A/B runs) the UI thread CPU went down 4–8 % with no regressions in frame times or memory — thanks for those.
- Lingua principale
- Rust
- Stelle
- 20k
- Fork
- 1.2k
- Merge medio
- 1g 3h
- PR unite (30g)
- 276
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di longbridge/gpui-kit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
longbridge/gpui-kit#3871 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
longbridge/gpui-kit#3852 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
longbridge/gpui-kit#3850 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
longbridge/gpui-kit#3795 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
longbridge/gpui-kit#3735 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di longbridge/gpui-kit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
bytecodealliance/rustix#1736 ·
I maintainer di solito rispondono entro 1 giorno
-
area:models enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
fix v1 repository metadataApertagood first issue help wanted
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
servo/rust-smallvec#864 ·
-
bug frontend ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno