-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[release/7.0-rc2] Ensure Max/Min for floating-point on x86/x64 are not handled as commutative #75761
[release/7.0-rc2] Ensure Max/Min for floating-point on x86/x64 are not handled as commutative #75761
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsBackport of #75683 to release/7.0-rc2 /cc @tannergooding Customer ImpactTestingRiskIMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.
|
@JulieLeeMSFT, should we attempt to backport this to .NET 6 as well given that the codegen issue is present there and .NET 6 is an LTS? |
Cc @jeffschwMSFT for RC2 servicing PR. |
The customer reported the issue in .NET 7, but didn’t report it in 6.0. Please check with them if they need the fix in 6.0 as well. |
The issue doesn't repro with their particular code pattern in .NET 6. However, the issue very much exists in .NET 6 and may be trivially reproduced with a small code refactoring. Given the fix is small/isolated, I think its worth pre-emptively backporting to prevent any downstream issues for users running on the current LTS. |
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.
approved. we will take for consideration in rc2. Please get a code review.
CC. @EgorBo could you review this one as well, since you reviewed the original into main? |
@tannergooding, agreed. Let's backport it to 6.0 as well. |
Approved via email by Tactics.
The JIT failures are being reported in this other issue, which is affecting several PRs: Ready to merge. |
Backport of #75683 to release/7.0-rc2
/cc @tannergooding
Customer Impact
Customers utilizing the
Sse.Min/Max(float)
,Sse2.Min/Max(double)
orAvx.Min/Max(float/double)
intrinsics may get "invalid" codegen that results in an incorrect result being returned if an input isNaN
or both inputs arezero
(of any sign).This issue was raised by ImageSharp as it was impacting their ability to update code to target .NET 7
Testing
Explicit tests were added to cover the impacted scenarios.
Risk
Low. This issue has been in the codebase for at least 5 years and impacts .NET Core 3.1, 5.0, 6.0, and 7.0. Due to other codegen improvements, it is now more likely to be hit in .NET 7.
However, the root cause of the issue is related to an incorrect flag labeling the intrinsics as being
commutative
and we are effectively removing that flag so the code churn is small and any risk of the change is localized to these intrinsics.