New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 664007 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

https://ride.uber.com scrolling background video flashes

Project Member Reported by djkurtz@chromium.org, Nov 10 2016

Issue description

Forked from https://code.google.com/p/chrome-os-partner/issues/detail?id=59313

Chrome Version: >= 54.0.2840.15
Chrome OS Version: >= 8743.15.0
Chrome OS Platform: any (repro on elm, peach_pi, samus)

Steps To Reproduce:
(1) https://ride.uber.com
(2) wait for vertical scrolling background video
(3)

Expected Result:

No black flashes.

Actual Result:

The vertical video strips 'flash' - sometimes the vertical video strips are transparent, exposing the "black with white square" background (this is the same image shown between white screen animation and the video strips).

How frequently does this problem reproduce? (Always, sometimes, hard to
reproduce?)

Always.

Reproduced on:

 peach_pi (ARM Mali GPU) (@ 8791.0.0 / 55.0.2857.0)
 samus    (Intel GPU) (@ 8743.83.0 / 54.0.2840.93) - although much less frequent; usually only after resizing window to less than full screen

What is the impact to the user, and is there a workaround? If so, what is
it?

Poor experience on https://ride.uber.com

Please provide any additional information below. Attach a screen shot or
log if possible.

This issue is caused by this Chrome CL:

8d9a5f91b19c30f88e0a9812abf2e936a38dbd0b is the first bad commit
commit 8d9a5f91b19c30f88e0a9812abf2e936a38dbd0b
Author: Sunny Sachanandani <sunnyps@chromium.org>
Date:   Tue Sep 6 11:59:55 2016 -0700

    Reland of Default enable main frame before activation and remove finch experiment. (patchset #1 id:1 of https://codereview.chromium.org/2170233002/ )
    
    Reason for revert:
    Relanding after fixing android webview issues
    
    Original issue's description:
    > Revert of Default enable main frame before activation and remove finch experiment. (patchset #1 id:1 of https://codereview.chromium.org/2159103008/ )
    >
    > Reason for revert:
    > Speculative revert for failing WebView tests on Lollipop:
    >
    > https://build.chromium.org/p/chromium.android/builders/Lollipop%20Phone%20Tester/builds/5794
    > https://build.chromium.org/p/chromium.android/builders/Lollipop%20Tablet%20Tester/builds/4054
    >
    > Both phone and tablet started failing and this is the most "suspicious" change.  boliu@ can help investigate further assuming this holds true.
    >
    > Original issue's description:
    > > Default enable main frame before activation and remove finch experiment.
    > >
    > > The finch experiment hasn't revealed any regressions other than in page
    > > load times which has been deemed a blink scheduler issue (see
    > > crbug.com/614482).
    > >
    > > R=piman@chromium.org,rkaplow@chromium.org
    > > BUG= 612596 
    > >
    > > Committed: https://crrev.com/45041a7e286c665ab14d8ae0b182e1c11cef65ed
    > > Cr-Commit-Position: refs/heads/master@{#406916}
    >
    > TBR=piman@chromium.org,rkaplow@chromium.org,sunnyps@chromium.org
    > # Skipping CQ checks because original CL landed less than 1 days ago.
    > NOPRESUBMIT=true
    > NOTREECHECKS=true
    > NOTRY=true
    > BUG= 612596 
    >
    > Committed: https://crrev.com/2863590ee8e57543f646f4308130765afb02bd44
    > Cr-Commit-Position: refs/heads/master@{#407003}
    
    TBR=piman@chromium.org,rkaplow@chromium.org,tedchoc@chromium.org
    BUG= 612596 
    
    Review-Url: https://codereview.chromium.org/2184243003
    Cr-Commit-Position: refs/heads/master@{#416402}
    (cherry picked from commit 398642c9f408c394cd87564780b64602e8d310f9)
    
    Review URL: https://codereview.chromium.org/2316743002 .

Appending --disable-main-frame-before-activation to /etc/chrome_dev.conf, fixes the flicker on latest-canary (R56-8970.0.0 / 56.0.2910.0).

 
Status: Started (was: Assigned)
I'll take a look at this today.
Cc: vmp...@chromium.org enne@chromium.org
I was able to reproduce on samus 56.0.2905.0 but not on minnie 55.0.2878.0

Trace from samus attached. The page uses a timer for DOM update/layout in addition to rAF.

enne/vmpstr: Can you take a look at the trace and tell me if anything stands out? I suspect there's some shared state used for raster/draw between blink and compositor that's being updated outside of commit.
trace_uber.json.gz
4.7 MB Download

Comment 4 by enne@chromium.org, Nov 10 2016

Cc: chrishtr@chromium.org pdr@chromium.org
The only thing that looks suspicious is PaintLayerCompositor::updateIfNeededRecursive that happens with the timer but then not again during the begin frame.  I wonder if there's some missing dirty flag, where something in the Blink compositing code needs to be updated again or is updated incorrectly.

If it were me, I'd hack PaintLayerCompositor to always say that it needed updating and see if that changed anything.
ubertracing.png
83.7 KB View Download
Trace with MFBA disabled attached.


trace_MFBA_disabled.json.gz
5.9 MB Download
I removed the early out here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp?rcl=0&l=385

  if (updateType == CompositingUpdateNone)
    return;

However, the bug still reproduces. Attached trace shows that paint update happens in every BeginMainFrame.
trace_force_paint_update.json.gz
4.2 MB Download
Cc: ericrk@chromium.org
The black flashes are correlated with extra UDP/PrepareTiles calls in between commits. If I force the scheduler to PrepareTiles in every frame's deadline I can increase the frequency of the black flashes. If I remove PrepareTiles from the scheduler, the black flashes go away.

vmpstr@ suggested debugging missing paint by enabling some debug options in RasterSource. That ruled out missing paint.

If I enable debug borders in dev tools, the same tiles flash red which means they are OOM. I collected a memory-infra trace (attached) which shows that cc memory usage is ~500 MB for that tab and most of it is image memory.

+ ericrk@
trace_memory.json.gz
6.9 MB Download

Comment 8 by ericrk@chromium.org, Nov 15 2016

Thanks for the trace! - a few things I notice:

- Image memory is from the SW controller, and appears to all be unlocked discardable memory. This *should* be free, but it's possible that due to fragmentation/etc, it's not actually free on ChromeOS. It appears that there is a *lot* of discarded memory in the controller as well, indicating that we do have memory pressure and are pushing a lot through the discardable cache.

- There seems to be about ~230mb of tile memory (from all processes) - this seems like it should be fine, but is on the high side.

I'll look a bit more in a bit.

Comment 9 by ericrk@chromium.org, Nov 15 2016

Also, FWIW, enne reminded me that the Tile Manager running out of memory doesn't mean the system is out of memory, just that we're running up against our somewhat arbitrary limit. So Images/other tile managers are likely not the cause.

It seems likely that the page in question just generates too much tile content for us to successfully draw.

Comment 10 by enne@chromium.org, Nov 15 2016

Pages running out of tile memory comes up every once in a while.  There may be some better way to handle this in the pre-slimming paint v2 short term, though.
IIRC, the tile memory limit is 512mb per renderer. This means if there's a tree that takes over 256mb and we create a second tree with something like a full invalidation, we're going to run out and activate to checkerboards...

On cros, we should be occluding content so that we don't rasterize too much as well. enne@, did you have some solutions in mind?
If I force PrepareTiles on every draw and turn off MFBA, I can still reproduce the bug although less frequently.
Found the cause:

1. Enter high latency mode.
2. Draw and PrepareTiles.
< No tile priorities modified >
3. Commit.

LTHI::CommitComplete calls NotifyReadyToActivate because tile priorities haven't been modified.

Forcing PrepareTiles after every draw and reducing the time e.g. capture a frame viewer trace :-) between steps 2 & 3 helps for repro.

The bug is fixed if I comment out the early out for tile_priorities_dirty_ in LTHI::PrepareTiles (https://cs.chromium.org/chromium/src/cc/trees/layer_tree_host_impl.cc?rcl=0&l=486).

Why this happens with MFBA?
MFBA forces the compositor into a heavily pipelined state to maximize throughput which makes it more likely that tile priorities aren't modified between steps 2 & 3. MFBA also makes PrepareTiles after draw more likely.

I think we need TileManager to expose if it's expecting activation/draw and not issue those signals in LTHI::CommitComplete on PrepareTiles early out if that's the case.

Comment 14 by enne@chromium.org, Nov 16 2016

Excellent investigation! Are you saying that there's some new content from the commit and because there's no PrepareTiles call, that once it activates (and PrepareTiles then) it's just racing rasterization against the draw?
Project Member

Comment 15 by bugdroid1@chromium.org, Nov 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53fabb1f55e8db09a8bd53ca7af11c2c96667af3

commit 53fabb1f55e8db09a8bd53ca7af11c2c96667af3
Author: sunnyps <sunnyps@chromium.org>
Date: Wed Nov 23 20:23:20 2016

cc: Force update tile priorities for pending tree tiling set on commit.

Forcing |UpdateTilePriorities| for pending tree tiling sets to prevent
checkerboarding for cases where compositor is heavily pipelined. In
these cases it's possible for a commit to happen after |PrepareTiles| is
called during draw. The commit then skips |PrepareTiles| and activates
the pending tree causing checkerboarding.

|PrepareTiles| is skipped because of a |PictureLayerTilingSet| early out
optimization that relies on frame time and viewport to avoid updating
tiles. To fix this the tile priorities are always updated on commit.

BUG= 664007 
R=vmpstr@chromium.org
TEST=unittest + manual testing on samus
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2529533002
Cr-Commit-Position: refs/heads/master@{#434236}

[modify] https://crrev.com/53fabb1f55e8db09a8bd53ca7af11c2c96667af3/cc/tiles/picture_layer_tiling_set.cc
[modify] https://crrev.com/53fabb1f55e8db09a8bd53ca7af11c2c96667af3/cc/tiles/picture_layer_tiling_set_unittest.cc

Labels: Merge-Request-56
Does this warrant a merge to M55?

Comment 18 by dimu@chromium.org, Nov 28 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Project Member

Comment 19 by bugdroid1@chromium.org, Nov 28 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c42c5358255976cf362d5bda542107bcbef52af6

commit c42c5358255976cf362d5bda542107bcbef52af6
Author: Sunny Sachanandani <sunnyps@chromium.org>
Date: Mon Nov 28 23:27:23 2016

cc: Force update tile priorities for pending tree tiling set on commit.

Forcing |UpdateTilePriorities| for pending tree tiling sets to prevent
checkerboarding for cases where compositor is heavily pipelined. In
these cases it's possible for a commit to happen after |PrepareTiles| is
called during draw. The commit then skips |PrepareTiles| and activates
the pending tree causing checkerboarding.

|PrepareTiles| is skipped because of a |PictureLayerTilingSet| early out
optimization that relies on frame time and viewport to avoid updating
tiles. To fix this the tile priorities are always updated on commit.

BUG= 664007 
R=vmpstr@chromium.org
TEST=unittest + manual testing on samus
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2529533002
Cr-Commit-Position: refs/heads/master@{#434236}
(cherry picked from commit 53fabb1f55e8db09a8bd53ca7af11c2c96667af3)

Review URL: https://codereview.chromium.org/2538593002 .

Cr-Commit-Position: refs/branch-heads/2924@{#140}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/c42c5358255976cf362d5bda542107bcbef52af6/cc/tiles/picture_layer_tiling_set.cc
[modify] https://crrev.com/c42c5358255976cf362d5bda542107bcbef52af6/cc/tiles/picture_layer_tiling_set_unittest.cc

Labels: Merge-Request-55
Labels: -Hotlist-Merge-Approved

Comment 22 by dimu@chromium.org, Nov 29 2016

Labels: -Merge-Request-55 Merge-Review-55 Hotlist-Merge-Review
[Automated comment] Less than 2 weeks to go before stable on M55, manual review required.
Status: Fixed (was: Started)
Change landed in 57.0.2931.0 / 9023.0.0.
Change landed in 56.0.2924.10 / 9000.11.0.

I verified this is fixed on elm in 9035.0.0.
Cc: gov...@chromium.org bhthompson@chromium.org amineer@chromium.org
Status: Started (was: Fixed)
TPMs, did you get a chance to look at this merge for M55? I'm guessing it's too late for M55.
At this point I would agree, we are about to cut our stable RC, unless we believe this to be particularly safe and necessary punting to 56 seems reasonable.
Labels: -Hotlist-Merge-Review -Merge-Review-55
Removing the M55 merge request for now.
Status: Fixed (was: Started)
Components: -Internals>Graphics
Moving old issues out of Internal>Graphics to delete this obsolete component ( crbug.com/685425  for details)

Comment 29 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Verified on 9592.0.0/60.0.3112.64
Status: Verified (was: Fixed)

Sign in to add a comment