[Python-apps-team] Bug#654604: Bug #654604

Jeremy Sanders jeremy at jeremysanders.net
Mon Jan 23 17:46:00 UTC 2012


Interesting - most of the comparison failures here are because the self
test has to run in US or C locale - we should fix that upstream and/or
in the Debian packaging.

However there are some subtle floating point differences which are
propagating through causing the differences.

For instance on x86/x86-64 we have:
<g fill="none" stroke-dasharray="0.125,2.5" stroke-width="1.25">
and on arm we have
<g fill="none" stroke-dasharray="0.125000001863,2.5" stroke-width="1.25">

The value is coming out with far less precision than expected (it is one
of the few places in the output where numbers don't get rounded when
written). I think this is probably because on ARM, qreal is a float
rather than double in Qt:
http://developer.qt.nokia.com/doc/qt-4.8/qtglobal.html#qreal-typedef

There are several other minor floating point differences, like this:
-<path d="m265.84,265.97c0,1.36,0.33,2.46,0.75,2.46"/>
+<path d="m265.85,265.97c0,1.36,0.33,2.46,0.75,2.46"/>

I think this is because every drawing command gets passed via qreal, and
has less precision.

It's difficult to know how to fix this:
 - Drop some/all tests on ARM (yuck)
 - Try to do some sort of better rounding of output values written to
the self test file. Perhaps it's possible to round the output values so
that the floats and doubles give the same results. Maybe the values
could get varied by a small amount, rounded and the lower value chosen.
 - Round to fewer decimal places in the self tests, which may or may not
work.
 - Make the self test comparison less sensitive to small numerical
changes. They are just compared as text currently.

So the solution is not obvious.

Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tests.diff
Type: text/x-patch
Size: 54432 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20120123/201de655/attachment-0001.bin>


More information about the Python-apps-team mailing list