Specialize eps(::IEEEFloat) #52087
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 209 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.320
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #52087"
general
weight: 0.35
mikmoore
eps(::IEEEFloat)can be made notably faster. I doubt this function appears in performance-critical places, but better is better and this new version is branch-free.``
julia-repljulia> using BenchmarkTools
julia> x = randn(2^10);
julia> @btime map(eps,$x); # v1.9.1
2.067 μs (1 allocation: 8.12 KiB)
julia> @btime map(eps,$x); # this PR
613.095 ns (1 allocation: 8.12 KiB)
`
A couple probably-negligible caveats that arise from the use of floating point arithmetic in this implementation:
when the result would be NaN. In this PR, the NaN payload depends on the payload behavior of the hardware and the input.. The usability of a subnormal result amidst flushing mode is questionable, as is the well-posed-ness ofeps's semantics in such a situation. Note that the existing implementation has this same vulnerability (due toldexp), though only when the input toepsis normal and the result would be subnormal (only with an input of zero or a subnormal is a correct subnormal output produced, assuming the flushing occurs during arithmetic but not storage).Canonicalizing NaN
would require a simpleifelse` switch on the result, though I can't imagine we care. Guaranteeing a proper subnormal result in flush-to-zero mode may be more challenging (and may warrant a branch) and is only handled slightly more correctly by the preexisting implementation. I imagine that flushing breaks a lot more functions than just this one, anyway.