media: Report hardware-context-reset as an error if not recovered [chromium/src : main]

0 views
Skip to first unread message

Xiaohan Wang (Gerrit)

unread,
Feb 27, 2026, 2:23:10 PMFeb 27
to Sangbaek Park, Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Daoyuan Li, Evan Liu and Sangbaek Park

Xiaohan Wang added 3 comments

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Xiaohan Wang . resolved

I didn't review the detailed CL yet. Trying to see whether we could trigger some corner cases...

Commit Message
Line 7, Patchset 9 (Latest):media: Report hardware-context-reset as an error if not recovered
Xiaohan Wang . unresolved

The change looks good overall. I am trying to see whether there are corner cases that we could miss. Do you know whether HCR can ever happen when the player is paused? e.g. user paused the video, then drag the window to a different GPU, or close the lid of the laptop etc... Asking because in a paused state the media time won't change...

Also, I'll add @daoy...@microsoft.com here, to see whether there are other (better) signals we could use to detect this.

Line 10, Patchset 9 (Latest):within a very short time window, so we should consider this as an
Xiaohan Wang . unresolved

Here and in other places in this CL, "within a very short time window" is ambiguous. Does that mean media time or wall time?

Open in Gerrit

Related details

Attention is currently required from:
  • Daoyuan Li
  • Evan Liu
  • Sangbaek Park
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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
Gerrit-Change-Number: 7609444
Gerrit-PatchSet: 9
Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
Gerrit-Reviewer: Evan Liu <ev...@google.com>
Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
Gerrit-Attention: Evan Liu <ev...@google.com>
Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
Gerrit-Comment-Date: Fri, 27 Feb 2026 19:23:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sangbaek Park (Gerrit)

unread,
Feb 27, 2026, 2:43:52 PMFeb 27
to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Daoyuan Li, Evan Liu and Xiaohan Wang

Sangbaek Park added 1 comment

Commit Message
Line 10, Patchset 9:within a very short time window, so we should consider this as an
Xiaohan Wang . resolved

Here and in other places in this CL, "within a very short time window" is ambiguous. Does that mean media time or wall time?

Sangbaek Park

Good point. renamed to `a ver short media time winodw` in the commit msg and code.

Open in Gerrit

Related details

Attention is currently required from:
  • Daoyuan Li
  • Evan Liu
  • Xiaohan Wang
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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
Gerrit-Change-Number: 7609444
Gerrit-PatchSet: 11
Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
Gerrit-Reviewer: Evan Liu <ev...@google.com>
Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
Gerrit-Attention: Evan Liu <ev...@google.com>
Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
Gerrit-Comment-Date: Fri, 27 Feb 2026 19:43:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Xiaohan Wang <xhw...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Evan Liu (Gerrit)

unread,
Feb 27, 2026, 3:02:24 PMFeb 27
to Sangbaek Park, Daoyuan Li, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
Attention needed from Daoyuan Li, Sangbaek Park and Xiaohan Wang

Evan Liu voted and added 1 comment

Votes added by Evan Liu

Code-Review+1

1 comment

File third_party/blink/renderer/platform/media/web_media_player_impl.cc
Line 424, Patchset 11 (Latest): UMA_HISTOGRAM_BOOLEAN(
Evan Liu . unresolved

nit: if this histogram isn't reported very often, it's generally preferable to use a function of a macro

https://chromium.googlesource.com/chromium/src/tools/+/HEAD/metrics/histograms/README.md#coding-emitting-to-histograms

Open in Gerrit

Related details

Attention is currently required from:
  • Daoyuan Li
  • Sangbaek Park
  • Xiaohan Wang
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 11
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Comment-Date: Fri, 27 Feb 2026 20:02:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Feb 27, 2026, 4:57:19 PMFeb 27
    to Evan Liu, Daoyuan Li, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Daoyuan Li and Xiaohan Wang

    Sangbaek Park added 1 comment

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 424, Patchset 11: UMA_HISTOGRAM_BOOLEAN(
    Evan Liu . resolved

    nit: if this histogram isn't reported very often, it's generally preferable to use a function of a macro

    https://chromium.googlesource.com/chromium/src/tools/+/HEAD/metrics/histograms/README.md#coding-emitting-to-histograms

    Sangbaek Park

    Fixed (to use `base::UmaHistogramBoolean` instead). Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daoyuan Li
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 12
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Comment-Date: Fri, 27 Feb 2026 21:57:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Evan Liu <ev...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Feb 27, 2026, 5:22:02 PMFeb 27
    to Evan Liu, Daoyuan Li, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Daoyuan Li and Xiaohan Wang

    Sangbaek Park added 1 comment

    Commit Message
    Line 7, Patchset 9:media: Report hardware-context-reset as an error if not recovered
    Xiaohan Wang . unresolved

    The change looks good overall. I am trying to see whether there are corner cases that we could miss. Do you know whether HCR can ever happen when the player is paused? e.g. user paused the video, then drag the window to a different GPU, or close the lid of the laptop etc... Asking because in a paused state the media time won't change...

    Also, I'll add @daoy...@microsoft.com here, to see whether there are other (better) signals we could use to detect this.

    Sangbaek Park

    Since `media_time_on_last_hardware_context_reset` is set only when hardware context reset happens, failing logic with reporting `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET` error for the subsequent error will not be a problem but there is a chance we report the recovery result as NotRecoverd because the media time didn't update due to the pause.

    Do you know whether HCR can ever happen when the player is paused? e.g. user paused the video, then drag the window to a different GPU, or close the lid of the laptop etc

    Yes, it can happen at any time including during start, suspend, resume etc.

    Asking because in a paused state the media time won't change

    This is a good point since we could end up report an incorrect recovery result since the media time didn't tick with no error.

    One reason why I report the recovery result UMA at the end of WMPI lifecycle was I observed WMPI is stalled after the first HCR error and wanted to consider it as an unrecovered HCR case. But, you're right the HCR case with paused video will fall into this category even if it's recovered internally.

    Do I need to track the video pause state? Or should we report immediately the obvious unrecovery HCR case in the OnError() but no record for recovered cases? Any thoughts? @xhw...@chromium.org @daoy...@microsoft.com

    Gerrit-Comment-Date: Fri, 27 Feb 2026 22:21:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Xiaohan Wang <xhw...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daoyuan Li (Gerrit)

    unread,
    Feb 27, 2026, 5:25:17 PMFeb 27
    to Sangbaek Park, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park and Xiaohan Wang

    Daoyuan Li added 1 comment

    Commit Message
    Line 7, Patchset 9:media: Report hardware-context-reset as an error if not recovered
    Xiaohan Wang . unresolved

    The change looks good overall. I am trying to see whether there are corner cases that we could miss. Do you know whether HCR can ever happen when the player is paused? e.g. user paused the video, then drag the window to a different GPU, or close the lid of the laptop etc... Asking because in a paused state the media time won't change...

    Also, I'll add @daoy...@microsoft.com here, to see whether there are other (better) signals we could use to detect this.

    Daoyuan Li

    I do believe so, due to timing or such as calling UpdateVideo in the dual gpu case, even if MF is paused, it would still return invalid hwdrm state

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sangbaek Park
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 12
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Fri, 27 Feb 2026 22:25:10 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daoyuan Li (Gerrit)

    unread,
    Feb 27, 2026, 5:51:09 PMFeb 27
    to Sangbaek Park, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park and Xiaohan Wang

    Daoyuan Li added 2 comments

    Patchset-level comments
    File-level comment, Patchset 12 (Latest):
    Daoyuan Li . resolved

    replying to comments

    Commit Message
    Line 7, Patchset 9:media: Report hardware-context-reset as an error if not recovered
    Xiaohan Wang . unresolved

    The change looks good overall. I am trying to see whether there are corner cases that we could miss. Do you know whether HCR can ever happen when the player is paused? e.g. user paused the video, then drag the window to a different GPU, or close the lid of the laptop etc... Asking because in a paused state the media time won't change...

    Also, I'll add @daoy...@microsoft.com here, to see whether there are other (better) signals we could use to detect this.

    Daoyuan Li

    I do believe so, due to timing or such as calling UpdateVideo in the dual gpu case, even if MF is paused, it would still return invalid hwdrm state

    Daoyuan Li

    hmmm if you mean if we should consider the case of HCR in paused state, then yes, I do believe it should be considered.

    Gerrit-Comment-Date: Fri, 27 Feb 2026 22:51:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Xiaohan Wang <xhw...@chromium.org>
    Comment-In-Reply-To: Daoyuan Li <daoy...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Feb 27, 2026, 7:31:22 PMFeb 27
    to Evan Liu, Daoyuan Li, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Daoyuan Li and Xiaohan Wang

    Sangbaek Park added 1 comment

    Commit Message
    Line 7, Patchset 9:media: Report hardware-context-reset as an error if not recovered
    Xiaohan Wang . unresolved

    The change looks good overall. I am trying to see whether there are corner cases that we could miss. Do you know whether HCR can ever happen when the player is paused? e.g. user paused the video, then drag the window to a different GPU, or close the lid of the laptop etc... Asking because in a paused state the media time won't change...

    Also, I'll add @daoy...@microsoft.com here, to see whether there are other (better) signals we could use to detect this.

    Daoyuan Li

    I do believe so, due to timing or such as calling UpdateVideo in the dual gpu case, even if MF is paused, it would still return invalid hwdrm state

    Daoyuan Li

    hmmm if you mean if we should consider the case of HCR in paused state, then yes, I do believe it should be considered.

    Sangbaek Park

    Regardless of video pause state, failing logic with reporting `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET` is independent since it only gets triggered by the second error. And we need the last media time at the first HCR error to determine whether the second error happened within a short media time window.

    Examples (exhausively), 
    - a) video is paused -> 1st HCR -> video recovered (assuming still in pause state). no subsequent error -> no failure will happen.
    - a-1) If user unpaused the video, then `RecoveryResult` UMA will be true in the end.
    - a-2) However, if user refreshes the tab or video element is removed somehow, `RecoveryResult` UMA will be false since the media time didn't update.
    - b) video is paused -> 1st HCR -> video recovered (assuming still in pause state) -> 2nd HCR (moving the video window or hibernation etc) -> fail with HCR pipeline status error since the media time didn't update after the 1st recovery.
    - I think this is okay to consider it as a recovery failure case.
    - c) video is paused -> 1st HCR -> 2nd error -> fail with HCR pipeline status error.
    - d) video is paused -> 1st HCR -> unpaused by user or automatic (media time ticks) -> 2nd HCR error -> no failure will happen if media time is elaspsed > 100ms but consider the 2nd HCR as a new HCR error so we update the last media time.
    - e) video is NOT paused -> 1st HCR -> video recovered but paused by user (how fast user can pause? can they pause within 100ms after seeing the recovered video?) -> 2nd HCR -> no failure will happen but consider the 2nd HCR as a new HCR error so we update the last media time.
    - f) video is NOT paused -> 1st HCR -> video recovered but paused by user -> unpaused -> no failure will happen.

    One case that would report an incorrect `RecoveryResult` would be a-2) above.

    If you agree with that the video pause state doesn't affect the HCR recovery failure detection, my question is how accurate should the `RecoveryResult` UMA be?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daoyuan Li
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 13
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Comment-Date: Sat, 28 Feb 2026 00:31:15 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daoyuan Li (Gerrit)

    unread,
    Mar 2, 2026, 1:19:37 PMMar 2
    to Sangbaek Park, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park and Xiaohan Wang

    Daoyuan Li added 2 comments

    Patchset-level comments
    File-level comment, Patchset 13 (Latest):
    Daoyuan Li . resolved

    thoughts on the question

    Commit Message
    Line 7, Patchset 9:media: Report hardware-context-reset as an error if not recovered
    Xiaohan Wang . unresolved

    The change looks good overall. I am trying to see whether there are corner cases that we could miss. Do you know whether HCR can ever happen when the player is paused? e.g. user paused the video, then drag the window to a different GPU, or close the lid of the laptop etc... Asking because in a paused state the media time won't change...

    Also, I'll add @daoy...@microsoft.com here, to see whether there are other (better) signals we could use to detect this.

    Daoyuan Li

    I do believe so, due to timing or such as calling UpdateVideo in the dual gpu case, even if MF is paused, it would still return invalid hwdrm state

    Daoyuan Li

    hmmm if you mean if we should consider the case of HCR in paused state, then yes, I do believe it should be considered.

    Sangbaek Park

    Regardless of video pause state, failing logic with reporting `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET` is independent since it only gets triggered by the second error. And we need the last media time at the first HCR error to determine whether the second error happened within a short media time window.

    Examples (exhausively), 
    - a) video is paused -> 1st HCR -> video recovered (assuming still in pause state). no subsequent error -> no failure will happen.
    - a-1) If user unpaused the video, then `RecoveryResult` UMA will be true in the end.
    - a-2) However, if user refreshes the tab or video element is removed somehow, `RecoveryResult` UMA will be false since the media time didn't update.
    - b) video is paused -> 1st HCR -> video recovered (assuming still in pause state) -> 2nd HCR (moving the video window or hibernation etc) -> fail with HCR pipeline status error since the media time didn't update after the 1st recovery.
    - I think this is okay to consider it as a recovery failure case.
    - c) video is paused -> 1st HCR -> 2nd error -> fail with HCR pipeline status error.
    - d) video is paused -> 1st HCR -> unpaused by user or automatic (media time ticks) -> 2nd HCR error -> no failure will happen if media time is elaspsed > 100ms but consider the 2nd HCR as a new HCR error so we update the last media time.
    - e) video is NOT paused -> 1st HCR -> video recovered but paused by user (how fast user can pause? can they pause within 100ms after seeing the recovered video?) -> 2nd HCR -> no failure will happen but consider the 2nd HCR as a new HCR error so we update the last media time.
    - f) video is NOT paused -> 1st HCR -> video recovered but paused by user -> unpaused -> no failure will happen.

    One case that would report an incorrect `RecoveryResult` would be a-2) above.

    If you agree with that the video pause state doesn't affect the HCR recovery failure detection, my question is how accurate should the `RecoveryResult` UMA be?

    Daoyuan Li

    agreed that a-2 would be the issue. although I am also not sure how accurate this needs to be as it is a false positive, I would be curious to see how often this false positive may hit (I guess if we can determine the state of the pipeline eg pause/play, then we can know if a-2 is worth differentiating)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sangbaek Park
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 13
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Mon, 02 Mar 2026 18:19:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Sangbaek Park <sangba...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 4, 2026, 1:00:53 PMMar 4
    to Evan Liu, Daoyuan Li, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Daoyuan Li and Xiaohan Wang

    Sangbaek Park added 1 comment

    Commit Message
    Sangbaek Park

    I don't think it would be worth differentiating a-2 case since the handling logic itself works as expected regardless of pause state. Any opinion, @xhw...@chromium.org?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daoyuan Li
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 13
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Comment-Date: Wed, 04 Mar 2026 18:00:42 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Wang (Gerrit)

    unread,
    Mar 4, 2026, 1:56:01 PMMar 4
    to Sangbaek Park, Evan Liu, Daoyuan Li, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Daoyuan Li

    Xiaohan Wang added 1 comment

    Commit Message
    Xiaohan Wang

    Thanks for listing all the cases, which makes the discussion a lot easier!!!

    I actually didn't pay attention to the UMA reporting. My original comment was more about what users will experience in production. Case (b) seems to be problematic since throughout the process there's no no-recoverable failure, but we triggered a MediaError. I don't really know how common the case is, that whether we should consider the playing state in the logic, or just ignore it and always trigger an error. Thoughts?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daoyuan Li
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 13
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Comment-Date: Wed, 04 Mar 2026 18:55:48 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 5, 2026, 2:32:39 PMMar 5
    to Evan Liu, Daoyuan Li, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Daoyuan Li and Xiaohan Wang

    Sangbaek Park added 1 comment

    Commit Message
    Sangbaek Park

    For the case b), I've tested with simply tester, shaka-player and Canal+:

    • Paused video
    • Move video to another display -> 1st HCR -> (WMPI is just in waiting state. No new MFR creation yet)
    • Move video back to original -> (nothing happens in the code. No new MFR creation or Pipeline resume until user unpauses the video)
    • Unpause by user -> Non-HCR -> Since the 2nd error occurred within the same WMPI, we give up by reporting `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET`.

    I can proto-type by adding `paused_on_hardware_context_reset_` to track the last pause state at the time of HCR. For the 2nd error, if `paused_on_hardware_context_reset_` and the current `paused_` are true, then treat it as 1st error by updating the last media time. But, I still doubt if this complexity is worth it? @xhw...@chromium.org WDYT?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daoyuan Li
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 13
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Comment-Date: Thu, 05 Mar 2026 19:32:28 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 6, 2026, 1:59:58 PMMar 6
    to Evan Liu, Daoyuan Li, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Daoyuan Li and Xiaohan Wang

    Sangbaek Park voted and added 1 comment

    Votes added by Sangbaek Park

    Commit-Queue+1

    1 comment

    Commit Message
    Sangbaek Park

    Added handling logic for video pause cases. Since testing manually is tricky, I've added new unit tests to cover all scenarios:
    ```
    PipelineErrorHardwareContextReset_PlayingVideo_NotRecovered
    PipelineErrorHardwareContextReset_PlayingVideo_Recovered
    PipelineErrorHardwareContextReset_PausedVideo_NotRecovered
    PipelineErrorHardwareContextReset_PausedVideo_Recovered
    ```

    @xhw...@chromium.org, PTAL agian, thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daoyuan Li
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 15
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Comment-Date: Fri, 06 Mar 2026 18:59:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daoyuan Li (Gerrit)

    unread,
    Mar 6, 2026, 2:10:28 PMMar 6
    to Sangbaek Park, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park and Xiaohan Wang

    Daoyuan Li voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sangbaek Park
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 16
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Fri, 06 Mar 2026 19:10:13 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Wang (Gerrit)

    unread,
    Mar 6, 2026, 3:01:47 PMMar 6
    to Sangbaek Park, Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org

    Xiaohan Wang added 7 comments

    Patchset-level comments
    File-level comment, Patchset 16:
    Xiaohan Wang . resolved

    I like the new approach, which addressed my concern. I have some questions, mostly asking for more clarification. Thanks!

    Commit Message
    Line 32, Patchset 16:media time has advanced since the reset.
    Xiaohan Wang . unresolved

    It's a bit hard to get a clear understanding of all the cases. Can we combine this with line 9-13 and describe the algorithm as a whole? I guess part of the reason is that 9-13 discusses when it's unrecoverable, but here we discuss when it's recoverable...

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 419, Patchset 16: return !(time_difference <= time_difference_tolerance);
    Xiaohan Wang . unresolved

    Instead of !<=, just use >?

    Line 425, Patchset 16: "Media.PipelineStatus.HardwareContextReset.RecoveryResult", is_recovered);
    Xiaohan Wang . unresolved

    nit: If you follow naming convention, this can just be "IsRecovered".

    Line 1982, Patchset 16: // of restart. If the video was paused on the first hardware context reset and
    // the video is still paused, we cannot conclude that this is an
    Xiaohan Wang . unresolved

    If you translate this into code, it's

    `paused_on_hardware_context_reset_ && paused_`

    Bit the check in the code is

    `!paused_on_hardware_context_reset_ && !paused_`

    whose invert is

    `paused_on_hardware_context_reset_ || paused_`

    So there's a mismatch here. Could you please help check what the exact behavior should be?

    Line 1988, Patchset 16: !IsHardwareContextResetRecovered(
    Xiaohan Wang . unresolved

    This function name is a bit misleading. Whether it's recovered depends on not only the media time, but other factors as well (e.g. pause state). If the other comment below makes sense, maybe we don't need this to be a function. Or maybe we can find a better name, e.g. HasMediaTimeSufficentlyElapsed()?

    Line 4166, Patchset 16: pipeline_controller_->GetMediaTime());
    Xiaohan Wang . unresolved

    Since this is reported in WMPI's dtor; I am not sure what it means to still compare media time...

    Does it make sense to just say if we HCR happened (media_time_on_last_hardware_context_reset_.has_value()) but we never send a PIPELINE_ERROR_HARDWARE_CONTEXT_RESET MediaError, then we call it good (recovered)?

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 16
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Comment-Date: Fri, 06 Mar 2026 20:01:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 6, 2026, 5:12:45 PMMar 6
    to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Xiaohan Wang

    Sangbaek Park added 7 comments

    Commit Message
    Line 7, Patchset 9:media: Report hardware-context-reset as an error if not recovered
    Xiaohan Wang . resolved
    Sangbaek Park

    Done

    Line 32, Patchset 16:media time has advanced since the reset.
    Xiaohan Wang . resolved

    It's a bit hard to get a clear understanding of all the cases. Can we combine this with line 9-13 and describe the algorithm as a whole? I guess part of the reason is that 9-13 discusses when it's unrecoverable, but here we discuss when it's recoverable...

    Sangbaek Park

    Done

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 419, Patchset 16: return !(time_difference <= time_difference_tolerance);
    Xiaohan Wang . resolved

    Instead of !<=, just use >?

    Sangbaek Park

    Done

    Line 425, Patchset 16: "Media.PipelineStatus.HardwareContextReset.RecoveryResult", is_recovered);
    Xiaohan Wang . resolved

    nit: If you follow naming convention, this can just be "IsRecovered".

    Sangbaek Park

    Done

    Line 1982, Patchset 16: // of restart. If the video was paused on the first hardware context reset and
    // the video is still paused, we cannot conclude that this is an
    Xiaohan Wang . resolved

    If you translate this into code, it's

    `paused_on_hardware_context_reset_ && paused_`

    Bit the check in the code is

    `!paused_on_hardware_context_reset_ && !paused_`

    whose invert is

    `paused_on_hardware_context_reset_ || paused_`

    So there's a mismatch here. Could you please help check what the exact behavior should be?

    Sangbaek Park

    Great finding! Done. Updated the comment and logic.

    Line 1988, Patchset 16: !IsHardwareContextResetRecovered(
    Xiaohan Wang . resolved

    This function name is a bit misleading. Whether it's recovered depends on not only the media time, but other factors as well (e.g. pause state). If the other comment below makes sense, maybe we don't need this to be a function. Or maybe we can find a better name, e.g. HasMediaTimeSufficentlyElapsed()?

    Sangbaek Park

    Done

    Line 4166, Patchset 16: pipeline_controller_->GetMediaTime());
    Xiaohan Wang . unresolved

    Since this is reported in WMPI's dtor; I am not sure what it means to still compare media time...

    Does it make sense to just say if we HCR happened (media_time_on_last_hardware_context_reset_.has_value()) but we never send a PIPELINE_ERROR_HARDWARE_CONTEXT_RESET MediaError, then we call it good (recovered)?

    Sangbaek Park

    That goes back to the original discussion point where how accurately we want to report this result. PipelineStatus signals come throguh OnError() only. By default, it's PIPELINE_OK. And the problem is once the 1st HCR happened but no subsequent error occurred yet but then we can't tell it is recovered (e.g., the video is stalled and waiting for user action or no streaming data or no new MediaKeySession etc).

    Did you mean we want to report the result right away at the time of OnError() call with the 2nd error there and update a flag like `is_hardware_context_reset_recovery_reported=true`? And then dtor() checks this flag to report the recovery result as false if media_time_on_last_hardware_context_reset_.has_value() is true?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 19
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Fri, 06 Mar 2026 22:12:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Wang (Gerrit)

    unread,
    Mar 6, 2026, 9:12:46 PMMar 6
    to Sangbaek Park, Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park

    Xiaohan Wang added 8 comments

    Patchset-level comments
    File-level comment, Patchset 20 (Latest):
    Xiaohan Wang . resolved

    We had an offline discussion. Other than that there are some nits.

    File media/base/pipeline_status.h
    Line 66, Patchset 20 (Latest): // https://crbug.com/1208618
    Xiaohan Wang . unresolved

    Add the new bug number here as well, since the old bug doesn't catch the new behavior.

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 412, Patchset 20 (Latest): const base::TimeDelta& media_time_on_last_hardware_context_reset,
    Xiaohan Wang . unresolved

    This can just be `previous_media_time` now.

    Line 416, Patchset 20 (Latest): // we should consider this as an unrecoverable error.
    Xiaohan Wang . unresolved

    The comment belongs to the logic on line 1980. This function only compares time and doesn't need this comment.

    Line 417, Patchset 20 (Latest): const auto time_difference_tolerance = base::Milliseconds(100);
    Xiaohan Wang . unresolved

    Use KTimeDifferenceTolerance style for const names.

    Line 1996, Patchset 20 (Latest):
    Xiaohan Wang . unresolved

    drop empty line?

    Line 2009, Patchset 20 (Latest): // Hardware context reset is not an error. Restart to recover.
    Xiaohan Wang . unresolved

    We had an offline discussion, trying to make this logic easier to follow, and similar to the UMA reporting part. Please let me know when you have an update. Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sangbaek Park
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 20
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Comment-Date: Sat, 07 Mar 2026 02:12:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 6, 2026, 9:15:15 PMMar 6
    to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org

    Sangbaek Park added 1 comment

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 4166, Patchset 16: pipeline_controller_->GetMediaTime());
    Xiaohan Wang . unresolved

    Since this is reported in WMPI's dtor; I am not sure what it means to still compare media time...

    Does it make sense to just say if we HCR happened (media_time_on_last_hardware_context_reset_.has_value()) but we never send a PIPELINE_ERROR_HARDWARE_CONTEXT_RESET MediaError, then we call it good (recovered)?

    Sangbaek Park

    That goes back to the original discussion point where how accurately we want to report this result. PipelineStatus signals come throguh OnError() only. By default, it's PIPELINE_OK. And the problem is once the 1st HCR happened but no subsequent error occurred yet but then we can't tell it is recovered (e.g., the video is stalled and waiting for user action or no streaming data or no new MediaKeySession etc).

    Did you mean we want to report the result right away at the time of OnError() call with the 2nd error there and update a flag like `is_hardware_context_reset_recovery_reported=true`? And then dtor() checks this flag to report the recovery result as false if media_time_on_last_hardware_context_reset_.has_value() is true?

    Sangbaek Park

    Summary from the offline discussion:
    1. Report the new UMA as the last pipeline status after the first hardware context reset.
    2. OnError(): if two HCRs occurred within the short period of media time and video is not paused etc, we report the last pipeline status as `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET``. For other error codes, we don't force it to `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET`.
    3. On WMPI dtor(): We report the last pipeline status if the UMA was never reported by OnError() with the first HCR.
    4. Consider reporting the time delta from the first hardware context reset OnError.
    5. For unit tests, if the unit test breaks the infinite loop, it should be enough.

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 20
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Comment-Date: Sat, 07 Mar 2026 02:15:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 9, 2026, 1:25:07 PMMar 9
    to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Xiaohan Wang

    Sangbaek Park added 7 comments

    File media/base/pipeline_status.h

    Add the new bug number here as well, since the old bug doesn't catch the new behavior.

    Sangbaek Park

    Done

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 412, Patchset 20: const base::TimeDelta& media_time_on_last_hardware_context_reset,
    Xiaohan Wang . resolved

    This can just be `previous_media_time` now.

    Sangbaek Park

    Done

    Line 413, Patchset 20: const base::TimeDelta& current_media_time) {
    Xiaohan Wang . resolved
    Sangbaek Park

    Done

    Line 416, Patchset 20: // we should consider this as an unrecoverable error.
    Xiaohan Wang . resolved

    The comment belongs to the logic on line 1980. This function only compares time and doesn't need this comment.

    Sangbaek Park

    Done

    Line 417, Patchset 20: const auto time_difference_tolerance = base::Milliseconds(100);
    Xiaohan Wang . resolved

    Use KTimeDifferenceTolerance style for const names.

    Sangbaek Park

    Done

    Line 1996, Patchset 20:
    Xiaohan Wang . resolved

    drop empty line?

    Sangbaek Park

    Done

    Line 2009, Patchset 20: // Hardware context reset is not an error. Restart to recover.
    Xiaohan Wang . resolved

    We had an offline discussion, trying to make this logic easier to follow, and similar to the UMA reporting part. Please let me know when you have an update. Thanks!

    Sangbaek Park

    Thanks for the discussions! I'll handle these in the other comment: http://crrev.com/c/7609444/comment/a68f7fa3_6876a115/

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 21
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Mar 2026 17:24:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Xiaohan Wang <xhw...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Wang (Gerrit)

    unread,
    Mar 9, 2026, 11:22:25 PMMar 9
    to Sangbaek Park, Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park

    Xiaohan Wang added 1 comment

    Patchset-level comments
    File-level comment, Patchset 23 (Latest):
    Xiaohan Wang . resolved

    Is this CL ready for another round of review? I saw there's one comment outstanding and some bots failing... Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sangbaek Park
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 23
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Comment-Date: Tue, 10 Mar 2026 03:22:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 10, 2026, 11:48:35 AMMar 10
    to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Xiaohan Wang

    Sangbaek Park added 1 comment

    Patchset-level comments
    Xiaohan Wang . resolved

    Is this CL ready for another round of review? I saw there's one comment outstanding and some bots failing... Thanks!

    Sangbaek Park

    Sorry, not ready. The bots failing will be fixed. I'm just trying to add unit tests but very tricky. I'll let you know once it's ready. I might want to merge request as well. Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 23
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Tue, 10 Mar 2026 15:48:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Xiaohan Wang <xhw...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 10, 2026, 5:00:05 PMMar 10
    to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Xiaohan Wang

    Sangbaek Park added 1 comment

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 4166, Patchset 16: pipeline_controller_->GetMediaTime());
    Xiaohan Wang . unresolved

    Since this is reported in WMPI's dtor; I am not sure what it means to still compare media time...

    Does it make sense to just say if we HCR happened (media_time_on_last_hardware_context_reset_.has_value()) but we never send a PIPELINE_ERROR_HARDWARE_CONTEXT_RESET MediaError, then we call it good (recovered)?

    Sangbaek Park

    That goes back to the original discussion point where how accurately we want to report this result. PipelineStatus signals come throguh OnError() only. By default, it's PIPELINE_OK. And the problem is once the 1st HCR happened but no subsequent error occurred yet but then we can't tell it is recovered (e.g., the video is stalled and waiting for user action or no streaming data or no new MediaKeySession etc).

    Did you mean we want to report the result right away at the time of OnError() call with the 2nd error there and update a flag like `is_hardware_context_reset_recovery_reported=true`? And then dtor() checks this flag to report the recovery result as false if media_time_on_last_hardware_context_reset_.has_value() is true?

    Sangbaek Park

    Summary from the offline discussion:
    1. Report the new UMA as the last pipeline status after the first hardware context reset.
    2. OnError(): if two HCRs occurred within the short period of media time and video is not paused etc, we report the last pipeline status as `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET``. For other error codes, we don't force it to `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET`.
    3. On WMPI dtor(): We report the last pipeline status if the UMA was never reported by OnError() with the first HCR.
    4. Consider reporting the time delta from the first hardware context reset OnError.
    5. For unit tests, if the unit test breaks the infinite loop, it should be enough.

    Sangbaek Park

    I've reflected our discussion. I've locally tested and verified. But, I've removed newly added tests since I couldn't make them run correctly due to the complexity of handing 2-3 pipeline errors with play/pause/seek. Please review the updated logic first, @xhw...@chromium.org. Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 24
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Tue, 10 Mar 2026 20:59:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Wang (Gerrit)

    unread,
    Mar 10, 2026, 10:45:12 PMMar 10
    to Sangbaek Park, Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park

    Xiaohan Wang added 5 comments

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 417, Patchset 24 (Latest):void ReportLastPipelineStatusForHardwareContextResetRecoveryUMA(
    Xiaohan Wang . unresolved

    nit: This reports two UMAs, maybe ReportHardwareContextResetRecoveryUMAs?

    If we do this, then rename `is_pipeline_status_reported_after_hardware_context_reset_` to `has_reported_hardware_context_reset_recovery_umas_`.

    Line 421, Patchset 24 (Latest): << ", media_time_diff=" << media_time_diff.InMicrosecondsF() << "ms";
    Xiaohan Wang . unresolved

    "ms" stands for millisecond while the number is microseconds.

    Or you can just do "<< media_time_diff" which will print the duration in seconds in floating point: https://source.chromium.org/chromium/chromium/src/+/main:base/time/time.cc;drc=10b6082ae57b34c1d623275ed00dae987fb2a590;l=91

    Line 1984, Patchset 24 (Latest): // time has advanced since the reset.
    Xiaohan Wang . unresolved

    sufficiently

    Line 1995, Patchset 24 (Latest): }
    Xiaohan Wang . unresolved

    This can be written as the following which might be easier to read:
    ```
    bool can_conclude_recovery_result = !(paused_on_hardware_context_reset_ && paused_);
    ```

    Then this makes me wonder about this case (we touched on this on Friday but didn't discuss further into it):

    • playing (not paused) when 1st HCR happened
    • paused when second HCR happened
    • media time didn't change.

    If we follow the currently logic, "can_conclude_recovery_result" should be true. But it seems to be a bit questionable, since time won't change if the new state is "paused".

    If that makes sense, then we don't need to track `paused_on_hardware_context_reset_`, and only need to check `paused_`, which will actually make the logic a lot simpler.

    WDYT?

    Line 2024, Patchset 24 (Latest): }
    Xiaohan Wang . unresolved

    What if we don't report here, and just leave the destructor to report the last pipeline status? It seems it can work, but I am probably missing some cases...

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sangbaek Park
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 24
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Comment-Date: Wed, 11 Mar 2026 02:45:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 11, 2026, 12:51:53 PMMar 11
    to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Xiaohan Wang

    Sangbaek Park added 6 comments

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 417, Patchset 24:void ReportLastPipelineStatusForHardwareContextResetRecoveryUMA(
    Xiaohan Wang . resolved

    nit: This reports two UMAs, maybe ReportHardwareContextResetRecoveryUMAs?

    If we do this, then rename `is_pipeline_status_reported_after_hardware_context_reset_` to `has_reported_hardware_context_reset_recovery_umas_`.

    Sangbaek Park

    Done

    Line 421, Patchset 24: << ", media_time_diff=" << media_time_diff.InMicrosecondsF() << "ms";
    Xiaohan Wang . resolved

    "ms" stands for millisecond while the number is microseconds.

    Or you can just do "<< media_time_diff" which will print the duration in seconds in floating point: https://source.chromium.org/chromium/chromium/src/+/main:base/time/time.cc;drc=10b6082ae57b34c1d623275ed00dae987fb2a590;l=91

    Sangbaek Park

    Done. Good catch! I'd blaim VSCode auto complete is very aggressive but my mistake.

    Line 1984, Patchset 24: // time has advanced since the reset.
    Xiaohan Wang . resolved

    sufficiently

    Sangbaek Park

    Done

    Line 1995, Patchset 24: }
    Xiaohan Wang . resolved

    This can be written as the following which might be easier to read:
    ```
    bool can_conclude_recovery_result = !(paused_on_hardware_context_reset_ && paused_);
    ```

    Then this makes me wonder about this case (we touched on this on Friday but didn't discuss further into it):

    • playing (not paused) when 1st HCR happened
    • paused when second HCR happened
    • media time didn't change.

    If we follow the currently logic, "can_conclude_recovery_result" should be true. But it seems to be a bit questionable, since time won't change if the new state is "paused".

    If that makes sense, then we don't need to track `paused_on_hardware_context_reset_`, and only need to check `paused_`, which will actually make the logic a lot simpler.

    WDYT?

    Sangbaek Park

    Done. Actually, I prefer this simpler approach. I've removed `paused_on_hardware_context_reset_`.

    Xiaohan Wang . unresolved

    What if we don't report here, and just leave the destructor to report the last pipeline status? It seems it can work, but I am probably missing some cases...

    Sangbaek Park

    What if we don't report here, and just leave the destructor to report the last pipeline status?

    Yes

    How can we report the recovery is successful here? Because this location is OnError() method which is only called when an error occurs. This means we don't know when to conclude the HCR case is recovered until end. All preivous UMAs by WMPI have been only reported in dtor (UKM is the same by dtor of MediaMetricsProvider which is destroyed by WMPI). We might lose some successful recovery cases but other UMAs/UKMs will see the same issues.

    Line 4166, Patchset 16: pipeline_controller_->GetMediaTime());
    Xiaohan Wang . resolved

    Since this is reported in WMPI's dtor; I am not sure what it means to still compare media time...

    Does it make sense to just say if we HCR happened (media_time_on_last_hardware_context_reset_.has_value()) but we never send a PIPELINE_ERROR_HARDWARE_CONTEXT_RESET MediaError, then we call it good (recovered)?

    Sangbaek Park

    That goes back to the original discussion point where how accurately we want to report this result. PipelineStatus signals come throguh OnError() only. By default, it's PIPELINE_OK. And the problem is once the 1st HCR happened but no subsequent error occurred yet but then we can't tell it is recovered (e.g., the video is stalled and waiting for user action or no streaming data or no new MediaKeySession etc).

    Did you mean we want to report the result right away at the time of OnError() call with the 2nd error there and update a flag like `is_hardware_context_reset_recovery_reported=true`? And then dtor() checks this flag to report the recovery result as false if media_time_on_last_hardware_context_reset_.has_value() is true?

    Sangbaek Park

    Summary from the offline discussion:
    1. Report the new UMA as the last pipeline status after the first hardware context reset.
    2. OnError(): if two HCRs occurred within the short period of media time and video is not paused etc, we report the last pipeline status as `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET``. For other error codes, we don't force it to `PIPELINE_ERROR_HARDWARE_CONTEXT_RESET`.
    3. On WMPI dtor(): We report the last pipeline status if the UMA was never reported by OnError() with the first HCR.
    4. Consider reporting the time delta from the first hardware context reset OnError.
    5. For unit tests, if the unit test breaks the infinite loop, it should be enough.

    Sangbaek Park

    I've reflected our discussion. I've locally tested and verified. But, I've removed newly added tests since I couldn't make them run correctly due to the complexity of handing 2-3 pipeline errors with play/pause/seek. Please review the updated logic first, @xhw...@chromium.org. Thanks!

    Sangbaek Park

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 25
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Wed, 11 Mar 2026 16:51:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Wang (Gerrit)

    unread,
    Mar 11, 2026, 3:57:57 PMMar 11
    to Sangbaek Park, Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park

    Xiaohan Wang added 3 comments

    Patchset-level comments
    File-level comment, Patchset 26 (Latest):
    Xiaohan Wang . resolved

    The new logic looks good and clean! I just have one question on the timedelta UMA, and one minor comment on comments.

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 428, Patchset 26 (Latest): media_time_diff);
    Xiaohan Wang . unresolved

    Reporting this timedelta in OnError makes a lot of sense. We are reporting the time delta between HCR and the next error or HCR.

    But reporting it in the destructor feels odd. Destruction can happen any time when there's no error. It feels it could pollute the data? WDYT?

    Line 1982, Patchset 26 (Latest): // If the video was paused on hardware context reset, we consider the
    // recovery successful only if the video is not paused anymore and the media
    // time has advanced sufficiently since the reset.
    // The same hardware context reset (or a different error) occurred within a
    // very short media time window, so we should consider this as an
    // unrecoverable hardware context reset and give up to avoid an infinite loop
    // of restart. If the video is paused, we don't conclude recovery, so we
    // should not give up but keep trying to restart until we recover or the video
    // is unpaused by user.
    Xiaohan Wang . unresolved

    Thanks for the detailed comment. I had some difficulty following the logic in these comments. Here's my try based on my understanding. Does it make sense to you?


    An error or another hardware context reset (HCR) occurred within a very short media time window from the previous HCR and the video is not paused (playing). In this case we consider the recovery attempt from the previous HCR failed. To avoid infinite loop of retrying, we will trigger an error and will not ScheduleRestart(). We gate the logic on short elapsed media time to have more confidence that the error (or another HCR) are related to the previous HCR. We check the paused state because if the video is paused, the media time can't advance.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sangbaek Park
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 26
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Comment-Date: Wed, 11 Mar 2026 19:57:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 11, 2026, 8:16:02 PMMar 11
    to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Xiaohan Wang

    Sangbaek Park added 3 comments

    File third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc
    Line 2170, Patchset 29 (Latest):
    Sangbaek Park . unresolved

    @xhw...@chromium.org, You will see some trybot failures.

    I've verified by adding new unit tests to cover the new behavior. However, the newly added unit tests are failing on trybots. Locally running 20 times doesn't have any issue so looks like there is some timing issue when being destroyed or something else. I'll update here.

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 428, Patchset 26: media_time_diff);
    Xiaohan Wang . resolved

    Reporting this timedelta in OnError makes a lot of sense. We are reporting the time delta between HCR and the next error or HCR.

    But reporting it in the destructor feels odd. Destruction can happen any time when there's no error. It feels it could pollute the data? WDYT?

    Sangbaek Park

    it could pollute the data
    I agree with this. Done not to report the time delta in dtor.

    Line 1982, Patchset 26: // If the video was paused on hardware context reset, we consider the

    // recovery successful only if the video is not paused anymore and the media
    // time has advanced sufficiently since the reset.
    // The same hardware context reset (or a different error) occurred within a
    // very short media time window, so we should consider this as an
    // unrecoverable hardware context reset and give up to avoid an infinite loop
    // of restart. If the video is paused, we don't conclude recovery, so we
    // should not give up but keep trying to restart until we recover or the video
    // is unpaused by user.
    Xiaohan Wang . resolved

    Thanks for the detailed comment. I had some difficulty following the logic in these comments. Here's my try based on my understanding. Does it make sense to you?


    An error or another hardware context reset (HCR) occurred within a very short media time window from the previous HCR and the video is not paused (playing). In this case we consider the recovery attempt from the previous HCR failed. To avoid infinite loop of retrying, we will trigger an error and will not ScheduleRestart(). We gate the logic on short elapsed media time to have more confidence that the error (or another HCR) are related to the previous HCR. We check the paused state because if the video is paused, the media time can't advance.

    Sangbaek Park

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Xiaohan Wang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 29
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 00:15:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Xiaohan Wang <xhw...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Wang (Gerrit)

    unread,
    Mar 11, 2026, 9:18:10 PMMar 11
    to Sangbaek Park, Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Sangbaek Park

    Xiaohan Wang voted and added 3 comments

    Votes added by Xiaohan Wang

    Code-Review+1

    3 comments

    Patchset-level comments
    File-level comment, Patchset 29 (Latest):
    Xiaohan Wang . resolved

    LGTM! Thanks for all the discussions. I didn't review the unit tests in detail and will leave it to you.

    File third_party/blink/renderer/platform/media/web_media_player_impl.cc
    Line 427, Patchset 29 (Latest): base::UmaHistogramTimes(
    "Media.PipelineStatus.HardwareContextResetRecovery."
    "TimeDeltaSinceLastHardwareContextReset",
    media_time_diff.value());
    Xiaohan Wang . resolved

    optional: This is only reported in one place, it might be simpler to just pull this out of the function and report directly in the code...

    Line 2024, Patchset 24: }
    Xiaohan Wang . resolved

    What if we don't report here, and just leave the destructor to report the last pipeline status? It seems it can work, but I am probably missing some cases...

    Sangbaek Park

    What if we don't report here, and just leave the destructor to report the last pipeline status?

    Yes

    How can we report the recovery is successful here? Because this location is OnError() method which is only called when an error occurs. This means we don't know when to conclude the HCR case is recovered until end. All preivous UMAs by WMPI have been only reported in dtor (UKM is the same by dtor of MediaMetricsProvider which is destroyed by WMPI). We might lose some successful recovery cases but other UMAs/UKMs will see the same issues.

    Xiaohan Wang

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sangbaek Park
    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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
    Gerrit-Change-Number: 7609444
    Gerrit-PatchSet: 29
    Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
    Gerrit-Reviewer: Evan Liu <ev...@google.com>
    Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
    Gerrit-Attention: Sangbaek Park <sangba...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Mar 2026 01:17:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Sangbaek Park (Gerrit)

    unread,
    Mar 12, 2026, 2:26:47 PMMar 12
    to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org

    Sangbaek Park added 1 comment

    File third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc
    Line 2170, Patchset 29:
    Sangbaek Park . resolved

    @xhw...@chromium.org, You will see some trybot failures.

    I've verified by adding new unit tests to cover the new behavior. However, the newly added unit tests are failing on trybots. Locally running 20 times doesn't have any issue so looks like there is some timing issue when being destroyed or something else. I'll update here.

    Sangbaek Park

    I found the root cause and fixed it. It was due to the recent change by http://crrev.com/c/chromium/src/+/7609443, which requires to call WMPI's Shutdown() first before reset(). My local repo was behind this change.

    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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
      Gerrit-Change-Number: 7609444
      Gerrit-PatchSet: 31
      Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
      Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
      Gerrit-Reviewer: Evan Liu <ev...@google.com>
      Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
      Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Piet Schouten <Piet.S...@microsoft.com>
      Gerrit-Comment-Date: Thu, 12 Mar 2026 18:26:37 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Sangbaek Park <sangba...@chromium.org>
      satisfied_requirement
      open
      diffy

      Sangbaek Park (Gerrit)

      unread,
      Mar 12, 2026, 2:27:05 PMMar 12
      to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org

      Sangbaek Park voted Commit-Queue+2

      Commit-Queue+2
      Gerrit-Comment-Date: Thu, 12 Mar 2026 18:26:55 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Sangbaek Park (Gerrit)

      unread,
      Mar 12, 2026, 3:35:15 PMMar 12
      to Daoyuan Li, Evan Liu, Piet Schouten, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
      Gerrit-Comment-Date: Thu, 12 Mar 2026 19:35:03 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Mar 12, 2026, 7:23:55 PMMar 12
      to Sangbaek Park, Daoyuan Li, Evan Liu, Piet Schouten, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-...@chromium.org, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org

      Chromium LUCI CQ submitted the change with unreviewed changes

      Unreviewed changes

      29 is the latest approved patch-set.
      The change was submitted with unreviewed changes in the following files:

      ```
      The name of the file: third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc
      Insertions: 58, Deletions: 8.

      The diff is too large to show. Please review the diff.
      ```

      Change information

      Commit message:
      media: Report hardware-context-reset as an error if not recovered

      If the same hardware context reset (or a different error) occurred
      within a very short media time window, so we should consider this as an

      unrecoverable hardware context reset and give up to avoid an infinite
      loop of restart:
      - If the video has been playing during the subsequent error, we will
      report PIPELINE_ERROR_HARDWARE_CONTEXT_RESET(23) error code via
      MediaError.
      - If a subsequent error occurs, we can conclude whether it's recovered
      nor not only when the video is not paused. In this case, we update the
      last media time of hardware context reset.

      Example error message:
      ```
      video.error.code: MEDIA_ERR_DECODE
      video.error.message: PipelineStatus::PIPELINE_ERROR_HARDWARE_CONTEXT_RESET: MediaFoundationRenderer error: kFailedToSetOutputRect (Error (0x13D) while retrieving error. (0x8004CD12))
      ```

      Also verified error code 23 (PIPELINE_ERROR_HARDWARE_CONTEXT_RESET) is
      reported in this case:
      ```
      - Histogram: Media.PipelineStatus.AudioVideo.H264.MediaFoundationRenderer recorded 1 samples, mean = 23.0 (flags = 0x41) [#]
      0 ...
      23 -O (1 = 100.0%) {0.0%}
      24 ...
      ```

      The new UMA
      `Media.PipelineStatus.HardwareContextResetRecovery.LastPipelineStatus`
      is reported to tell the last pipeline status after hardware context
      reset. This will be PIPELINE_OK if recovered. This will be
      PIPELINE_ERROR_HARDWARE_CONTEXT_RESET if unrecovered by a subsequent
      error within a very short media time window. If a different error
      occurs outside of the time window, that error will be reported.
      `*.TimeDeltaSinceLastHardwareContextReset` will be reported together,
      indicating the media time difference since the last hardware context
      reset error. For example,
      ```
      - Histogram: Media.PipelineStatus.HardwareContextResetRecovery.LastPipelineStatus recorded 2 samples, mean = 11.5 (flags = 0x41) [#]
      0 -O (1 = 50.0%)
      1 ...
      23 -O (1 = 50.0%) {50.0%}
      24 ...

      - Histogram: Media.PipelineStatus.HardwareContextResetRecovery.TimeDeltaSinceLastHardwareContextReset recorded 2 samples, mean = 0.0 (flags = 0x41) [#]
      0 --O (2 = 100.0%)
      1 ...
      ```

      Updated the existing unit test for the new behavior:
      `WebMediaPlayerImplTest.PipelineErrorHardwareContextReset_Twice`

      Added new unit tests:
      ```
      PipelineErrorHardwareContextReset_PlayingVideo_NotRecovered
      PipelineErrorHardwareContextReset_PlayingVideo_Recovered
      PipelineErrorHardwareContextReset_PausedVideo_InconclusiveRecovery
      PipelineErrorHardwareContextReset_PausedVideo_Recovered
      ```
      Bug: 492147920, b:474674985
      Change-Id: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
      Reviewed-by: Daoyuan Li <daoy...@microsoft.com>
      Commit-Queue: Sangbaek Park <sangba...@chromium.org>
      Reviewed-by: Evan Liu <ev...@google.com>
      Reviewed-by: Xiaohan Wang <xhw...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1598765}
      Files:
      • M media/base/pipeline_status.h
      • M third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc
      • M third_party/blink/renderer/platform/media/web_media_player_impl.cc
      • M third_party/blink/renderer/platform/media/web_media_player_impl.h
      • M tools/metrics/histograms/metadata/media/histograms.xml
      Change size: L
      Delta: 5 files changed, 670 insertions(+), 19 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Evan Liu, +1 by Xiaohan Wang, +1 by Daoyuan Li
      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: I9624308ff3a3221eb9e4058d8d4f0fcc507a3173
      Gerrit-Change-Number: 7609444
      Gerrit-PatchSet: 32
      Gerrit-Owner: Sangbaek Park <sangba...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Daoyuan Li <daoy...@microsoft.com>
      Gerrit-Reviewer: Evan Liu <ev...@google.com>
      Gerrit-Reviewer: Sangbaek Park <sangba...@chromium.org>
      Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages