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

[main] Update dependencies from 9 repositories #84635

Merged
merged 32 commits into from
Apr 22, 2023

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Apr 11, 2023

This pull request updates the following dependencies

From https://dev.azure.com/dnceng/internal/_git/dotnet-optimization

  • Subscription: d3a5b203-1393-4534-5b62-08d8d8feb47e
  • Build: 20230420.15
  • Date Produced: April 20, 2023 10:27:57 PM UTC
  • Commit: f9ae5c9fda841a26d8eaaa07151ac2618725da87
  • Branch: refs/heads/main

From https://github.com/dotnet/hotreload-utils

  • Subscription: bfe6dacf-8231-4ea1-e2fe-08d962847885
  • Build: 20230419.2
  • Date Produced: April 20, 2023 12:24:34 AM UTC
  • Commit: 0492aceaa61c1171a29c1a1130224267a7279d02
  • Branch: refs/heads/main

From https://github.com/dotnet/xharness

  • Subscription: be30ac4f-4b72-4287-1eb6-08d8d8fef0ea
  • Build: 20230412.1
  • Date Produced: April 12, 2023 7:37:21 PM UTC
  • Commit: cc6611a8c5eee02e5095d9d14a8b0c509ac46e86
  • Branch: refs/heads/main

From https://github.com/dotnet/emsdk

  • Subscription: c22d5069-447c-4252-29fd-08d90a7bb4bc
  • Build: 20230419.1
  • Date Produced: April 20, 2023 3:48:06 AM UTC
  • Commit: 31a4a877360713c4345ce48662e5baeeadfda898
  • Branch: refs/heads/main

From https://github.com/dotnet/runtime

  • Subscription: 3db4b8c8-0fae-4f82-086c-08dad31ae87d
  • Build: 20230418.4
  • Date Produced: April 18, 2023 1:08:54 PM UTC
  • Commit: 90d0d5c
  • Branch: refs/heads/main

From https://github.com/dotnet/llvm-project

  • Subscription: a7d541fc-4d59-4f09-2997-08d96284e872
  • Build: 20230421.2
  • Date Produced: April 21, 2023 7:54:48 PM UTC
  • Commit: 22bd769077ac1e84b5ad9d8d7cc27750c5e62275
  • Branch: refs/heads/dotnet/main

From https://github.com/dotnet/runtime-assets

  • Subscription: 0c5a34f5-504e-413b-9376-08d8d8ff2d75
  • Build: 20230418.1
  • Date Produced: April 18, 2023 6:30:57 PM UTC
  • Commit: b00e1e8c26672a4006c6de774093033d85bfecbb
  • Branch: refs/heads/main

From https://github.com/dotnet/cecil

  • Subscription: bb5d2106-9fd3-425f-0abc-08daad65778c
  • Build: 20230418.2
  • Date Produced: April 18, 2023 5:47:50 PM UTC
  • Commit: 80d3f38fc59c351fa1942209e66f54a6fc912deb
  • Branch: refs/heads/main

…otnet-optimization build 20230406.7

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23175.4 -> To Version 1.0.0-prerelease.23206.7
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-codeflow for labeling automated codeflow label Apr 11, 2023
…ild 20230412.6

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.23179.3 -> To Version 8.0.0-alpha.0.23212.6
@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dnceng/internal/dotnet-optimization [main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/hotreload-utils Apr 12, 2023
…otnet-optimization build 20230411.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23175.4 -> To Version 1.0.0-prerelease.23211.4
@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/hotreload-utils [main] Update dependencies from dotnet/hotreload-utils dnceng/internal/dotnet-optimization Apr 12, 2023
Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-preview.4.23203.1 -> To Version 8.0.0-preview.4.23212.1
@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dotnet/hotreload-utils dnceng/internal/dotnet-optimization [main] Update dependencies from dotnet/hotreload-utils dnceng/internal/dotnet-optimization dotnet/icu Apr 12, 2023
Steve Pfister and others added 3 commits April 12, 2023 17:05
…30412.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.23178.2 -> To Version 1.0.0-prerelease.23212.1
@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dotnet/hotreload-utils dnceng/internal/dotnet-optimization dotnet/icu [main] Update dependencies from dotnet/hotreload-utils dnceng/internal/dotnet-optimization dotnet/icu dotnet/xharness Apr 13, 2023
@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dotnet/hotreload-utils dnceng/internal/dotnet-optimization dotnet/icu dotnet/xharness [main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/icu dotnet/xharness dotnet/hotreload-utils Apr 13, 2023
…otnet-optimization build 20230412.3

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23175.4 -> To Version 1.0.0-prerelease.23212.3
@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/icu dotnet/xharness dotnet/hotreload-utils [main] Update dependencies from dotnet/icu dotnet/xharness dotnet/hotreload-utils dnceng/internal/dotnet-optimization Apr 13, 2023
@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dotnet/icu dotnet/xharness dotnet/hotreload-utils dnceng/internal/dotnet-optimization [main] Update dependencies from dotnet/xharness dotnet/hotreload-utils dnceng/internal/dotnet-optimization dotnet/icu Apr 13, 2023
@pavelsavara
Copy link
Member

[21:14:22] fail: Error: ERR24: Unexpected error: System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'months')
    at li (http://127.0.0.1:49238/dotnet.js:3:142848)
    at m.javaScriptExports.call_entry_point (http://127.0.0.1:49238/dotnet.js:3:203696)
    at Object.Rn [as runMain] (http://127.0.0.1:49238/dotnet.js:3:98952)
    at run (http://127.0.0.1:49238/test-main.js:379:50)

@pavelsavara
Copy link
Member

Process terminated. Encountered infinite recursion while looking up resource 'Word_At' in System.Private.CoreLib. Verify the installation of .NET is complete and does not need repairing, and that the state of the process has not become corrupted.
   at System.Environment.FailFast(System.String)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.Diagnostics.StackTrace.ToString(TraceFormat, System.Text.StringBuilder)
   at System.Diagnostics.StackTrace.ToString(TraceFormat)
   at System.Diagnostics.DebugProvider.Fail(System.String, System.String)
   at System.Diagnostics.Debug.Fail(System.String, System.String)

@steveisok
Copy link
Member

/azp run runtime-ioslike

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dotnet/xharness dotnet/hotreload-utils dnceng/internal/dotnet-optimization dotnet/icu [main] Update dependencies from dotnet/hotreload-utils dnceng/internal/dotnet-optimization dotnet/icu dotnet/xharness Apr 14, 2023
@lewing
Copy link
Member

lewing commented Apr 14, 2023

@steveisok should we split the icu flow out and let the rest complete?

@dotnet-maestro dotnet-maestro bot changed the title [main] Update dependencies from dotnet/hotreload-utils dnceng/internal/dotnet-optimization dotnet/icu dotnet/xharness [main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/icu dotnet/xharness dotnet/hotreload-utils Apr 14, 2023
@lewing
Copy link
Member

lewing commented Apr 21, 2023

should we roll back the dotnet-optimization update here to unblock the other flow?

@AndyAyersMS
Copy link
Member

AndyAyersMS commented Apr 21, 2023

Taking a look now...

Tests seem to be calling FailFast from managed code, still tracking down why.

Looks like we hit an assert in one of these two methods:

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static Vector256<byte> PackSources(Vector256<short> source0, Vector256<short> source1)
{
Debug.Assert(Avx2.IsSupported);
// Pack two vectors of characters into bytes. While the type is Vector256<short>, these are really UInt16 characters.
// X86: Downcast every character using saturation.
// - Values <= 32767 result in min(value, 255).
// - Values > 32767 result in 0. Because of this we can't accept needles that contain 0.
return Avx2.PackUnsignedSaturate(source0, source1).AsByte();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static Vector128<byte> PackSources(Vector128<short> source0, Vector128<short> source1)
{
Debug.Assert(Sse2.IsSupported);
// Pack two vectors of characters into bytes. While the type is Vector128<short>, these are really UInt16 characters.
// X86: Downcast every character using saturation.
// - Values <= 32767 result in min(value, 255).
// - Values > 32767 result in 0. Because of this we can't accept needles that contain 0.
return Sse2.PackUnsignedSaturate(source0, source1).AsByte();
}

and are unable to handle an assert happening quite this early (the code gets reinvoked as part of assert handling).

So possibly we're calling a version we should not be calling? Will keep digging, but progress is slow; WinDBG keeps disconnecting unexpectedly.

… 20230421.2

runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
 From Version 14.0.0-alpha.1.23179.1 -> To Version 14.0.0-alpha.1.23221.2
@AndyAyersMS
Copy link
Member

AndyAyersMS commented Apr 21, 2023

So possibly we're calling a version we should not be calling? Will keep digging, but progress is slow; WinDBG keeps disconnecting unexpectedly.

FWIW I can repro running on a checked build, with no DOTNET env vars set. Same setup is fine with a latest main build. So has nothing to do directly with PGO or OSR. (using the Runtime_77968 test case, which is very simple).

Just a guess at this point -- I see the number of methods being jitted drop considerably, so perhaps:

  • the new pgo data causes more methods to be prejitted
  • (perhaps) some of these run afoul of the somewhat subtle HW dependence issues in prejitting (IIRC methods must check their own HW dependences explicitly and can't rely on checks done by callers, and it seems like the new PackedSpan stuff referenced above may not do this). @davidwrighton do you recall where we wrote up these rules?
  • but if so, seemingly this would cause widespread failures since these methods are active at app startup -- so I can't yet explain why it just seems to impact a handful of tests like it does.

@davidwrighton
Copy link
Member

Yes, those functions appear to be violating the special rules for System.Private.CoreLib. The rule for writing code in there is that each and every function MUST behave identically whether or not the particular intrinsics are enabled. This means that you can't safely write a function which assumes that Avx2 is enabled in System.Private.CoreLib. See the special rules in https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/botr/vectors-and-intrinsics.md

@davidwrighton
Copy link
Member

@AndyAyersMS The problem is that failing to follow the rules will only cause problems if tiering occurs in a problematic order.

@tannergooding
Copy link
Member

tannergooding commented Apr 21, 2023

@davidwrighton, the guidance needs to be updated a bit, as for crossgen 2: https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/botr/vectors-and-intrinsics.md#code-review-rules-for-use-of-platform-intrinsics-1

Any use of a platform intrinsic in the codebase SHOULD be wrapped with a call to the associated IsSupported property. This wrapping may be done within the same function that uses the hardware intrinsic, but this is not required as long as the programmer can control all entrypoints to a function that uses the hardware intrinsic.

Edit Nevermind, I missed the subsequent:

Since System.Private.CoreLib.dll is known to be code reviewed with the code review rules as written above for crossgen1 with System.Private.CoreLib.dll, it is possible to relax rule "Code which attempts to use instruction sets outside of the optimistic set will generate code that will not be used on machines with support for the instruction set." What this will do is allow the generation of non-optimal code for these situations, but through the magic of code review, the generated logic will still work correctly.

@davidwrighton
Copy link
Member

@tannergooding Note that that comment applies to usage of intrinsics OUTSIDE of System.Private.CoreLib. System.Private.CoreLib also needs to follow the rules in https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/botr/vectors-and-intrinsics.md#crossgen1-model-of-hardware-intrinsic-usage

@davidwrighton
Copy link
Member

@tannergooding Yes, the wording is unfortunately confusing. I'd happily approve a PR which removed comments about crossgen1 and simply talked about special rules for System.Private.CoreLib.

@tannergooding
Copy link
Member

Note that that comment applies to usage of intrinsics OUTSIDE of System.Private.CoreLib. System.Private.CoreLib also needs to follow the rules in

It would be beneficial if the doc explicitly reiterated that corelib needs to follow the rules of crossgen1. Right now its somewhat inferred, but its very easy to miss or misinterpret things.

That being said, I wonder in general if the rules for corelib are the right thing here overall. We have the need and desire to factor out things into helpers that are only for one platform. This overall helps with maintainability and often JIT throughput/perf. Having these different rules for corelib makes it a lot easier to accidentally break things and much harder to write "clean code".

@lewing
Copy link
Member

lewing commented Apr 21, 2023

So wrt to this pr, it sounds like the correct thing to do is remove the dotnet-optimization flow from it to unblock the other flow? If that is the case @sbomer already has a separate pr with the optimization flow that is triggering the existing problem I'll also mark the dotnet-optimization darc subscription as non-batchable until the underlying issue is worked out.

@AndyAyersMS
Copy link
Member

So wrt to this pr, it sounds like the correct thing to do is remove the dotnet-optimization flow from it to unblock the other flow? If that is the case @sbomer already has a separate pr with the optimization flow that is triggering the existing problem I'll also mark the dotnet-optimization darc subscription as non-batchable until the underlying issue is worked out.

Yes, let's do that. We can sort those issues out separately.

@tannergooding
Copy link
Member

We can sort those issues out separately.

👍, I imagine we have several of these that have snuck in.

@AndyAyersMS
Copy link
Member

We can sort those issues out separately.

👍, I imagine we have several of these that have snuck in.

@BruceForstall and were wondering if there could be some special test mode that might uncover these issues more readily, especially if there is no simple way to check for them directly. Say we have a crossgen2 of SPC that crossgens everything it can, and then some runtime mode that randomly decides to use prejitted code or not -- running that we'd get a much more varied mixtures of prejitted and jitted code.

@stephentoub stephentoub merged commit a3e0d47 into main Apr 22, 2023
@stephentoub stephentoub deleted the darc-main-df7736a2-e675-492c-ba93-267f741558dc branch April 22, 2023 12:18
@lewing
Copy link
Member

lewing commented Apr 23, 2023

I've disabled dontet-optimization batching and the new flow is #85193

@davidwrighton
Copy link
Member

@AndyAyersMS, @BruceForstall, @tannergooding Sigh. Yes the rules in System.Private.CoreLib are a problem. Unfortunately, we derive significant startup performance wins from these special rules, but I'll spend some time this week thinking about if we can make writing code .... sensible again in S.P.C When we only had a small amount of intrinsics usage this was reasonable, but we've been increasing their usage, and testing for this is impractical.

@davidwrighton
Copy link
Member

Ok, it looks like we can build an analyzer based off of the logic of the PlatformCompatibilityAnalyzer, to find all the problematic code, and we could build a pattern with a slightly modified variant of the BypassReadyToRun attribute that would allow a bail-out for helper methods so that we can follow good engineering practices. Given the impact on the build today, I'm taking this as my current high priority item.

@sbomer
Copy link
Member

sbomer commented Apr 24, 2023

For a quick solution, we may not even need to write a new analyzer - it looks like you can make the existing platform analyzer do roughly what we want with a few tweaks: https://gist.github.com/sbomer/4bfb41750259d60810aeb0b92bcc0279.

@sbomer sbomer mentioned this pull request Apr 25, 2023
sbomer added a commit that referenced this pull request Apr 25, 2023
Unblocks dotnet-optimization flow and
#84711. Includes a
dotnet-optimization update to confirm this it avoids the issue
discussed in #84635. This
fixes that issue by preventing R2R for any Avx2 helpers which
assume they are called with Avx2 enabled.
@ghost ghost locked as resolved and limited conversation to collaborators May 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-codeflow for labeling automated codeflow area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.