Skip to content

iter-139: perf honesty II — unmeasurable vitals, byte attribution, page identity - #178

Merged
ractive merged 2 commits into
mainfrom
iter-139/perf-honesty-2
Aug 10, 2026
Merged

iter-139: perf honesty II — unmeasurable vitals, byte attribution, page identity#178
ractive merged 2 commits into
mainfrom
iter-139/perf-honesty-2

Conversation

@ractive

@ractive ractive commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • perf vitals/perf audit/perf compare reported a fabricated "good" 0.0 for CLS/TBT — Firefox's PerformanceObserver.supportedEntryTypes has neither layout-shift nor longtask, structurally, so these can never be measured. Adds apply_unavailable_metric_fields (mirroring the iter-125 LCP guard, driven by the browser's own supportedEntryTypes list) so both now report null/"unavailable" plus a note naming the missing entry type. Verified live on bbc.com/news and en.wikipedia.org, before and after the fix.
  • resource_by_type/resource_by_domain/third_party_summary previously excluded the top-level navigation document (a navigation entry, never a resource entry per the Resource Timing spec), so resource_by_type.document (a few hundred bytes, populated only by incidental ad iframes) contradicted navigation.transfer_size (tens of KB), and pages with no other same-hostname subresources read as ~100% third-party. Folds the navigation entry in as a first-party synthetic resource for these breakdowns, and adds per-type/per-domain transfer_size_opaque markers (previously only flagged at the top-level summary).
  • perf vitals/perf audit gain page_url + measured_at_ms, so stale (pre-navigation) numbers are detectable instead of silently looking current.
  • perf summary/perf audit --format text "slowest resources" tables now apply iter-128's middle_ellipsis to URLs — ad-tracker query strings previously produced single lines of 6000+ chars.

Test plan

  • cargo fmt, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace -q all green
  • cargo run -p xtask -- check-iteration-ready --plan kb/iterations/iteration-139-perf-honesty-2.md --base origin/main — 10/10 PASS
  • 7 new live tests in tests/live/live_139_perf_honesty_2.rs, all run and passed against real headless Firefox over the default daemon path (no --no-daemon): live_139_cls_unavailable, live_139_tbt_unavailable, live_139_audit_document_bytes_agree, live_139_audit_opaque_flagged_per_type, live_139_third_party_excludes_first_party, live_139_vitals_page_identity, live_139_perf_summary_text_bounded
  • 8 new unit tests for the unavailable-guard, entry_type_supported, and text-truncation
  • Manually reproduced every bug live (bbc.com/news, wikipedia.org) before writing the fix, per the plan's run-guidance

🤖 Generated with Claude Code## Claims vs code
<generated 2026-08-10T14:23:34Z by ralph-loop>

  • apply_unavailable_metric_fields → ✅ matched in diff

ractive and others added 2 commits August 10, 2026 15:08
Firefox structurally cannot measure layout-shift/longtask; perf vitals/audit
fabricated "good" 0.0 for CLS/TBT anyway. Adds apply_unavailable_metric_fields
(mirroring the iter-125 LCP guard) driven by PerformanceObserver.supportedEntryTypes,
applied to perf vitals, perf audit, and perf compare.

resource_by_type/resource_by_domain/third_party_summary previously excluded the
top-level navigation document (a `navigation` entry, never a `resource` entry),
making resource_by_type.document contradict navigation.transfer_size and reading
third_party_summary as ~100% on pages with no other same-hostname subresources.
Folds the navigation entry in as a first-party synthetic resource and adds
per-type/per-domain opaque markers. perf vitals/audit also gain page_url +
measured_at_ms; perf summary/audit text renderers now middle_ellipsis the
slowest-resource URLs.

Verified live against real headless Firefox (bbc.com/news, wikipedia.org)
before and after the fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…er-139 reuse pattern

iter-137 (daemon-mode-parity) merged before iter-138/iter-139 both landed on
top of it using the default daemon path, so Theme D's frame-scanning
dependency is no longer a blocker. Also note iter-139's shared-helper /
shared-spec pattern (middle_ellipsis, UnavailableMetricSpec) as the model to
follow if Theme D/A/B end up needing the same field-shape logic in more than
one place.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ractive
ractive merged commit cb43d9c into main Aug 10, 2026
10 checks passed
@ractive
ractive deleted the iter-139/perf-honesty-2 branch August 10, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant