Commit Graph

2 Commits

Author SHA1 Message Date
ed52109dba GPU-resident thumbnails: worker uploads to Slint's wgpu device (gputex)
Root cause of scroll jank: first-present of each Image uploaded pixels
inside the render frame (~11-30 ms per 400px texture, 1.3 visible
hitches/s at 120 Hz; grey-image A/B: 20 -> 1). Slint has no render
thread and no pre-upload API.

Fix: decode worker creates the Rgba8Unorm texture on Slint's own wgpu
device (captured from GraphicsAPI::WGPU30 at RenderingSetup) and submits
the async upload; UI wraps it in Image::try_from(tex). Zero pixel work
in the render frame. CPU from_rgba8 fallback retained.

Measured (Pixel 9 Pro 120 Hz, 400 px, per-frame FR hook):
  before: >10ms renders 20 in 15s (max 30 ms), 3 borderline 8-9 ms
  after:  0 mid-scroll renders > 4.4 ms (median 1.9, p95 2.9);
          only post-idle first-frames expensive (invisible)

Also: FR per-frame logging via set_rendering_notifier; APLY timestamp.
2026-10-28 10:57:15 -04:00
d38dcd3495 Jank A/B script for the phone (scripts/jank_ab.sh)
One-shot: install release APK, verify thread priorities (thumb-* nice 2,
slint vsync nice 0), then two 30 s user-scroll windows — real textures vs
grey 1x1 images — with SCRDBG cadence analysis (on-grid %, stalls, p95,
worst). Decisive fork: real-janky+grey-smooth -> texture/GPU path; both
janky -> base render/present path; both smooth -> priority fix worked.
Dry-run tested on the emulator (grey knob detection, priority readback).
2026-10-28 00:56:37 -04:00