Skip to content

The simulator capture decides on the 60 fps grid before it copies, and frames carry their seen time #1752

Closed

Description

@V3RON

Part of #1751.

Scope

The simulator capture decides on the 60 fps grid before it copies a composite, copies on a queue of its own, and every frame carries the time its composite was seen, on the simulator and the iPhone source. After this PR the about four in ten copies the encode loop used to throw away are no longer made, and a slow copy no longer shifts which frames are kept.

If it goes wrong: the stream gets fewer frames a second than today, or a still screen's idle-floor picture stops arriving.

Technical spec

Commit fb42676.

Rows

Behaviours: B1, B2, B3
Interfaces: I1, I5, I6, I7, I8
Existing code: X1, X2, X3, X6, X7, X8, X9, X10

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 The test target can import the simulator program's types (@testable import), as the panel tests do vendor/screen-capture/Package.swift:50-54

Modules touched

vendor/screen-capture/Sources/SimlockCapture/ (new FrameGrid.swift, Lifecycle.swift, Options.swift), vendor/screen-capture/Sources/simlock-screen-capture/ (new FrameSelection.swift, FrameCapture.swift, SimulatorSource.swift, main.swift), vendor/screen-capture/Sources/simlock-device-capture/DeviceScreenSource.swift, vendor/screen-capture/NOTICE.md (its file table and a new entry under Deviations, NOTICE.md:113), vendor/screen-capture/Package.swift:10-21 (its "two changes" comment), docs/internal/VENDORED-CODE.md. Searches: onFrame in Sources/ (14), atNanos (7), photocopier.copy (1), SimulatorSource( (1).

Rules in play

  • vendor-and-third-party-code.md: FrameCapture.swift gets a MODIFIED FILE header naming the notice/copy split; NOTICE.md and the VENDORED-CODE.md serve-sim row say "modified by us" and list FrameGrid.swift and FrameSelection.swift as ours, MIT.
  • testing.md: one table test per Behaviours row, at the seams the rows name.

Retired words

  • one patch: FrameCapture.swift is "modified by us" in NOTICE.md and VENDORED-CODE.md.

Tests

Seam: FrameGrid, FrameSelection and encodeLoop in SimlockCaptureTests, modelled on vendor/screen-capture/Tests/SimlockCaptureTests/EncodeLoopTests.swift; the TypeScript side is src/drivers/ios/screen-capture.test.ts, which starts these programs and must keep passing.

  • B1: the encode loop keeps frames on the grid through FrameGrid: the four fix(capture): a source of at least --fps is written at --fps #1718 cases; isDue asked twice moves nothing; commit then isDue 5 ms later is not due.
  • B2: the capture decides before it copies: 100/s for 2 s at fps 60 gives 120 copied; 30/s gives 60; forced 200 ms after: copied, grid moves; forced 5 ms after: copied, grid does not move; a new picture size: copied.
  • B3: frames the capture copies are written by the encode loop: pending called late keeps the seen time; the B2 cases written equal copied, except the forced one under one interval.

Done when

Out of scope

The 1 ms seed check (#1753), 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. added a commit that references this issue on Nov 19, 2026
    1dc0448
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