[3dprinter-general] Bug#1037614: cura-engine: ftbfs with GCC-13

Christoph Berg myon at debian.org
Sun Jul 23 08:14:10 BST 2023


Re: Gregor Riepl
> So, I investigated where the second issue
> (PolygonConnectorTest.getBridgeNestedSquares) is coming from, and found
> another case where tiny precision problems lead to off-by-one rounding
> errors. In this case, the end result is much more severe than in
> IntPointTest.TestRotationMatrix, because many errors accumulate and lead to
> a big difference.
> 
> After adding more llrint() rounding in the right places, the unit tests no
> longer fail on i686, while still producing correct results on amd64.
> 
> I'm inclined to push the patch (attached) as it is and not gate it with
> #ifdef __i386__. The explicit rounding has no impact on performance on
> amd64/SSE, because the truncating conversion function (cvttsd2si) has the
> same performance as the rounding conversion function (cvtsd2si).
> On the FPU, there is a slight penalty, because the rounding mode needs to be
> loaded into the FPU control register first.

Sounds fine for me.

> As an added bonus, I added a rounding fix for the original issue reported in
> https://github.com/Ultimaker/CuraEngine/issues/1192 - this was actually in
> the unit test itself. With this fix, the patch 1001-relax-test.patch can be
> dropped.

Cool.

Christoph



More information about the 3dprinter-general mailing list