65 lines
8.3 KiB
Markdown
Executable File
65 lines
8.3 KiB
Markdown
Executable File
---
|
||
title: 'CPM — metrics, causes and mitigations'
|
||
date: '2026-10-16'
|
||
tags:
|
||
- work
|
||
- cpm
|
||
- analysis
|
||
---
|
||
# CPM: metrics, causes and mitigations
|
||
|
||
Updated 16 October 2026. Internal metrics; keep these figures out of public PRs. `cpm-e2e-init` is the local test/fix worktree referenced here.
|
||
|
||
## What the metrics mean
|
||
|
||
The monitor reports failure when no matching native dashboard refresh arrives within 4 seconds of navigation completion. A second qualifying timeout marks the episode stuck and triggers M4 extension reload. Neither timeout nor recovery proves delivery of `initResp` to the page: tests can receive it while dashboard delivery fails.
|
||
|
||
Daily pixels count installation-days per event/reason, not distinct users or episodes. Independently deduplicated failure/recovery totals cannot establish transition or recovery success rates. Keep `.count` separate from `.daily`.
|
||
|
||
## Distribution
|
||
|
||
Latest received production cut: **12–14 October**, iOS 7.240+ / macOS 1.210+. Figures below always use **iOS / macOS** order.
|
||
|
||
- Initial failures: **3,273,025 / 119,950**; stuck: **511,660 / 40,842**.
|
||
- Recovery without reload: **1,135,477 / 30,738** (34.7% / 25.6% of initial-failure daily totals).
|
||
- Recovery after M4: **293,557 / 21,865** (57.4% / 53.5% of stuck daily totals); reload-failed reports: **140,921 / 17,796** (27.5% / 43.6%). These are ratios of event totals, not episode outcomes.
|
||
|
||
Mutually exclusive snapshot cohorts, in classification priority order. Each pair shows **share of initial failures → share of stuck**:
|
||
|
||
- Error 6: **6.1% → 21.5% / 1.0% → 1.9%**.
|
||
- No background view: **48.1% → 10.9% / 3.3% → 1.8%**.
|
||
- Tab detached: **0.03% → 0.05% / 6.2% → 8.9%**.
|
||
- Network process replaced: **16.8% → 39.7% / 13.6% → 26.6%**.
|
||
- Recent wake: **7.9% → 9.5% / 32.5% → 32.2%**.
|
||
- Recent context load: **15.7% → 6.0% / 20.0% → 6.4%**.
|
||
- Other: **5.3% → 12.5% / 23.4% → 22.2%**.
|
||
|
||
These classify observed state, not causes. Network replacement and error 6 are more prominent in stuck; missing-view and recent-load cases are less prominent.
|
||
|
||
Earlier **5 October post-release** cut: initial failures **6,624 / 1,377**, stuck **1,440 / 487**, first post-reload timeouts **670 / 232**. It established the same wake/load distinction; its different window and filters must not be combined with the newer totals. [[cpm-web-extension-public-attribution-2026-10-05|Original cut]] · [[cpm-web-extension-data-analysis-summary-2026-10-08|Earlier analysis]]
|
||
|
||
## Causes and suggested mitigations
|
||
|
||
Percentages below are shares of all initial-failure / stuck daily reports in the 12–14 October cut. Snapshot cohorts are proxies for causes; P5/P6 selections use separate denominators.
|
||
|
||
- **Network crash:** replacement cohort — **iOS init 16.8%, stuck 39.7%; macOS init 13.6%, stuck 26.6%**. reproduced across tabs/windows; a surviving background view can retain a dead worker after Network-process replacement. Fix B restarts the background. Production attribution remains incomplete: `network_restarted` compares against context load, not the latest view. Add `network_replaced_since_view`; the older analysis supports at most 20–45% of healthy-looking stuck reports, not the whole cohort.
|
||
- **P1, slow idle wake:** recent-wake cohort — **iOS init 7.9%, stuck 9.5%; macOS init 32.5%, stuck 32.2%**; excludes older wake tails. an imposed startup delay reproduces timeout followed by a late answer; natural production slowness remains unexplained. Local mitigation prepares background before navigation, with a shared, cancellable **5-second maximum wait**. It passed with an 8-second worker delay; longer delays remain possible.
|
||
- **P2, error 6:** error-6 cohort — **iOS init 6.1%, stuck 21.5%; macOS init 1.0%, stuck 1.9%**. controlled macOS suspension reproduces WebKit's roughly 30-second background-load timeout. The main iOS chains remain unproven. Local mitigation retries `loadBackgroundContent` once on the current context, with cooldown and recovery guards. Same-document dashboard **and page initResp** recovery passed twice. Full-context replacement was rejected after repeat page-response loss. Foreground-resume recovery remains untested.
|
||
- **P3, loaded context without view:** no-view cohort — **iOS init 48.1%, stuck 10.9%; macOS init 3.3%, stuck 1.8%**. startup dominates on iOS. Base-URL cleanup can delay startup, but the full P3 failure remains unreproduced, including the 20,000-resource cache test. Stable extension base URL is an unfinished candidate.
|
||
- **P4, first mid-session load:** Fix A signature — **iOS init 3.9%, stuck 0.9%**. Broader recent-load cohort: **iOS init 15.7%, stuck 6.0%; macOS init 20.0%, stuck 6.4%**. early init loss is reproduced; Fix A waits for first background readiness. The narrower signature is 129k → 4.6k iOS reports and can include reloads.
|
||
- **P5, background fails to wake:** **5 October, after each platform's release tag: iOS init 1.40% (93 / 6,624) → stuck 2.08% (30 / 1,440); macOS init 6.83% (94 / 1,377) → stuck 4.52% (22 / 487)**. Recounted from the saved `cpm-public-attribution-2026-10-06/initialization_daily.tsv` and `events_daily.tsv`: last five `bg_events` names `proxy_on>dealloc>view>proxy_on>dealloc`, excluding error 6, Network replacement and scripts=false. This is the earlier 5 October cut, not 12–14 October. **14 October stuck: iOS 1.15% (1,953 / 169,115); macOS 3.57% (499 / 13,992)**; init for that newer cut has not been recounted. Closing a window with a shared pinned tab reproduces lost tab registration on macOS; fix window/tab lifecycle reporting. That signature appears in **13.6% of macOS P5** (68 / 499), or **0.49% of all macOS stuck**. Missing listener registration also reproduces P5 in controlled tests; its natural trigger remains unknown. The earlier 494-report selection used different filters.
|
||
- **P6, controller mismatch:** broader detached-tab cohort — **iOS init 0.03%, stuck 0.05%; macOS init 6.2%, stuck 8.9%**. P6-only init/stuck shares are unavailable. a main `webExtensions` flag cycle creates a new manager while existing web views retain the old controller. Recreate/rebind affected views when replacing the manager; context reload alone cannot repair this. The conditional mechanism is reproduced, but its occurrence in production is unconfirmed. Selected macOS tails: **627 + 235** reports.
|
||
- **Other:** **iOS init 5.3%, stuck 12.5%; macOS init 23.4%, stuck 22.2%**. Tests reproduce slow settings replies, lost messages, and missing dashboard confirmation even when the page receives its answer. Some iOS reports also resemble slow wake-up (P1). Their individual shares are unknown. Mitigations depend on which step fails: wait for background readiness, reduce settings delays, or fix message/confirmation delivery.
|
||
|
||
## Open PRs and local validation
|
||
|
||
**Last verified open: 15 October, 17:26 UTC. Live GitHub access was declined in this pass; current state is unverified.**
|
||
|
||
- [#7376](https://github.com/duckduckgo/apple-browsers/pull/7376): readiness/recovery telemetry; [#7384](https://github.com/duckduckgo/apple-browsers/pull/7384): healthy readiness baselines; [#7385](https://github.com/duckduckgo/apple-browsers/pull/7385) + [extension #3727](https://github.com/duckduckgo/duckduckgo-privacy-extension/pull/3727): native/JS init progress.
|
||
- [#7378](https://github.com/duckduckgo/apple-browsers/pull/7378): repro harness → [#7379](https://github.com/duckduckgo/apple-browsers/pull/7379): Fix A → [#7381](https://github.com/duckduckgo/apple-browsers/pull/7381): Fix B. Last check: #7384/#7385 failed Danger; #7381 failed Non-Sandbox. B's corrective commit was local only.
|
||
- The newer [PR0 episode-report proposal](cpm-pr0-episode-telemetry-summary-2026-10-16.md) replaces separate failure/recovery events with one terminal episode report; it supersedes the older reporting design, not the historical measurements.
|
||
|
||
**Local `cpm-e2e-init`, 16 October:** P1/P2 candidates remain uncommitted. **22 unique app methods passed across separate runs**; two deliberate disabled-fix controls failed. Package validation: **806 tests, 14 skipped, zero failures**. Tests use real app/WebKit paths with an instrumented bundle and imposed faults; they do not identify every production cause. P3 remains unreproduced; app P5 establishes one lost navigation. No shipped-effect claim.
|
||
|
||
Detailed evidence and final validation: [[cpm-status-2026-10-15]] · [[cpm-web-extension-code-guide-2026-10-09]].
|