Skip to content

Use all.equal for event comparison in single-analysis test - #682

Merged
yihui merged 2 commits into
mainfrom
fix-arm64-event-tolerance
Oct 2, 2026
Merged

yihui merged 2 commits into
mainfrom
fix-arm64-event-tolerance

Conversation

@yihui

@yihui yihui commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Problem

R CMD check fails on aarch64-unknown-linux-gnu (discovered via r-universe check log):

Error: -- Assertion failed: Single analysis --
   x1$analysis$event (LHS) ==>
    num 280
   ----------
    num 280
   <== (RHS) u2$Events
   Detailed diff (- LHS, + RHS):
   - 279.72639477630287
   + 279.72639477630293
   x1$analysis$event %==% u2$Events is not TRUE but FALSE at testit/test-developer-gs_design_ahr.R#22

%==% is testit's identical() — exact. The two values differ only in the last bit, a platform floating-point artifact.

Fix

Switch the single-analysis event comparison to all.equal(), matching the "Multiple analysisTimes" assertion which already uses all.equal() for the same event vs Events comparison.

🤖 Generated with Claude Code

yihui and others added 2 commits October 2, 2026 15:05
The "Single analysis" assertion compared x1$analysis$event against
u2$Events with %==% (testit's identical()), which failed on
aarch64-linux due to a last-bit floating-point difference
(279.72639477630287 vs 279.72639477630293).

Switch to all.equal(), matching the "Multiple analysisTimes" assertion
which already uses it for the same event comparison.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The platform floating-point difference that triggered the arm64 failure
is ~5e-14, far below the default all.equal tolerance of ~1.5e-8. Set
tolerance = 1e-13 so the assertion still absorbs cross-platform float
noise while catching any meaningful regression. Applied to both the
single- and multiple-analysis event comparisons.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yihui
yihui force-pushed the fix-arm64-event-tolerance branch from f5e9b49 to 096b1d3 Compare October 2, 2026 19:11
@yihui
yihui merged commit 1ba1456 into main Oct 2, 2026
10 checks passed
@yihui
yihui deleted the fix-arm64-event-tolerance branch October 2, 2026 19:20
@yihui

yihui commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Now it passes on arm64 Linux: https://github.com/r-universe/merck/actions/runs/37053673682/job/110994423760

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.

2 participants