[soft navs] Refactor pending ICP entry buffering [chromium/src : main]

0 views
Skip to first unread message

Scott Haseley (Gerrit)

unread,
Dec 11, 2025, 2:34:56 PM (9 days ago) Dec 11
to Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Michal Mocny

Scott Haseley added 1 comment

Patchset-level comments
File-level comment, Patchset 12 (Latest):
Scott Haseley . resolved

PTAL. The next couple of CLs in the chain shows where this is heading. Emitting more entries is small change on top of the last CL, which I just need to add tests for.

Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
Gerrit-Change-Number: 7120640
Gerrit-PatchSet: 12
Gerrit-Owner: Scott Haseley <shas...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Thu, 11 Dec 2025 19:34:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Dec 11, 2025, 4:02:43 PM (9 days ago) Dec 11
to Scott Haseley, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Scott Haseley

Michal Mocny voted and added 12 comments

Votes added by Michal Mocny

Code-Review+1

12 comments

Commit Message
Line 16, Patchset 12 (Latest):where we either create and emit it synchronously or buffer it for later.
Michal Mocny . resolved

I like that. Also, I think post-OT we want to change to not hold back ICP entries, anyway.

Line 22, Patchset 12 (Latest): calculator. We don't plan to expose these values, as the records
Michal Mocny . resolved

Nit: technically this is requested of us, and we might in theory.

But, I still think the LCP calculator could consider the pair of largest image and text as a single candidate that it emits together, if that happens.

File third_party/blink/renderer/core/timing/soft_navigation_context.h
Line 125, Patchset 12 (Latest): // if there is one. The context must not have been previously emitted.
Michal Mocny . unresolved

Could we Emit a soft-nav without an ICP? (I guess yes, until we "harden"?)

File third_party/blink/renderer/core/timing/soft_navigation_context.cc
Line 164, Patchset 12 (Latest):// few frames/paints. This is potentially unlikely given the low paint area
// requirement right now, but increasingly likely as we bump that up. We do
Michal Mocny . unresolved

Nit: maybe just remove this part of the comment now?

Line 193, Patchset 12 (Latest): if (RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_)) {
Michal Mocny . unresolved

Hmmm, we guard the actual emit further down, anyway:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/window_performance.cc;l=1564-1567

And along the way we emit trace events. I wonder if we should just call this unconditionally?

Line 246, Patchset 12 (Latest): performance->AddSoftNavigationEntry(
Michal Mocny . unresolved

Since we are moving PerfEntry creation into this class for the ICP entry, I wonder if we should do the same for Soft-Nav (and hard-LCP?)

Looking at WindowPerformance, most apis do just pass data and let it get created there, often lazily based on buffer, but many of the recent apis create the entry first and pass it along...

(I have no preference, just wonder if we are duplicating constructor signature basically anyway)

Line 258, Patchset 12 (Latest): // TODO(crbug.com/448974465): We currently don't emit ICP entries or record
// metrics for soft navs that are interrupted by a new interaction when there
// is pending presentation feedback for FCP, but we do emit the soft nav
// entry. We might want to reconsider this.
Michal Mocny . resolved

I guess this affects more than just Paint->Presentation, it also could be:

  • Interaction
  • Network, Routing, Dom update, Paint...
  • ...
  • URL (finally)

It's more common to set URL before or during routing, and increasingly so, but some sites still do it very late/lazy after render.

(And Shopify team recently shared that they sometimes actually yield() after router rendering and before updating URL, on purpose, because it prevents unwanted scripts from triggering...)

---

Do you think we could just remove this restriction? We wouldn't accept new paint candidates after input, anyway?

(Fine to decouple from this patch, just curious.)

Line 270, Patchset 12 (Latest):void SoftNavigationContext::EmitPerformanceEntry(
Michal Mocny . unresolved

In hindsight I wonder if this should have had "LCP" in its name-- since there are 2 types of perf entry this class manages, its ambiguous without knowing which base class we override...

Line 277, Patchset 12 (Latest): CHECK(RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_));
Michal Mocny . unresolved

Similarly, we could leave this unenforced.

Obviously we don't need to create entries if we aren't going to expose them, which is what the flag guards-- but now we are sort of using the entry as a temporary buffer which is useful also for tracing.

File third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
Line 412, Patchset 12 (Latest): OnMetricsChanged(context);
Michal Mocny . unresolved

Nit: I think this this is specifically about soft-LCP and might be worth keeping in the name?

Line 480, Patchset 12 (Latest): if (context != context_for_current_url_) {
Michal Mocny . resolved

I think today this could be a CHECK today? But might change if we start to emit ICP always, as the TODO in `UpdateSoftLcpCandidate` suggests?

In which case, the name of `context_for_current_url_` should really be more like "current_active_navigation_context_" or something?

File third_party/blink/renderer/core/timing/window_performance.h
Line 194, Patchset 12 (Latest): void OnInteractionContentfulPaintUpdated(InteractionContentfulPaint*);
Michal Mocny . resolved

I'm fine with this, but FYI `AddLongAnimationFrameEntry` just uses the base class PerformanceEntry* to avoid the type declaration.

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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
    Gerrit-Change-Number: 7120640
    Gerrit-PatchSet: 12
    Gerrit-Owner: Scott Haseley <shas...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Dec 2025 21:02:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Dec 11, 2025, 8:05:52 PM (8 days ago) Dec 11
    to Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Michal Mocny

    Scott Haseley added 7 comments

    File third_party/blink/renderer/core/timing/soft_navigation_context.h
    Line 125, Patchset 12 (Latest): // if there is one. The context must not have been previously emitted.
    Michal Mocny . unresolved

    Could we Emit a soft-nav without an ICP? (I guess yes, until we "harden"?)

    Scott Haseley

    The code coverage lines indicate the early-exit is being hit, but I'm not entirely sure how. I think the only way we wouldn't is if we consider something an FCP but not an LCP, which I don't _think_ can happen? I had considered making this a CHECK instead, but thought I maybe had a scenario that would trip this. I'll poke at this a bit.

    File third_party/blink/renderer/core/timing/soft_navigation_context.cc
    Line 164, Patchset 12 (Latest):// few frames/paints. This is potentially unlikely given the low paint area
    // requirement right now, but increasingly likely as we bump that up. We do
    Michal Mocny . unresolved

    Nit: maybe just remove this part of the comment now?

    Scott Haseley

    SGTM.

    Line 193, Patchset 12 (Latest): if (RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_)) {
    Michal Mocny . unresolved

    Hmmm, we guard the actual emit further down, anyway:

    https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/window_performance.cc;l=1564-1567

    And along the way we emit trace events. I wonder if we should just call this unconditionally?

    Scott Haseley

    We currently flag-guard this in SNH: https://source.chromium.org/chromium/chromium/src/+/b068c0e68af54aee01cc40a55f50a7be0f1f22e7:third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc;l=487-491, with the comment "Performance timeline won't allow emitting soft-LCP entries without this flag, but we can save some needless work by just not even trying to report." So that other check is redundant, and this matches the current behavior.

    FWIW I like the guard here so more of the feature is behind the flag. Hard navs emits trace events for metrics candidates as well; maybe we should consider doing that for soft navs? Although, not sure having both makes sense for either case.

    Line 246, Patchset 12 (Latest): performance->AddSoftNavigationEntry(
    Michal Mocny . unresolved

    Since we are moving PerfEntry creation into this class for the ICP entry, I wonder if we should do the same for Soft-Nav (and hard-LCP?)

    Looking at WindowPerformance, most apis do just pass data and let it get created there, often lazily based on buffer, but many of the recent apis create the entry first and pass it along...

    (I have no preference, just wonder if we are duplicating constructor signature basically anyway)

    Scott Haseley

    I was wondering that as well. Let's discuss offline and follow up? I'd rather keep this scoped to ICP, but you're right that we should discuss it (I actually might have a patch somewhere that does this for hard navs for some something unrelated..).

    Line 258, Patchset 12 (Latest): // TODO(crbug.com/448974465): We currently don't emit ICP entries or record
    // metrics for soft navs that are interrupted by a new interaction when there
    // is pending presentation feedback for FCP, but we do emit the soft nav
    // entry. We might want to reconsider this.
    Michal Mocny . resolved

    I guess this affects more than just Paint->Presentation, it also could be:

    • Interaction
    • Network, Routing, Dom update, Paint...
    • ...
    • URL (finally)

    It's more common to set URL before or during routing, and increasingly so, but some sites still do it very late/lazy after render.

    (And Shopify team recently shared that they sometimes actually yield() after router rendering and before updating URL, on purpose, because it prevents unwanted scripts from triggering...)

    ---

    Do you think we could just remove this restriction? We wouldn't accept new paint candidates after input, anyway?

    (Fine to decouple from this patch, just curious.)

    Scott Haseley
    What should happen if:
    - Interaction
    - Network, Routing, Dom update, Paint...
    - ...
    - Another interaction
    - ...
    - URL (finally)

    Should we still emit if we've stopped counting its paints? I don't think I've totally wrapped my head around how to best handle concurrent interactions.

    --

    I _think_ just removing this would be okay --- there might be a test that this affects, but I can't remember.

    Line 270, Patchset 12 (Latest):void SoftNavigationContext::EmitPerformanceEntry(
    Michal Mocny . resolved

    In hindsight I wonder if this should have had "LCP" in its name-- since there are 2 types of perf entry this class manages, its ambiguous without knowing which base class we override...

    Scott Haseley

    Yeah, let's update that in a follow-up. I also thought this was getting confusing while drafting this.

    Line 277, Patchset 12 (Latest): CHECK(RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_));
    Michal Mocny . unresolved

    Similarly, we could leave this unenforced.

    Obviously we don't need to create entries if we aren't going to expose them, which is what the flag guards-- but now we are sort of using the entry as a temporary buffer which is useful also for tracing.

    Scott Haseley

    See comment above -- we're not currently tracing this. I think I'd rather trace the metrics candidate (which needs less info) and have anything that touches an ICP entry behind the flag.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • 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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
    Gerrit-Change-Number: 7120640
    Gerrit-PatchSet: 12
    Gerrit-Owner: Scott Haseley <shas...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Fri, 12 Dec 2025 01:05:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Dec 11, 2025, 8:12:08 PM (8 days ago) Dec 11
    to Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Michal Mocny

    Scott Haseley added 1 comment

    Commit Message
    Line 22, Patchset 12 (Latest): calculator. We don't plan to expose these values, as the records
    Michal Mocny . resolved

    Nit: technically this is requested of us, and we might in theory.

    But, I still think the LCP calculator could consider the pair of largest image and text as a single candidate that it emits together, if that happens.

    Scott Haseley

    We don't have to expose the records necessarily, only enough information to meet use cases. Some of the info is just needed to get the timing, which could be decoupled from the timing itself.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • 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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
    Gerrit-Change-Number: 7120640
    Gerrit-PatchSet: 12
    Gerrit-Owner: Scott Haseley <shas...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Fri, 12 Dec 2025 01:11:54 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Dec 12, 2025, 6:27:07 PM (7 days ago) Dec 12
    to AyeAye, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Michal Mocny

    Scott Haseley added 5 comments

    Patchset-level comments
    File-level comment, Patchset 13 (Latest):
    Scott Haseley . resolved

    I rebased this on the prefinalizer change, and it should be in better shape now. I left a few comments open for visibility.

    File third_party/blink/renderer/core/timing/soft_navigation_context.h
    Line 125, Patchset 12: // if there is one. The context must not have been previously emitted.
    Michal Mocny . resolved

    Could we Emit a soft-nav without an ICP? (I guess yes, until we "harden"?)

    Scott Haseley

    The code coverage lines indicate the early-exit is being hit, but I'm not entirely sure how. I think the only way we wouldn't is if we consider something an FCP but not an LCP, which I don't _think_ can happen? I had considered making this a CHECK instead, but thought I maybe had a scenario that would trip this. I'll poke at this a bit.

    Scott Haseley
    OK so multiple things:
    - we don't buffer without the web-exposed feature enabled, so it could have be null in that case.
    - but also, there was a bug since we were only updating candidates for the context associated with the current URL. This wasn't caught by any tests, but crashed when I added a CHECK. So I fixed this and updated one of the tests to also check for the ICP entry.
    File third_party/blink/renderer/core/timing/soft_navigation_context.cc
    Line 164, Patchset 12:// few frames/paints. This is potentially unlikely given the low paint area

    // requirement right now, but increasingly likely as we bump that up. We do
    Michal Mocny . resolved

    Nit: maybe just remove this part of the comment now?

    Scott Haseley

    SGTM.

    Scott Haseley

    Done

    File third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
    Line 412, Patchset 12: OnMetricsChanged(context);
    Michal Mocny . resolved

    Nit: I think this this is specifically about soft-LCP and might be worth keeping in the name?

    Scott Haseley

    Changed to `UpdateSoftLcpMetricsForContext()`. The method now only updates metrics based on existing values (vs updating the candidate), so I wanted to change it to indicate that.

    Line 480, Patchset 12: if (context != context_for_current_url_) {
    Michal Mocny . resolved

    I think today this could be a CHECK today? But might change if we start to emit ICP always, as the TODO in `UpdateSoftLcpCandidate` suggests?

    In which case, the name of `context_for_current_url_` should really be more like "current_active_navigation_context_" or something?

    Scott Haseley

    I think it's possible, however unlikely, to delay the soft-nav entry while waiting for FCP presentation time and have `context_for_current_url_` change in the meantime. We ordered the checks in `MaybeCommitNavigationOrEmitSoftNavigationEntry` to account for that. In that case, we'd emit the soft nav entry (metrics and perf timeline), but not update soft LCP metrics or emit the perf timeline entry (to your other comments). So I think this keeps the status quo, though I think we should rethink that as a follow-up.

    ---

    Also, FYI: in crrev.com/c/7181848, which is 2 away, I'm for the metrics update call to be driven async just like the EmitPerformanceEntry method to streamline the LCP candidate update dance, in which case this will be needed.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michal Mocny
    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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
      Gerrit-Change-Number: 7120640
      Gerrit-PatchSet: 13
      Gerrit-Owner: Scott Haseley <shas...@chromium.org>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
      Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
      Gerrit-Comment-Date: Fri, 12 Dec 2025 23:26:57 +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

      Michal Mocny (Gerrit)

      unread,
      Dec 15, 2025, 9:43:10 AM (5 days ago) Dec 15
      to Scott Haseley, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
      Attention needed from Scott Haseley

      Michal Mocny voted and added 4 comments

      Votes added by Michal Mocny

      Code-Review+1

      4 comments

      File third_party/blink/renderer/core/timing/soft_navigation_context.cc
      Line 193, Patchset 12: if (RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_)) {
      Michal Mocny . resolved

      Hmmm, we guard the actual emit further down, anyway:

      https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/window_performance.cc;l=1564-1567

      And along the way we emit trace events. I wonder if we should just call this unconditionally?

      Scott Haseley

      We currently flag-guard this in SNH: https://source.chromium.org/chromium/chromium/src/+/b068c0e68af54aee01cc40a55f50a7be0f1f22e7:third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc;l=487-491, with the comment "Performance timeline won't allow emitting soft-LCP entries without this flag, but we can save some needless work by just not even trying to report." So that other check is redundant, and this matches the current behavior.

      FWIW I like the guard here so more of the feature is behind the flag. Hard navs emits trace events for metrics candidates as well; maybe we should consider doing that for soft navs? Although, not sure having both makes sense for either case.

      Michal Mocny

      Resolving because we do this-- but it also came up in Connor Clarks DevTools update that he is seeing soft-nav trace event but not soft-LCP and I wonder if it is just that he didnt have SNH flag enabled...

      Line 246, Patchset 12: performance->AddSoftNavigationEntry(
      Michal Mocny . resolved

      Since we are moving PerfEntry creation into this class for the ICP entry, I wonder if we should do the same for Soft-Nav (and hard-LCP?)

      Looking at WindowPerformance, most apis do just pass data and let it get created there, often lazily based on buffer, but many of the recent apis create the entry first and pass it along...

      (I have no preference, just wonder if we are duplicating constructor signature basically anyway)

      Scott Haseley

      I was wondering that as well. Let's discuss offline and follow up? I'd rather keep this scoped to ICP, but you're right that we should discuss it (I actually might have a patch somewhere that does this for hard navs for some something unrelated..).

      Michal Mocny

      Acknowledged

      Line 258, Patchset 12: // TODO(crbug.com/448974465): We currently don't emit ICP entries or record

      // metrics for soft navs that are interrupted by a new interaction when there
      // is pending presentation feedback for FCP, but we do emit the soft nav
      // entry. We might want to reconsider this.
      Michal Mocny . resolved

      I guess this affects more than just Paint->Presentation, it also could be:

      • Interaction
      • Network, Routing, Dom update, Paint...
      • ...
      • URL (finally)

      It's more common to set URL before or during routing, and increasingly so, but some sites still do it very late/lazy after render.

      (And Shopify team recently shared that they sometimes actually yield() after router rendering and before updating URL, on purpose, because it prevents unwanted scripts from triggering...)

      ---

      Do you think we could just remove this restriction? We wouldn't accept new paint candidates after input, anyway?

      (Fine to decouple from this patch, just curious.)

      Scott Haseley
      What should happen if:
      - Interaction
      - Network, Routing, Dom update, Paint...
      - ...
      - Another interaction
      - ...
      - URL (finally)

      Should we still emit if we've stopped counting its paints? I don't think I've totally wrapped my head around how to best handle concurrent interactions.

      --

      I _think_ just removing this would be okay --- there might be a test that this affects, but I can't remember.

      Michal Mocny

      In the example you give, the timeline would be consistent in its reporting (perfectly non-overlapping paint entries), so its semantically equivalent to URL before Interaction but performance observer buffering for a long time.

      Even if the second interaction painted.

      ---

      I think even cases like this could be fine:

      • Interaction 1 paints
      • Interaction 2 paints
      • Interaction 2 updates URL
      • Interaction 1 updates URL

      ... the only problem with this case is that interaction 1 would no longer be reporting new ICP's.

      ---

      Anyway-- I think erring on reporting rather than dropping is better here, but I'm leaving comment resolved so we can fiddle with it after this patch.

      Line 277, Patchset 12: CHECK(RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_));
      Michal Mocny . resolved

      Similarly, we could leave this unenforced.

      Obviously we don't need to create entries if we aren't going to expose them, which is what the flag guards-- but now we are sort of using the entry as a temporary buffer which is useful also for tracing.

      Scott Haseley

      See comment above -- we're not currently tracing this. I think I'd rather trace the metrics candidate (which needs less info) and have anything that touches an ICP entry behind the flag.

      Michal Mocny

      The point might become moot anyway once we emit ICP without buffering, so resolving.

      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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
        Gerrit-Change-Number: 7120640
        Gerrit-PatchSet: 13
        Gerrit-Owner: Scott Haseley <shas...@chromium.org>
        Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
        Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
        Gerrit-Attention: Scott Haseley <shas...@chromium.org>
        Gerrit-Comment-Date: Mon, 15 Dec 2025 14:43:01 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Blink W3C Test Autoroller (Gerrit)

        unread,
        Dec 15, 2025, 11:58:02 AM (5 days ago) Dec 15
        to Scott Haseley, Michal Mocny, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
        Attention needed from Scott Haseley

        Message from Blink W3C Test Autoroller

        Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/56743.

        When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

        WPT Export docs:
        https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

        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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
        Gerrit-Change-Number: 7120640
        Gerrit-PatchSet: 13
        Gerrit-Owner: Scott Haseley <shas...@chromium.org>
        Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
        Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Attention: Scott Haseley <shas...@chromium.org>
        Gerrit-Comment-Date: Mon, 15 Dec 2025 16:57:51 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Michal Mocny (Gerrit)

        unread,
        Dec 16, 2025, 11:34:44 AM (4 days ago) Dec 16
        to Scott Haseley, Blink W3C Test Autoroller, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
        Attention needed from Scott Haseley

        Michal Mocny voted and added 3 comments

        Votes added by Michal Mocny

        Code-Review+1

        3 comments

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

        A+ comments in header, thanks

        File third_party/blink/renderer/core/timing/soft_navigation_context.h
        Line 143, Patchset 16 (Latest): // for the text. Moving more logic into presentation time, like we do for
        // hard LCP, in conjunction with emitting largest presented image/text
        // (vs. pending image) would fix this.
        Michal Mocny . resolved

        I guess the main reason for doing it at paint time is to increment navigationID so that other entries are segmented accordingly. Otherwise the timing of the navigationID change is based on arbitrary scheduling of presentation feedback.

        But with the intended ICP change to report before soft-nav, we no longer need navigationId for the ICP timings themselves... and potentially we could just using timestamps for other entries.

        (I speculated about dropping navigationID earlier this year... let's see)

        File third_party/blink/renderer/core/timing/soft_navigation_context.cc
        Line 242, Patchset 16 (Latest): TRACE_EVENT_INSTANT("scheduler,devtools.timeline,loading",
        Michal Mocny . unresolved

        Maybe move this below the flag check now? Or do you want to do that in a separate patch?

        Connor mentioned NOT guarding trace events on flag settings, but I think we decided to start with consistency first and then moving all the relevant trace events afterwards?

        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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
          Gerrit-Change-Number: 7120640
          Gerrit-PatchSet: 16
          Gerrit-Owner: Scott Haseley <shas...@chromium.org>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
          Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
          Gerrit-Attention: Scott Haseley <shas...@chromium.org>
          Gerrit-Comment-Date: Tue, 16 Dec 2025 16:34:36 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Scott Haseley (Gerrit)

          unread,
          Dec 16, 2025, 12:00:18 PM (4 days ago) Dec 16
          to Blink W3C Test Autoroller, Michal Mocny, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org

          Scott Haseley voted and added 3 comments

          Votes added by Scott Haseley

          Commit-Queue+2

          3 comments

          Patchset-level comments
          Scott Haseley . resolved

          Thanks!

          File third_party/blink/renderer/core/timing/soft_navigation_context.h
          Line 143, Patchset 16 (Latest): // for the text. Moving more logic into presentation time, like we do for
          // hard LCP, in conjunction with emitting largest presented image/text
          // (vs. pending image) would fix this.
          Michal Mocny . resolved

          I guess the main reason for doing it at paint time is to increment navigationID so that other entries are segmented accordingly. Otherwise the timing of the navigationID change is based on arbitrary scheduling of presentation feedback.

          But with the intended ICP change to report before soft-nav, we no longer need navigationId for the ICP timings themselves... and potentially we could just using timestamps for other entries.

          (I speculated about dropping navigationID earlier this year... let's see)

          Scott Haseley

          Good point. We also track the total area, so we need all paints currently. I think we could still support since we already have decoupled incrementing nav id with presentation feedback (i.e. we wait for FCP presentation time) -- it's the candidate update that's a problem, and that could be moved around, which I _think_ will be straightforward once LCP calculator owns the records.

          File third_party/blink/renderer/core/timing/soft_navigation_context.cc
          Line 242, Patchset 16 (Latest): TRACE_EVENT_INSTANT("scheduler,devtools.timeline,loading",
          Michal Mocny . resolved

          Maybe move this below the flag check now? Or do you want to do that in a separate patch?

          Connor mentioned NOT guarding trace events on flag settings, but I think we decided to start with consistency first and then moving all the relevant trace events afterwards?

          Scott Haseley

          Lets do that separately and attribute it to the tracing bug. I'll send a follow-up once this lands.

          Open in Gerrit

          Related details

          Attention set is empty
          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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
            Gerrit-Change-Number: 7120640
            Gerrit-PatchSet: 16
            Gerrit-Owner: Scott Haseley <shas...@chromium.org>
            Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
            Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
            Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
            Gerrit-Comment-Date: Tue, 16 Dec 2025 17:00:04 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            Dec 16, 2025, 12:04:31 PM (4 days ago) Dec 16
            to Scott Haseley, Blink W3C Test Autoroller, Michal Mocny, AyeAye, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org

            Chromium LUCI CQ submitted the change

            Change information

            Commit message:
            [soft navs] Refactor pending ICP entry buffering

            Currently, SoftNavigationContext tracks the current largest text and
            image records, and uses those to emit the ICP performance entry and
            update metrics if and when the soft navigation entry is emitted. This CL
            changes this flow so that now we track the latest un-emitted
            InteractionContentfulPaint object and emit that directly. To do this,
            the LCP calculator continuously updates its state and calls the Delegate
            EmitPerformanceEntry method, but actual ICP emission is guarded there,

            where we either create and emit it synchronously or buffer it for later.

            This is being done because:
            1. To unify ICP and LCP and to better control lifetime of
            PaintTimingRecords (in advance of strongifying some of its fields),
            we want to move the largest text and image tracking into the LCP

            calculator. We don't plan to expose these values, as the records
                themselves shouldn't be persisted beyond getting presentation
            feedback, but SNC needs to buffer the latest candidate indefinitely.

            2. We plan to guarantee the Node and MediaObject are alive through this
            callback, which might not be the case now if the node is removed,
            and capturing the state here ensures we have what we need for
            emission.
            Bug: 454082771, 454082773
            Change-Id: I093d37960f774e5ca8946d8a0aa27cd9d592125f
            Reviewed-by: Michal Mocny <mmo...@chromium.org>
            Commit-Queue: Scott Haseley <shas...@chromium.org>
            Cr-Commit-Position: refs/heads/main@{#1559386}
            Files:
            • M third_party/blink/renderer/core/timing/soft_navigation_context.cc
            • M third_party/blink/renderer/core/timing/soft_navigation_context.h
            • M third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
            • M third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
            • M third_party/blink/renderer/core/timing/window_performance.cc
            • M third_party/blink/renderer/core/timing/window_performance.h
            • M third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/smoke/tentative/late-url-change.html
            Change size: L
            Delta: 7 files changed, 149 insertions(+), 102 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Michal Mocny
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I093d37960f774e5ca8946d8a0aa27cd9d592125f
            Gerrit-Change-Number: 7120640
            Gerrit-PatchSet: 17
            Gerrit-Owner: Scott Haseley <shas...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
            Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
            Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
            open
            diffy
            satisfied_requirement

            Blink W3C Test Autoroller (Gerrit)

            unread,
            Dec 16, 2025, 12:31:56 PM (4 days ago) Dec 16
            to Scott Haseley, Chromium LUCI CQ, Michal Mocny, AyeAye, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org

            Message from Blink W3C Test Autoroller

            The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/56743

            Open in Gerrit

            Related details

            Attention set is empty
            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: I093d37960f774e5ca8946d8a0aa27cd9d592125f
            Gerrit-Change-Number: 7120640
            Gerrit-PatchSet: 17
            Gerrit-Owner: Scott Haseley <shas...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
            Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
            Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
            Gerrit-Comment-Date: Tue, 16 Dec 2025 17:31:49 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: No
            satisfied_requirement
            open
            diffy

            Scott Haseley (Gerrit)

            unread,
            Dec 18, 2025, 8:47:34 PM (2 days ago) Dec 18
            to Chromium LUCI CQ, Blink W3C Test Autoroller, Michal Mocny, AyeAye, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org

            Scott Haseley has created a revert of this change

            Related details

            Attention set is empty
            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: revert
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages