Remove SafeSinh cross-lane defense now that eve fixed it upstream - #173
Merged
Conversation
jfalcou/eve#2366 fixes the root cause PR #172 worked around (a wrong fast-path in expm1's non-finite-lane handling, corrupting unrelated finite lanes in the same SIMD register). Bumped the eve pin (foolnotion/nur-pkg#049b418) and reverted sinh's three call sites to eve::sinh directly; Tanh's derivative stays on FastTanh for consistency with primal Tanh, independent of the eve bug. Verified with a standalone before/after repro (all of sinh, tanh, expm1, coth, csch, gd corrupted under the old eve pin, clean under the new one) and operon's full test suite passing both with and without the defense in place.
Windows CI uses vcpkg (not the nix flake, which was already bumped), so it was still building against the pre-eve#2366 buggy eve and failing the cross-lane corruption regression test this PR relies on.
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.
Summary
#172 defended
eve::sinh/eve::tanhcall sites against a confirmedthird-party bug: a
NaNin one SIMD lane of aneve::wideregistercorrupted the computed result in a completely unrelated, non-
NaNlaneof the same register (affecting
sinh,tanh,expm1,coth,csch,gdineve's math module).jfalcou/eve#2366 fixes the
shared root cause:
expm1's own non-finite-lane handling was callingthe fast/approximate
[raw]path for the entire register whenever anylane was non-finite, degrading accuracy in every other lane too. Since
sinh,tanh, andcothcallexpm1directly, andcsch/gdcallsinh/tanhrespectively, this one-line upstream fix covers all 6affected functions.
Changes
foolnotion/nur-pkg(evepackage) pin tounstable-2026-08-07(past eve#2366's merge).SafeSinh(functions.hpp) and reverted its 3 call sites(primal
Sinh, JITSinh,Cosh's derivative rule) to calleve::sinhdirectly.Tanh's derivative rule onFastTanh— Defend Sinh/Tanh-derivative call sites against eve's cross-lane NaN bug #172 framed that switchas also fixing an unrelated inconsistency with primal
Tanh(whichalready used
FastTanh), not purely a defensive workaround, so keptit independent of the eve bug status.
SafeSinh-referencing comment on the regressiontest, kept the test itself as a permanent guard.
Verification
-march=x86-64-v3target) against both eve pins: all 6 functions(
sinh,tanh,expm1,coth,csch,gd) show cross-lanecorruption under the old pin, clean under the new one.
~[performance]) passes both with the defense inplace (confirms the eve bump alone doesn't regress anything) and
without it (confirms nothing else depended on
SafeSinhincidentally) — 0 failures in both runs.
Test plan