Skip to content
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

Merged
merged 3 commits into from
Sep 16, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 16, 2022

Backport of #75683 to release/7.0-rc2

/cc @tannergooding

Customer Impact

Customers utilizing the Sse.Min/Max(float), Sse2.Min/Max(double) or Avx.Min/Max(float/double) intrinsics may get "invalid" codegen that results in an incorrect result being returned if an input is NaN or both inputs are zero (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.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 16, 2022
@ghost
Copy link

ghost commented Sep 16, 2022

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #75683 to release/7.0-rc2

/cc @tannergooding

Customer Impact

Testing

Risk

IMPORTANT: 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.

Author: github-actions[bot]
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@tannergooding
Copy link
Member

@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?

@tannergooding tannergooding added the Servicing-consider Issue for next servicing release review label Sep 16, 2022
@JulieLeeMSFT
Copy link
Member

Cc @jeffschwMSFT for RC2 servicing PR.

@JulieLeeMSFT
Copy link
Member

@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?

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.

@tannergooding
Copy link
Member

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.

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a 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.

@tannergooding
Copy link
Member

CC. @EgorBo could you review this one as well, since you reviewed the original into main?

@JulieLeeMSFT
Copy link
Member

@tannergooding, agreed. Let's backport it to 6.0 as well.

@carlossanlop
Copy link
Member

Approved via email by Tactics.
Signed off.
CI failures are unrelated:

  • Build Linux arm64 Release NativeAOT: Problem with arm64 machines that is being investigated by FR and is affecting several PRs.
##[error]The job running on agent NetCore-Svc-Public 95 ran longer than the maximum time of 240 minutes. For more information, see https://go.microsoft.com/fwlink/?linkid=2077134

The JIT failures are being reported in this other issue, which is affecting several PRs:
[release/7.0][wasm] Multiple JIT.* runtime test failures on rolling builds

Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit 5634242 into release/7.0-rc2 Sep 16, 2022
@carlossanlop carlossanlop deleted the backport/pr-75683-to-release/7.0-rc2 branch September 16, 2022 22:51
@ghost ghost locked as resolved and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants