evidence · 9.4 KiB

README.md

Committed at docs/evidence/interaction-jank/keyboard-blend/README.md. This is what grounds the requirements that cite it.

Open raw source

Keyboard frames and the OVER blend of opaque surfaces

Evidence class: board, injected native touch. All captures were taken on 2026-10-25 (UTC) on the board’s DSI panel in landscape: 1232x568 logical pixels, 52.19 Hz (19.16 ms per refresh), max_render_time 12, one online CPU. There was no real glass and no camera.

Workload

measure.sh from compositor-repaint, unchanged: a 30 s drawer scroll, then eight keyboard cycles (show, type, hold-and-reverse, hide) with the compositor benchmark armed. The analysers are analyze.py for the keyboard and cadence.py for the drawer.

RunSystemPixman in swayTime (UTC)
run-basepb5l6lmb (boot default), test-activatedstock RVV00:53
run-firstjpc0hl8p, test-activatedfirst patch: test every chunk00:51
run-finalh4rqzlgr, test-activatedfinal patch: per-row bail-out00:59
run-booth4rqzlgr, boot default, ordinary bootfinal patch01:07

All three ran on the same boot within nine minutes, in the order first, base, final.

Where the settle time went

Show settle was the last keyboard phase over budget after compositor-repaint (38.3 ms presented interval, 16 ms render).

The change

nix/patches/pixman-rvv-over-0565-exact-shortcuts.patch adds two exact shortcuts to Pixman’s RVV over_8888_0565 (OVER, a8r8g8b8 → r5g6b5):

Neither declares or infers an opaque region, and nothing below a surface is culled. Each frame is the same OVER blend as before, computed faster.

The first version tested every chunk. On the drawer, whose sheet is drawn at alpha 0.95, every chunk failed both tests: sway’s drawer repaint rose from 10.19 to 10.79 ms (run-first). The final version stops testing for the rest of a row once a chunk is neither, so a uniformly translucent surface pays one test per row.

Only the compositor gets the patch. nix/card-shell.nix builds sway’s wlroots against the patched Pixman and puts it first in sway’s build inputs, so sway’s RUNPATH resolves its own libpixman-1.so.0 there. Cairo’s request then reuses it by soname. On the board, /proc/<sway>/maps shows only sn5is273…-pixman on h4rqzlgr. The rest of the closure keeps the shared Pixman: patching it globally would rebuild 104 store paths (about 300 MB, GTK, GStreamer, Nautilus among them), whereas the system delta for this change is about 25 MB.

Exactness

exact.c, built by exact.nix, composites 112 OVER a8r8g8b8 → r5g6b5 cases on the board:

It ran under stock RVV Pixman (brhzfimak…), patched RVV Pixman (sn5is273…), and the patched library with PIXMAN_DISABLE=rvv. All three destination dumps have sha256 a39338ae…be41.

The same program timed a keyboard-sized 1232x240 composite (best of 30, heap memory):

SourceStock RVVPatched RVVScalar
Opaque2.28 ms1.01 ms2.42 ms
Alpha 242 everywhere2.37 ms2.26 ms9.92 ms
Random alpha2.28 ms2.26 ms9.77 ms

Each run’s grim captures were taken from sway’s output:

All six are pixel-identical between run-base and run-final, with an empty difference bounding box. They are not committed, matching compositor-repaint.

Results

Cells give the presented interval median / p95 in ms, intervals over 33.334 ms, and the render wall median / p95 in ms.

Phaserun-baserun-final
Show, contact19.2 / 172.5, 29 of 78, 8.4 / 20.319.2 / 172.4, 21 of 94, 8.1 / 16.0
Show, settle38.3 / 57.5, 79 of 102, 16.0 / 17.519.2 / 57.5, 54 of 124, 10.0 / 12.9
Hold and reverse, contact19.2 / 57.5, 28 of 304, 9.8 / 11.619.2 / 57.5, 22 of 305, 7.0 / 8.3
Hold and reverse, settle57.5 / 115.0, 19 of 33, 10.7 / 18.719.2 / 76.6, 9 of 19, 8.4 / 14.0
Hide, contact19.2 / 19.2, 2 of 129, 8.7 / 11.419.2 / 19.2, 0 of 134, 6.2 / 8.1
Drawerrun-baserun-firstrun-final
Distinct presented fps23.623.324.2
Interval median / p9521 / 39 ms21 / 39 ms21 / 39 ms
Sway repaint median (p10–p90)10.19 (10.08–10.31) ms10.79 (10.69–10.90) ms10.22 (10.11–10.33) ms

preload-trial ran the first patch under a runtime-only LD_LIBRARY_PATH drop-in in /run/systemd/system/shell.service.d/ before any system was built (show-settle render 16.6 → 12.2 ms). It was removed again, and /proc/<sway>/maps showed the stock Pixman afterwards. prof-trial profiles that arm. slowfast.py splits its settle frames into those under and over 11 ms (slow-fast.txt).

Promotion to the boot default

On 2026-10-25, h4rqzlgr (commit 44997ea3, which is what master evaluates to) replaced pb5l6lmb as the persistent system. The kernel and initrd are identical between the two. promote.py is the card-resize promotion script with the system paths, state directory and source revision changed. It ran as root under the board lock and set the profile to system-89-link.

An SSH-initiated reboot booted h4rqzlgr as both /run/booted-system and /run/current-system, with shell, shell-ui and shell-keyboard active, no failed units, sway at SCHED_RR and sn5is273…-pixman mapped in sway. See the receipt, boot ID b10247c0….

run-boot repeated the measurement on that boot:

Rollback: write the copies under /var/lib/k230/keyboard-blend-promote-20261025/promotion/rollback/ back to /boot, then run nix-env --profile /nix/var/nix/profiles/system --set with pb5l6lmb.

Limits

Owned files under /var/tmp were removed.