RESOLVED FIXED 72254
[GTK] Rounding errors on 32-bit machines causes tests to fail
https://bugs.webkit.org/show_bug.cgi?id=72254
Summary [GTK] Rounding errors on 32-bit machines causes tests to fail
vanuan
Reported 2011-11-14 02:07:14 PST
Many SVG tests are failing on 32 bit Gtk build. I've managed to have all rounding related tests pass by using these additional flags: Index: GNUmakefile.am =================================================================== --- GNUmakefile.am (revision 99472) +++ GNUmakefile.am (working copy) @@ -116,7 +116,8 @@ -Wformat -Wformat-security -Wno-format-y2k -Wundef \ -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \ -Wno-unused-parameter -Wno-parentheses \ - -fno-exceptions -DENABLE_GLIB_SUPPORT=1 + -fno-exceptions -DENABLE_GLIB_SUPPORT=1 \ + -march=pentium4 -msse2 -mfpmath=sse global_cxxflags += \ The description of these flags and why they are needed is here: http://codesearch.google.com/codesearch/p?hl=en#OAMlx_jo-ck/src/build/common.gypi&q=file:build/common.gypi&exact_package=chromium&l=1718 Martin Robinson suggested that I should modify Tools/Scripts/webkitdirs.pm to ensure that this work-around only be applied when building via build-webkit. But I'm not sure how to do that. How can we pass cppflags to autogen scripts from Tools/Scripts/webkitdirs.pm ?
Attachments
proposed patch (1.83 KB, patch)
2011-12-15 02:32 PST, Philippe Normand
mrobinson: review+
svg rebaseline (40.18 KB, patch)
2011-12-15 04:06 PST, Philippe Normand
no flags
Nikolas Zimmermann
Comment 1 2011-11-14 02:23:12 PST
Great that you're working on this as well. It turns out there are still numerical instabilities, especially in SVG <path> dumping, and in the expected.txt files where it says "RenderFoo at (0.00,1.00) size 100x100". Both use String::format, once directly, once through TextStream::operator<<(float). I'm working on a fix for that and like to see the impact on Gtk before this gets landed, if possible. I'll try to finish it in the next (few) hour(s).
Philippe Normand
Comment 2 2011-11-14 05:59:22 PST
(In reply to comment #0) > How can we pass cppflags to autogen scripts from Tools/Scripts/webkitdirs.pm ? You can do something like: CXXFLAGS=... ./autogen.sh See also the help of the configure script.
Martin Robinson
Comment 3 2011-11-14 09:58:41 PST
Another thing to consider for you patch is that we've skipped many tests because of these rounding errors. It probably be good to unskip them all and generate new results. Some of them will probably fail again, but we can reskip them after you patch lands. To find the skipped tests just open LayoutTests/platform/gtk/Skipped and search for the phrase "rounding". Again, I really appreciate you solving this puzzle!
Nikolas Zimmermann
Comment 4 2011-11-29 02:07:57 PST
(In reply to comment #3) > Another thing to consider for you patch is that we've skipped many tests because of these rounding errors. It probably be good to unskip them all and generate new results. Some of them will probably fail again, but we can reskip them after you patch lands. > > To find the skipped tests just open LayoutTests/platform/gtk/Skipped and search for the phrase "rounding". This is potentially fixed by r101342, we need to unskip it and try all the currently skipped tests w/o the "workaround" suggested by altering the compile flags.
Philippe Normand
Comment 5 2011-12-14 09:44:23 PST
(In reply to comment #4) > (In reply to comment #3) > > Another thing to consider for you patch is that we've skipped many tests because of these rounding errors. It probably be good to unskip them all and generate new results. Some of them will probably fail again, but we can reskip them after you patch lands. > > > > To find the skipped tests just open LayoutTests/platform/gtk/Skipped and search for the phrase "rounding". > > This is potentially fixed by r101342, we need to unskip it and try all the currently skipped tests w/o the "workaround" suggested by altering the compile flags. We have a new list of svg and tables tests skipped, even after r101342. Can we give this patch a try?
Philippe Normand
Comment 6 2011-12-15 02:32:41 PST
Created attachment 119402 [details] proposed patch A clean build should be needed I think.
Philippe Normand
Comment 7 2011-12-15 02:33:41 PST
(In reply to comment #6) > Created an attachment (id=119402) [details] > proposed patch > > A clean build should be needed I think. I got the current unskipped svg tests passing on my 32-bit Release build with this patch.
Philippe Normand
Comment 8 2011-12-15 04:06:06 PST
Created attachment 119409 [details] svg rebaseline
Martin Robinson
Comment 9 2011-12-15 07:49:12 PST
Comment on attachment 119402 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=119402&action=review Thank you! > Tools/Scripts/webkitdirs.pm:1627 > + # used on Chromium build. > + $ENV{'CXXFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse"; I think we should only pass these flags if we are on a 32-bit system.
vanuan
Comment 10 2011-12-15 10:57:38 PST
View in context: https://bugs.webkit.org/attachment.cgi?id=119402&action=review >> Tools/Scripts/webkitdirs.pm:1627 >> + $ENV{'CXXFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse"; > > I think we should only pass these flags if we are on a 32-bit system. And I think you should append these flags, not overwrite.
Nikolas Zimmermann
Comment 11 2011-12-16 00:00:48 PST
Sorry for not commenting earlier, really busy these days. I think this is probably the right way to go, it's truly hard to find the real cause of the rounding diffs. Let's try if the bots like it :-)
Philippe Normand
Comment 12 2011-12-16 00:27:22 PST
(In reply to comment #10) > View in context: https://bugs.webkit.org/attachment.cgi?id=119402&action=review > > >> Tools/Scripts/webkitdirs.pm:1627 > >> + $ENV{'CXXFLAGS'} = "-march=pentium4 -msse2 -mfpmath=sse"; > > > > I think we should only pass these flags if we are on a 32-bit system. > > And I think you should append these flags, not overwrite. They're appended, AFAIK.
Philippe Normand
Comment 13 2011-12-16 00:29:01 PST
Comment on attachment 119409 [details] svg rebaseline Will land this once the bots cycled the patch.
Philippe Normand
Comment 14 2011-12-16 00:29:59 PST
vanuan
Comment 15 2011-12-16 05:18:07 PST
But wait: if ($architecture ne "x86_64") { doesn't this mean that only two architectures are supported? What about ARM?
vanuan
Comment 16 2011-12-16 05:20:42 PST
And what if I want to crosscompile 32 bit webkit on 64 bit machine?
Philippe Normand
Comment 17 2011-12-16 06:05:52 PST
(In reply to comment #16) > And what if I want to crosscompile 32 bit webkit on 64 bit machine? This change is mostly meant for our buildbots. And we have no ARM bot, so far. In any case you can still do something like: CXXFLAGS="..." build-webkit ... Or tweak webkitdirs.pm again.
vanuan
Comment 18 2012-01-09 08:48:41 PST
> And we have no ARM bot, so far. Somebody already has: https://bugs.webkit.org/show_bug.cgi?id=75846 Does this patch affect only buildbot? And developers will still have these failures? I thought development builds and buildbot builds should be exactly the same? If so, what's the point of buildbot then if developers will get a different results?
Martin Robinson
Comment 19 2012-01-09 09:29:48 PST
(In reply to comment #18) > Does this patch affect only buildbot? If you are building a development release, you should use configure and make manually to compile. This change only affects build-webkit, which is used by developers working on trunk, the build bots and the EWS. > And developers will still have these failures? Anyone not compiling with build-webkit will see these failures. These are only "failures" in the sense that they cause the layout tests to fail, as they are rounding errors that typically result in one pixel differences. This is not something that matters or would be noticed when actually using WebKit. On the other hand, these tests probably fail on ARM anyway, if rounding affects the results. > I thought development builds and buildbot builds should be exactly the same? They are not. The build bot often tests features that are unfinished or experimental, but we want test coverage for. > If so, what's the point of buildbot then if developers will get a different results? The build bots typically test a superset of the features in development and stable releases. In this case, it was appropriate to add these flags only for build-webkit, because they improve result consistency at the expense of some unknown performance impact. We didn't want this work-around to affect the performance of releases.
Martin Robinson
Comment 20 2012-01-24 10:33:34 PST
*** Bug 39022 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.