Skip to content

Fix TestExpRotation1BlockOfFour on arm64 - #252

Merged
thomas-vilte merged 2 commits into
pion:mainfrom
thomas-vilte:test/exprotation1-arm64-tolerance
Sep 17, 2026
Merged

thomas-vilte merged 2 commits into
pion:mainfrom
thomas-vilte:test/exprotation1-arm64-tolerance

Conversation

@thomas-vilte

Copy link
Copy Markdown
Member

Description

TestExpRotation1BlockOfFour compares the unrolled expRotation1 with a scalar reference using assert.Equal. On arm64 the compiler contracts the multiply-adds into FMA, and it does so differently for the two versions, so they drift in the last float32 bit (-6.7551584 vs -6.755159). The test only passed on amd64, and on the macOS runner, because that job runs with -race, which changes codegen enough to hide it.

The rotation itself is fine, so this only changes the test, to InDeltaSlice with a 1e-5 tolerance. The largest difference I saw was about 6e-7 on values up to ~10, so this leaves room for a few ulps while still catching a real mistake in the unrolled path.

With this change, go test ./... passes on arm64 without -race (qemu, Go 1.27). Before, this was the only failing test. amd64 passes with and without -race.

Reference issue

Fixes #241

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.11%. Comparing base (9c08810) to head (42d1881).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #252   +/-   ##
=======================================
  Coverage   94.11%   94.11%           
=======================================
  Files          63       63           
  Lines       11119    11119           
=======================================
  Hits        10465    10465           
  Misses        453      453           
  Partials      201      201           
Flag Coverage Δ
go 94.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thomas-vilte
thomas-vilte merged commit ba49dcb into pion:main Sep 17, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

go test ./... fails on arm64 in internal/celt without -race

3 participants