Files
magpie/internal
yetone 4b3bdbe28c masking: the flow's dots, scan and Live dot stop moving once played (#3185)
The Masking page never came to rest. Each dot in its agents-to-providers
flow was an SVG animateMotion with repeatCount "indefinite", the scan
mark on the middle line ran forever, and the Live dot pulsed forever.
The SMIL dots alone made Chromium lay the page out ~700 times a second
(6,965 layouts and 2,282 style recalcs in 10s, read with CDP
Performance.getMetrics). Removing just those 22 elements took it to 0.

Now each dot goes round twice when the flow is drawn, and the scan mark
plays twice. The flow is drawn again only when the numbers change. The
Live dot pulses once each time the list is drawn again, which happens on
each 15s read. Reduced motion is unchanged: still no motion at all.

Measured on a sandbox `magpie app` (origin/main, sandbox HOME, real
deepseek provider, the real masking log copied in: 19,657 values over
577 requests). The Masking page was loaded in Playwright 1.62.0, and only
that browser's own processes were sampled with proc_pid_rusage, 20s per
sample:
- WebKit, before: 180 wakeups/s, 2.8% CPU, 56 mW.
  After: 37/s and 9.7 mW while the motion plays out (8-28s), then
  10.8/s, 0.1% CPU, 1.4 mW.
- Chromium, before: 96-98/s, 17% CPU, 537-543 mW.
  After: 40/s, 2.0% CPU, 57 mW while the motion plays out, then
  18.5/s, 0.5% CPU, 10 mW.
- The other pages at rest: 12-30/s and 1.6-7.7 mW in WebKit.

Test: masking-records' new "the masking page's motion ends" (chromium
and webkit, 1100px and 640px). It moves the SVG clock on an hour and
asks Chromium whether any dot is still in an interval. In both engines
it checks that no SMIL element is set to repeat for good and that no
CSS animation has an infinite end. All 4 cases are red on the old
page.js/redact.css and green on the new ones.

Run at this tree:
- masking-records, held-animations and i18n-keys: 68/68.
- account-mask-sessions, account-mask, mask-actions, mask-emails,
  provider-unmasked and redact-*: 172/172.
- go test -timeout 45m ./internal/gui: ok.
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui: ok.
- gofmt: clean.

Other states measured, with no change made:
- Go main process at rest with the window open: 25/s, 7 mW.
- Streaming 3 deepseek-flash replies (2,450 SSE events in 20s):
  275/s, 3.5% CPU, 107 mW, about 2 wakeups per event.

Not tried: the window hidden and the tray panel open; the
WKWebView in the real app window on Masking (measured in Playwright's
WebKit instead); the full GUI suite.
2026-10-25 20:33:33 +08:00
..
…
…
…
…
…