Repository navigation
Description
Part of #1751.
Scope
The simulator capture hashes each composite it takes in tiles and copies a due one only when it carries a new app frame, so the Liquid Glass changing on every composite no longer makes the stream repeat and skip app frames. This PR also adds the counter app and reader and posts the measurement that closes the feature.
If it goes wrong: a small animation stutters for up to 1.5 frame intervals, or the stream repeats frames as today.
Technical spec
Commit fb42676.
Rows
Behaviours: B5, B6
Interfaces: I2, I4, I9
Existing code: X3, X11
Facts
| # | Fact | Source |
|---|---|---|
| F1 | The Swift tests are the SimlockCaptureTests target, run with swift test --package-path vendor/screen-capture on a Mac with Xcode |
vendor/screen-capture/Package.swift:50-55, docs/internal/agent-rules/toolchain.md:171-172 |
| F2 | unframe.mjs reads the capture's framed output (tags 1-5) and is the model for the reader's parser |
vendor/screen-capture/scripts/unframe.mjs:16-30 |
| F3 | This Mac has ffmpeg, Xcode and an iOS 26 runtime |
which ffmpeg printed /opt/homebrew/bin/ffmpeg; xcodebuild -version printed Xcode 27.2; xcrun simctl list runtimes printed iOS 26.4 (26.4.1 - 23E254a) |
Modules touched
vendor/screen-capture/Sources/simlock-screen-capture/ (FrameSelection.swift, FrameCapture.swift), vendor/screen-capture/scripts/ (new fps-counter/, fps-reader.mjs), vendor/screen-capture/NOTICE.md (rows for scripts/fps-counter/ and scripts/fps-reader.mjs beside scripts/unframe.mjs at NOTICE.md:69). Searches: photocopier.copy (1), scripts/ under vendor/screen-capture (1 file).
Rules in play
vendor-and-third-party-code.md: the counter app and reader are ours, MIT; no built.appis committed, whichsrc/source-hygiene.repo.test.tschecks.testing.md: one table test for B5 atTileSelectorandFrameSelection; B6 is a one-off hardware run, not a lane test, by the maintainer's decision on iOS simulator stream delivers each app frame once, evenly, at --fps 60 #1751.
Tests
Seam: TileSelector and FrameSelection with tiles in SimlockCaptureTests, modelled on vendor/screen-capture/Tests/SimlockCaptureTests/EncodeLoopTests.swift; the TypeScript side is src/source-hygiene.repo.test.ts, which must accept the new scripts.
- B5: a due composite is copied only with a new app frame: only always-changing tiles 10 ms after, skipped, then a steady change 4 ms later copied; a steady tile changed, copied; half the sometimes-changing changed, copied; under half, skipped; only always-changing 13 ms after, copied; 26 ms since the last sent, copied; nothing changed 5 ms after, skipped; first composite, copied; new size, copied and history cleared; forced, copied; the scroll pattern, every due block change copied.
- B6: the reader on this Mac (hardware, once): scroll and animation at fps 60 with the capture built at
fb4267632, then at this PR's head;ffmpegmissing exits 1 withffmpeg not found. Also: Seed check cost: the CPU condition stands, and the 1 ms seed check (The simulator capture's seed skip moves into SeedGate (the 1 ms seed check is dropped) #1753) gives way to it. No interval of 1, 2, 4 or 8 ms keptcpuat or below before (measured on feat(screen-capture): the simulator capture copies only composites that carry a new app frame #1773), soSeedWatchis removed from the stack, in The simulator capture's seed skip moves into SeedGate (the 1 ms seed check is dropped) #1753's own PR, and the callback alone notices composites. Tests: the B6 run per interval, posted in the PR body (decided in delivery, approved by the maintainer 2026-11-19) Also: P95 where before is already over: when the before build's p95 on a scenario is above 20 ms on this Mac, that scenario's p95 condition is "no higher than before" instead of "at most 20 ms"; before and after are measured back to back, three 20 s runs each, and compared by their medians. Tests: the B6 run, three before and three after lines per scenario and their medians, posted in the PR body (decided in delivery, approved by the maintainer 2026-11-19)
Done when
swift test --package-path vendor/screen-capturepasses.pnpm exec vitest run --project unit src/source-hygiene.repo.test.tspasses.- Hardware, once on this Mac (no slow-lane test), on an iPhone 17 Pro simulator with an iOS 26 runtime (26.4, or 26.5 when 26.4 is not installed), both named in the PR body: the PR body holds the reader's lines for both scenarios before and after, and after shows
distinct/sat least 58,p95at most 20 ms (or, on a scenario whose beforep95is over 20 ms, no higher than before, by medians of three back-to-back runs each) andcpuat most 1 point above before, by medians of three back-to-back runs (approved by the maintainer 2026-11-19).
Out of scope
NV12, the alive tag, the frame trace (#1751 Non-goals).
Depends on
- The simulator capture decides on the 60 fps grid before it copies, and frames carry their seen time #1752
- The simulator capture's seed skip moves into SeedGate (the 1 ms seed check is dropped) #1753
Written by an agent.
Activity
test: half the sometimes-changing tiles changed is a new app frame (#…
feat(screen-capture): half the sometimes-changing tiles changed is a …
test: a composite 1.5 intervals after the last one sent is copied wha…
feat(screen-capture): a composite 1.5 intervals after the last one se…
test: the copy stage hashes the surface in tiles and skips a composit…
feat(screen-capture): the copy stage hashes each composite in tiles b…
feat(screen-capture): a counter app and reader measure the simulator …
fix(screen-capture): the fps reader keeps the capture's stdin open fo…
fix(screen-capture): the seed check is dropped, the frame callback al…
refactor(screen-capture): the fps reader's argument and envelope pars…
10 remaining items
chore(screen-capture): merge task/1753, which removes SeedWatch itself (
refactor(screen-capture): the tile history's warm-up flag is dropped,…
test(screen-capture): the 26 ms overdue case is asserted and the titl…
perf(screen-capture): the tile hash reads every 8th row and every 2nd…
V3RON commentedon Nov 19, 2026
Handoff
Done: #1753 fix:
SeedWatchremoved in #1771 (fix-check passed, body and title updated); stack synced. #1773: stack merge, audit (deadTileSelectorcounter removed), review round 1 and fix-check passed at10bf2f7d. Hardware-fix2fdf6907hashes every 8th row and every 2nd pixel.Not done: Done when line 3; fix-check of
2fdf6907; PR body ticks; ready.Findings: verifier run 2 on iOS 26.4 (table in #1773's body):
distinct/sandp95pass on both scenarios.cpuafter is above before in all six alternating pairs: medians +0.6 (scroll), +0.3 (animation), inside the ~1.5-point run spread. Tile hashing cannot cost zero, so "no higher" fails on every head so far.Blocked on: the maintainer: accept a cpu margin (for example within 1 point by medians), or name another target.
Written by an agent.
feat(screen-capture): the simulator capture decides on the 60 fps gri…
feat(screen-capture): the simulator capture copies only composites th…