Skip to content

v0.7.1

Choose a tag to compare

@kenshaw kenshaw released this 14 Nov 22:40
· 22 commits to main since this release

This release fixes the results of okage on arm64 and s390x, and the tests on 32-bit platforms.

go get github.com/xo/okage@v0.7.1

The same results on arm64 and s390x

On arm64 and s390x, the Go compiler fuses a multiply and an add into one instruction, even across statements. The fused result can differ in the last bit from the result on amd64, where the compiler does not fuse. okage requires the same results on each platform (D16), so each product that feeds an add is now rounded first, with an explicit float64 or float32 conversion. The fault was in these places:

  1. internal/crmath: the double-double arithmetic of sin, cos, tan, atan2 and pow. An unrounded product broke the arithmetic, so some results differed in the last bit, such as pow(2, 10), which gave 1023.9999999999998. The transforms of svg use these functions.
  2. internal/kurbo: SolveCubic, SolveQuadratic, the products of Affine and the ITP solver.
  3. The cubic and quadratic solvers of path64 in the root package.
  4. svg: the offsets of the gradients of COLR glyphs, the lighting filters, the angles of markers, text on a path and the alignment of a view box.
  5. html: the layout of tables.
  6. lottie: the shapes, the easing, the repeaters, the trim paths, the gradient stops, and the effects of the PixmapSink.

The results on amd64 do not change. The calls of math.FMA that port mul_add of Rust stay fused, as Rust does.

32-bit tests

The test of Composition.Image compiles where an int has 32 bits, and internal/lottiecompat has a test, so that TinyGo builds a test program for each package for wasip1.