Skip to content

Fix linux-arm64 CRAN test failure in minqa comparison - #7

Open
mattfidler wants to merge 2 commits into
mainfrom
arm64
Open

mattfidler wants to merge 2 commits into
mainfrom
arm64

Conversation

@mattfidler

Copy link
Copy Markdown
Member

Fixes the CRAN linux-arm64 check failure (https://github.com/r-devel/linux-arm64-checks/tree/HEAD/RcppTrust):

Failure ('test-minqa.R:68:5'): bobyqa() matches minqa::bobyqa() exactly
  `actual`: 0.06688 0.36668 0.28874 0.63332 0.71126 0.93312
`expected`: 0.06688 0.28874 0.36668 0.63332 0.71126 0.93312

Cause

On aarch64, gfortran contracts minqa's Fortran to FMA while our ports forbid contraction, so rounding differs. The chebyquad objective is invariant under permutation of x, so both runs reach the same minimum with two coordinates swapped. The non-bitwise branch of expectSameAsMinqa() compared par positionally.

Fix

  • expectSameAsMinqa() gains permInvariant; when set (non-bitwise platforms only), par is compared sorted and fval with tolerance 1e-6.
  • Applied to the chebyquad cases for both bobyqa() and newuoa().
  • x86_64 bitwise comparison is unchanged.
  • NEWS.md entry under 0.2.1.

Testing

  • devtools::test(filter='minqa') passes on x86_64 (bitwise branch).
  • Also passes with bitwise forced to FALSE locally (exercises the arm64 branch). Not run on actual arm64 hardware.

🤖 Generated with Claude Code

On linux-arm64 the FMA-contracted minqa build reaches the same
permutation-invariant chebyquad minimum with two coordinates swapped,
failing the positional par comparison in test-minqa.R.
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.80%. Comparing base (c9ba9bc) to head (d71b9ec).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
- Coverage   92.00%   91.80%   -0.21%     
==========================================
  Files          26       26              
  Lines        3916     3917       +1     
==========================================
- Hits         3603     3596       -7     
- Misses        313      321       +8     

☔ 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.

This branch has not been deployed

No deployments
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.

1 participant