peachsim 0.1.1728 → 0.1.1744

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/README.md +4 -0
  2. package/cli/app-catalog.ts +47 -23
  3. package/cli/app-fonts.ts +19 -1
  4. package/cli/command-registry.ts +3 -0
  5. package/cli/commands/control.ts +68 -16
  6. package/cli/commands/coverage-swift.ts +112 -4
  7. package/cli/commands/device.ts +3 -1
  8. package/cli/commands/doctor.ts +1 -4
  9. package/cli/commands/inspect/settling.ts +6 -1
  10. package/cli/commands/inspect/wait-ready.ts +22 -2
  11. package/cli/commands/package.ts +33 -21
  12. package/cli/commands/push.ts +56 -0
  13. package/cli/commands/serve.ts +9 -0
  14. package/cli/commands/shell-url.ts +41 -9
  15. package/cli/commands/swift.ts +1 -1
  16. package/cli/current-sim.ts +27 -0
  17. package/cli/drivers/linux-browser-libs.lock.json +323 -1
  18. package/cli/drivers/linux-browser-libs.ts +8 -6
  19. package/cli/drivers/playwright.ts +5 -1
  20. package/cli/internal-child.ts +11 -1
  21. package/cli/main.ts +6 -0
  22. package/cli/native-input.ts +1 -7
  23. package/cli/outbound-endpoints.ts +9 -1
  24. package/cli/packaged-app-launcher.ts +3 -1
  25. package/cli/scene-video.ts +28 -7
  26. package/cli/ws-bridge.ts +3 -1
  27. package/detox/index.ts +18 -5
  28. package/dist-lib/agent-daemon-client.cjs +1 -1
  29. package/dist-lib/agent-events.cjs +1 -1
  30. package/dist-lib/attached-projects.cjs +5 -2
  31. package/dist-lib/auth/shared-session.cjs +5 -2
  32. package/dist-lib/backend-origin.cjs +1 -1
  33. package/dist-lib/beta.cjs +1 -1
  34. package/dist-lib/beta.mjs +1 -1
  35. package/dist-lib/bridge-constants.cjs +1 -1
  36. package/dist-lib/bridge-contract-input.cjs +1 -1
  37. package/dist-lib/bridge-contract-input.mjs +1 -1
  38. package/dist-lib/bridge-contract.cjs +1 -1
  39. package/dist-lib/bridge-contract.mjs +1 -1
  40. package/dist-lib/bundle-channel.cjs +9932 -4561
  41. package/dist-lib/capture-contract.cjs +1 -1
  42. package/dist-lib/capture-contract.mjs +1 -1
  43. package/dist-lib/cloud-contract.cjs +1 -1
  44. package/dist-lib/cloud-contract.mjs +1 -1
  45. package/dist-lib/cloud-test-args.cjs +1 -1
  46. package/dist-lib/cloud-test-args.mjs +1 -1
  47. package/dist-lib/cloud.cjs +1 -1
  48. package/dist-lib/cloud.mjs +1 -1
  49. package/dist-lib/config.cjs +1 -1
  50. package/dist-lib/config.mjs +1 -1
  51. package/dist-lib/detox/index.cjs +30 -8
  52. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  53. package/dist-lib/expo-swift-bundle.cjs +6886 -3303
  54. package/dist-lib/expo-swift-metadata.cjs +14 -2
  55. package/dist-lib/expo-swift-metadata.mjs +14 -2
  56. package/dist-lib/home-paths.cjs +7 -2
  57. package/dist-lib/host/bridge-host.cjs +8513 -3085
  58. package/dist-lib/host/fetch-proxy-handler.cjs +19 -7
  59. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  60. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  61. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  62. package/dist-lib/host/websocket-proxy.cjs +6 -3
  63. package/dist-lib/index.cjs +175 -80
  64. package/dist-lib/jump-to-source-babel.cjs +1 -1
  65. package/dist-lib/jump-to-source-native.cjs +1 -1
  66. package/dist-lib/kotlin-host.cjs +209 -32
  67. package/dist-lib/menu.cjs +7 -1
  68. package/dist-lib/menu.mjs +7 -1
  69. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  70. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  71. package/dist-lib/metro-production-bundle.cjs +1 -1
  72. package/dist-lib/metro-production-bundle.mjs +1 -1
  73. package/dist-lib/metro.cjs +146 -76
  74. package/dist-lib/native-app-identity-project.cjs +76 -39
  75. package/dist-lib/native-app-identity-project.mjs +76 -39
  76. package/dist-lib/native-app-identity.cjs +10 -3
  77. package/dist-lib/native-app-identity.mjs +10 -3
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +1 -1
  80. package/dist-lib/plist.cjs +1 -1
  81. package/dist-lib/plist.mjs +1 -1
  82. package/dist-lib/profiles.cjs +5 -2
  83. package/dist-lib/public-brand.cjs +1 -1
  84. package/dist-lib/public-origins-lib-esm.json +25 -23
  85. package/dist-lib/public-origins-lib.json +138 -80
  86. package/dist-lib/react-native-host-modules.cjs +5 -2
  87. package/dist-lib/react-native-host-modules.mjs +5 -2
  88. package/dist-lib/reap-browser.cjs +1 -1
  89. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  90. package/dist-lib/sdk.cjs +4 -1
  91. package/dist-lib/sdk.mjs +4 -1
  92. package/dist-lib/skills.cjs +41126 -36493
  93. package/dist-lib/swift-compile.cjs +2103 -444
  94. package/dist-lib/swift-compile.mjs +2025 -369
  95. package/dist-lib/swift-package.cjs +1 -1
  96. package/dist-lib/swift-package.mjs +1 -1
  97. package/dist-lib/swift-submit.cjs +2 -2
  98. package/dist-lib/swift-submit.mjs +2 -2
  99. package/dist-lib/swift-toolchain.cjs +84 -24
  100. package/dist-lib/swift.cjs +1 -1
  101. package/dist-lib/vite-swift.cjs +6094 -2687
  102. package/dist-lib/vite.cjs +32 -10
  103. package/dist-lib/worklet-executable.cjs +1 -1
  104. package/dist-lib/worklet-executable.mjs +1 -1
  105. package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +1 -0
  106. package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
  107. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +2 -0
  108. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
  109. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -3
  110. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
  111. package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +8 -0
  112. package/dist-types/packages/peach-engine/src/engine/node.d.ts +10 -1
  113. package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
  114. package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
  115. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +25 -3
  116. package/dist-types/packages/peach-engine/src/engine/scroll-platform.d.ts +1 -15
  117. package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +1 -3
  118. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +6 -0
  119. package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
  120. package/dist-types/packages/peach-engine/src/engine/types.d.ts +23 -0
  121. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +6 -0
  122. package/dist-types/packages/peach-engine/src/metro-identity-contract.d.ts +33 -0
  123. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
  124. package/dist-types/packages/peach-engine/src/preview/bundle-layout.d.ts +1 -1
  125. package/dist-types/packages/peach-engine/src/remote-stream/scene-recording.d.ts +2 -0
  126. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -1
  127. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -0
  128. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +28 -0
  129. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +21 -1
  130. package/dist-types/packages/peach-engine/src/render-worker/prepared-boot-bundle.d.ts +7 -0
  131. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -2
  132. package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +1 -0
  133. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +6 -0
  134. package/dist-types/packages/peach-engine/src/render-worker/test-bridge-protocol.d.ts +3 -3
  135. package/dist-types/packages/peach-engine/src/render-worker/webgpu-frame-transaction.d.ts +1 -0
  136. package/dist-types/packages/peach-engine/src/render-worker/webgpu-readback-scheduler.d.ts +1 -1
  137. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +14 -1
  138. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +8 -1
  139. package/dist-types/packages/peach-engine/src/rolldown-production-fingerprint.d.ts +1 -4
  140. package/dist-types/packages/peach-engine/src/rolldown-production-module.d.ts +12 -0
  141. package/dist-types/packages/peach-engine/src/rolldown-production-roles.d.ts +6 -0
  142. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +6 -1
  143. package/dist-types/packages/peach-engine/src/settings/duo-fold-bus.d.ts +1 -0
  144. package/dist-types/packages/peach-engine/src/shell-events.d.ts +4 -0
  145. package/dist-types/packages/peach-kit/src/capabilities.d.ts +8 -0
  146. package/kotlin/README.md +3 -0
  147. package/kotlin/sdk.tar.gz +0 -0
  148. package/package.json +2 -1
  149. package/runtime-companion.json +1 -1
  150. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccount.h +55 -0
  151. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
  152. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
  153. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
  154. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
  155. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
  156. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
  157. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
  158. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +1 -0
  159. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h +257 -0
  160. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h +305 -0
  161. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +2 -0
  162. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h +204 -0
  163. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h +260 -0
  164. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h +164 -0
  165. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h +101 -0
  166. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h +510 -0
  167. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h +1132 -0
  168. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h +34 -0
  169. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h +83 -0
  170. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h +197 -0
  171. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h +36 -0
  172. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h +38 -0
  173. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h +312 -0
  174. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h +106 -0
  175. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h +123 -0
  176. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h +31 -0
  177. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h +409 -0
  178. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h +78 -0
  179. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h +120 -0
  180. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h +55 -0
  181. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h +535 -0
  182. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h +133 -0
  183. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h +252 -0
  184. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFMarkedContentItem.h +37 -0
  185. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h +67 -0
  186. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h +51 -0
  187. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h +101 -0
  188. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h +123 -0
  189. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h +44 -0
  190. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h +52 -0
  191. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStructureElement.h +87 -0
  192. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h +441 -0
  193. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h +89 -0
  194. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRenderingBufferProvider.h +49 -0
  195. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h +124 -0
  196. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h +85 -0
  197. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +44 -252
  198. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap +1 -0
  199. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/CFNetworkErrors.h +257 -0
  200. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -9
  201. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +992 -98
  202. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/NSURLSession+Network.h +32 -0
  203. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/Network.h +51 -0
  204. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/advertise_descriptor.h +193 -0
  205. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_descriptor.h +163 -0
  206. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_result.h +207 -0
  207. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browser.h +285 -0
  208. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection.h +714 -0
  209. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_group.h +629 -0
  210. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_report.h +932 -0
  211. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/content_context.h +229 -0
  212. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/endpoint.h +390 -0
  213. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/error.h +135 -0
  214. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ethernet_channel.h +349 -0
  215. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/framer_options.h +1187 -0
  216. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/group_descriptor.h +184 -0
  217. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/interface.h +150 -0
  218. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ip_options.h +351 -0
  219. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/listener.h +438 -0
  220. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/nw_object.h +200 -0
  221. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/parameters.h +1205 -0
  222. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path.h +392 -0
  223. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path_monitor.h +216 -0
  224. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/privacy_context.h +188 -0
  225. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/protocol_options.h +126 -0
  226. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/proxy_config.h +357 -0
  227. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/quic_options.h +889 -0
  228. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/resolver_config.h +94 -0
  229. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tcp_options.h +459 -0
  230. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tls_options.h +115 -0
  231. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/txt_record.h +432 -0
  232. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/udp_options.h +112 -0
  233. package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ws_options.h +743 -0
  234. package/sdk/ios/System/Library/Frameworks/Network.framework/Modules/module.modulemap +9 -0
  235. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h +395 -0
  236. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h +132 -0
  237. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h +107 -0
  238. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterCell.h +153 -0
  239. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterLayer.h +151 -0
  240. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAFrameRateRange.h +40 -0
  241. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAGradientLayer.h +78 -0
  242. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1078 -0
  243. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h +97 -0
  244. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h +67 -0
  245. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAReplicatorLayer.h +65 -0
  246. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAScrollLayer.h +64 -0
  247. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAShapeLayer.h +135 -0
  248. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATextLayer.h +99 -0
  249. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATiledLayer.h +67 -0
  250. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h +124 -0
  251. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h +138 -0
  252. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransformLayer.h +40 -0
  253. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h +78 -0
  254. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +19 -38
  255. package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h +1757 -0
  256. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h +19 -0
  257. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h +28 -0
  258. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h +114 -0
  259. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +16 -0
  260. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarAppearance.h +47 -0
  261. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDataDetectors.h +20 -0
  262. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h +13 -0
  263. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h +16 -0
  264. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h +84 -0
  265. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h +119 -0
  266. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizerSubclass.h +66 -0
  267. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIHoverGestureRecognizer.h +45 -0
  268. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +161 -37
  269. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h +76 -0
  270. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h +8 -0
  271. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBarAppearance.h +78 -0
  272. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h +29 -0
  273. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h +104 -0
  274. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h +19 -0
  275. package/sdk/ios/usr/include/dns_sd.h +3616 -0
  276. package/sdk/ios/usr/include/dnssd.modulemap +4 -0
  277. package/sdk/ios/usr/include/module.modulemap +1 -0
  278. package/sdk/ios/usr/include/os/signpost.h +414 -0
  279. package/sdk/ios/usr/include/os.modulemap +5 -0
  280. package/sdk/ios/usr/include/sys/socketvar.h +191 -0
  281. package/sdk/ios/usr/include/sys/vsock.h +84 -0
  282. package/sdk/ios/wasm/include/errno.h +4 -20
  283. package/sdk/ios/wasm/include/pthread.h +3 -0
  284. package/sdk/ios/wasm/include/setjmp.h +57 -0
  285. package/sdk/ios/wasm/include/sys/resource.h +2 -2
  286. package/sdk/native-hashes.json +3 -3
  287. package/skills/contrast/SKILL.md +6 -5
  288. package/skills/peach-debug/SKILL.md +68 -265
  289. package/skills/peach-debug/references/accessibility.md +37 -73
  290. package/skills/peach-debug/references/commands.md +2 -2
  291. package/skills/peach-debug/references/events.md +74 -0
  292. package/skills/peach-perf/SKILL.md +64 -402
  293. package/skills/peach-perf/references/presentation.md +46 -0
  294. package/skills/peach-perf/references/profiling.md +93 -0
  295. package/skills/peach-perf/references/render-counters.md +57 -0
  296. package/skills/peach-setup/SKILL.md +66 -217
  297. package/skills/peach-setup/references/native-config.md +35 -0
  298. package/skills/peach-setup/references/reporting.md +28 -0
  299. package/skills/peach-test/SKILL.md +68 -285
  300. package/skills/peach-test/references/detox.md +69 -0
  301. package/skills/peach-test/references/maestro.md +95 -0
  302. package/skills/peach-visual/SKILL.md +53 -106
  303. package/src/android-autolinking.ts +1 -0
  304. package/src/android-bridge-packages.ts +279 -0
  305. package/src/appPackageContract.ts +14 -1
  306. package/src/assetCatalogContract.ts +8 -1
  307. package/src/bridge-contract.ts +6 -0
  308. package/src/bundle-channel.mjs +152 -60
  309. package/src/cli-runtime.ts +3 -0
  310. package/src/configured-bundle-producer.ts +10 -0
  311. package/src/device-catalog.ts +68 -4
  312. package/src/expo-discovery-cache.ts +10 -3
  313. package/src/expo-kotlin-host.ts +97 -26
  314. package/src/expo-native-workspace.ts +211 -52
  315. package/src/expo-swift-host.ts +149 -123
  316. package/src/expo-swift-ready.ts +5 -1
  317. package/src/expo-widget-assets.ts +76 -0
  318. package/src/expoKotlinContract.ts +12 -2
  319. package/src/expoSwiftContract.ts +21 -2
  320. package/src/generated/swift-c-predefines.json +1 -1
  321. package/src/home-paths.ts +6 -1
  322. package/src/host/bridge-host.ts +5 -0
  323. package/src/host/fetch-proxy-handler.ts +10 -0
  324. package/src/host/websocket-proxy.ts +7 -2
  325. package/src/kotlin-host.ts +204 -30
  326. package/src/kotlinSdkContract.ts +2 -1
  327. package/src/menu.ts +7 -0
  328. package/src/native-prebuilt.ts +154 -0
  329. package/src/nitro-adapter.lock.json +261 -261
  330. package/src/nitro-adapter.ts +118 -50
  331. package/src/nitro-bundle.ts +134 -96
  332. package/src/nitro-compile.ts +16 -6
  333. package/src/nitro-dependencies.ts +43 -28
  334. package/src/nitro-source.ts +142 -30
  335. package/src/nitro-superset.lock.json +103 -0
  336. package/src/nitro-superset.ts +137 -0
  337. package/src/nitroAdapterContract.ts +146 -98
  338. package/src/nitroContract.ts +68 -21
  339. package/src/react-bridge-importers.ts +1 -0
  340. package/src/react-native-bridge-modules.ts +2 -0
  341. package/src/react-native-host-modules.ts +4 -1
  342. package/src/settingsContract.ts +37 -1
  343. package/src/storageSnapshotContract.ts +29 -81
  344. package/src/swift-compile.ts +315 -117
  345. package/src/swift-compiler-digest.ts +2 -0
  346. package/src/swift-coverage/indexdump.ts +22 -6
  347. package/src/swift-coverage/indexing.ts +4 -4
  348. package/src/swift-coverage/sdk.ts +104 -20
  349. package/src/swift-coverage/types.ts +34 -0
  350. package/src/swift-coverage/xcode-packages.ts +61 -1
  351. package/src/swift-coverage/xcode.ts +19 -13
  352. package/src/swift-cxx-reachable.ts +1 -1
  353. package/src/swift-distribution.lock.json +18 -13
  354. package/src/swift-distribution.ts +57 -26
  355. package/src/swift-host.ts +51 -35
  356. package/src/swift-link-roots.ts +45 -18
  357. package/src/swift-objc-compile.ts +78 -2
  358. package/src/swift-objc-standin.ts +3 -0
  359. package/src/swift-shared-sdk.ts +85 -1
  360. package/src/swift-standin-emit.ts +6 -1
  361. package/src/swift-standins.ts +403 -19
  362. package/src/swift-submit.ts +17 -1
  363. package/src/swift-toolchain.ts +98 -23
  364. package/src/swift-wasm-prune.ts +1629 -0
  365. package/src/turbo-bundle.ts +82 -0
  366. package/src/turbo-compile.ts +120 -0
  367. package/src/turbo-runtime.lock.json +69 -0
  368. package/src/turbo-source.ts +754 -0
  369. package/src/vite-plugin-one.ts +15 -3
  370. package/src/vite-plugin.ts +82 -23
  371. package/src/wasm-optimize.ts +34 -0
  372. package/src/worker-system-chunks.ts +3 -3
  373. package/src/xcode-project.ts +52 -0
  374. package/src/xcode-target-members.ts +12 -1
@@ -1,428 +1,90 @@
1
1
  ---
2
2
  name: peach-perf
3
- model: sm
4
- description: Optimize Peach engine and app performance: scroll jank, dropped frames, slow animation, idle CPU, memory growth, and lag under load. Covers measuring on the right thread, proving perf tiers engage via counters, a CPU-contention harness, and perf machinery. For debugging load peach-debug first.
3
+ description: Diagnose and optimize measured scroll jank, dropped frames, animation latency, idle CPU, or memory growth in an app running in Peach. Use for performance profiling and before/after comparisons; use peach-debug for general rendering or interaction bugs and peach-setup for connection problems.
5
4
  ---
6
5
 
7
6
  # Peach performance
8
7
 
9
- optimize performance in Peach: the shell frame pipeline, the compositor
10
- tiers, and the guest app. this skill exists because every real perf win in
11
- this engine followed the same loop — measure on the right thread, read the
12
- counters that prove machinery engaged, fix the one thing the counters
13
- indict, remeasure — and every wasted week came from skipping a step.
8
+ Start with a connected, pinned sim (`peach describe` returns your app). Use
9
+ `peach-setup` if it does not. Identify the slow interaction and reproduce it
10
+ before changing code.
14
11
 
15
- > needs a connected, pinned sim (`/peach-setup`). general "what's wrong"
16
- > triage lives in `/peach-debug`; this skill goes deeper on perf only.
12
+ ## Measure the cause
17
13
 
18
- ## the five laws (each paid for by a real incident)
19
-
20
- 0. **find the cause before you time it.** compare our paint, frame and tier
21
- counters against GPU Chrome on every screen, at rest and in motion, and
22
- follow the surface whose counts differ. a short probe needs no exclusive
23
- slot and no matched timing; exclusive timing proves only the final before
24
- and after number. a narrow, admissible measurement of one journey can run
25
- for hours and never meet the cause.
26
-
27
- 1. **measure the worker that painted it, in the right browser.** the tenant
28
- hasn't painted since the two-worker split, so never read a tenant sampler
29
- (the one reporting `avg 0.48ms (2069 fps)` for a visibly janky scroll was
30
- removed). but "the shell" is no longer the whole answer either: the
31
- compositor worker owns `home`, `app:one` and `app:two`, so **every guest-app
32
- draw call, paint boundary and raster-tier decision is in the compositor's
33
- render profile, not the shell's.** `perf shell stop` prints both, labelled
34
- by worker — read the compositor block for anything inside an app. for
35
- months it printed only the shell's, and a dense token-list fling
36
- therefore reported `raster tier: 0 promotions / 0 blits` while the
37
- compositor was blitting ~14 rows a frame; the giveaway was `node visits: 7`
38
- next to `app:one 1014 paints`. if a render-profile block describes a
39
- handful of nodes while an app surface is painting hundreds of times, you
40
- are reading the wrong worker.
41
- browser matters just as much: playwright's bundled headless chromium has
42
- NO GPU — CanvasKit falls back to software rendering and every number lies
43
- high. launch a dedicated GPU-backed Chrome executable with a disposable
44
- profile and an owning process supervisor that terminates its exact process
45
- tree. never automate the user's own browser profile.
46
- 2. **machinery silently not engaging is the default failure mode.** the
47
- raster tier compiled, gated, and did *nothing* for months — zero
48
- promotions on its textbook case — until per-gate rejection counters
49
- existed. the frame-demand gate was blind to commit storms. the vsync
50
- pump flapped 100 msgs/s at rest. never assume a tier works because it's
51
- wired; read its counter during the exact workload.
52
- 3. **check reclaimable memory and sampled CPU before blaming code.** an OOM or
53
- busy machine mimics every perf and infra failure. on macOS, read
54
- `memory_pressure -Q` and take multiple `iostat -c 3` CPU samples; on Linux,
55
- read `MemAvailable` from `/proc/meminfo` and sample CPU idle over time. keep
56
- the busiest sample. raw macOS `freemem()` and load average are not admission
57
- signals. attribute browser processes with `ps -eo pid,ppid,args` before
58
- treating one as abandoned or stopping an exact pid.
59
- 4. **never trade animation fidelity for CPU.** perpetual sub-frame animation
60
- must keep its authored cadence. attack per-frame cost (layers, caching,
61
- damage), never cadence or fidelity.
14
+ ```sh
15
+ peach version
16
+ peach perf shell start
17
+ # reproduce the slow interaction
18
+ peach perf shell stop --json
19
+ peach get errors 5
20
+ ```
62
21
 
63
- ## measuring
22
+ Read the **compositor** render-profile block for guest-app painting, boundaries,
23
+ and raster decisions. Shell and tenant statistics alone do not describe app
24
+ paint cost. If a report visits only a handful of nodes during a dense app
25
+ scroll, check which worker it describes.
64
26
 
65
- ### record a Performance timeline
27
+ Compare painted-frame count, layout/render/flush costs, p95, worst frames, and
28
+ cadence. A low cost per painted frame can hide missing frames. The frame budget
29
+ is about 8.3 ms at 120 Hz or 16.7 ms at 60 Hz. Use the actual display cadence;
30
+ a single p95 is insufficient evidence of an improvement.
66
31
 
67
- `peach perf record` and the devtools Performance tab share one recording.
68
- Start from either, interact with the app, then Stop from either. The saved
69
- category choice is used unless the command supplies a preset or category list:
32
+ For a timeline linked to animations, interactions, network, and logs:
70
33
 
71
34
  ```sh
72
35
  peach perf record start --preset default
36
+ # reproduce
73
37
  peach perf record status --json
74
38
  peach perf record stop -o /tmp/app.profile.jsonl.gz
75
39
  ```
76
40
 
77
- Default records compositor frames, Animated and Reanimated animation runs,
78
- interactions, network and logs. `--categories frames,animations,react` selects
79
- specific categories. React attribution and memory cost more than Default;
80
- Paint Detail changes the renderer's path, so do not compare those frame
81
- times with a Default run. A recording retains its last five minutes and
82
- reports gaps when frame coverage is lost. Stop releases its profiling resources.
83
- Save writes the preview timeline’s gzip JSONL format. Open reads it, plain
84
- JSONL, or a CLI JSON profile; a `.json` CLI output keeps the JSON form. Both
85
- forms include frame columns, animation spans, discrete events, missed display
86
- ticks and optional value samples. Upload shares the profile alongside the
87
- currently loaded app through the preview uploader. This is a diagnostic capture; use the independent
88
- presentation evidence below to make smoothness claims.
89
-
90
- ### presentation proof must stay outside the simulator
91
-
92
- Performance acceptance must not use `peach record`, `liveComposite`,
93
- `captureBitmaps`, Chrome screencast, or another in-page frame-copy path. Those
94
- paths add work to the simulator or browser and can change the cadence being
95
- measured. Record the visible window with the operating system's native screen
96
- capture instead.
97
-
98
- Use an operating-system-owned window recorder. Target the exact browser window
99
- rather than the display when the platform supports it, start recording before
100
- normal user input, preserve the movie, and record the operating system and
101
- recorder version. Confirm that the recorder process, not the browser or
102
- simulator, owns capture and encoding. If native window capture is unavailable,
103
- report the proof as blocked instead of substituting an in-page capture path.
41
+ Start and stop also work in the devtools Performance tab. React, memory, and
42
+ Paint Detail add overhead; Paint Detail changes the rendering path. Compare
43
+ runs with the same categories. Read [profiling](references/profiling.md) when
44
+ you need categories, CPU profiles, cadence interpretation, or contention tests.
104
45
 
105
- The visual run contains only normal user input. Do not query the performance,
106
- debug, or test bridge while it records. Treat that video as visual evidence of
107
- frame progression. Collect worker paint, flush, delivery, and tier counters in
108
- a separate run with screen capture off. The two runs answer different questions
109
- without making the simulator measure its own recording overhead.
46
+ ## Choose the next probe
110
47
 
111
- Open the sim with `?debug=framestamp` to make that video machine-readable.
112
- Every surface paint then draws its `Date.now()` low 20 bits as a 23-cell
113
- barcode — `home` and `app:*` at 45% of the surface height, `shell-overlay` on
114
- its own row at 55% so overlay paints (keyboard, native UI) are attributable
115
- separately. Decode the documented 23-cell barcode with a compatible framestamp
116
- decoder to report, per presented frame, which paint it shows and how late that
117
- paint presented. If no decoder is available, keep the recording as qualitative
118
- evidence and make no numeric presentation-latency claim from it.
48
+ | Observation | Investigate |
49
+ | --- | --- |
50
+ | Layout spikes during scrolling | Row materialization, layout-affecting animation, repeated commits |
51
+ | Boundary records approach replays | Cache invalidation, moved origins, or cold content |
52
+ | Raster promotions/blits stay zero | Eligibility rejection counters in the compositor block |
53
+ | Work cost stays low but frames disappear | Host clock, delivery lag, worker scheduling, presentation cadence |
54
+ | First tap or paint stalls | `peach get requests 5`, image/font loading |
55
+ | Memory grows while repeating a flow | `peach debug memory`, active animations, retained resources |
119
56
 
120
- This is the only way to separate a frame the compositor never produced from one
121
- it produced and the browser never presented.
57
+ Read [render counters](references/render-counters.md) only when interpreting
58
+ cache tiers, rejection gates, idle activity, or memory cleanup. Prove the
59
+ existing mechanism engages before proposing another cache or fast path.
60
+ A promotion or blit count alone does not prove a speedup.
122
61
 
123
- **Screen capture is not presentation-neutral, so the decoded timing expires.**
124
- Starting a ScreenCaptureKit window capture flips the 120hz `OffscreenCanvas`
125
- out of latest-wins presentation into sequential presentation, which falls behind
126
- roughly 0.5ms for every 1ms of capture. A capture started mid-activity begins
127
- near zero latency and climbs from there. A recording is therefore truthful about
128
- content and trajectory for its whole length, and truthful about timing for
129
- roughly its first 500ms; latency growth past that is the capture, not the
130
- engine. Live uncaptured presentation stays latest-wins and current. Never report
131
- a late-recording latency as an engine number, and never compare two recordings
132
- of different lengths.
133
-
134
- Worker counters and presentation are different claims, and a green counter never
135
- licenses a smoothness claim. A capture can report a perfect 120hz worker cadence
136
- for motion the user never sees move: the overscroll release shipped exactly that
137
- way, with the compositor stepping on schedule while the presented frames showed
138
- a clamped fling instead of the bounce spring. Counters prove a tier engaged;
139
- only a framestamp decode of an out-of-process recording proves what presented.
140
-
141
- When an external transform control is smooth but the simulator is not, inspect
142
- every animation on the presented element. A separate Web Animation object does
143
- not isolate paint work: animating `box-shadow`, `filter`, or another paint-only
144
- property on the transform owner can move the whole trajectory to the browser's
145
- main thread. Paint stable decoration once or give it a distinct layer.
62
+ Enable only the debug channels you need, then disable them before timing:
146
63
 
147
64
  ```sh
148
- peach perf shell start # arm shell frame capture (clears prior)
149
- # reproduce — e.g. 8 fling swipes:
150
- # for i in {1..8}; do peach do swipe 196 650 196 250 8 8 --no-wait; sleep 0.9; done
151
- peach perf shell stop # report (add --json for scripting)
65
+ peach debug enable layout,render
66
+ # reproduce and inspect
67
+ peach debug recent layout 40
68
+ peach debug disable layout,render
152
69
  ```
153
70
 
154
- the report and how to read it:
155
-
156
- - `painted frames / avg / p50 p95 p99 / jank` — work-per-painted-frame.
157
- budget: 8ms at 120hz, 16.7ms at 60hz; p95 > 20ms is visible jank.
158
- - `surfaces` — per-surface layout/render/flush split. `layout` spikes on a
159
- scroll capture mean shell-side yoga re-layout when virtualized rows
160
- materialize (mid-fling commit), not steady-state cost.
161
- - `boundaries: N records / M replays` — layer compositor health. healthy
162
- scroll: replays >> records, record cost near zero. records ≈ replays
163
- means invalidation is defeating the cache (the SkPicture attempt-1
164
- failure shape: `records: 1525, replays: 35`).
165
- the `why recorded` line under it splits those records three ways, and each
166
- one is a different bug: `invalidated` means something dirtied the boundary's
167
- content (the usual culprit, and usually a style write that did not change a
168
- value), `moved` means the boundary's record origin shifted so the cached
169
- picture no longer lines up, and `first-record` is a boundary that had no
170
- picture yet. a scroll dominated by `invalidated` is an invalidation bug; one
171
- dominated by `first-record` is a warm-up problem, so look at whether the
172
- idle pre-record reaches that content.
173
- - `raster tier: promotions / blits` — blits per scrolled frame > 0 or the
174
- tier is not firing; `raster skips` names the first gate each candidate
175
- failed (rebuild / animated / cacheable). zero blits on a feed scroll is
176
- a bug, not a tuning matter — but check you are reading the compositor's
177
- block first (law 1), because the shell's is legitimately zero for an app
178
- workload.
179
- **before widening any skip bucket, read the `also fail a later gate`
180
- line under it.** the counters name only the FIRST failed gate, so a big
181
- bucket can be entirely blocked a second time and unwidenable: on one dense
182
- token-list fling all 8298 `animated` skips also carried a style transform
183
- or a non-cacheable chunk, and narrowing the animated gate moved 6007 to
184
- `transform` and 2350 to `cacheable` while promoting nothing. a bucket is
185
- worth attacking when its also-blocked share is small.
186
- and blits firing is not the same as the tier paying for itself: on that same
187
- token list the tier blits every visible row and costs 70MB of GPU
188
- cache for no frame-time change, while the retained row boundaries under it
189
- cost 2.4ms a frame. the discriminator is per-row draw density, so check
190
- `draw calls` in the same block before concluding a cache is earning its
191
- keep.
192
- - `worst frames` — read the layout/render split of each; they are usually
193
- a different problem than the average.
194
-
195
- three runs minimum; single-run p95 is noise. a fresh `perf start` between
196
- runs clears the buffer.
197
-
198
- ### browser-site interaction matrices
199
-
200
- for a browser-level regression, use three fresh documents per browser engine.
201
- within each document, capture cold then warm versions of the same interaction;
202
- do not call two independent fresh documents "cold versus warm." wait for the
203
- home surface's first compositor paint before starting—the compositor-ready flag
204
- only proves worker bootstrap and can precede the first visible layout.
205
-
206
- during a measured transition, use a fixed observation window. do not poll the
207
- shell state, test tree, or perf bridge while the animation is running; verify
208
- the positive control once after profiling stops. query a targeted id or text on
209
- large virtualized apps, never the full tree, because enumeration can dominate
210
- or terminate the browser process. for a remotely populated list, require the
211
- same scroll-container identity and content extent for a quiet window before the
212
- gesture; "a row exists" can still be true while the app replaces the tree.
213
- keep pointer down, moves, release, and the fixed settle window inside one
214
- uninterrupted profile. stopping or querying between drag and release changes
215
- velocity, cache state, and worker scheduling.
216
-
217
- the minimum browser matrix is home drag plus snapback, a cold/warm built-in app
218
- open, and a cold/warm app-switcher open. add one quiet heavy-app screen, one
219
- navigation transition, and one long-list scroll when those surfaces are in
220
- scope. use GPU-backed Chrome for Chromium claims. use installed WebKit in a
221
- visible nonpersistent WKWebView for Safari-engine claims; Playwright WebKit is
222
- not the installed Safari engine.
223
-
224
- every receipt must carry the exact page and frame URLs, browser user agent,
225
- browser executable path and content hash,
226
- harness-source identity, capture time, engine build identity and generation,
227
- runtime bundle receipt, sampled host capacity at run start, runtime errors, and
228
- any partial failure. use the shared host-capacity sampler; do not record raw
229
- `freemem()` or decide from macOS load average.
230
- partial artifacts remain inadmissible until every requested run number for that
231
- scenario exists with one harness, browser executable, engine, seed, and
232
- viewport identity. browser
233
- comparisons use the same root/target viewport tuple and backing scale. for a
234
- wrapper or embedded surface, first prove the target has nonzero presented
235
- geometry; a finite host viewport that responsively hides the target measures a
236
- different surface. direct and embedded modes may intentionally have different
237
- tuples, but browsers within one mode may not. finite but different device pixel
238
- ratios are not comparable. if setup reloads only the child frame, replay the
239
- parent's presentation control and wait for the new child to acknowledge it. a
240
- selected parent toggle can outlive its child and is not proof of the child's
241
- mode.
242
- the profile intentionally blocks Graphite cache cleanup, so its cache snapshot
243
- is not a terminal memory verdict. require a capture-local post-profile
244
- compositor snapshot with before, after, and delta cleanup counters. an
245
- over-limit profiled Context needs fresh submitted-work attempt and
246
- successful-completion deltas; an over-limit profiled Recorder also needs a
247
- fresh cleanup in that capture. classify Context and Recorder independently as
248
- within-limit, locked-over-limit, or purgeable-over-limit; never compare their
249
- aggregate, and never admit purgeable overage. a cache with zero purgeable bytes
250
- can still hold a returned-resource queue: settled maintenance releases completed
251
- Recorder resources, then budget enforcement evicts
252
- least-recently-used overage before the next paint or resource insertion can
253
- inherit the synchronous work. perpetual renderer
254
- animation is not finite interaction demand; finite motion, readbacks, and
255
- profiling must still block cleanup.
256
- the host-clock `displayFrames`/`timerFrames` and shell-link
257
- `displayPumps`/`timerPumps` counters prove whether the visible-rAF fallback
258
- engaged. preserve failed receipts instead of retrying them out of the data set.
259
-
260
- ### confirm which build you measured, every time
261
-
262
- Record the CLI and runtime versions with `peach version`. For a development
263
- build, include a build marker in the capture and verify it after reloading.
264
- An A/B measurement must identify each build from its own output.
265
-
266
-
267
- deeper tools when the frame report isn't enough:
268
-
269
- ```sh
270
- peach maestro test .maestro/scroll.yaml --profile # per-step + frame stats
271
- peach perf cpu --duration 5 --output /tmp/t.cpuprofile # sampled CPU
272
- peach open 8089 --new --driver playwright --cdp-port 9222 # cpu-profile a driveable sim
273
- peach debug enable layout,render && peach debug recent layout 40
274
- ```
275
-
276
- `peach perf cpu` writes one profile for the page and one for every attached
277
- worker, plus a manifest that labels shell, compositor, tenant, worklet, and
278
- unknown workers. exit zero requires page, shell, compositor, and tenant plus
279
- every other discovered target, with each covering at least 99% of the requested
280
- window. inspect start/stop offsets as well as sample counts; a late-attached
281
- near-empty profile is incomplete. a profile of only the tenant—or a helper
282
- that relabels the busiest worker as tenant—cannot distinguish CPU saturation
283
- from sparse browser scheduling.
284
-
285
- for an automated interaction, pass `--interaction-barrier` and start the cpu
286
- command during the runner's pre-workload attachment delay, and give the runner
287
- a post-workload delay long enough to remain open through profiler stop. the
288
- pre-workload delay alone is not synchronization: it can end the profile while
289
- the workload is still preparing. barrier mode pauses the workload before its
290
- first measured capture until every discovered target is profiling, then rejects
291
- the manifest unless the workload publishes its completion marker, every expected
292
- capture label, and action timestamps inside the capture interval. retain its
293
- browser executable, engine build and generation, root and target viewports, and
294
- workload source identity in the CPU manifest. the barrier also has a bounded
295
- page-side lease so an interrupted
296
- profiler cannot strand the workload; lease expiry releases the runner but
297
- invalidates the profile.
298
-
299
- ### the cadence block: frames that never happened
300
-
301
- work-per-painted-frame cannot see a frame that was never delivered because a
302
- worker was descheduled or its resilient clock fell back late. the report shows
303
- low avg and zero jank while the user sees stutter.
304
- the `cadence` section of `perf shell stop` measures the delivery side and
305
- attributes a missing frame to its hop:
306
-
307
- - `display clock / host rAF interval` — stretch here (gaps >1.5x median)
308
- means the page thread's rAF starved or was throttled, upstream of the
309
- shell worker entirely.
310
- - `delivery lag` — vsync postMessage receipt latency above the run's
311
- best case; jitter here means the shell worker was descheduled or its
312
- queue was busy.
313
- - `present interval` — intervals between admitted compositor presentations,
314
- including native frames, while progress remains pending after the preceding
315
- presentation (`motionPending` in `compositorCadence.frameSeries`). Settled
316
- admitted frames end a sequence; deferred frames retain the pending gap.
317
- `paintIntervals` reports the sample count, so zero samples do not prove
318
- smoothness. Shell work and JavaScript flushes can park while native frames
319
- continue presenting.
320
- - `idle breaks` — host gaps >250ms, excluded from host interval statistics.
321
-
322
- the compositor `compositorHostFrameClock` keeps its historical name and reports
323
- display/timer ticks consumed by the compositor worker's resilient clock during
324
- the acknowledged profile window. `published` is null because renderer-main no
325
- longer publishes compositor frames. sparse consumed ticks with low production
326
- time identifies worker scheduling starvation. many consumed ticks with sparse
327
- paints can be legitimate dirty-gating; correlate the frame series before
328
- treating it as a regression. Host and shell delivery statistics come from the
329
- shell worker; `cadence.paintInterval*` comes from compositor presentation times
330
- during motion.
331
-
332
- compare baseline vs contended captures of the same scripted window; also
333
- compare **painted-frame counts**, the crudest and most robust signal.
334
-
335
- the compositor cadence lines separate worker delivery from work submitted by
336
- the worker:
337
-
338
- - `engine-empty rAF` includes only sustained intervals where adjacent frames
339
- have no engine demand, input message, shared-slot demand epoch change,
340
- paint, prewarm pass, or CanvasKit flush.
341
- - `rAF with CanvasKit flush` and `rAF after CanvasKit flush` isolate the frame
342
- that called `Surface.flush()` and the next delivered frame.
343
- - `CanvasKit submission` measures intervals between final `Surface.flush()`
344
- completions on frames that submitted at least one surface. The JSON
345
- `frameSeries` preserves each phase flag and exact count for correlation.
346
-
347
- these are engine-owned boundaries. Playwright exposes raw CDP sessions only
348
- for Chromium, and WebKit's public Inspector timeline exposes a WebCore
349
- `Composite` record without a RemoteLayerTree transaction id or commit event.
350
- Do not label CanvasKit flush or compositor rAF as a RemoteLayerTree commit.
351
-
352
- ## the contention harness ("smooth alone, laggy on a zoom call")
353
-
354
- low-load numbers do not predict feel under real-world CPU pressure. run the
355
- same scripted capture twice, once with synthetic load, self-terminating so
356
- it can't leak:
357
-
358
- ```sh
359
- # 6 cores of load for 30s, self-terminating
360
- for i in 1 2 3 4 5 6; do
361
- (perl -e 'my $end=time()+30; while(time()<$end){my $x=0; $x+=rand() for 1..10000}' &)
362
- done
363
- ```
364
-
365
- compare: painted-frame count (cadence), avg/p95 (work), layout spikes. the
366
- diagnostic split:
367
-
368
- - **work grows under load** (avg/p95 way up) → paint path too heavy;
369
- attack per-frame cost (layers, damage, raster, draw calls).
370
- - **work flat but frames missing** (counts drop, avg barely moves) →
371
- delivery starvation: the host-rAF → postMessage → shell hop chain and
372
- worker scheduling. browsers give no thread priorities, so the only
373
- levers are fewer hops on the frame-critical path, less work per hop, and
374
- keeping motion (scroll, native anims) as close to the paint site as
375
- possible.
376
- - also remember GPU contention is real (video calls encode on the GPU);
377
- webkit-lane numbers are Metal, chrome numbers are its GL/Metal stack.
378
-
379
- ## the perf machinery map (improve, don't reinvent)
380
-
381
- every tier below exists and has a counter. before optimizing, identify
382
- which tier *should* absorb your cost and prove whether it does.
383
-
384
- | tier | what it absorbs | proof it engaged |
385
- | --- | --- | --- |
386
- | demand-gated frames + visibility re-marking | idle costs nothing; invisible animations quiesce | `+N skipped idle ticks`; `queryStats().needsVsync` false at rest |
387
- | per-surface dirty scoping | one app's commit/animation repaints only its surface | idle repaints ≈ commit rate, owning surface only |
388
- | dirty-tracked layout + tiered text measurement | color/opacity/transform commits skip yoga; repeated strings skip shaping | `layout: 0` on steady frames |
389
- | layer compositor (`paint-boundary.ts`) | animating a child never re-records ancestors | replays >> records |
390
- | idle boundary pre-record | the first drag replays instead of recording; cold records happen while the surface is quiet | `pre-recorded: N boundaries at idle` in the report, and the first interaction's record cost near its warm cost |
391
- | damage rects (`damage-rect.ts`) | repaint clips to changed region (opaque-backdrop gated) | worst-frame render bounded during small updates |
392
- | raster tier | stable rows become GPU textures; scroll skips recording | compositor block: promotions > 0 once warm, blits ≈ one per visible row on a dense feed |
393
- | flood guard, pointer coalescing, vsync hysteresis | message-storm and pump-thrash protection | msgs/s sane during gestures and at rest |
394
- | worker-owned resilient frame clocks | renderer-main stalls do not stop shell or compositor motion | compositor consumed display/timer frames plus shell worker frame and paint cadence |
395
-
396
- there is no whole-screen scroll blit. one existed for a few hours in June
397
- 2026 and was reverted (`6706f3a014`): it shifted a surface RECTANGLE, so a
398
- full-surface feed with floating translucent chrome dragged its bars along with
399
- the content and smeared their old pixels through the feed. scroll rides the
400
- layer, damage, and raster machinery above instead, and any future blit has to
401
- own a scroll SUBTREE with provable backdrop correctness rather than a screen
402
- rect. do not look for `blitBlocked`; it does not exist.
403
-
404
- if a workload's cost lands in a tier that shows zero activity, the fix is
405
- almost always "why didn't it engage" (a gate, a shape, an eligibility
406
- rule), not new machinery. the area-gate fix that finally made the raster
407
- tier fire on feeds came entirely from rejection counters.
408
-
409
- ## guest-app-side causes (fix the app, or fix the engine honestly)
410
-
411
- - dynamic format strings (`` `${n} messages` ``) bust the shaping LRU —
412
- split number and label into separate `<Text>` nodes.
413
- - `Animated.Value` on `width`/`height` forces layout per frame — use
414
- `transform` (scale/translate).
415
- - per-frame React work from reanimated-style code is an engine conformance
416
- bug (valid worklet apps must not commit per frame) — fix Peach core,
417
- never add a divergent fast-path (upstream alignment overrides perf; see
418
- the `shouldFreezeOffscreenStackContent` incident).
419
- - render-storm loops (poll → remount) show up as commit-rate repaints and
420
- RSS growth; check `debug state animations` and the timeline.
421
-
422
- ## closing the loop
423
-
424
- done means: a named hot path + the counter or split that indicts it + the
425
- same capture re-run showing the number moved + no new errors (`get errors`)
426
- + nothing torn down left running (close sims you opened, kill load loops).
427
- for engine changes, run the affected integration tests exposed by the installed
428
- Peach version and capture stable screenshots of surfaces you touched.
71
+ ## Keep comparisons honest
72
+
73
+ - Identify each build with `peach version` and, for development builds, a build
74
+ marker verified after reload. Keep device, theme, viewport, scale, data,
75
+ browser, and workload the same between runs.
76
+ - Check available memory and sampled CPU before blaming app code. Use the same
77
+ browser and GPU configuration. Software rendering and GPU rendering produce
78
+ different performance results; confirm which is active.
79
+ - Keep the input, release, and settle interval in one uninterrupted capture.
80
+ Avoid tree enumeration or debug queries during the measured interaction.
81
+ - Optimize work per frame. Preserve animation cadence, trajectory, native
82
+ behavior, and app semantics. A transform can avoid layout only when it
83
+ preserves the intended behavior.
84
+ - Worker counters prove work and scheduling. For a claim about what users
85
+ actually see, read [presentation evidence](references/presentation.md) and
86
+ capture the visible window outside the simulator in a separate run.
87
+
88
+ Finish with a named cause, comparable before/after results for the same
89
+ interaction, and no new console errors. Stop profiling, disable channels,
90
+ terminate synthetic load you started, and close only sims you own.
@@ -0,0 +1,46 @@
1
+ # Presentation evidence
2
+
3
+ Use this only when making claims about visible motion or presentation latency.
4
+ Worker counters cannot prove that a produced frame reached the display.
5
+
6
+ Record the visible browser window with an operating-system-owned recorder.
7
+ `peach record`, Chrome screencast, and simulator frame-copy paths add work inside
8
+ the measured system. Keep normal user input in the visual run and collect debug,
9
+ paint, delivery, and tier counters separately with screen capture off.
10
+
11
+ Target the exact window when supported. Preserve the movie, OS and recorder
12
+ versions, browser identity, build, device, viewport, scale, and workload. If an
13
+ external recorder is unavailable, state the limitation instead of presenting
14
+ an in-page recording as independent evidence.
15
+
16
+ For machine-readable paint identity, enable the `framestamp` debug channel
17
+ before capture:
18
+
19
+ ```sh
20
+ peach debug enable framestamp
21
+ # record externally and reproduce with normal input
22
+ peach debug disable framestamp
23
+ ```
24
+
25
+ It draws a 23-cell barcode containing the low 20 bits of the paint's epoch
26
+ milliseconds. Home and app stamps sit at 45% of surface height; the shell overlay
27
+ uses 55% to separate keyboard/native-UI paints. A compatible decoder can identify
28
+ which paint each recorded frame contains. Without a decoder, use the video as
29
+ qualitative evidence and make no numeric presentation-latency claim.
30
+
31
+ Screen capture itself can change browser presentation. In particular,
32
+ ScreenCaptureKit capture can turn latest-wins presentation into sequential
33
+ presentation and accumulate delay during a recording. Do not attribute growing
34
+ late-recording latency to the engine without an independent control, or compare
35
+ recordings of different lengths as if capture overhead were constant.
36
+
37
+ For cross-browser comparisons, match device geometry, backing scale, data, and
38
+ workload. Within one document, capture cold then warm interactions; separate
39
+ fresh documents do not establish a cold/warm pair. Wait for visible content,
40
+ not only worker bootstrap. Keep pointer down, moves, release, and settling in
41
+ one uninterrupted observation window without bridge queries.
42
+
43
+ If an external transform control is smooth while the simulator stutters,
44
+ inspect every animation on the presented element. Animating `box-shadow` or
45
+ `filter` on the transform owner can force paint work onto the browser main
46
+ thread. Stable decoration on a separate layer can isolate that cost.
@@ -0,0 +1,93 @@
1
+ # Profiling tools
2
+
3
+ Read this when the shell frame summary is insufficient.
4
+
5
+ ## Performance timeline
6
+
7
+ ```sh
8
+ peach perf record start --categories frames,animations,react
9
+ peach perf record status --json
10
+ peach perf record stop -o /tmp/app.profile.jsonl.gz
11
+ ```
12
+
13
+ Presets are `default`, `animations`, and `everything`. Without a category or
14
+ preset, start uses the saved Performance-tab categories. The recording retains
15
+ its last five minutes and reports lost frame coverage. Stop releases profiling
16
+ resources.
17
+
18
+ | Category | Cost |
19
+ | --- | --- |
20
+ | `frames`, `animations`, `interactions`, `network-logs` | Low |
21
+ | `react`, `animation-values`, `layout`, `memory` | Medium |
22
+ | `paint-detail` | High; changes the renderer path |
23
+
24
+ Save supports gzip JSONL; a `.json` CLI output retains JSON form. The Performance
25
+ tab can open these captures. Keep categories identical for timing comparisons.
26
+ Use `peach maestro test .maestro/scroll.yaml --profile` for per-step frame stats
27
+ from an existing flow.
28
+
29
+ ## Sampled CPU
30
+
31
+ ```sh
32
+ peach open 8081 --new --driver playwright --cdp-port 9222
33
+ peach perf cpu --cdp-port 9222 --duration 5 --output /tmp/app.cpuprofile
34
+ ```
35
+
36
+ This intentionally creates a separate profiling sim. Close it when finished.
37
+ Use an isolated browser profile, never the user's normal browser profile.
38
+ Confirm hardware acceleration before making GPU-performance claims.
39
+
40
+ The command writes profiles for the page and every attached worker, plus a
41
+ manifest identifying shell, compositor, tenant, worklet, and unknown targets.
42
+ Inspect coverage, start/stop offsets, and sample counts. A late-attached,
43
+ nearly empty worker profile cannot explain scheduling starvation. Successful
44
+ capture requires page, shell, compositor, tenant, and all discovered targets
45
+ covering at least 99% of the requested window.
46
+
47
+ `--match <substring>` filters the page URL; `--sample-interval <ms>` controls
48
+ sampling. See `peach perf cpu --help` for defaults.
49
+
50
+ `--interaction-barrier` is for an automated workload that implements the
51
+ profiler's barrier and completion markers. It pauses before measured input until
52
+ targets are profiling, checks action timestamps and expected capture labels,
53
+ and rejects incomplete coverage. An arbitrary script does not acquire this
54
+ synchronization simply by passing the flag. The page-side lease releases a
55
+ stranded workload but makes an expired capture invalid.
56
+
57
+ ## Cadence
58
+
59
+ Read work cost and frame delivery together:
60
+
61
+ | Report field | Meaning |
62
+ | --- | --- |
63
+ | Host rAF interval | Display-clock delivery to the page; long gaps can indicate page throttling or starvation |
64
+ | Delivery lag | Receipt latency above the run's best case; jitter can indicate a busy queue or descheduled worker |
65
+ | Present interval | Intervals between admitted compositor presentations while motion remains pending |
66
+ | Idle breaks | Host gaps over 250 ms, excluded from host interval statistics |
67
+
68
+ Zero `paintIntervals` samples do not prove smoothness. Settled admitted frames
69
+ end a pending-motion sequence; deferred frames retain its gap. Shell JavaScript
70
+ flushes can park while native frames keep presenting.
71
+
72
+ `compositorHostFrameClock` counts consumed display/timer ticks in the profile
73
+ window. Sparse ticks with low work cost suggest scheduling starvation; many
74
+ ticks with few paints can be legitimate dirty gating. Correlate the frame series.
75
+
76
+ The cadence report also separates sustained engine-empty rAF intervals, frames
77
+ with CanvasKit flush, the following rAF, and CanvasKit submission intervals.
78
+ These are engine boundaries, not operating-system display commits. Never label
79
+ a CanvasKit flush as proof that the browser presented that frame.
80
+
81
+ ## CPU contention
82
+
83
+ If the problem occurs only under load, compare the same bounded interaction
84
+ with and without controlled, self-terminating load. Record CPU, available memory,
85
+ and GPU conditions. Do not saturate a shared machine without its owner's consent.
86
+
87
+ - Work cost rises: investigate paint, layout, draw calls, and cache activity.
88
+ - Work stays flat but frame count falls: investigate delivery and scheduling.
89
+ - Video calls can also create GPU contention; CPU load alone does not model it.
90
+
91
+ Keep load duration and concurrency explicit and stop only processes you started.
92
+ Repeat a noisy comparison enough to establish the effect; preserve failed runs
93
+ and report variability instead of selecting the fastest capture.