Cache soft focus shadows and compare TV rendering performance

This commit is contained in:
Elijah Kuntz 2026-10-19 10:01:28 -07:00
parent 1f69422354
commit 5bb15fa69e
11 changed files with 85 additions and 17 deletions

View file

@ -1 +1 @@
Improves navigation performance on integrated Android TVs by precomposing cinematic backgrounds off the main thread. Reduces redundant tile shadows while keeping focus animations, dynamic colors, and the existing spacious layout. Image work and caches are released when leaving Home.
Further improves focus animation performance with a small shared soft-shadow texture. Keeps the cinematic background, app-colored glow, focus enlargement, and smooth scrolling. Includes the integrated-TV background rendering optimization.

View file

@ -48,7 +48,7 @@ No launcher application was disabled or uninstalled. Screensaver selection at th
Build validation uses aapt2, javac, D8, zipalign, and apksigner signature verification. There are no third-party runtime libraries.
Final APK (1.1.6): 2,753,622 bytes. SHA-256: `59527fde9ca270d76864406dadbdad219905fbfdf75e853b536ca09e51811cdd`.
Final APK (1.1.7): 2,753,622 bytes. SHA-256: `b15cd4abad3cb55eab29916fdd61b4702e665d163d3225779b04b7dee302ee23`.
## Updater regression — October 18, 2026
@ -96,3 +96,15 @@ The original D-pad workload was then repeated against the final installed APK: *
Foreground PSS was 43,742 KiB (42.7 MiB), and background PSS was 35,803 KiB (35.0 MiB). The launcher consumed zero CPU ticks over five seconds while Android settings was foreground. Source/composite caches are cleared when stopped; actual heap reclamation remains Android's responsibility. These short samples do not establish overnight endurance.
The TV's Home override was already off (no enabled accessibility services) and was retained. A physical Home-key injection returns to Google Home on this TV; opening Luma directly and repeated Back stays in Luma. No default-launcher, picture, power, resolution, or accessibility settings were changed. The optimized APK was installed only on the authorized TV at `.200`; the onn was not operated during this investigation. Version 1.1.6 is published in the existing Git update feed for the other devices.
## Further focus optimization and onn comparison — October 19, 2026
The onn was still running 1.1.5. After waking it and allowing its images to settle, the same 42-key D-pad workload reported 603 frames, 34 missed deadlines (5.64%), median 20 ms, 90th percentile 23 ms, and 95th percentile 24 ms. Thus the integrated TV's 1.1.6 results were already comparable to the working onn installation, with a lower median and missed-deadline rate. This compares the devices' actual installed versions and app grids; it is not a same-version hardware ranking. The onn's package, preferences, and Home override were not changed; its original standby state was restored after measurement.
On the TV, the 1.1.6 diagnostic showed that the remaining native focused-tile shadow increased tail latency. Version 1.1.7 replaces it with one shared 192 × 122 ARGB soft-shadow texture (93,696 bytes), tinted for each app and faded over the existing 160 ms focus transition. The existing 6.5% focus scale, glow, background colors, and scrolling remain enabled. This avoids animating live elevation-shadow geometry and does not require reducing image resolution further or removing animations.
The same TV-local focus benchmark with the new shadow enabled produced **640 frames, median 13.48 ms, 90th percentile 14.31 ms, and zero frames over 16.7 ms**. Version 1.1.6's corresponding sample was 639 frames, median 12.99 ms, 90th percentile 17.00 ms, and 64 frames over 16.7 ms. The gain is consistency/tail latency rather than a faster median. Disabling the cached shadow for diagnosis barely changed the result (median 13.33 ms, 90th percentile 14.10 ms), indicating its remaining rendering cost is small.
The enhanced wake regression passed with the cached-shadow build, including checking that its animation stops on leaving Home, nonblank bounded backgrounds, interrupted-load recovery, screensaver dismissal, and five stop/start cycles. An initial attempt began while the TV was asleep; later ADB disconnects interrupted streamed test reports. Running the diagnostic locally with saved output while the TV was awake completed successfully. The temporary diagnostic APK is removed after verification.
The broader 42-key D-pad sequence on 1.1.7 recorded 861 frames, 16 missed deadlines (1.86%), median 14 ms, 90th percentile 25 ms, and 95th percentile 25 ms. This is roughly level with the 1.1.6 sample (1.41%, 13/24/26 ms); the cached shadow's isolated-focus consistency gain did not produce a measurable improvement to the whole navigation workload in these samples. It is not presented as a new overall performance leap. Screenshots confirm the soft app-colored shadow, scale/outline, wallpaper, and spacing remain visible. The remaining navigation time is primarily GPU/compositing work; main-thread draw/traversal was already sub-millisecond in the sampled 1.1.6 trace. The onn comparison remains 1.1.5, rather than claiming a same-version hardware comparison.