Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Issue 861213003: Fix problems with flakes in SVG LayoutTests by reordering arithmetic. (Closed)

Created:
5 years, 11 months ago by Daniel Bratell
Modified:
5 years, 11 months ago
Reviewers:
pdr., Stephen Chennney, fs
CC:
blink-reviews, blink-reviews-rendering, zoltan1, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, kouhei+svg_chromium.org, fs, Dominik Röttsches, ed+blinkwatch_opera.com, krit, f(malita), gyuyoung.kim_webkit.org, jchaffraix+rendering, Stephen Chennney, rwlbuis, pdr+svgwatchlist_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix problems with flakes in SVG LayoutTests by reordering arithmetic. This operation gives 4.99999952: float(25 + 200 * double(1.f*(-10.0f/100.f))) This operation gives 5.00000000: float(25 + 200 * float(1.f*(-10.0f/100.f))) Why 4.99999952 appear only sometimes, and only on Windows, is not fully known. A suspect is that it's related to the 32-bit ABI which requires use of x87 for passing floats. That combined with various inlining decisions and context switches could possibly affect the final value in a way that makes it seem random. The fix in this patch is to reorder some operations. Using the example above it will be changed to: float(25 + (200 * 1.f * -10.f) / 100.f) By delaying the dangerous division, every intermediate value will be representable by a float with no errors. This won't solve all floating point errors but it will solve the one that causes the most common CQ flakes. BUG=438282 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=188871

Patch Set 1 : Remove a bit more of the test code. #

Patch Set 2 : Renamed method. #

Patch Set 3 : Taught testcases that 100 + 20% is 120, not 121. #

Patch Set 4 : Updated a text test too. #

Total comments: 4

Patch Set 5 : One more 111 -> 110 #

Patch Set 6 : Updating tests for Mac and Linux as well. #

Total comments: 8

Patch Set 7 : With review feedback #

Total comments: 4

Patch Set 8 : Compiler warning. #

Patch Set 9 : Removing stray ; #

Patch Set 10 : Rephrased comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -128 lines) Patch
M LayoutTests/TestExpectations View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M LayoutTests/platform/linux/svg/batik/text/smallFonts-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/platform/linux/svg/custom/recursive-filter-expected.txt View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/platform/linux/svg/filters/feColorMatrix-values-expected.txt View 1 2 3 4 5 6 chunks +7 lines, -7 lines 0 comments Download
M LayoutTests/platform/mac/svg/batik/text/textEffect-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/platform/mac/svg/custom/recursive-filter-expected.txt View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/platform/mac/svg/filters/feColorMatrix-values-expected.txt View 1 2 3 4 5 7 chunks +8 lines, -8 lines 0 comments Download
M LayoutTests/platform/win/svg/batik/text/smallFonts-expected.txt View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/platform/win/svg/batik/text/textEffect-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/platform/win/svg/custom/recursive-filter-expected.txt View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/platform/win/svg/filters/feColorMatrix-values-expected.txt View 1 2 7 chunks +8 lines, -8 lines 0 comments Download
M LayoutTests/svg/custom/empty-merge-expected.txt View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/svg/custom/feDisplacementMap-01-expected.txt View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/svg/custom/resource-invalidate-on-target-update-expected.txt View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/svg/filters/animate-fill-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feColorMatrix-default-type-expected.txt View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/svg/filters/feColorMatrix-saturate-expected.txt View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/svg/filters/feImage-change-target-id-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-objectBoundingBox-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-filterUnits-objectBoundingBox-primitiveUnits-userSpaceOnUse-expected.txt View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/svg/filters/feImage-multiple-targets-id-change-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/svg/filters/feImage-position-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/svg/filters/feImage-preserveAspectratio-expected.txt View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/svg/filters/feImage-reference-invalidation-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-reference-svg-primitive-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-remove-target-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-subregions-expected.txt View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M LayoutTests/svg/filters/feImage-subregions-preseveAspectRatio-none-expected.txt View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M LayoutTests/svg/filters/feImage-subregions-preseveAspectRatio-none-with-viewBox-expected.txt View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/svg/filters/feImage-target-add-to-document-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-attribute-change-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-attribute-change-with-use-indirection-2-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-attribute-change-with-use-indirection-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-changes-id-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-id-change-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-inline-style-change-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-property-change-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-remove-from-document-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/feImage-target-style-change-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/fecomposite-region-expected.txt View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M LayoutTests/svg/filters/filter-hidden-content-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/filter-placement-issue-expected.txt View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M LayoutTests/svg/filters/filterRes-expected.txt View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/svg/filters/filteredImage-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/svg/filters/innershadow-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/filters/invalidate-on-child-layout-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/svg/filters/parent-children-with-same-filter-expected.txt View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/rendering/svg/SVGTextLayoutEngineBaseline.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGLength.h View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/svg/SVGLength.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +26 lines, -5 lines 0 comments Download
M Source/core/svg/SVGLengthContext.h View 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/svg/SVGLengthContext.cpp View 1 2 3 4 5 6 7 8 3 chunks +21 lines, -6 lines 0 comments Download

Messages

Total messages: 18 (4 generated)
Daniel Bratell
This is a non-strange change to make the flakiness go away. It solves the case ...
5 years, 11 months ago (2015-01-21 17:44:28 UTC) #3
Daniel Bratell
On 2015/01/21 17:44:28, Daniel Bratell wrote: > This is a non-strange change to make the ...
5 years, 11 months ago (2015-01-22 10:28:26 UTC) #4
fs
Personally I think I'd prefer to just do the "/ 100" explicitly where necessary (since ...
5 years, 11 months ago (2015-01-22 12:37:36 UTC) #5
Daniel Bratell
Please take a new look. https://codereview.chromium.org/861213003/diff/120001/Source/core/svg/SVGLength.cpp File Source/core/svg/SVGLength.cpp (right): https://codereview.chromium.org/861213003/diff/120001/Source/core/svg/SVGLength.cpp#newcode206 Source/core/svg/SVGLength.cpp:206: float SVGLength::scaleByPercentage(float input) const ...
5 years, 11 months ago (2015-01-22 13:13:44 UTC) #6
fs
LGTM, but please allow for pdr to have a look too. https://codereview.chromium.org/861213003/diff/120001/Source/core/svg/SVGLength.cpp File Source/core/svg/SVGLength.cpp (right): ...
5 years, 11 months ago (2015-01-22 14:06:36 UTC) #7
Daniel Bratell
https://codereview.chromium.org/861213003/diff/140001/Source/core/svg/SVGLengthContext.cpp File Source/core/svg/SVGLengthContext.cpp (right): https://codereview.chromium.org/861213003/diff/140001/Source/core/svg/SVGLengthContext.cpp#newcode206 Source/core/svg/SVGLengthContext.cpp:206: float resultValue; On 2015/01/22 14:06:36, fs wrote: > Nit: ...
5 years, 11 months ago (2015-01-22 14:15:46 UTC) #8
Daniel Bratell
pdr, if you don't mind this change, then feel free to use the Commit checkbox. ...
5 years, 11 months ago (2015-01-22 14:16:41 UTC) #9
Stephen Chennney
These are old comments I had when I looked at it. I don't know why ...
5 years, 11 months ago (2015-01-22 21:57:25 UTC) #11
Daniel Bratell
https://codereview.chromium.org/861213003/diff/80001/Source/core/svg/SVGLength.cpp File Source/core/svg/SVGLength.cpp (right): https://codereview.chromium.org/861213003/diff/80001/Source/core/svg/SVGLength.cpp#newcode188 Source/core/svg/SVGLength.cpp:188: // 100% = 100.0 instead of 1.0 for historical ...
5 years, 11 months ago (2015-01-23 08:49:40 UTC) #12
Daniel Bratell
5 years, 11 months ago (2015-01-23 08:49:44 UTC) #13
fs
Still LGTM
5 years, 11 months ago (2015-01-23 09:05:18 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/861213003/200001
5 years, 11 months ago (2015-01-23 09:28:07 UTC) #16
commit-bot: I haz the power
Committed patchset #10 (id:200001) as https://src.chromium.org/viewvc/blink?view=rev&revision=188871
5 years, 11 months ago (2015-01-23 10:09:15 UTC) #17
pdr.
5 years, 11 months ago (2015-01-23 21:59:27 UTC) #18
Message was sent while issue was closed.
On 2015/01/22 at 14:16:41, bratell wrote:
> pdr, if you don't mind this change, then feel free to use the Commit checkbox.
It's the most common flake by far so if this fixes things (I think they will),
it will make people very happy.

I apologize for being slow. Had jury duty earlier this week (mandatory civil
service in the US, also may continue for the next month, TBD). This change looks
great, LGTM

Powered by Google App Engine
This is Rietveld 408576698