Skip to content

The simulator capture's seed skip moves into SeedGate (the 1 ms seed check is dropped) #1753

Closed

Description

@V3RON

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: the MODIFIED FILE header of FrameCapture.swift and the NOTICE.md row name SeedWatch too.
  • 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(), tick does nothing; after watch(surface), the next tick reads the new surface.

Done when

  • swift test --package-path vendor/screen-capture passes.
  • pnpm build builds dist/bin/simlock-screen-capture.

Out of scope

Tile selection and the measurement (#1754).

Depends on

Written by an agent.

Activity

  1. added
    task:draft
    on Nov 19, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 19, 2026
  3. self-assigned this
    on Nov 19, 2026
  4. changed the title [-]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)[/+] on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

task:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions