This inconsistency also seems to infect functions that call muladd like evalpoly. This means that currently PhiloxRNG.jl’s randn_f32 which calls evalpoly is also impacted and returns different random numbers even if the seed is exactly the same and the function is running on the exact same computer. Is this a bug in the compiler, or should I just replace evalpoly and such with versions that use fma directly?
Here is an example:
using PhiloxRNG
@inline g(k) = randn_f32(UInt64(k), UInt64(0), UInt64(0))
@noinline full(k) = g(k)
@noinline first_only(k) = g(k)[1]
k = 93
full(k)[1] - first_only(k)
# -1.1920929f-7
Base.infer_effects(randn_f32)
# (+c,+e,+n,+t,+s,+m,+u,+o,+r)
julia> versioninfo()
Julia Version 1.13.1
Commit 96ca370cf0e (2026-09-25 19:34 UTC)
Build Info:
Official https://julialang.org release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 × AMD Ryzen 7 9800X3D 8-Core Processor
WORD_SIZE: 64
LLVM: libLLVM-20.1.8 (ORCJIT, znver5)
GC: Built with stock GC
Threads: 4 default, 1 interactive, 4 GC (on 16 virtual cores)