← Board · source

T-049: Phone performance of the web viewer

done · M0 · model opus · needs T-002

bevy: true

Problem

Evan opened alife-kz9.pages.dev on 2026-12-02. His laptop shows 60 frames per second. His phone shows 1. The page was drawing 5,000 placeholder spheres. He often looks at the project on his phone, so the phone is a real target, not an extra.

All earlier measurements came from headless Chrome on this Mac's GPU, including the "phone size" one. Nobody here has a phone to test on, so this ticket must also make it possible to measure on Evan's phone from a link.

Scope

Done when

Notes

Result

Branch t-049-phone-performance. Details, evidence tables and lessons for T-015 are in docs/VIEWER.md, section "Phone performance (T-049)".

Cause (with evidence, but not yet confirmed on the phone). The old page asked the phone GPU for 1170×2532 pixels × 4× MSAA (about 12 M samples) and 1.6 M triangles a frame, most of them about one pixel in size. CPU (3.2 ms a frame, still 30 fps at 10× throttle), draw calls (63 on WebGPU, about 215 on WebGL2) and uploads are ruled out by measurement. The only stand-in here that reproduces 1 fps is a software GPU: 1.7 fps, GPU-bound. On it, cutting pixels alone or triangles alone gives about 2.5×; cutting both gives about 15×. Native Metal says the same work is about 0.5 ms on an Apple GPU, so a recent iPhone should not reach 1 fps from raw GPU work alone. Which of three things put Evan's phone there (software fallback, a very weak GPU, or a slow WebGPU path in the browser) is exactly what the benchmark separates.

Fix. Pixel ratio capped at 1.5 on touch screens (2 on desktop), spheres at 80 triangles instead of 320, automatic quality that steps down pixels and triangles until 30 fps holds, and continuous redraw whether or not the canvas has focus.

Before → after on the stand-ins (390×844 at 3×): software GPU 1.7 → 30–33 fps (WebGPU and WebGL2); real M6 GPU at 4× CPU throttle 60 → 60 fps, CPU 12.6 → 9 ms; at 10× throttle 29.6 → 35 fps. Desktop unchanged at 60 fps.

Preview: phone-perf.alife-kz9.pages.dev (diagnostics ?diag=1, benchmark ?bench=1). Example benchmark output: docs/media/T-049/bench-report-software-gpu-example.txt.

Only Evan's phone can confirm the fix.

Correction 2026-12-02 (from T-014)

The triangle counts in this ticket's result were too high. Bevy's sphere mesh at detail n has 20 x (n+1)^2 triangles, not 20 x 4^n. The code and docs/VIEWER.md now use the right figures. The conclusion (the phone's graphics chip was the limit, and fewer pixels and triangles fixed it) stands.