Run a virtual iPhone on an Apple Silicon Mac.
Swift
Tidy the DeviceHub research note for review
Jacky2e39906ea952
diff --git a/Research/Guest/devicehub_screen_viewing.md b/Research/Guest/devicehub_screen_viewing.mdindex d807b87f..e772a2c5 100644--- a/Research/Guest/devicehub_screen_viewing.md+++ b/Research/Guest/devicehub_screen_viewing.md@@ -7,8 +7,8 @@ opens a live view of the screen. Before this work the view spun forever onevery guest, 26.x and 27.x alike.Measured with Xcode 27.0 (27A266a) and CoreDevice 642.16 on macOS 27.0.1,-against `iPad16,1 26.6.2 (23G90)` and `iPhone17,3 27.0.1 (24A446)` guests-over cloudOS 26.4, 2026-10-06 and 2026-10-07.+against `iPad16,1` 26.6.2 (23G90) and 27.0.1 (24A446) and `iPhone17,3` 26.6.2+and 27.0.1 guests over cloudOS 26.4, 2026-10-06 and 2026-10-07.Status: the live view works on iPadOS 26, iOS 26 and iOS 27; iPadOS 27 refusespairing and is untested. Known issue: under load (several VMs streaming, or the@@ -191,7 +191,7 @@ Interposing works because `cryptexd`, `dtremotedisplayd`, `dtdeviceinfod` and`CoreDeviceUtilities` are standalone images, not shared-cache ones, so dyldbinds their imports through the interposing table. `CoreDeviceUtilities` liveson the DDI and not in the SDK, so its two symbols are weak flat-namespace-imports (`-Wl,-U`) and resolve to nothing in `cryptexd`.+imports (`-Wl,-U`) and resolve to nothing outside `dtremotedisplayd`.The library ships with `system-launchdaemons-boot-environment`. An existingguest gets it from the environment update when it next starts on a bundle@@ -277,9 +277,9 @@ showed the guest live, 30–40 ms behind the VZ window.and from Xcode alike) without showing a trust alert. That happens beforeany of this code is involved and is left for separate work.- **Tests.** `InjectionEnvironmentTests` covers the three targets and their- near-miss suffixes. The real-cache force-kern tests cover conditional- routing, the preserved null check, symbol discovery, dry run and- idempotence. `ARM64CompareBranchTests` pins the new encoder.+ near-miss suffixes. The seven real-cache force-kern tests (pristine 24A435+ cache via `VPHONE_DSC_PRISTINE`) cover conditional routing, the preserved+ null check, symbol discovery, dry run and idempotence, and pass. `ARM64CompareBranchTests` pins the new encoder.Touch input sent from inside DeviceHub reaches the guest (checked by hand),but has no automated check.@@ -364,7 +364,7 @@ paravirtualized, and the conversion ahead of it goes throughround trip to the Mac's VideoToolbox and scaler, which every running VMshares.-That explains the worst events seen on 2026-10-07: two VMs streaming at once+That fits the worst events seen on 2026-10-07: two VMs streaming at once(26.6.2 iPad and 27.0.1 iPhone) logged `Delay Warning: Encoding time=…` at thesame second, up to about 1.2 s a frame against about 5 ms normally, and bothDeviceHub views fell 1.9–2.7 s behind, then recovered within about ten@@ -385,7 +385,7 @@ The slow growth in a single long session (above) is a different shape: noencode warnings, just a lag that ratchets up. A 26.6.2 iPad stream that hadrun for about an hour was measured at 2.1 s on 2026-10-07 as well.-### A single stream on a quiet Mac does not degrade+### A single stream on a quiet Mac does not ratchetOn 2026-10-07 the 26.6.2 iPad streamed alone for about two hours, with theother test VMs stopped and about 20 GB free, the frame-code probe running and@@ -404,7 +404,7 @@ ratchet or the long encode stalls on their own. Both were only seen whileseveral VMs streamed or the Mac was busy restoring and downloading, which fitsthe encode path being a shared paravirtual resource. Two stalls did occur inthis session (12:13 and 12:15 local, up to 1.4 s a frame) without such load;-neither profiling attempt (29 spindumps around Home presses) caught one.+none of the 29 spindumps taken around Home presses caught one.During stalls `VCScreenCapture` logs `Frame PresentationTime … going backwards… Dropping frame`. MediaToolbox's `FigVirtualDisplayProcessor` stamps a@@ -414,9 +414,10 @@ when the two interleave a real frame can land 1–28 ms behind an idle one andis dropped. The offsets do not accumulate, so this costs single frames, notseconds.-### Other+## Other open items- iPadOS 27 refuses pairing (see Validation), so DeviceHub is untested there.+- Touch input sent from DeviceHub has no automated check.- The `0x14` port offset in the conditional dispatch is fixed, not derived;check it on the next 27.x build.