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

Ecma edit for conv.ovf.<to type>.un. #56450

Merged
merged 9 commits into from
Aug 4, 2021
Merged

Conversation

sandreenko
Copy link
Contributor

@sandreenko sandreenko commented Jul 28, 2021

Edit ECMA description for ovf.un conversion when the source is a floating-point type.

Add a test for this conv table parts:
image

Question: Have not we had a conformance test for it already?
I have found only a small coverage in https://github.com/dotnet/runtime/tree/main/src/tests/JIT/IL_Conformance/Old/Conformance_Base without tests for .ovf and ovf.un.

Closes #53189, the test will probably fail on mono. I will disable it there after CI confirms it.

@sandreenko sandreenko requested a review from davidwrighton July 28, 2021 08:33
@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 Jul 28, 2021
@sandreenko
Copy link
Contributor Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sandreenko sandreenko removed the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 28, 2021
@sandreenko
Copy link
Contributor Author

@davidwrighton
Copy link
Member

@sandreenko I'd like to have a discussion here about the behavior of conversion of floating point numbers to integers where the conversion is outside of the range of the destination integer type. We have had customer reports of problems due to inconsistencies here between behavior on x86/x64/arm/arm64, and I'd like for us to revisit what we do here. I did some research last year, and my personal preference is to follow the arm64 model of conversions long term, but that is a possibly breaking change everywhere.

@sandreenko
Copy link
Contributor Author

@sandreenko I'd like to have a discussion here about the behavior of conversion of floating point numbers to integers where the conversion is outside of the range of the destination integer type. We have had customer reports of problems due to inconsistencies here between behavior on x86/x64/arm/arm64, and I'd like for us to revisit what we do here. I did some research last year, and my personal preference is to follow the arm64 model of conversions long term, but that is a possibly breaking change everywhere.

Yes, I remember that and your test with different models, the new test added in this PR will need to be updated once the UnspecifiedBehaviour is specified.
However, this PR is about better explaining a current deterministic behavior.

@sandreenko
Copy link
Contributor Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sandreenko
Copy link
Contributor Author

looks like this test exposes an unknown issue on arm64 Linux/Osx. Looking.

@sandreenko sandreenko mentioned this pull request Jul 29, 2021
@sandreenko
Copy link
Contributor Author

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sandreenko
Copy link
Contributor Author

I have disabled the bad Jit optimization for this test and the PR should be ready for merge.

Copy link
Member

@davidwrighton davidwrighton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust the Ecma changes as requested.

Edit rule 12 to specify that "The method signature defined by *MethodBody* shall match those defined by *MethodDeclaration* exactly if *MethodDeclaration* defines a method on an interface or be *covariant-return-compatible-with* (§I.8.7.1) if *MethodDeclaration* represents a method on a class."

### III.3.19, conv.ovf.to type.un (page 354)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be put into a new section describing feature area. Effectively, each set of changes to the Ecma standard describes what the general impact is, and then there is the modification to the actual standardese. As it is this work is appended onto the covariant return types work, but really should be in its own chunk.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I have added a new chapter and tried to add a justification for the change. I have not found a template for this, looks like different chapters are organized differently, please tell me if you want me to add issue numbers, link to the current standard, or something else.

Copy link
Member

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor feedback to make it appropriate in rich-text mode.

docs/design/specs/Ecma-335-Augments.md Outdated Show resolved Hide resolved
docs/design/specs/Ecma-335-Augments.md Outdated Show resolved Hide resolved
docs/design/specs/Ecma-335-Augments.md Show resolved Hide resolved
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandreenko I think you've already taken note of this, but I believe the reason CI has been green so far is because the outerloop has only been triggered for CoreCLR, and not Mono. Not sure what is the best course of action here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thanks for reminding me. I have not found a pipeline that runs outerloop on mono. Do we run them there nowadays?

@sandreenko sandreenko merged commit 13a2b6d into dotnet:main Aug 4, 2021
@sandreenko sandreenko deleted the ecmaCastOvfUn branch August 4, 2021 00:04
thaystg added a commit to thaystg/runtime that referenced this pull request Aug 4, 2021
…ger_proxy_attribute

* origin/main:
  disable token info in traces. (dotnet#56780)
  [debugger] Fix debugger.break behavior (dotnet#56788)
  [mono][wasm] Allow setting env variables with '=' characters in the test runner. (dotnet#56802)
  Ecma edit for `conv.ovf.<to type>.un`. (dotnet#56450)
  Mark HandleProcessCorruptedStateExceptionsAttribute as obsolete (dotnet#56664)
  Enable SxS install of previews on Mac OS (dotnet#56797)
  CoreCLR runtime tests + Mono on the x64 iOS simulator (dotnet#43954)
  [main] Update dependencies from mono/linker (dotnet#56593)
  STJ: Fix deserialization of UInt16 properties (dotnet#56793)
@ghost ghost locked as resolved and limited conversation to collaborators Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECMA is not clear about conv.ovf.i1.un behavior.
5 participants