-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Require .upperBound - .lowerBound be finite for FloatingPoint random #17833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require .upperBound - .lowerBound be finite for FloatingPoint random #17833
Conversation
…ndom. This is a slightly conservative precondition; when we re-work the FloatingPoint random computation in a more principled fashion, we can relax this to only requiring that .upperBound and .lowerBound are both finite. However, the current computation will break down unless this conservative condition is used, and this is future proof--we will only relax it going forward.
@swift-ci please smoke test |
CC @Azoy as well |
@swift-ci please smoke test |
Can you benchmark as well? Curious to see if we get anything interesting here. |
@Azoy I expect decent wins at Onone, smaller for O, since the compiler should be able to see through the inlinable calls and replace the |
@swift-ci Please benchmark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@swift-ci please benchmark |
1 similar comment
@swift-ci please benchmark |
@stephentyrone Just doing a drive by to get the benchmarking going. Sometimes if you do a force push, you need to call swift-ci twice. It is a bug in the Jenkins system. |
Build comment file:Build failed before running benchmark. |
Love the spurious build failure messages too =) |
Build comment file:Optimized (O)Regression (21)
Improvement (26)
No Changes (411)
Hardware Overview
|
Build comment file:Optimized (O)Regression (9)
Improvement (9)
No Changes (440)
Unoptimized (Onone)Regression (4)
Improvement (32)
No Changes (422)
Hardware Overview
|
…wiftlang#17833) This is a slightly conservative precondition; when we re-work the FloatingPoint random computation in a more principled fashion, we can relax this to only requiring that .upperBound and .lowerBound are both finite. However, the current computation will break down unless this conservative condition is used, and this is future proof--we will only relax it going forward.
* [SR-8178] Fix BinaryFloatingPoint.random(in:) open range returning upperBound (#17794) * Require .upperBound - .lowerBound be finite for FloatingPoint random (#17833) This is a slightly conservative precondition; when we re-work the FloatingPoint random computation in a more principled fashion, we can relax this to only requiring that .upperBound and .lowerBound are both finite. However, the current computation will break down unless this conservative condition is used, and this is future proof--we will only relax it going forward.
This is a slightly conservative precondition; when we re-work the FloatingPoint random computation in a more principled fashion, we can relax this to only requiring that .upperBound and .lowerBound are both finite. However, the current computation will break down unless this conservative condition is used, and this is future proof--we will relax it in the future, but any code that works now will continue to work when we do that.