[cc/scheduler] Add SendEarlyLastBeginMainFrame [chromium/src : main]

0 views
Skip to first unread message

Stacy Gaikovaia (Gerrit)

unread,
May 4, 2026, 3:45:03 PM (7 days ago) May 4
to Jonathan Ross, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, schedule...@chromium.org, alexmo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, creis...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org
Attention needed from Jonathan Ross

Stacy Gaikovaia added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Stacy Gaikovaia . resolved

This is the root cl for a chain which implements the performance optimization that Blink is looking for. Please perform a preliminary review. Patch #9 passes dry-run on CQ. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Jonathan Ross
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: Ie256bb7fe17a047d5dd7f81b1e3a8d88673b7b01
Gerrit-Change-Number: 7787531
Gerrit-PatchSet: 9
Gerrit-Owner: Stacy Gaikovaia <ga...@google.com>
Gerrit-Reviewer: Jonathan Ross <jon...@chromium.org>
Gerrit-Reviewer: Stacy Gaikovaia <ga...@google.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Jonathan Ross <jon...@chromium.org>
Gerrit-Comment-Date: Mon, 04 May 2026 19:44:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Jonathan Ross (Gerrit)

unread,
May 5, 2026, 4:32:28 PM (6 days ago) May 5
to Stacy Gaikovaia, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, schedule...@chromium.org, alexmo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, creis...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org
Attention needed from Stacy Gaikovaia

Jonathan Ross added 3 comments

File cc/scheduler/scheduler.cc
Line 195, Patchset 10: viz::BeginFrameArgs args = last_dispatched_begin_main_frame_args_;
Jonathan Ross . unresolved

We should exit if `!last_dispatched_begin_main_frame_args_.IsValid()`. As `interval` would be 0 for the division below.

Could occur after context loss, where the Renderer stays alive but we rebuild CC to reconnect to new Viz.

Line 205, Patchset 10: args.on_critical_path = !state_machine_->ImplLatencyTakesPriority();
Jonathan Ross . unresolved

Would we want this feature to be `on_critical_path` by default?

File cc/scheduler/scheduler_state_machine.cc
Line 1586, Patchset 10: urgent_begin_main_frame_pending_ = true;
SetNeedsBeginMainFrame(true);
Jonathan Ross . unresolved

Could we reuse the `bool now` param of `SetNeedsBeginMainFrame` instead of a new `urgent_begin_main_frame_pending_`?

Open in Gerrit

Related details

Attention is currently required from:
  • Stacy Gaikovaia
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: Ie256bb7fe17a047d5dd7f81b1e3a8d88673b7b01
    Gerrit-Change-Number: 7787531
    Gerrit-PatchSet: 10
    Gerrit-Owner: Stacy Gaikovaia <ga...@google.com>
    Gerrit-Reviewer: Jonathan Ross <jon...@chromium.org>
    Gerrit-Reviewer: Stacy Gaikovaia <ga...@google.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Stacy Gaikovaia <ga...@google.com>
    Gerrit-Comment-Date: Tue, 05 May 2026 20:32:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Stacy Gaikovaia (Gerrit)

    unread,
    May 7, 2026, 2:28:49 PM (4 days ago) May 7
    to Jonathan Ross, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, schedule...@chromium.org, alexmo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, creis...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org
    Attention needed from Jonathan Ross

    Stacy Gaikovaia added 3 comments

    File cc/scheduler/scheduler.cc
    Line 195, Patchset 10: viz::BeginFrameArgs args = last_dispatched_begin_main_frame_args_;
    Jonathan Ross . resolved

    We should exit if `!last_dispatched_begin_main_frame_args_.IsValid()`. As `interval` would be 0 for the division below.

    Could occur after context loss, where the Renderer stays alive but we rebuild CC to reconnect to new Viz.

    Stacy Gaikovaia

    Sounds good, done.

    Line 205, Patchset 10: args.on_critical_path = !state_machine_->ImplLatencyTakesPriority();
    Jonathan Ross . resolved

    Would we want this feature to be `on_critical_path` by default?

    Stacy Gaikovaia

    Sure - that's the default case, so I will remove those lines.

    File cc/scheduler/scheduler_state_machine.cc
    Line 1586, Patchset 10: urgent_begin_main_frame_pending_ = true;
    SetNeedsBeginMainFrame(true);
    Jonathan Ross . resolved

    Could we reuse the `bool now` param of `SetNeedsBeginMainFrame` instead of a new `urgent_begin_main_frame_pending_`?

    Stacy Gaikovaia

    Leaving this as a TODO for myself.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jonathan Ross
    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: Ie256bb7fe17a047d5dd7f81b1e3a8d88673b7b01
      Gerrit-Change-Number: 7787531
      Gerrit-PatchSet: 12
      Gerrit-Owner: Stacy Gaikovaia <ga...@google.com>
      Gerrit-Reviewer: Jonathan Ross <jon...@chromium.org>
      Gerrit-Reviewer: Stacy Gaikovaia <ga...@google.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-Attention: Jonathan Ross <jon...@chromium.org>
      Gerrit-Comment-Date: Thu, 07 May 2026 18:28:39 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Jonathan Ross <jon...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Stacy Gaikovaia (Gerrit)

      unread,
      May 7, 2026, 3:37:11 PM (4 days ago) May 7
      to Jonathan Ross, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, schedule...@chromium.org, alexmo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, creis...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org
      Attention needed from Jonathan Ross

      Stacy Gaikovaia added 1 comment

      File cc/scheduler/scheduler_state_machine.cc
      Line 1586, Patchset 10: urgent_begin_main_frame_pending_ = true;
      SetNeedsBeginMainFrame(true);
      Jonathan Ross . resolved

      Could we reuse the `bool now` param of `SetNeedsBeginMainFrame` instead of a new `urgent_begin_main_frame_pending_`?

      Stacy Gaikovaia

      Leaving this as a TODO for myself.

      Stacy Gaikovaia

      The answer is no, it does too many things and we can't just insert it in place of urgent_bmf_

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Jonathan Ross
      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: Ie256bb7fe17a047d5dd7f81b1e3a8d88673b7b01
      Gerrit-Change-Number: 7787531
      Gerrit-PatchSet: 13
      Gerrit-Owner: Stacy Gaikovaia <ga...@google.com>
      Gerrit-Reviewer: Jonathan Ross <jon...@chromium.org>
      Gerrit-Reviewer: Stacy Gaikovaia <ga...@google.com>
      Gerrit-CC: Daniel Cheng <dch...@chromium.org>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-Attention: Jonathan Ross <jon...@chromium.org>
      Gerrit-Comment-Date: Thu, 07 May 2026 19:37:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Jonathan Ross <jon...@chromium.org>
      Comment-In-Reply-To: Stacy Gaikovaia <ga...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jonathan Ross (Gerrit)

      unread,
      May 7, 2026, 8:12:13 PM (4 days ago) May 7
      to Stacy Gaikovaia, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Daniel Cheng, Olga Gerchikov, schedule...@chromium.org, alexmo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, cc-...@chromium.org, creis...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org
      Attention needed from Stacy Gaikovaia

      Jonathan Ross added 5 comments

      Patchset-level comments
      File-level comment, Patchset 13 (Latest):
      Jonathan Ross . resolved

      Once subtle scheduling question. Overall approach SGTM

      File cc/scheduler/scheduler.cc
      Line 192, Patchset 13 (Latest):// in which we send a BeginMainFrame with the same args we just processed
      Jonathan Ross . unresolved

      Please fix this WARNING reported by autoreview issue finding: This comment is slightly misleading. The code actually increments the sequence number and adjusts the frame time and deadline to align with current time, rather than using the exact same args.

      This comment is slightly misleading. The code actually increments the sequence number and adjusts the frame time and deadline to align with current time, rather than using the exact same args.

      Line 195, Patchset 13 (Latest):void Scheduler::SendEarlyLastBeginMainFrame() {
      Jonathan Ross . unresolved

      We aren't invoking this in code in this patch, just tests for now?

      Line 201, Patchset 13 (Latest): state_machine_->SetUrgentBeginMainFramePending();
      Jonathan Ross . unresolved

      We could set this after calling `FinishImplFrame`

      Please fix this WARNING reported by autoreview issue finding: Setting this flag here is potentially problematic. `FinishImplFrame()` (called below) triggers `ProcessScheduledActions()`. If the scheduler is currently in a state that allows sending a BeginMainFrame, it will do so immediately using the *current* (stale) `begin_main_frame_args_`.

      `OnBeginFrame(args)` is the call that updates `begin_main_frame_args_` to the new values calculated in this method. To ensure the "urgent" frame uses the correct, updated args, you should set this flag *after* the `OnBeginFrame(args)` call or ensure that no actions are processed during the intermediate `FinishImplFrame()`.

      Setting this flag here is potentially problematic. `FinishImplFrame()` (called below) triggers `ProcessScheduledActions()`. If the scheduler is currently in a state that allows sending a BeginMainFrame, it will do so immediately using the *current* (stale) `begin_main_frame_args_`.

      `OnBeginFrame(args)` is the call that updates `begin_main_frame_args_` to the new values calculated in this method. To ensure the "urgent" frame uses the correct, updated args, you should set this flag *after* the `OnBeginFrame(args)` call or ensure that no actions are processed during the intermediate `FinishImplFrame()`.

      Line 204, Patchset 13 (Latest): int64_t intervals = base::ClampRound(elapsed / args.interval);
      Jonathan Ross . unresolved

      Please fix this WARNING reported by autoreview issue finding: `base::ClampRound` requires `#include \"base/numerics/safe_conversions.h\"`. Please add it to the includes section.

      `base::ClampRound` requires `#include \"base/numerics/safe_conversions.h\"`. Please add it to the includes section.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Stacy Gaikovaia
      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: Ie256bb7fe17a047d5dd7f81b1e3a8d88673b7b01
        Gerrit-Change-Number: 7787531
        Gerrit-PatchSet: 13
        Gerrit-Owner: Stacy Gaikovaia <ga...@google.com>
        Gerrit-Reviewer: Jonathan Ross <jon...@chromium.org>
        Gerrit-Reviewer: Stacy Gaikovaia <ga...@google.com>
        Gerrit-CC: Daniel Cheng <dch...@chromium.org>
        Gerrit-CC: Menard, Alexis <alexis...@intel.com>
        Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
        Gerrit-Attention: Stacy Gaikovaia <ga...@google.com>
        Gerrit-Comment-Date: Fri, 08 May 2026 00:12:04 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages