Repository navigation
Description
Part of #1751.
Scope
The callback's seed skip (lastSeeds in FrameCapture) moves into SeedGate, a tested struct, so each new seed is noticed once. The capture's behaviour does not change.
Planned first: a 1 ms check of the screen surface's seed beside SimulatorKit's frame callback (SeedWatch), so a composite the callback reports late is still noticed. Dropped: on #1754 no interval of 1, 2, 4 or 8 ms kept the capture's CPU at or below before (measured on #1773: 71, 54, 41 and 33 against 27 to 28), and the feature's outcome is "no more CPU than today". This PR removes SeedWatch again, with its wiring, the seenNanos hand-in of captureFrame and its tests; the callback alone notices composites, as before #1751. Tests: the SeedGate rows of B4 (seed unchanged, none; forced with an unchanged seed, one; after reset, the next seed is news) stay, and no source or test names SeedWatch (decided in delivery, approved by the maintainer 2026-11-19)
If it goes wrong: the capture copies one composite twice or misses a new one, which the SeedGate tests catch.
Technical spec
Commit fb42676.
Rows
Behaviours: B4
Interfaces: I3
Existing code: X4, X5, X9
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 |
Modules touched
vendor/screen-capture/Sources/simlock-screen-capture/ (FrameSelection.swift, FrameCapture.swift), vendor/screen-capture/NOTICE.md, docs/internal/VENDORED-CODE.md. Searches: lastSeeds (5), pickBestDescriptor (4), IOSurfaceGetSeed (1).
Rules in play
vendor-and-third-party-code.md: theMODIFIED FILEheader ofFrameCapture.swiftand theNOTICE.mdrow nameSeedWatchtoo.testing.md: one table test for B4, with the fake seed reader and clock I3 takes.
Tests
Seam: SeedWatch.tick and SeedGate in SimlockCaptureTests, modelled on vendor/screen-capture/Tests/SimlockCaptureTests/PanelFollowerTests.swift; the TypeScript side is src/drivers/ios/screen-capture.test.ts, which starts these programs and must keep passing.
- B4: each new seed is noticed once: two seeds between two callbacks, both noticed with their own times; callback and tick on the same seed, one notice; seed unchanged, none; forced with an unchanged seed, one; after
stop(),tickdoes nothing; afterwatch(surface), the next tick reads the new surface.
Done when
swift test --package-path vendor/screen-capturepasses.pnpm buildbuildsdist/bin/simlock-screen-capture.
Out of scope
Tile selection and the measurement (#1754).
Depends on
Written by an agent.
Activity
test: a tick reports only a changed seed and nothing after stop, what…
[-]The simulator capture notices each new screen seed within 1 ms, beside the frame callback[/-][+]The simulator capture's seed skip moves into SeedGate (the 1 ms seed check is dropped)[/+]fix(screen-capture): SeedWatch is not shipped; the capture keeps Seed…
refactor(screen-capture): the simulator capture's seed skip moves int…
feat(screen-capture): the simulator capture copies only composites th…