Bug 145733 - REGRESSION (r181720): Unnecessary layout triggered any time animated GIF advances to a new frame
Summary: REGRESSION (r181720): Unnecessary layout triggered any time animated GIF adva...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-06-06 22:01 PDT by Darin Adler
Modified: 2015-06-07 19:39 PDT (History)
9 users (show)

See Also:


Attachments
Patch (10.31 KB, patch)
2015-06-06 22:09 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-mavericks (531.36 KB, application/zip)
2015-06-06 22:43 PDT, Build Bot
no flags Details
Patch (3.10 KB, patch)
2015-06-06 23:07 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-mavericks (537.32 KB, application/zip)
2015-06-06 23:40 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews107 for mac-mavericks-wk2 (614.12 KB, application/zip)
2015-06-07 00:08 PDT, Build Bot
no flags Details
Patch (10.31 KB, patch)
2015-06-07 14:54 PDT, Darin Adler
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-mavericks (530.52 KB, application/zip)
2015-06-07 15:28 PDT, Build Bot
no flags Details
Patch (15.07 KB, patch)
2015-06-07 17:35 PDT, Darin Adler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2015-06-06 22:01:40 PDT
REGRESSION (r181720): Unnecessary layout triggered any time animated GIF advances to a new frame
Comment 1 Darin Adler 2015-06-06 22:09:58 PDT
Created attachment 254425 [details]
Patch
Comment 2 Darin Adler 2015-06-06 22:11:00 PDT
<rdar://problem/21177253>
Comment 3 Darin Adler 2015-06-06 22:13:26 PDT
I had a *much* bigger patch, but then when it failed some tests I decided to scale back and concentrate on testing and fixing just this regression.
Comment 4 Build Bot 2015-06-06 22:43:18 PDT
Comment on attachment 254425 [details]
Patch

Attachment 254425 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5420209930240000

New failing tests:
fast/images/animated-gif-no-layout.html
Comment 5 Build Bot 2015-06-06 22:43:22 PDT
Created attachment 254426 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 6 Darin Adler 2015-06-06 22:59:36 PDT
Damn, looks like the test failed on the WebKit1 bot but succeeded on the WebKit2 bot. I predict I could make it pass by making the delay constant in the test longer, but of course that would make Alexey unhappy. I wonder what we should do with this.
Comment 7 Darin Adler 2015-06-06 23:01:14 PDT
Yes, looking at the result I can see that the timer for the second stage of the test fired before the GIF advanced to a new frame, and that’s why the test failed. So a longer timer or faster GIF animation would be the pragmatic solution; not sure what the real long term solution would be.
Comment 8 Darin Adler 2015-06-06 23:07:15 PDT
Created attachment 254428 [details]
Patch
Comment 9 Build Bot 2015-06-06 23:40:30 PDT
Comment on attachment 254428 [details]
Patch

Attachment 254428 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5374759915225088

New failing tests:
fast/images/animated-gif-no-layout.html
Comment 10 Build Bot 2015-06-06 23:40:33 PDT
Created attachment 254429 [details]
Archive of layout-test-results from ews103 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 11 Build Bot 2015-06-07 00:08:46 PDT
Comment on attachment 254428 [details]
Patch

Attachment 254428 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5284660091289600

New failing tests:
fast/images/animated-gif-no-layout.html
Comment 12 Build Bot 2015-06-07 00:08:51 PDT
Created attachment 254431 [details]
Archive of layout-test-results from ews107 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 13 David Kilzer (:ddkilzer) 2015-06-07 06:36:43 PDT
(In reply to comment #8)
> Created attachment 254428 [details]
> Patch

There are no code changes with this patch, only a layout test.
Comment 14 Alexey Proskuryakov 2015-06-07 11:35:53 PDT
With the number of timers involved in this test, it seems nearly impossible to reason about its behavior. I would suggest some extra heavy local testing:

run-webkit-tests the-test.html --guard-malloc --repeat 10000 -f --child-processes 15 (the number should be well above the number of cores including hyperthreading, so something like 40 for a 12-core Mac Pro).

Plus a few variations - same but WK1, without GuardMalloc, maybe with --leaks. If the test can't survive that, chances are that it won't do good in regular testing. 

We should make EWS do that for all new tests.
Comment 15 Alexey Proskuryakov 2015-06-07 11:41:07 PDT
Long running tests that are mostly idle waiting for a timer are not a huge problem. With enough RAM, we run as many test processes as there are virtual cores, which is somewhat excessive, given that there are other processes involved, and that hyperthreading only kicks in when the main thread of execution stalls. 

So a test that takes 500ms shouldn't make the whole test suite 500ms slower, I think.
Comment 16 Darin Adler 2015-06-07 14:52:59 PDT
I did a lot of local testing but I realize now it was all WebKit 2.
Comment 17 Darin Adler 2015-06-07 14:53:37 PDT
(In reply to comment #13)
> There are no code changes with this patch, only a layout test.

Oops! That’s the real reason the test is failing. I forgot the bug fix in this second patch!
Comment 18 Darin Adler 2015-06-07 14:54:41 PDT
Created attachment 254451 [details]
Patch
Comment 19 Darin Adler 2015-06-07 14:56:58 PDT
If we still experience any test flakiness, I suspect a longer delay will do the trick. I’m going to try Alexey’s recipe for stress testing the test. There really aren’t as many timers involved as you might think. The “force layout” stuff takes the timing of the layout timer out of the equation so it’s possibly just the GIF animation frame timer and the timeout in the test itself that are racing.
Comment 20 Build Bot 2015-06-07 15:28:48 PDT
Comment on attachment 254451 [details]
Patch

Attachment 254451 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5710859359748096

New failing tests:
fast/images/animated-gif-no-layout.html
Comment 21 Build Bot 2015-06-07 15:28:51 PDT
Created attachment 254453 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 22 Darin Adler 2015-06-07 16:47:46 PDT
So the test works with WebKit 2 and not WebKit 1. It’s not a raciness issue necessarily.
Comment 23 Darin Adler 2015-06-07 17:18:04 PDT
Here’s what I’ve learned:

The test I based this new test on, gif-loop-count.html, doesn’t actually test anything unless it’s run as a pixel test. It passes when run as a pixel test under WebKit 2, but fails when run as a pixel test under WebKit 1. So it seems that animated GIFs don’t animate inside DumpRenderTree. That’s not new to this test, just wasn’t noticed before.
Comment 24 Darin Adler 2015-06-07 17:35:16 PDT
Created attachment 254464 [details]
Patch
Comment 25 Andreas Kling 2015-06-07 18:31:51 PDT
Comment on attachment 254464 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=254464&action=review

r=me

> Source/WebCore/testing/Internals.idl:301
> +    readonly attribute unsigned long layoutCount;

Shouldn't this be "unsigned int" instead of "unsigned long"?
This is a nice addition btw, we should make more tests using it :)
Comment 26 Darin Adler 2015-06-07 18:49:53 PDT
Comment on attachment 254464 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=254464&action=review

>> Source/WebCore/testing/Internals.idl:301
>> +    readonly attribute unsigned long layoutCount;
> 
> Shouldn't this be "unsigned int" instead of "unsigned long"?
> This is a nice addition btw, we should make more tests using it :)

No, it's a quirk of IDL that unsigned long in the IDL file is how you write bindings for something that is unsigned int in our C++. Would be nice to fix that some day. I think it's because IDL was developed a long time ago and used short to mean 16 bit and long to mean 32 bit.
Comment 27 WebKit Commit Bot 2015-06-07 19:39:45 PDT
Comment on attachment 254464 [details]
Patch

Clearing flags on attachment: 254464

Committed r185310: <http://trac.webkit.org/changeset/185310>
Comment 28 WebKit Commit Bot 2015-06-07 19:39:54 PDT
All reviewed patches have been landed.  Closing bug.