diff --git a/.github/workflows/apple.yml b/.github/workflows/apple.yml index ddce1ed..3dd332d 100644 --- a/.github/workflows/apple.yml +++ b/.github/workflows/apple.yml @@ -22,9 +22,12 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# 仓库公开后,fork 提的 PR 默认不在自托管 runner 上跑(避免陌生代码在本机执行); +# 只有源仓库自己分支的 PR、push 到 main、或手动触发才会实际执行 job。 jobs: apple: name: Apple + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository runs-on: [self-hosted, qc-macos] timeout-minutes: 30 steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fdeb83..ce5c00e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,12 @@ concurrency: # PR 只跑 ubuntu;push main 与手动触发跑 ubuntu + macOS。 # Windows 暂无本地 runner,全矩阵里已移除——Windows 验证(含 G2 Job Object 真机) # 仍待 Actions 配额恢复或接入 Windows 主机后补。 +# 仓库公开后,fork 提的 PR 默认不在自托管 runner 上跑(避免陌生代码在本机执行); +# 只有源仓库自己分支的 PR、push 到 main、或手动触发才会实际执行 job。 jobs: rust: name: Rust (${{ matrix.os }}) + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository strategy: fail-fast: false matrix: @@ -59,6 +62,7 @@ jobs: gui: name: GUI (${{ matrix.os }}) + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository strategy: fail-fast: false matrix: diff --git a/.gitignore b/.gitignore index 3b091ac..e213aac 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ DerivedData/ selfIdentity.plist # third-party WebDriverAgent checkout used for real-device acceptance /WebDriverAgent/ +# Claude Code session scaffolding (launch.json, agent worktrees) — local only +/.claude/ diff --git a/agents/ios-wda/README.md b/agents/ios-wda/README.md index f1f567d..9bf2747 100644 --- a/agents/ios-wda/README.md +++ b/agents/ios-wda/README.md @@ -83,6 +83,8 @@ macOS 26.5 host, go-ios 1.2.1. | Capture vs tunnel ordering | starting **or** stopping the capture re-enumerates USB: every live `ios tunnel start --userspace` connection failed at that instant and the WDA runner died with `lost connection to testmanagerd`. Rule: capture first, then tunnel and WDA; after the capture stops, restart both | | Side effects on the device | the status bar shows Apple's demo values (9:41, full battery, no carrier) while captured; iOS 26 asked for the device passcode once ("验证以访问 XCTest") when WDA was relaunched after a long idle | | `wda/tap` re-timed (2026-09-16, three fresh sessions, home screen and Settings, capture on and off) | **0.81–1.49 s per tap**, `wda/dragfromtoforduration` 1.7–3.1 s, `pressButton home` 0.51 s. The **0.01 s** in the row above was a **404 on an invalidated session** (a tap against a dead session id answers in ~25 ms; the GUI's probe session had just been invalidated by a second `POST /session`), not a real tap. `waitForIdleTimeout` 0, `animationCoolOffTimeout` 0, `defaultActiveApplication` set, `snapshotMaxDepth` 1 and `wda/touchAndHold` change nothing: the time is XCTest event synthesis itself. ~1 s per gesture is the control-side floor | +| Gate 1 of P4.4 (2026-09-16, phone re-plugged first): probe `--serve` (CoreImage JPEG, quality 0.5) → existing proxy → GUI `` in `LaunchMode::Attach` | probe: **58–60 fps capture on the home screen, JPEG encode 7.6–9.6 ms/frame, 50–100 KB/frame**; proxy took 54–60 parts/s; GUI label 58 fps. Render side (rAF + canvas pixel diff, changed frames per second): **50–56 in every second fully inside a 2 s home-screen drag**, median 32 across 8 drags (each 2 s of motion + 1.4 s idle). The Clock stopwatch page is not a valid motion source: the device sends only **30 fps** there (the app runs its display at 30 Hz) and the render count matched it 1:1. `requestAnimationFrame` stops entirely while the Mac is locked or the window is occluded, and the capture itself stalls to ~0.2 fps while the Mac is locked | +| Drag latency through the GUI's own session (2026-09-16) | `wda/dragfromtoforduration` with `duration` 2.0 returned after **3.4–3.5 s** each time (8 samples); the ~1.4 s overhead on top of the requested duration is the XCTest floor already seen for taps | | Windows availability (desk research) | upstream gave up Windows; `chotgpt/quicktime_video_hack_windows` (C++ rewrite, MIT, commits to 2026-03) needs a replacement usbmuxd on port 37015 plus a libusb0 or filter driver that conflicts with Apple's driver | Conclusion for engine selection: the stream is 2.5–3× the frame rate of the MJPEG path diff --git a/agents/ios-wda/tools/avprobe.swift b/agents/ios-wda/tools/avprobe.swift index 2a548ea..1d821f9 100644 --- a/agents/ios-wda/tools/avprobe.swift +++ b/agents/ios-wda/tools/avprobe.swift @@ -1,15 +1,40 @@ // avprobe: capture the iPhone screen via Apple's CoreMediaIO/AVFoundation path -// (the same USB "Valeria" interface qvh uses) and stamp every frame with the -// host wall clock plus a luma-difference score against the previous frame. +// (the same USB "Valeria" interface QuickTime Player uses). +// +// Two modes: +// avprobe stamp every frame (wall clock, PTS, luma diff) +// avprobe --serve [--quality q] JPEG-encode every frame and serve it as an +// MJPEG stream shaped like WDA's (HTTP/1.0, +// boundary --BoundaryString, Content-Length per +// part); prints "port=" on stdout once bound. +// +// Never prints the device name or unique id. Run from Terminal.app: camera permission is +// granted per launching app and a probe started from an agent shell is denied silently. import AVFoundation +import CoreImage import CoreMediaIO +import Darwin import Foundation -let args = CommandLine.arguments -let seconds = args.count > 1 ? Double(args[1]) ?? 30 : 30 -let outPath = args.count > 2 ? args[2] : "frames.tsv" func err(_ s: String) { FileHandle.standardError.write((s + "\n").data(using: .utf8)!) } +let args = CommandLine.arguments +var serveMode = false +var servePort: UInt16 = 0 +var quality = 0.5 +var seconds = 30.0 +var outPath = "frames.tsv" +var i = 1 +while i < args.count { + switch args[i] { + case "--serve": serveMode = true; servePort = UInt16(args[i + 1]) ?? 0; i += 2 + case "--quality": quality = Double(args[i + 1]) ?? 0.5; i += 2 + default: + if Double(args[i]) != nil { seconds = Double(args[i])! } else { outPath = args[i] } + i += 1 + } +} + var prop = CMIOObjectPropertyAddress( mSelector: CMIOObjectPropertySelector(kCMIOHardwarePropertyAllowScreenCaptureDevices), mScope: CMIOObjectPropertyScope(kCMIOObjectPropertyScopeGlobal), @@ -24,40 +49,70 @@ if auth == .notDetermined { AVCaptureDevice.requestAccess(for: .video) { ok in err("requestAccess -> \(ok)"); sem.signal() } _ = sem.wait(timeout: .now() + 120) } +if AVCaptureDevice.authorizationStatus(for: .video) != .authorized { + err("capture_permission_denied"); exit(3) +} func findScreenDevice() -> AVCaptureDevice? { let ds = AVCaptureDevice.DiscoverySession(deviceTypes: [.external], mediaType: nil, position: .unspecified) - for d in ds.devices { - err("device: muxed=\(d.hasMediaType(.muxed)) video=\(d.hasMediaType(.video)) model=\(d.modelID)") - if d.hasMediaType(.muxed) { return d } - } - return nil + return ds.devices.first { $0.hasMediaType(.muxed) } } - var device: AVCaptureDevice? = nil for _ in 0..<40 { device = findScreenDevice() if device != nil { break } RunLoop.main.run(until: Date(timeIntervalSinceNow: 0.5)) } -guard let dev = device else { err("no muxed (screen) device found"); exit(2) } -err("using screen device model=\(dev.modelID)") -for f in dev.formats { - let dims = CMVideoFormatDescriptionGetDimensions(f.formatDescription) - let codec = CMFormatDescriptionGetMediaSubType(f.formatDescription) - let rates = f.videoSupportedFrameRateRanges.map { "\($0.minFrameRate)-\($0.maxFrameRate)" } - err("format: \(dims.width)x\(dims.height) subtype=\(String(format: "%08x", codec)) rates=\(rates)") +guard let dev = device else { err("capture_device_not_found"); exit(2) } +err("using an iOS screen device") + +// MARK: - frame sinks + +final class LatestFrame { + private let lock = NSCondition() + private var data = Data() + private var seq = 0 + func publish(_ d: Data) { lock.lock(); data = d; seq += 1; lock.broadcast(); lock.unlock() } + /// Blocks until a frame newer than `after` exists; returns (seq, bytes). + func wait(after: Int) -> (Int, Data) { + lock.lock(); defer { lock.unlock() } + while seq <= after { lock.wait() } + return (seq, data) + } } final class Sink: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate { var idx = 0 var prev: [UInt8]? = nil - let fh: FileHandle - init(fh: FileHandle) { self.fh = fh } + let fh: FileHandle? + let latest: LatestFrame? + let ci = CIContext(options: [.useSoftwareRenderer: false]) + let cs = CGColorSpace(name: CGColorSpace.sRGB)! + var encodeNs: Int64 = 0 + var encoded = 0 + var lastReport = Date() + init(fh: FileHandle?, latest: LatestFrame?) { self.fh = fh; self.latest = latest } + func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) { let wall = Date().timeIntervalSince1970 - let pts = CMSampleBufferGetPresentationTimeStamp(sampleBuffer).seconds guard let pb = CMSampleBufferGetImageBuffer(sampleBuffer) else { return } + if let latest = latest { + let t0 = DispatchTime.now().uptimeNanoseconds + let image = CIImage(cvPixelBuffer: pb) + if let jpeg = ci.jpegRepresentation(of: image, colorSpace: cs, options: [kCGImageDestinationLossyCompressionQuality as CIImageRepresentationOption: quality]) { + latest.publish(jpeg) + encodeNs += Int64(DispatchTime.now().uptimeNanoseconds - t0) + encoded += 1 + } + idx += 1 + if Date().timeIntervalSince(lastReport) >= 5 { + let ms = encoded > 0 ? Double(encodeNs) / Double(encoded) / 1e6 : 0 + err(String(format: "capture %.1f fps, jpeg encode %.1f ms/frame, last frame %d bytes", Double(idx) / Date().timeIntervalSince(lastReport), ms, latest.wait(after: -1).1.count)) + idx = 0; encodeNs = 0; encoded = 0; lastReport = Date() + } + return + } + let pts = CMSampleBufferGetPresentationTimeStamp(sampleBuffer).seconds CVPixelBufferLockBaseAddress(pb, .readOnly) let w = CVPixelBufferGetWidthOfPlane(pb, 0), h = CVPixelBufferGetHeightOfPlane(pb, 0) let stride = CVPixelBufferGetBytesPerRowOfPlane(pb, 0) @@ -68,31 +123,107 @@ final class Sink: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate { CVPixelBufferUnlockBaseAddress(pb, .readOnly) var diff = 0.0 if let p = prev, p.count == cur.count { - var acc = 0; for i in 0...size)) + var addr = sockaddr_in() + addr.sin_family = sa_family_t(AF_INET) + addr.sin_port = port.bigEndian + addr.sin_addr.s_addr = inet_addr("127.0.0.1") + let bound = withUnsafePointer(to: &addr) { $0.withMemoryRebound(to: sockaddr.self, capacity: 1) { bind(fd, $0, socklen_t(MemoryLayout.size)) } } + guard bound == 0, listen(fd, 4) == 0 else { err("bind/listen failed: \(errno)"); exit(4) } + var bound_addr = sockaddr_in(); var len = socklen_t(MemoryLayout.size) + withUnsafeMutablePointer(to: &bound_addr) { $0.withMemoryRebound(to: sockaddr.self, capacity: 1) { _ = getsockname(fd, $0, &len) } } + let actual = UInt16(bigEndian: bound_addr.sin_port) + print("port=\(actual)"); fflush(stdout) + while true { + let client = accept(fd, nil, nil) + if client < 0 { continue } + Thread.detachNewThread { + var nosig: Int32 = 1 + setsockopt(client, SOL_SOCKET, SO_NOSIGPIPE, &nosig, socklen_t(MemoryLayout.size)) + // Wait for the request line + headers (the proxy sends GET / HTTP/1.1 first). + var req = Data(); var buf = [UInt8](repeating: 0, count: 1024) + while req.range(of: Data("\r\n\r\n".utf8)) == nil { + let n = read(client, &buf, buf.count) + if n <= 0 { close(client); return } + req.append(buf, count: n) + if req.count > 8192 { close(client); return } + } + func send(_ d: Data) -> Bool { + var off = 0 + while off < d.count { + let n = d.withUnsafeBytes { write(client, $0.baseAddress! + off, d.count - off) } + if n <= 0 { return false } + off += n + } + return true + } + let head = "HTTP/1.0 200 OK\r\nContent-Type: multipart/x-mixed-replace; boundary=--BoundaryString\r\n\r\n" + guard send(Data(head.utf8)) else { close(client); return } + var seq = -1 + var sent = 0 + let started = Date() + while true { + let (s, frame) = latest.wait(after: seq) + seq = s + let part = "--BoundaryString\r\nContent-type: image/jpeg\r\nContent-Length: \(frame.count)\r\n\r\n" + guard send(Data(part.utf8)), send(frame), send(Data("\r\n".utf8)) else { break } + sent += 1 + if sent % 250 == 0 { err(String(format: "client: %d parts sent, %.1f parts/s", sent, Double(sent) / Date().timeIntervalSince(started))) } + } + close(client) + err("client disconnected after \(sent) parts") + } } } -FileManager.default.createFile(atPath: outPath, contents: nil) -let fh = FileHandle(forWritingAtPath: outPath)! +// MARK: - session + +let latest: LatestFrame? = serveMode ? LatestFrame() : nil +var fh: FileHandle? = nil +if !serveMode { + FileManager.default.createFile(atPath: outPath, contents: nil) + fh = FileHandle(forWritingAtPath: outPath) +} let session = AVCaptureSession() let input = try AVCaptureDeviceInput(device: dev) session.addInput(input) let out = AVCaptureVideoDataOutput() -out.alwaysDiscardsLateVideoFrames = false -out.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange] -let sink = Sink(fh: fh) +out.alwaysDiscardsLateVideoFrames = serveMode +out.videoSettings = [kCVPixelBufferPixelFormatTypeKey as String: serveMode ? kCVPixelFormatType_32BGRA : kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange] +let sink = Sink(fh: fh, latest: latest) out.setSampleBufferDelegate(sink, queue: DispatchQueue(label: "sink")) session.addOutput(out) -fh.write("# start wall=\(Date().timeIntervalSince1970)\n".data(using: .utf8)!) +fh?.write("# start wall=\(Date().timeIntervalSince1970)\n".data(using: .utf8)!) session.startRunning() -RunLoop.main.run(until: Date(timeIntervalSinceNow: seconds)) -session.stopRunning() -err("done: \(sink.idx) frames") + +signal(SIGINT) { _ in exit(0) } +signal(SIGTERM) { _ in exit(0) } +if serveMode { + // Exit when stdin closes (the supervisor's pipe), so a killed parent takes us down. + Thread.detachNewThread { + while let _ = readLine() {} + err("stdin closed, exiting"); exit(0) + } + serve(latest: latest!, port: servePort) +} else { + RunLoop.main.run(until: Date(timeIntervalSinceNow: seconds)) + session.stopRunning() + err("done: \(sink.idx) frames") +} diff --git a/crates/quadcontrol-gui/src-tauri/src/lib.rs b/crates/quadcontrol-gui/src-tauri/src/lib.rs index 2817aaf..f50c064 100644 --- a/crates/quadcontrol-gui/src-tauri/src/lib.rs +++ b/crates/quadcontrol-gui/src-tauri/src/lib.rs @@ -714,6 +714,17 @@ fn ios_launch_allowed() -> Result<(), String> { Ok(()) } +/// P4.4 门 1 专用:debug 构建且 macOS 开发路径已放行时, +/// `QUADCONTROL_IOS_ATTACH=:` 让 GUI 接到手工起好的链路上。 +fn dev_attach_ports() -> Option<(u16, u16)> { + if !cfg!(debug_assertions) || !cfg!(target_os = "macos") || ios_launch_allowed().is_err() { + return None; + } + let raw = std::env::var("QUADCONTROL_IOS_ATTACH").ok()?; + let (http, mjpeg) = raw.split_once(':')?; + Some((http.trim().parse().ok()?, mjpeg.trim().parse().ok()?)) +} + fn wda_ids_from_env() -> WdaIds { let read = |name: &str, fallback: &str| { std::env::var(name) @@ -764,6 +775,15 @@ async fn ios_dev_wda_enabled() -> Result { Ok(cfg!(target_os = "macos") && ios_launch_allowed().is_ok()) } +/// P4.4 门 1 专用:前端渲染侧帧率,只打到本进程 stderr(debug 构建)。 +#[tauri::command] +async fn ios_dev_render_fps(fps: u32, note: String) -> Result<(), String> { + if cfg!(debug_assertions) { + eprintln!("ios render fps: {fps} {note}"); + } + Ok(()) +} + #[tauri::command] async fn start_ios_session( store: tauri::State<'_, IosSessionStore>, @@ -789,15 +809,21 @@ async fn start_ios_session( *session = Some(IosSlot::Starting); store.next_id.fetch_add(1, Ordering::Relaxed) }; - // GUI 只起完整链路;`LaunchMode::Attach` 只存在于库与其测试里(方案 §三)。 - let options = IosLaunchOptions::new( - device_id, - LaunchMode::Launch { + // GUI 默认只起完整链路。`LaunchMode::Attach` 只在 debug 构建 + macOS 开发路径下 + // 由 `QUADCONTROL_IOS_ATTACH=:` 放行,用于 P4.4 门 1: + // 手工起好采集探针与 WDA 链路,GUI 只接画面(IOS_MAC_STREAM_PLAN §四)。 + let mode = match dev_attach_ports() { + Some((http_port, mjpeg_port)) => LaunchMode::Attach { + http_port, + mjpeg_port, + }, + None => LaunchMode::Launch { ios: quadcontrol_ios::resolve_ios(None), wda: wda_ids_from_env(), env: Vec::new(), }, - ); + }; + let options = IosLaunchOptions::new(device_id, mode); // `spawn_supervised` 会跑 `ios version` 与端口探测(阻塞),不能占着 async // 运行时,也不能在持锁期间做。 let spawned = tauri::async_runtime::spawn_blocking(move || { @@ -1978,6 +2004,7 @@ pub fn run() { sessions, host_platform, ios_dev_wda_enabled, + ios_dev_render_fps, start_ios_session, stop_ios_session, ios_session_status, diff --git a/crates/quadcontrol-gui/src/index.html b/crates/quadcontrol-gui/src/index.html index 81ae305..de9397c 100644 --- a/crates/quadcontrol-gui/src/index.html +++ b/crates/quadcontrol-gui/src/index.html @@ -156,7 +156,7 @@

- +
diff --git a/crates/quadcontrol-gui/src/main.js b/crates/quadcontrol-gui/src/main.js index 80596fb..227524c 100644 --- a/crates/quadcontrol-gui/src/main.js +++ b/crates/quadcontrol-gui/src/main.js @@ -673,7 +673,8 @@ function iosViewModel({ status, ownsSelected, guidanceOnly, platform }) { locked, statusText, stageText: running - ? text.iosConnected.replace("{fps}", String(status.fps ?? 0)) + ? text.iosConnected.replace("{fps}", String(status.fps ?? 0)) + + (iosDevWda && iosRenderFps !== null ? ` · 渲染 ${iosRenderFps}` : "") : statusText, actionLabel: isDisconnect ? text.disconnect : text.startControl, actionIsDisconnect: isDisconnect, @@ -776,6 +777,55 @@ iosStream.addEventListener("error", () => { iosStream.src = `http://127.0.0.1:${iosStatus.proxy_port}/?t=${now}`; }); +/// P4.4 门 1 专用(仅 macOS 开发路径):在**渲染侧**数帧。每个 rAF 把 `` 画到 +/// 小画布上与上一帧比对,只有像素真的变了才计一帧;每秒把「变化帧/秒」写到帧率 +/// 标签并交给后端打日志。代理的 `frames` 计的是上游切出的帧,反映不了绘制。 +let iosRenderMeter = null; +let iosRenderFps = null; +function startIosRenderMeter() { + if (!iosDevWda || iosRenderMeter) return; + const canvas = document.createElement("canvas"); + canvas.width = 94; + canvas.height = 167; + const ctx = canvas.getContext("2d", { willReadFrequently: true }); + let prev = null; + let changed = 0; + let windowStart = performance.now(); + let lastFps = 0; + const tick = () => { + if (!iosStreaming) { + iosRenderMeter = null; + iosRenderFps = null; + return; + } + try { + if (iosStream.naturalWidth > 0) { + ctx.drawImage(iosStream, 0, 0, canvas.width, canvas.height); + const cur = ctx.getImageData(0, 0, canvas.width, canvas.height).data; + if (prev) { + let acc = 0; + for (let k = 0; k < cur.length; k += 16) acc += Math.abs(cur[k] - prev[k]); + if (acc > 64) changed += 1; + } + prev = cur; + } + } catch (error) { + window.__TAURI__.core.invoke("ios_dev_render_fps", { fps: 0, note: String(error) }).catch(() => {}); + prev = null; + } + const now = performance.now(); + if (now - windowStart >= 1000) { + lastFps = Math.round((changed * 1000) / (now - windowStart)); + changed = 0; + windowStart = now; + iosRenderFps = lastFps; + window.__TAURI__.core.invoke("ios_dev_render_fps", { fps: lastFps, note: "" }).catch(() => {}); + } + iosRenderMeter = requestAnimationFrame(tick); + }; + iosRenderMeter = requestAnimationFrame(tick); +} + /// MJPEG 是无限流:`src` **只在状态迁移时**设置或清空。每秒重设会让画面每秒重连。 function syncIosStream() { const device = selectedDevice(); @@ -785,6 +835,7 @@ function syncIosStream() { if (shouldStream) { iosStreamRetryAt = 0; iosStream.src = `http://127.0.0.1:${iosStatus.proxy_port}/`; + startIosRenderMeter(); } else { iosStream.removeAttribute("src"); } diff --git a/crates/quadcontrol-ios/src/mjpeg.rs b/crates/quadcontrol-ios/src/mjpeg.rs index a63156a..29d1825 100644 --- a/crates/quadcontrol-ios/src/mjpeg.rs +++ b/crates/quadcontrol-ios/src/mjpeg.rs @@ -642,6 +642,7 @@ fn write_downstream( let head = format!( "HTTP/1.1 200 OK\r\n\ + Access-Control-Allow-Origin: *\r\n\ Content-Type: multipart/x-mixed-replace; boundary={DOWNSTREAM_BOUNDARY}\r\n\ Cache-Control: no-store\r\n\ Connection: close\r\n\r\n" diff --git a/docs/IOS_MAC_STREAM_PLAN.md b/docs/IOS_MAC_STREAM_PLAN.md index 1760392..694eb50 100644 --- a/docs/IOS_MAC_STREAM_PLAN.md +++ b/docs/IOS_MAC_STREAM_PLAN.md @@ -1,6 +1,6 @@ # P4.4 方案:macOS→iPhone 画面引擎换成 QuickTime USB 屏幕流(提案,评审后修订) -状态:**提案,一轮 Fable 对抗性评审后修订**(2026-09-16;裁决见第七节)。范围只含 +状态:**提案,一轮 Fable 对抗性评审后修订;门 1 已通过**(2026-09-16,用户已确认按此方案做;数据见 [agents/ios-wda/README.md](../agents/ios-wda/README.md)「Gate 1」行:上游 58 fps,渲染侧完全运动的秒里 50–56 变化帧/秒,JPEG 编码 8 ms/帧)。范围只含 **macOS 宿主 + iPhone**;Windows/Linux 的同类替换(需要 libusb 驱动与替代 usbmuxd) 不在本片,留待 P6 之后另立方案。事实来源: [agents/ios-wda/README.md](../agents/ios-wda/README.md)「Third measurement pass」。 @@ -130,7 +130,7 @@ GUI (Tauri, macOS) ## 五、验收(真机 iPhone SE 3,macOS 26.5) -1. **门 1,先于全部实现,且在手机重新插拔后**:探针 MJPEG → 现有代理 → ``。 +1. **门 1,先于全部实现,且在手机重新插拔后**(**已通过,2026-09-16**:渲染侧在完全运动的秒里 50–56,见 README;运动源须用主屏拖动,秒表页只送 30 fps):探针 MJPEG → 现有代理 → ``。 帧率**在渲染侧取数**:页面里 rAF + canvas `drawImage` 逐帧像素比对,计「变化帧/秒」, 持续 60 s **≥ 45 fps**;代理的 `frames` 标签只作旁证(它计的是上游切出的帧,WebKit 再慢也会把 socket 读空,反映不了绘制)。同时记 JPEG 编码每帧耗时。达不到就走门 2