外观
P2 Startup Mapping v3 结果
结论
Startup Mapping v3 已交付匿名事件 census、跨 Session 聚合和证据门禁。Perfowl 现在能把目标进程中未被当前 decoder 识别的 KDebug 事件归并为稳定 fingerprint,统计同系统重复次数、跨 App 覆盖率和 arg0 分布,并把审计哈希写入 Foundation Delivery。
本批在 iOS 17.0 与 18.2.1 各执行 3 次冷启动、每个系统覆盖 2 个不同目标 App。六个 Session 均 identity verified、drop=0,共解码 4,734,239 条 KDebug;40 个 fingerprint 达到“同系统 3 次 + 2 App”的重复性门槛。但 xctrace 将两台设备列为 offline,受控 Fixture 未安装且本机没有 Apple Development 身份,Apple trace-code 表也没有这些私有 UIKit code 的符号,所以独立语义证据为 0,新阶段映射提升为 0。
这不是采集失败:重复性已经可以量化;只是没有证据证明某个稳定 code 就等于 didFinishLaunching 或其他阶段。现有阶段继续 fail-closed 为 partial/missing,App Launch Total 继续为 null,不通过相邻顺序猜测。
已实现
startup-mapping-audit.candidate.v1:按baseDebugID + func聚合未知目标事件。- arg0 独立直方图:仅保留 0–65535,小值之外统一为
large-or-pointer,不把地址当协议枚举。 - 每个 fingerprint 输出 count、thread count、首末相对时间和原始 code 结构。
- 单 Session 门禁:RAW 严格回放、identity verified、drop=0、launch PID 存在、CoreProfile 存在、schema 可解码。
- 跨 Session 门禁:同系统小版本至少 3 次、至少 2 个 App,并且具有
xctrace/fixture-marker/apple-symbol之一。 - 新的
startup-mapCLI 与startup-mapping-audit.json;Foundation Delivery 绑定 audit SHA-256、资格状态和未知 fingerprint 数量。 - Foundation 升级为
collector-foundation.1.6-beta,Collector0.15.0,Mac App1.0.0 (25);Registry 仍为 64 项。
公式与质量
text
baseDebugID = debugID & 0xFFFFFFFC
func = debugID & 0x3
code = (debugID & 0xFFFC) >> 2
relativeOffsetMs = (eventTimestampNs - firstTargetLifecycleTimestampNs) / 1,000,000
occurrenceRate = sessionsContainingFingerprint / eligibleSessionCountfingerprint 不携带设备标识、Bundle ID、PID 或 TID。repetitionGatePassed 只说明事件重复出现;只有独立语义证据也通过时才为 mappingEligible。完整口径见 StartupTiming 启动阶段指标 v5。
自动化与构建(E2)
| 验收项 | 结果 |
|---|---|
| 冻结 CPython 3.12 全量测试 | 151/151 |
| Swift 全量测试 | 80/80 |
| Foundation checksum | 284/284 |
| 打包 CLI | startup-map --help 与 iOS 17 冻结 Session 回放通过;1,191,884 条记录 / 26 fingerprints |
| Mac App / ZIP 独立解包签名 | ad-hoc deep strict 通过 |
| Foundation | collector-foundation.1.6-beta |
| Mac App | 1.0.0 (25) · x86_64 |
内部测试包:MacApp/dist/Perfowl-1.0.0-beta25-x86_64.zip,SHA-256 549eeb346644128f0373aee8bade3e59f2d00dd5996052c7271c049bc438566f。
Foundation:MacApp/dist/collector-core/perfowl-collector-foundation-1.6-beta-x86_64.tar.gz,SHA-256 f0d15962ad502d35f85a825c370e08b7a9b19fe4d820ff3b327e98314d94cad7。
六个映射样本(E4)
| 系统 | 样本 | App 覆盖 | KDebug records | target events | unknown fingerprints | identity / drop |
|---|---|---|---|---|---|---|
| iOS 17.0 | 3 | 2 | 2,247,186 | 3,377 | 24–38 / Session | verified / 0 |
| iOS 18.2.1 | 3 | 2 | 2,487,053 | 388 | 22–40 / Session | verified / 0 |
聚合共有 84 个 (OS, fingerprint) 行;40 个通过重复性门槛,0 个通过语义证据门槛,0 个被提升为 mapping。
最终二进制真机(E4)
| 事实 | iOS 17.0 · 设备 A | iOS 18.2.1 · 设备 B |
|---|---|---|
| raw / CoreProfile chunks | 435 / 16 | 190 / 17 |
| KDebug records | 1,191,884 | 1,432,989 |
| target / unknown events | 233 / 232 | 511 / 506 |
| unknown fingerprints | 26 | 47 |
| identity / drop | verified / 0 | verified / 0 |
| launch trace | missing / 0 span | partial / 2 spans |
| App Launch Total | null | null |
| audit hash 写入 Delivery | 是 | 是 |
iOS 18 的两个局部 Span 是 UIKit Scene Creation 与 Initial Frame Rendering;因缺完整开始锚点且存在未配对事件,不会被合并成完整启动时间。
xctrace 与 Fixture 门禁
- xctrace
16.0 (17F113)已能列出App Launch模板。 - Apple CoreDevice 报告当前设备
available (paired)、Developer Mode enabled、DDI service available。 - 但
xctrace list devices仍把真机列为 offline;按设备名和硬件标识录制均停在 “Waiting for device to boot”,CoreDevice 标识也不被 xctrace 接受。 - Fixture 在两台设备均未安装;本机 Apple Development identity 数为 0,不能生成可控真机 Fixture。
- 设备 trace-code 文件可读取,但没有未知私有 UIKit/CoreAnimation code 的符号名。
因此本批能关闭“没有映射审计工具”的缺口,暂时保留“没有独立语义老师”的门禁。匿名机器证据见 JSON。
下一阶段工作
下一阶段为 Startup Semantic Evidence:
- 修复 Instruments/xctrace 对 CoreDevice 真机的离线状态,或配置 Apple Development 身份并安装 PerformanceProbeFixture。
- 对 40 个重复 fingerprint 录制可控 marker/同窗 App Launch trace,只为有独立语义的 code 建立 mapping。
- 每条新 mapping 再跑 3 次 × 2 App 的回归,并补 iOS 15、17.4–17.x。
- 如果 xctrace 与 Fixture 两条路都不可用,内部 9 阶段继续条件显示,不影响外部 Running/Foreground 启动时间。
整体进度
- P0/P1:完成。
- P2:采集、公式、UI、匿名映射审计完成;启动阶段语义映射门禁开放。
- P3:采集与报告链完成;业务校准开放。
- P4:产品链完成;人工 UI 验收开放。
- P5:部分完成;Battery/Thermal/GPU 条件门禁开放。
- P6:模板枚举恢复,真机 xctrace 仍 offline。
- P7:云端尚未开始。