[event-timing] Update INP calculator to support multiple event timings. [chromium/src : main]

0 views
Skip to first unread message

Michal Mocny (Gerrit)

unread,
Feb 6, 2026, 5:16:14 PM (yesterday) Feb 6
to Scott Haseley, Johannes Henkel, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 3 comments

Patchset-level comments
File-level comment, Patchset 4:
Michal Mocny . resolved

Hey folks-- this is part 2 of the INP refactoring.

This should enable us to report multiple Event Timings, but the renderer still only sends one. The fact that the renderer hasn't changed de-risks this change in my oppinion and means we can make the change without a feature flag and delay deciding if we want to slow roll until the renderer-side change. (I think it will be easier to do it there, too).

But I'm open to suggestions otherwise, or how to simplify / test this to de-risk.

File components/page_load_metrics/browser/interaction_to_next_paint_calculator.cc
Line 55, Patchset 2: uint64_t& max_id = max_interaction_id_per_source_[source_token];
Michal Mocny . resolved

Right now this defaults to 0 for the first interaction with a new RenderFrameHost.

For this initial navigation on a page, this is the right assumption, but for soft-navs, and especially for soft-navs with iframes, the first id can be arbitrary.

I need to update to support this, perhaps by maintaining both a min and a max id, per renderer?

Michal Mocny

Done

Line 87, Patchset 2: // It might be that MergeAndClear can only ever "merge backwards", in which
Michal Mocny . resolved

If we knew 100% that `other_interactions` was strictly "newer" than we are, as would be the case if you "fork" and speculatively start to report a new soft-nav and then decide to abort instead.... we might be able to just move the data structures and overwrite our own.

But if that's the case, we could just overwrite the whole INP calculator.

So I tried to do a semi-decent merge for now.

Michal Mocny

Done-- but I think it only makes sense to merge two "adjacent" soft-navs from the same perf timeline together. You cannot merge two arbitrary lists and expect it to work.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
Gerrit-Change-Number: 7551230
Gerrit-PatchSet: 4
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Feb 2026 22:16:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Feb 6, 2026, 5:23:03 PM (yesterday) Feb 6
to Scott Haseley, Johannes Henkel, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 2 comments

File chrome/browser/page_load_metrics/integration_tests/soft_navigation_metrics_browsertest.cc
Line 772, Patchset 2:IN_PROC_BROWSER_TEST_P(SoftNavigationTest, MAYBE_INP_ClickWithPresentation) {
Michal Mocny . unresolved

This change isn't strictly part of the refactoring, but I was given a presubmit check fail about it because I touched the file.

I think that we might want to try to re-enabled these tests, or just delete them ive we have better coverage elsewhere. I didn't audit the quality of the test itself, but it ran locally.

Michal Mocny

Ah I read the message more carefully and it just says that we should use the macro or delete the macro (above).

I think its safer to leave this test disabled, and I can skip the presubmit check to keep the patch clean -- or just delete the test(s).

@joha...@chromium.org I think you have the best grasp of the state of the tests and maybe can advice if these are uniquely useful or not?

File components/page_load_metrics/browser/interaction_to_next_paint_calculator.cc
Line 112, Patchset 2: event_timings_.erase(event_timings_.begin() + 10, event_timings_.end());
Michal Mocny . resolved

I dont recall if `it+10` is good style or should use `std::next(it, 10)`. Both are fine for vector....

Michal Mocny

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
Gerrit-Change-Number: 7551230
Gerrit-PatchSet: 5
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Feb 2026 22:22:58 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Feb 6, 2026, 5:32:09 PM (yesterday) Feb 6
to Dibyajyoti Pal, Scott Haseley, Johannes Henkel, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Dibyajyoti Pal, Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Michal Mocny . resolved

dibyapal: Just for OWNERS review of a trivial `browser/web_applications/` change (I removed the include from a header file that you were depending on somehow)

Open in Gerrit

Related details

Attention is currently required from:
  • Dibyajyoti Pal
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
Gerrit-Change-Number: 7551230
Gerrit-PatchSet: 5
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Dibyajyoti Pal <diby...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Feb 2026 22:32:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Scott Haseley (Gerrit)

unread,
Feb 6, 2026, 5:38:43 PM (yesterday) Feb 6
to Michal Mocny, Dibyajyoti Pal, Johannes Henkel, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Dibyajyoti Pal, Johannes Henkel and Michal Mocny

Scott Haseley added 1 comment

File chrome/browser/page_load_metrics/integration_tests/soft_navigation_metrics_browsertest.cc
Line 772, Patchset 2:IN_PROC_BROWSER_TEST_P(SoftNavigationTest, MAYBE_INP_ClickWithPresentation) {
Michal Mocny . unresolved

This change isn't strictly part of the refactoring, but I was given a presubmit check fail about it because I touched the file.

I think that we might want to try to re-enabled these tests, or just delete them ive we have better coverage elsewhere. I didn't audit the quality of the test itself, but it ran locally.

Michal Mocny

Ah I read the message more carefully and it just says that we should use the macro or delete the macro (above).

I think its safer to leave this test disabled, and I can skip the presubmit check to keep the patch clean -- or just delete the test(s).

@joha...@chromium.org I think you have the best grasp of the state of the tests and maybe can advice if these are uniquely useful or not?

Scott Haseley

Yeah I wouldn't re-enable it in this patch since that could cause it to get reverted if it starts to flake.

Open in Gerrit

Related details

Attention is currently required from:
  • Dibyajyoti Pal
  • Johannes Henkel
  • Michal Mocny
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
Gerrit-Change-Number: 7551230
Gerrit-PatchSet: 5
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Dibyajyoti Pal <diby...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Feb 2026 22:38:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Feb 6, 2026, 5:44:55 PM (yesterday) Feb 6
to Dibyajyoti Pal, Scott Haseley, Johannes Henkel, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
Attention needed from Dibyajyoti Pal, Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

File chrome/browser/page_load_metrics/integration_tests/soft_navigation_metrics_browsertest.cc
Line 772, Patchset 2:IN_PROC_BROWSER_TEST_P(SoftNavigationTest, MAYBE_INP_ClickWithPresentation) {
Michal Mocny . resolved

This change isn't strictly part of the refactoring, but I was given a presubmit check fail about it because I touched the file.

I think that we might want to try to re-enabled these tests, or just delete them ive we have better coverage elsewhere. I didn't audit the quality of the test itself, but it ran locally.

Michal Mocny

Ah I read the message more carefully and it just says that we should use the macro or delete the macro (above).

I think its safer to leave this test disabled, and I can skip the presubmit check to keep the patch clean -- or just delete the test(s).

@joha...@chromium.org I think you have the best grasp of the state of the tests and maybe can advice if these are uniquely useful or not?

Scott Haseley

Yeah I wouldn't re-enable it in this patch since that could cause it to get reverted if it starts to flake.

Michal Mocny

Will just go back to what was there and skip checks, then we can clean up afterwards.

Open in Gerrit

Related details

Attention is currently required from:
  • Dibyajyoti Pal
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
    Gerrit-Change-Number: 7551230
    Gerrit-PatchSet: 5
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Dibyajyoti Pal <diby...@chromium.org>
    Gerrit-Comment-Date: Fri, 06 Feb 2026 22:44:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dibyajyoti Pal (Gerrit)

    unread,
    Feb 6, 2026, 5:56:46 PM (yesterday) Feb 6
    to Michal Mocny, Scott Haseley, Johannes Henkel, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Johannes Henkel, Michal Mocny and Scott Haseley

    Dibyajyoti Pal voted and added 1 comment

    Votes added by Dibyajyoti Pal

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 6 (Latest):
    Dibyajyoti Pal . resolved

    `c/b/web_applications/` LGTM, thanks for fixing iwyu.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Johannes Henkel
    • Michal Mocny
    • Scott Haseley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
    Gerrit-Change-Number: 7551230
    Gerrit-PatchSet: 6
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Fri, 06 Feb 2026 22:56:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Feb 6, 2026, 7:15:17 PM (yesterday) Feb 6
    to Michal Mocny, Johannes Henkel, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
    Attention needed from Johannes Henkel and Michal Mocny

    Scott Haseley voted and added 6 comments

    Votes added by Scott Haseley

    Code-Review+1

    6 comments

    Patchset-level comments
    Scott Haseley . resolved

    LGTM % a few comments/suggestions.

    File components/page_load_metrics/browser/interaction_to_next_paint_calculator.h
    Line 79, Patchset 6 (Latest): uint64_t min = std::numeric_limits<uint64_t>::max();
    Scott Haseley . unresolved

    It might be worth commenting at a high level how the interaction count is computing this, and the assumptions (I think just that interaction IDs are consecutive).

    Line 54, Patchset 6 (Latest): const content::RenderFrameHost* source,
    Scott Haseley . unresolved

    style nit: consider passing by const ref since `source` can't be null and it isn't stored past the life of the method.

    Line 42, Patchset 6 (Latest): mojom::EventTiming max_event;
    Scott Haseley . unresolved

    Q: Is the thought that this is small enough -- and will probably stay small/simple enough -- that copying makes sense? This version is probably better for memory locality when computing, so that's nice. Was just wondering thoughts behind changing from storing the pointer to copying.

    Line 37, Patchset 6 (Latest): struct InteractionEvents {
    Scott Haseley . unresolved

    Can this be private?

    File components/page_load_metrics/browser/interaction_to_next_paint_calculator.cc
    Line 64, Patchset 6 (Latest): if (event.duration > interaction.max_event.duration) {
    Scott Haseley . unresolved

    Is it worth commenting why this happens? It's not clear/obvious to me why the duration for an existing event would change.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Johannes Henkel
    • Michal Mocny
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
      Gerrit-Change-Number: 7551230
      Gerrit-PatchSet: 6
      Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
      Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
      Gerrit-Comment-Date: Sat, 07 Feb 2026 00:15:07 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Scott Haseley (Gerrit)

      unread,
      Feb 6, 2026, 7:16:32 PM (yesterday) Feb 6
      to Michal Mocny, Johannes Henkel, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Johannes Henkel and Michal Mocny

      Scott Haseley voted and added 1 comment

      Votes added by Scott Haseley

      Commit-Queue+1

      1 comment

      Patchset-level comments
      Scott Haseley . resolved

      Kicking off dry-run to check if this breaks anything.

      Gerrit-Comment-Date: Sat, 07 Feb 2026 00:16:23 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Johannes Henkel (Gerrit)

      unread,
      Feb 6, 2026, 8:41:28 PM (yesterday) Feb 6
      to Michal Mocny, Chromium LUCI CQ, Scott Haseley, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Michal Mocny and Scott Haseley

      Johannes Henkel voted and added 6 comments

      Votes added by Johannes Henkel

      Code-Review+1

      6 comments

      File components/page_load_metrics/browser/interaction_to_next_paint_calculator.h
      Line 87, Patchset 6 (Latest): interaction_id_ranges_per_source_;
      Johannes Henkel . unresolved

      Whereas the event_timings_ vector gets trimmed to at most 10, this map is only limited by the fact that there may not be so render frame hosts, is that right? Probably ok, but figure I should explicitly ask here. :-)

      Line 64, Patchset 6 (Latest): std::optional<mojom::EventTiming> ApproximateHighPercentile() const;
      std::optional<mojom::EventTiming> worst_latency() const;
      Johannes Henkel . unresolved

      I notice how both of these methods return mojom::EventTiming, which doesn't have the render frame host information. And, I'm wondering whether the other fields that are being returned here are useful: start_time and interaction id.

      If only the duration is useful, then perhaps we could just return that?

      If so, then the struct InteractionEvents could be made easier to read. It could have the stuff that's the identifying key (source_token and id), and the duration, and not carry the other stuff? Perhaps for a later refactoring? :-)

      File components/page_load_metrics/browser/interaction_to_next_paint_calculator.cc
      Line 22, Patchset 6 (Latest): uint64_t index =
      Johannes Henkel . unresolved

      Maybe the same in practice, though a compiler nitpicky person would use size_t for the [] in l. 26?

      Line 55, Patchset 6 (Latest): CompressEventTimings();
      Johannes Henkel . unresolved

      nitpicky also: Maybe TrimEventTimings would be an even better name?

      File components/page_load_metrics/browser/observers/ad_metrics/ads_page_load_metrics_observer_unittest.cc
      Line 68, Patchset 6 (Latest):#include "third_party/blink/public/common/features.h"
      Johannes Henkel . unresolved

      This added include feels a bit mysterious to me.

      File components/page_load_metrics/browser/observers/fenced_frames_page_load_metrics_observer_unittest.cc
      Line 22, Patchset 6 (Latest):#include "third_party/blink/public/common/features.h"
      Johannes Henkel . unresolved

      a second mention of features.h! :-)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Michal Mocny
      • Scott Haseley
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
      Gerrit-Change-Number: 7551230
      Gerrit-PatchSet: 6
      Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-Attention: Scott Haseley <shas...@chromium.org>
      Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
      Gerrit-Comment-Date: Sat, 07 Feb 2026 01:41:17 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michal Mocny (Gerrit)

      unread,
      1:44 PM (9 hours ago) 1:44 PM
      to Johannes Henkel, Chromium LUCI CQ, Scott Haseley, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Scott Haseley

      Michal Mocny added 9 comments

      Patchset-level comments
      Michal Mocny . resolved

      Thanks for comments-- will address and upload shortly. Looking at the failing test in parallel

      File components/page_load_metrics/browser/interaction_to_next_paint_calculator.h
      Line 87, Patchset 6 (Latest): interaction_id_ranges_per_source_;
      Johannes Henkel . resolved

      Whereas the event_timings_ vector gets trimmed to at most 10, this map is only limited by the fact that there may not be so render frame hosts, is that right? Probably ok, but figure I should explicitly ask here. :-)

      Michal Mocny

      True, but we dont want to trim RenderFrameHost (i.e. "forget" about some subset of frames). And we already have a bunch of throttling for number of renderers, and a lot of data structures for them.

      The reason we bound the number of interactions is just because its theoretically infinite. We probably should allow for more than 10 :P but that was borrowed from the JS suggestion.

      (We could experiment with adding a histogram to see how often we exceed 10 and consider bumping that up. Alternatively, with soft-navs, we could consider removing the need for p98...)

      Line 64, Patchset 6 (Latest): std::optional<mojom::EventTiming> ApproximateHighPercentile() const;
      std::optional<mojom::EventTiming> worst_latency() const;
      Johannes Henkel . resolved

      I notice how both of these methods return mojom::EventTiming, which doesn't have the render frame host information. And, I'm wondering whether the other fields that are being returned here are useful: start_time and interaction id.

      If only the duration is useful, then perhaps we could just return that?

      If so, then the struct InteractionEvents could be made easier to read. It could have the stuff that's the identifying key (source_token and id), and the duration, and not carry the other stuff? Perhaps for a later refactoring? :-)

      Michal Mocny

      I dont' remember if startTime is reporter, but InteractionId is used to report the InteractionOffset to UKM.

      This ends up being a subtle bug when you have iframes: the INP interaction might be the first in an iframe but not the first with the page overall... but this is existing behaviour and worth fixing later.

      ---

      The return value is the same it was before this patch, so I'm keen to leave it, but I think that we could return a Duration+Offset pair, or something. But right now we don't keep account of offset so it would take more work to add to this patch.

      ---

      If so, then the struct InteractionEvents could be made easier to read.

      I think this will always need to have RenderFrameHost id, Interaction Id, and Duration. So the only thing we can potentially get rid of is Interaction StartTime-- but I think its cleaner to just store the whole EventTiming.

      Line 54, Patchset 6 (Latest): const content::RenderFrameHost* source,
      Scott Haseley . unresolved

      style nit: consider passing by const ref since `source` can't be null and it isn't stored past the life of the method.

      Michal Mocny

      I was following existing style for page load metrics observers (e.g.: https://source.chromium.org/chromium/chromium/src/+/main:components/page_load_metrics/browser/page_load_metrics_observer.h;l=154-167;drc=ba8c2b489614ce6ee0f4d9109dbb19743b9c7c32)

      This calculator of course could accept a dereferenced value but it was just consistency.

      Not sure!

      Line 42, Patchset 6 (Latest): mojom::EventTiming max_event;
      Scott Haseley . resolved

      Q: Is the thought that this is small enough -- and will probably stay small/simple enough -- that copying makes sense? This version is probably better for memory locality when computing, so that's nice. Was just wondering thoughts behind changing from storing the pointer to copying.

      Michal Mocny

      If I switch to Ptr, then the struct is no longer POD and needs its own constructor/destructor. Trivial enough to add. Then you also need to use a bunch of .Clone() calls in various places. Trivial enough to add.

      But the values inside this EventTiming message are 3 numbers, so I just thought it was cleaner this way.

      File components/page_load_metrics/browser/interaction_to_next_paint_calculator.cc
      Johannes Henkel . resolved

      Maybe the same in practice, though a compiler nitpicky person would use size_t for the [] in l. 26?

      Michal Mocny

      The type of index comes from the type of `num_user_interactions_`. Either way, there is a conversion going on here.

      We could change the num_user_interactions_ type to `size_t`, but this is existing code and so I'll keep the patch focused on the goal!

      Line 64, Patchset 6 (Latest): if (event.duration > interaction.max_event.duration) {
      Scott Haseley . unresolved

      Is it worth commenting why this happens? It's not clear/obvious to me why the duration for an existing event would change.

      Michal Mocny

      I will add a comment-- but this isn't "an existing event changing" its a new event for the same interactionId.

      So like, pointerdown with 100ms followed by pointerup with 200ms.

      File components/page_load_metrics/browser/observers/ad_metrics/ads_page_load_metrics_observer_unittest.cc
      Line 68, Patchset 6 (Latest):#include "third_party/blink/public/common/features.h"
      Johannes Henkel . resolved

      This added include feels a bit mysterious to me.

      Michal Mocny

      I mentioned it in earlier reviewer comments, but, the INP Calculator previously included this header even though it didn't need it. Over time, other cc files came to depend on it as an include, so when I removed it from the header these started to not compile.

      These files should have "include what you use (IWYU)" so this is just a necessary include being added.

      File components/page_load_metrics/browser/observers/fenced_frames_page_load_metrics_observer_unittest.cc
      Line 22, Patchset 6 (Latest):#include "third_party/blink/public/common/features.h"
      Johannes Henkel . resolved

      a second mention of features.h! :-)

      Michal Mocny

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Scott Haseley
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
      Gerrit-Change-Number: 7551230
      Gerrit-PatchSet: 6
      Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
      Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-Attention: Scott Haseley <shas...@chromium.org>
      Gerrit-Comment-Date: Sat, 07 Feb 2026 18:44:06 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
      Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michal Mocny (Gerrit)

      unread,
      2:20 PM (9 hours ago) 2:20 PM
      to Johannes Henkel, Chromium LUCI CQ, Scott Haseley, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Scott Haseley

      Michal Mocny added 1 comment

      File components/page_load_metrics/browser/interaction_to_next_paint_calculator.cc
      Line 111, Patchset 6 (Latest): CHECK(range.min != 0);
      Michal Mocny . unresolved

      This is the failing check in the bots tests. The test runs fine for me, locally, so its somehow flaky, I guess.

      But the min value comes from the interactionid values that are sent to us. Some of the tests I already fixed where accidentally sending interaction id == 0 which is not a valid value.

      I can move some enforcement to the AddEventTimings() function to ingore EventTimings with interaction id == 0 (which might be prudent in case renderer sends bad data)-- but I still don't see how it could *sometimes* happen in tests.

      Investigating further.

      Gerrit-Comment-Date: Sat, 07 Feb 2026 19:20:39 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michal Mocny (Gerrit)

      unread,
      2:28 PM (8 hours ago) 2:28 PM
      to Johannes Henkel, Chromium LUCI CQ, Scott Haseley, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
      Attention needed from Scott Haseley

      Michal Mocny added 6 comments

      File components/page_load_metrics/browser/interaction_to_next_paint_calculator.h
      Line 79, Patchset 6 (Latest): uint64_t min = std::numeric_limits<uint64_t>::max();
      Scott Haseley . resolved

      It might be worth commenting at a high level how the interaction count is computing this, and the assumptions (I think just that interaction IDs are consecutive).

      Michal Mocny

      Done

      Line 54, Patchset 6 (Latest): const content::RenderFrameHost* source,
      Scott Haseley . resolved

      style nit: consider passing by const ref since `source` can't be null and it isn't stored past the life of the method.

      Michal Mocny

      I was following existing style for page load metrics observers (e.g.: https://source.chromium.org/chromium/chromium/src/+/main:components/page_load_metrics/browser/page_load_metrics_observer.h;l=154-167;drc=ba8c2b489614ce6ee0f4d9109dbb19743b9c7c32)

      This calculator of course could accept a dereferenced value but it was just consistency.

      Not sure!

      Michal Mocny

      Done

      Line 37, Patchset 6 (Latest): struct InteractionEvents {
      Scott Haseley . resolved

      Can this be private?

      Michal Mocny

      Done

      File components/page_load_metrics/browser/interaction_to_next_paint_calculator.cc
      Line 55, Patchset 6 (Latest): CompressEventTimings();
      Johannes Henkel . resolved

      nitpicky also: Maybe TrimEventTimings would be an even better name?

      Michal Mocny

      Done

      Line 64, Patchset 6 (Latest): if (event.duration > interaction.max_event.duration) {
      Scott Haseley . resolved

      Is it worth commenting why this happens? It's not clear/obvious to me why the duration for an existing event would change.

      Michal Mocny

      I will add a comment-- but this isn't "an existing event changing" its a new event for the same interactionId.

      So like, pointerdown with 100ms followed by pointerup with 200ms.

      Michal Mocny

      Done

      Line 111, Patchset 6 (Latest): CHECK(range.min != 0);
      Michal Mocny . resolved

      This is the failing check in the bots tests. The test runs fine for me, locally, so its somehow flaky, I guess.

      But the min value comes from the interactionid values that are sent to us. Some of the tests I already fixed where accidentally sending interaction id == 0 which is not a valid value.

      I can move some enforcement to the AddEventTimings() function to ingore EventTimings with interaction id == 0 (which might be prudent in case renderer sends bad data)-- but I still don't see how it could *sometimes* happen in tests.

      Investigating further.

      Michal Mocny

      Okay-- I found that this test was indeed setting 0.

      I dont know how it ran for me locally-- maybe CHECKS werent enforced or I wasn't running the test right...

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Scott Haseley
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
        Gerrit-Change-Number: 7551230
        Gerrit-PatchSet: 6
        Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
        Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
        Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
        Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
        Gerrit-Attention: Scott Haseley <shas...@chromium.org>
        Gerrit-Comment-Date: Sat, 07 Feb 2026 19:28:28 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
        Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
        Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
        satisfied_requirement
        open
        diffy

        Michal Mocny (Gerrit)

        unread,
        2:38 PM (8 hours ago) 2:38 PM
        to Johannes Henkel, Chromium LUCI CQ, Scott Haseley, Dibyajyoti Pal, AyeAye, chromium...@chromium.org, webap...@microsoft.com, aixba+wat...@chromium.org, mgiuca...@chromium.org, philli...@chromium.org, kuragin+web-ap...@chromium.org, dmurph+watc...@chromium.org, zelin+watch-we...@chromium.org, japhet+...@chromium.org, dibyapal+wa...@chromium.org, mek+w...@chromium.org, core-web-vita...@chromium.org, loyso...@chromium.org, bmcquad...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metrics...@chromium.org, speed-metr...@chromium.org
        Attention needed from Dibyajyoti Pal, Johannes Henkel and Scott Haseley

        Michal Mocny added 2 comments

        File components/page_load_metrics/browser/interaction_to_next_paint_calculator.cc
        Line 49, Patchset 7 (Latest): if (event_timing->interaction_id == 0) {
        Michal Mocny . resolved

        I won't add it to this patch, but this could be a good candidate for a UseCounter or adding to the existing PLMO error states histogram...

        File components/page_load_metrics/browser/page_load_metrics_update_dispatcher.cc
        Line 768, Patchset 6: client_->OnPageEventTimingChanged(event_timings.size());
        Michal Mocny . unresolved

        Reviewers: This is one more new fix that I snuck in, the rest of the changes are mostly trivial updates after initial review.

        This change here is because the `PageLoadMetricsUpdateDispatcher` was doing part of the job of the INP calculator and making assumptions about num interactions based on event timing vector size.

        I think it would be even better to remove the num_interactions from this `OnPageEventTimingChanged` and force clients to get this value from the right INP calculator-- after all, they already get the INP value from this.

        But I think this patch has sprawled enough and I wanted to stop somewhere !

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dibyajyoti Pal
        • Johannes Henkel
        • Scott Haseley
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ifc27b229be7e305c61a02aeec55527c39bd828bf
          Gerrit-Change-Number: 7551230
          Gerrit-PatchSet: 7
          Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Dibyajyoti Pal <diby...@chromium.org>
          Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
          Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
          Gerrit-Attention: Scott Haseley <shas...@chromium.org>
          Gerrit-Attention: Dibyajyoti Pal <diby...@chromium.org>
          Gerrit-Comment-Date: Sat, 07 Feb 2026 19:38:24 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages