Skip to content

Sync with upstream main branch #30

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

Merged
merged 71 commits into from
Jan 4, 2022

Conversation

joshpeterson
Copy link

This is an automatically generated pull request to merge changes from the upstream main branch.

MichalStrehovsky and others added 30 commits December 18, 2021 13:59
This is now getting hit in dotnet#62927, so it's somewhat more urgent. (The feature switches from the SDK put us into the situation that triggers this bug around `RunClassConstructor` on an otherwise unused type.)

Fixes dotnet/runtimelab#987.

Remember what class constructor contexts we saw during scanning phase and if the owning type is also generated, assume `RunClassConstructor` could be used and ensure the cctor context is also generated in the compilation phase.

This is somewhat less precise, but introducing a new node type for "a type used with `RunClassConstructor`" that dataflow analysis could report doesn't seem worth it.
To make sure ApiCompat tooling for NativeAOT's CoreLib runs at least in some legs, compile libs against NativeAOT CoreLib if we're building CLR, but not building the JIT flavor of the runtime.

The baselining is necessary because the reflection stack of NativeAOT doesn't live in CoreLib.

The CannotRemoveBaseTypeOrInteface baselining will go away once dotnet#62944 gets fixed. It's one of the "overall goodness" things we can take out of NativeAOT and put it into all runtimes.
* Suppress OSR for crossgen2 execution

In CI testing, crossgen2 currently is run via a .NET 6 runtime, and
that runtime has some bugs in OSR.

Work around by suppressing OSR for the duration of the run. We should
be able to revert this once we update the crossgen2 runtime
to a .NET 7 version.

* add COMPlus exclusions for readytorun/multifolder
* enable testing with NodeJS on CI
* Fix task marshal tests.
Co-authored-by: Marek Fišera <[email protected]>
Change encodes 'w' and 's' in the insFlags struct and INS_FLAG
entry for xarch instruction table. In addition, add methods to check
check if this flag is set for an instruction, which allows to start
simplifying some of the various ad-hoc checks for these bits that were
previously done per-instruction throughout emitxarch.cpp.
* Have NativeAOT test execution project include SDK

The SDK contains logic to configure trimming - we were skipping all of that. We couldn't previously include the SDK because it would reflection-root the entrypoint assembly. No longer the case after dotnet#62890.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Corrected return value type in XML documentation.

Fix dotnet#62993

Co-authored-by: Björn Sjögren <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
By it's default behavior, WinHttp stops reading the stream when Content-Length is specified, this prevents us to read the remaining trailers. Opt-in into WINHTTP_OPTION_REQUIRE_STREAM_END, so WinHttpHandler reads HTTP2 streams to the end regardless of Content-Length.
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* [mono] Add a mono_dummy_jit_icall_val () icall.

This can be used to trace values from AOT code during runtime
debugging.

* [mono] Avoid adding a try clause to vector alloc wrappers.

Previously, a try-catch clause was added to the vector Alloc
wrappers to convert the OverflowException thrown by the .ovf
opcodes to an OutOfMemoryException. This could cause EH problems on wasm
since on wasm no AOTed code should contain clauses, but this
wrapper was still AOTed for performance reasons.
Instead, add a new CIL opcode to make the .ovf opcodes throw the
OutOfMemoryException directly.

* Disable inline rgctx fetch in mono_decompose_vtype_opts () as well.

It can't handle the new bblocks added by the inline rgctx fetch code.

* [mono] Factor out the slow path of Array.Copy () into a separate method.

The slowpath contained a try-catch clause, preventing Array.Copy () from
being AOTed on WASM.

* [mono] Fix assigning a name to LLVM Alloca instructions.

* Add a V=1 makefile option to wasm/Makefile.

* Add a WasmAotProfilePath build property.
Android puts pthread stuff into libc. Because this wasn't detected, we are using some iOS fallbacks in System.Native. I'm propagating how pthreads are detected in the CoreCLR PAL (that was fixed up for Android in the CoreCLR PAL a couple years ago).

Failure to properly detect it here was causing build breaks in CoreCLR on Android (that's how I found this).
The package we're currently using is missing dotnet/runtimelab#1519.
* Implementing support on running getters using Runtime.GetProperties as it's done by chrome.

* Addressing @radical comments.

* testing datetime
* Expose AppContext.SetData in ref assembly

* Implement test for Set/GetData

* Add doc comment
* samples for ES6 and CJS
* hack for in-tree linking
* binlog for samples
…cessor (dotnet#62989)

* Add boxing for parameterless ctors in structs (C# 10 feature) during dynamic code generation

* move tests to Common

* fix tests

* Address feedback
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
- Cache method lookup for TimerQueue.TimeoutCallback and ThreadPool.Callback.
- Remove unused parameter "id" from timer related functions.
…#63069)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Cleanup copy/pasted assembly update test projects

* Keep the ProjectReferences as is

It's easier to grep and it's easier for the IDE to display them

Compute the TrimmerRootAssembly items from the project referferences

So to add a new test you just need to add a ProjectReference in one place
* disable failing HTTP3 interop test

Co-authored-by: Geoffrey Kizer <[email protected]>
Co-authored-by: Anton Firszov <[email protected]>
trylek and others added 23 commits December 28, 2021 09:42
…tnet#63031)

This change fixes mergeability of tailcall tests: apart from simple
deduplication of the test class names and visibility fixes
I have modified the pointer and reference tests to stop using
Environment.Exit for exiting the test as that kills the merged
wrapper in in-proc execution; I have also fixed them to have main
within a class. In two cases (recurse_ep_void and test_virt)
I found out that I had previously put the Fact attribute on the
wrong method so I fixed that too. I renamed the two C# test
projects to better match the test of tests (widen to widen_r to
indicate it's a release test and thread-race_il_r to thread-race_r
as it's not an IL test).

Thanks

Tomas
…l limit up to 128 bytes (dotnet#61030)

* Use SIMD operations in CodeGen::genCodeForInitBlkUnroll()

* Use SIMD operations in CodeGen::genCodeForCpBlkUnroll()

* Remove restrictions on offset values in Lowering::ContainBlockStoreAddress()

* Remove unused macros in src/coreclr/jit/instr.h
Remove ifdefs for always-on values: ASSERTION_PROP,
LOCAL_ASSERTION_PROP, OPT_BOOL_OPS, LARGE_EXPSET,
REDUNDANT_LOAD.
This will allow specifying disjoint paths for the various inputs to ILC. We'll need this if we want to run ILC as part of the build to either build crossgen2 with ILC or selfhost ILC. Separate properties avoid having to lay out things on the file system the way IlcPath expects.
The tests were renamed in dotnet#63178.

Fixes dotnet#63202 (and also the CI breaks in Mono leg seen in e.g. dotnet#63207).
This was disabled in dotnet@d98d9a2. I don't think those problems exist anymore - targets are written differently, and we would likely see musl-arm64 failures if this was still a problem.
Change diagnostics to use ILLink.Shared utilities
Update ReferenceSource folder
Add method to obtain Requires attribute named argument URL
I ran crossgen2 compiling a Release CoreLib under a profiler and this stood out quite a bit. The JIT-based CoreLib doesn't have the `Array<T>` type so `GetType` was walking all types in CoreLib.

I split this logic out to an ILC-specific file. I don't remember this showing up in the profiles for ILC, but I added a cache nevertheless.
…ete TLS frame (dotnet#63184)

* avoid ArgumentOutOfRangeException while processing invalid or incomplete TLS frame

* feedback from review
...from CoreRT repo since we skipped them in runtimelab.
Currently, the method context numbers are output for each failure,
but the assert message is output separately, so if there are multiple
asserts that fire, and you want to investigate a particular one,
it's hard to figure out which method context number to use.

Add the method context number to the assert message, so the relationship
between the method context number and the assert is obvious.

E.g., you always get messages like the following (both before this change
and after):
```
ERROR: Exception thrown: DebugBreak or AV Exception 123
ERROR: main method 16501 of size 286 failed to load and compile correctly.
```

Before you might see an assert like:
```
ISSUE: <ASSERT> C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286)
```

Now, it will look like:
```
ISSUE: <ASSERT> dotnet#16501 C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286)
```
@joshpeterson joshpeterson merged commit ab8f859 into unity-main Jan 4, 2022
@joshpeterson joshpeterson deleted the bot-upstream-main-merge-2022-01-01 branch January 4, 2022 14:24
alexey-zakharov pushed a commit that referenced this pull request Apr 28, 2025
…rious correctness fixes, and stability improvements (dotnet#114927)

* Refactor Tensor to be more reusable and validate appropriate state

* Handle Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, and the *All/*Any variants

* Many implementations correctly swapped to new form. (#25)

* Refactor Tensor to be more reusable and validate appropriate state

* finishing tensor primitives work

---------

Co-authored-by: Tanner Gooding <[email protected]>

* more tensors updates (#26)

* Resolve a few build failures

* Ensure SetSlice and ToString are working as expected

* Tensors lastfew (#27)

* only couple left

* pausing for food

* fixed rented buffer

* squeeze/unsqueeze

* set slice/ split

* only 2 left

* Minor cleanup of the Tensor files

* Ensure that tensor tests are building

* Resolving various build failures due to API compatibility

* Ensure flattendLength is adjusted after the stride is set for that dimension

* Ensure that we set linearLength if -1 is passed in when strides is empty

* Ensure that the first index is correct

* Cleanup to ensure iteration and construction initializes correctly

* Ensure that broadcasting is allowed to be in any stride position

* Have AreCompatible handle empty shapes

* Ensure IndexOutOfRangeException is thrown for invalid indexes

* Ensure that the stride is set to 0 when the length of a dimension is 1, so embedded broadcasting works

* Fixing Broadcasting Loop (#29)

* Fixing Broadcasting Loop

* fixes from pr coments

* squeeze fixed

* unsqueeze

* set slice

* more tensor fies

* Ensure that minimumLinearLength is actually the minimum

* Ensure the rented buffer is cleared

* Fix the AreCompatible checks

* Tensor finishing (#30)

* stack working

* more tensor tests working

* fix factory create tests

* only2 tests left

* Update src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs

* Update compatibility suppressions

* transpose working

* reverse working

* Revert the unnecessary sln changes

* Remove an unnecessary using

---------

Co-authored-by: Michael Sharp <[email protected]>
Co-authored-by: Michael Sharp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.