engine_xetex: attempt to fix redbox_png test issue - #847
Conversation
We would get results that varied depending on whether we were compiled in debug or release mode. It looks like the root cause is some single-precision math in computing image sizes.
Codecov Report
@@ Coverage Diff @@
## master #847 +/- ##
=======================================
Coverage 47.07% 47.08%
=======================================
Files 146 146
Lines 59493 59493
=======================================
+ Hits 28008 28012 +4
+ Misses 31485 31481 -4
Continue to review full report at Codecov.
|
|
This does indeed seem to fix #776 for me. Random thoughts below this line, because I was quite curious on what the issue might be here, but don't know what the compiler is allowed to do:
I also don't really understand this... Might this even be a compiler bug, where on |
|
I believe your diagnosis is about correct. In release mode, the behavior changed when I added a printf of bounds->wd between the function call and the multiplication. That implies to me that the two statements were being fused in a way that changed their behavior subtly. On the other hand, with this fix, the release mode behavior turns out to have been more correct: the behavior of the debug mode changed and I had to update the test files as a result. So I think the inlining actually helped to compiler maintain better precision, while in debug mode the conversion to float must happen "too early" and lose some precision. |
We would get results that varied depending on whether we were compiled in debug or release mode. It looks like the root cause is some single-precision math in computing image sizes.
Cf. #845, possibly #776.