Repository navigation
Build native kernels with -ffp-contract=off so Ubuntu 26.04 matches R bit for bit again - #202
Open
gitRasheed wants to merge 1 commit into
Open
gitRasheed wants to merge 1 commit into
gitRasheed wants to merge 1 commit into
Conversation
This was referenced Nov 19, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main has been red since GitHub moved
ubuntu-latestto Ubuntu 26.04: about 28 bitwise tests fail by 1 to 4 ulp on every Python version, on #200 and on #201 alike.The cause is fused multiply-add. The hosted runner's GCC 15.2 is Ubuntu's amd64v3 build (its
cc1plushash matches that package, not the stock one), whose default target is x86-64-v3 with FMA enabled. GCC's default-ffp-contract=fastthen turnsacc += a * binto one FMA, rounding once where R rounds twice.objdumpcounts 6, 52 and 14 FMA instructions in the seasonality, partial-moment and regression objects, and zero with contraction off.This sets
-ffp-contract=offonnnscoreand_nnscorefor GCC and Clang. Probes on the same container and wheels, contraction on vs off:Across the whole R cache, 528 of 6,266 values differed contracted and all matched with it off, on both GCC 15.2 and GCC 13.3. With this change alone, the original bitwise tests pass again on Ubuntu 24.04, stock 26.04 and the amd64v3 variant, Python 3.11 to 3.14 (3,223 tests on 3.12, each). No test or workflow file changes.
It also keeps AppleClang from contracting on arm64, whose default is
-ffp-contract=on.#201 has separate failures from R 14.2 itself (#166 makes SSD, TSD and continuous FSD reject infinite values); those belong with the cache refresh.