platform/upstream/dotnet/runtime.git
2 years agoGenerate fabricbot config for the machinelearning repo (#65875)
Jeff Handley [Sat, 26 Feb 2022 01:16:11 +0000 (17:16 -0800)]
Generate fabricbot config for the machinelearning repo (#65875)

2 years agoOverhaul SymbolicRegexMatcher to avoid DFA perf regressions from NFA changes
Stephen Toub [Thu, 24 Feb 2022 03:50:32 +0000 (22:50 -0500)]
Overhaul SymbolicRegexMatcher to avoid DFA perf regressions from NFA changes

This does a few things:
- The previous changes for Antimirov changed the representation from being represented as a DfaMatchingState to instead being a list of states.  Unfortunately, this came at the expense of a significant increase in overhead for the DFA mode.  This commit melds the old and new design, by still using a CurrentState struct that can be either a DFA state or an NFA state, but with a simplified representation that lacks any processing.  The processing is left to two separate structs that implement static abstract interface methods, as was previously done, using that to provide streamlined, generic-specialized processing for the DFA path.
- Overhauled how we switch from DFA mode to NFA mode.  Previously, the builder would store whether we were in NFA mode, and any matching after it had been switched over immediately started in NFA mode.  We now always start in DFA, and only switch over to NFA if we try to create a new state but doing so would exceed the graph size constraint.
- Overhauled how we handle the outer/inner loop logic.  Previously we wanted to remain in a tight inner loop and so would use some "leeway" to allow us to go beyond the graph size constraint in order to avoid having to check too frequently whether we'd exceeded that size.  Now, the transition function itself returns whether we need to exit out to the outer loop in order to upgrade from DFA to NFA, and until/unless that happens, we can stay in the inner loop.
- Avoids inlining huge amounts of NFA code that can result in worse DFA code
- Renamed Brzozowski and Antimirov to DFA and NFA.
- Added a lot of comments to SymbolicRegexMatcher
- Fixes "watchdog" issue with captures
- A few other renames / cleanups.

2 years agoImprovements to Antimirov mode and misc small formatting edits
Margus Veanes [Sun, 20 Feb 2022 18:51:32 +0000 (10:51 -0800)]
Improvements to Antimirov mode and misc small formatting edits

2 years agoadd RID for Ubuntu 22.04 (#65483)
Tomas Weinfurt [Sat, 26 Feb 2022 00:36:47 +0000 (16:36 -0800)]
add RID for Ubuntu 22.04 (#65483)

2 years ago[Perf][Maui] Set only android-arm64 to be built for Maui (#65747)
Parker Bibus [Fri, 25 Feb 2022 23:02:46 +0000 (17:02 -0600)]
[Perf][Maui] Set only android-arm64 to be built for Maui (#65747)

* Set android to only build one RID (android-arm64).

* Update the mv file path for the android apk.

* Add --self-contained to get rid of android build warning.

* Add comment about dotnet restore being done before publish.

2 years ago[PERF][MAUI]Maui Install Workaround Fix (#65904)
Parker Bibus [Fri, 25 Feb 2022 22:07:58 +0000 (16:07 -0600)]
[PERF][MAUI]Maui Install Workaround Fix (#65904)

* Test a potential fix for the maui install failures.

* Only run the app build.

* Reenable rest of the pipeline.

2 years agoRemove usages of native bootstrapping (#65901)
Juan Hoyos [Fri, 25 Feb 2022 22:06:33 +0000 (14:06 -0800)]
Remove usages of native bootstrapping (#65901)

* Remove usages of native bootstrapping
* Make sure cmake is in the path for mono wasm builds

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years agoCentralize regex tree analysis for atomic/capture/backtracking detection (#65734)
Stephen Toub [Fri, 25 Feb 2022 21:43:06 +0000 (16:43 -0500)]
Centralize regex tree analysis for atomic/capture/backtracking detection (#65734)

We currently either guess at some of this state based on the immediate surrounding nodes (e.g. whether the immediate child backtracks) or we do potentially-expensive walks each time we need to check (e.g. walking all ancestors until root to determine whether a given node is to be considered atomic).  This changes the code to do a pass over the graph to compute the relevant information, which can then be used by the code generators any time they need to access that information.  This provides the code with faster and more accurate answers.

2 years agoReduce TypeGeneratorTests log spew to 1% of its previous size (#65871)
Tomáš Rylek [Fri, 25 Feb 2022 20:42:58 +0000 (21:42 +0100)]
Reduce TypeGeneratorTests log spew to 1% of its previous size (#65871)

As JanV noticed during an independent investigation,
TypeGeneratorTests historically used to produce an enormous amount
of stdout spew due to individually reporting the details of all
passing test cases; for the entire set of 1501 tests the total
size of the spew was about 150 MB. In combination with the change
to capture stdout spew in the xml test reports this effectively
canceled out all previous wins achieved via test merging - in fact,
the tests became twice as slow compared to before the merging.

This modification only reports mismatches i.e. failures where we
don't receive the expected answer in one of the test cases. This
reduces the total spew from 150 MB to just over a megabyte and
restores the perf improvement achieved via test merging.

Thanks

Tomas

2 years agoMark architecture-specific tests with ConditionalFact attributes (#65862)
Tomáš Rylek [Fri, 25 Feb 2022 20:42:39 +0000 (21:42 +0100)]
Mark architecture-specific tests with ConditionalFact attributes (#65862)

This change adds initial provisions for platform detection similar
to library logic to CoreCLRTestLibrary and marks a few
architecture-conditional tests with ConditionalFact attributes.

While I must admit I'm not happy about the IL representation of
the ConditionalFact attributes, it's technically using the same
representation as the library tests do and it only affects a handful
of tests. During consolidation of the remaining tests we'll
continue working on an easier solution even though it may require
diverging further away from Xunit.

I'm not yet removing the CLRTestTargetUnsupported clauses from
the corresponding project files, that can only be done after
switching these tests over to use the merged wrappers (my next
change) as the legacy XUnit wrapper generator (in particular the
test execution script generator) relies on those properties.

Thanks

Tomas

2 years ago[wasm] Add disabled tests to ProjectExclusions (#65877)
Elinor Fung [Fri, 25 Feb 2022 15:59:26 +0000 (07:59 -0800)]
[wasm] Add disabled tests to ProjectExclusions (#65877)

2 years ago[wasm][debugger] Run debugger test in codespace (#64746)
Ilona Tomkowicz [Fri, 25 Feb 2022 14:01:01 +0000 (15:01 +0100)]
[wasm][debugger] Run debugger test in codespace (#64746)

* Tmp change for debugging.

* Added chromium, needed for running debugger tests.

* Corrected line breaking, removed suso.

* Removed update duplicate.

* Prevent regex on null.

* Set special env variable only for containers.

* Locally docker build crashes without it.

* Applied @eerhardt suggestion.

* Moved env assignment to a place that is executed by onCreateCommand.sh

* Revert accidential new line removal.

* Upgrade is unnecessary, works without it.

* Moved all logic to C# code.

* Remove duplicated line.

* Applied @thays's and @lewing's comments.

* Enabling @radical approach for chromium installation.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years ago[mono][hot reload] Fix sequence point logic for compiler-generated methods in updates...
Aleksey Kliger (λgeek) [Fri, 25 Feb 2022 13:57:38 +0000 (08:57 -0500)]
[mono][hot reload] Fix sequence point logic for compiler-generated methods in updates (#65865)

* [tests] Pass PDB delta to ApplyUpdate

* extra tracing output

* Return 0 if a method has no sequence points

   -1 means there was some kind of problem

   0 means 0 sequence points

   In particular for mono_ppdb_get_seq_points_enc a compiler-generated method might have 0 sequence points in the PDB delta, but we should consider that as ok, and not fall back to looking in the baseline image

* pass MONO_DEBUG=getn-seq-points to hot reload tests

   For platforms where we use the remote executor, set the environment variable when starting the remote process.

   For WASM, pass --setenv when building the project.

* fix whitespace

2 years agoJIT: Range Checks for "(uint)i > cns" pattern (#62864)
Egor Bogatov [Fri, 25 Feb 2022 12:04:02 +0000 (15:04 +0300)]
JIT: Range Checks for "(uint)i > cns" pattern (#62864)

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
2 years ago[Mono] Add SIMD intrinsic for Vector64/128 comparisons (#65128)
Simon Rozsival [Fri, 25 Feb 2022 09:52:08 +0000 (10:52 +0100)]
[Mono] Add SIMD intrinsic for Vector64/128 comparisons (#65128)

* Add vector comparison intrinsics

* Add EqualsAll and EqualsAny intrinsics

* Remove broken EqualsAny

* Fix EqualsAny

* Enable xequal also for arm64

* Fix xzero type

* Fix bad merge

* Add guards for invalid types

* Revert unrelated change

* Extract duplicate code blocks to a new function

* Fix EqualsAny

* Fix typo + code improvements

2 years agoUse SSA def descriptors in copy propagation (#65250)
SingleAccretion [Fri, 25 Feb 2022 07:19:51 +0000 (10:19 +0300)]
Use SSA def descriptors in copy propagation (#65250)

* Use direct SSA defs in copy propagation

* Add asserts

2 years agoCleanup fragile NGen leftovers (#65869)
Jan Kotas [Fri, 25 Feb 2022 05:57:13 +0000 (21:57 -0800)]
Cleanup fragile NGen leftovers (#65869)

2 years agoAdd `StringMarshallingCustomType` to `GeneratedDllImportAttribute` (#65855)
Elinor Fung [Fri, 25 Feb 2022 01:44:54 +0000 (17:44 -0800)]
Add `StringMarshallingCustomType` to `GeneratedDllImportAttribute` (#65855)

2 years agoDo not copy XState other than AVX when redirecting for GC stress (#65825)
Vladimir Sadov [Fri, 25 Feb 2022 01:23:22 +0000 (17:23 -0800)]
Do not copy XState other than AVX when redirecting for GC stress (#65825)

* Do not copy XState other than AVX

* #if defined(TARGET_X86) || defined(TARGET_AMD64)

* mask XState unconditionally

* Ensure XSTATE_MASK_AVX is set before calling EEGetThreadContext

* redundant supportsAVX, more clear comment

* PR feedback

2 years agoDisable failing EventLogSession.GetProviderNames test (#64780)
Sven Boemer [Thu, 24 Feb 2022 22:58:58 +0000 (14:58 -0800)]
Disable failing EventLogSession.GetProviderNames test (#64780)

* Disable failing EventLogSession.GetProviderNames test

2 years agoSwap out a Debug.Fail for a more graceful diagnostic failure. (#65861)
Jeremy Koritzinsky [Thu, 24 Feb 2022 22:20:27 +0000 (14:20 -0800)]
Swap out a Debug.Fail for a more graceful diagnostic failure. (#65861)

2 years agoUse ValueStringBuilder to fix allocations in ToString() methods of XdsDateTime and...
Trayan Zapryanov [Thu, 24 Feb 2022 21:06:13 +0000 (23:06 +0200)]
Use ValueStringBuilder to fix allocations in ToString() methods of XdsDateTime and XsdDuration (#64868)

* Use ValueStringBuilder to fix allocations in XdsDateTime struct method ToString()

* Use ValueStringBuilder in XsdDuration

* Fix failing tests

* Address feedback

* Address feedback 2

* few more brackets rmoved

* Use previous methods for formatting into 2/4/X digits as they are faster than AppendSpanFormattable

Co-authored-by: Traian Zaprianov <Traian.Zaprianov@docuware.com>
2 years agoMove the fabricbot config files to the eng folder to avoid changes triggering CI...
Jeff Handley [Thu, 24 Feb 2022 20:48:52 +0000 (12:48 -0800)]
Move the fabricbot config files to the eng folder to avoid changes triggering CI (#65856)

2 years agoNetworkAddressChange.Unix: fix error checking. (#65849)
Tom Deseyn [Thu, 24 Feb 2022 19:05:14 +0000 (20:05 +0100)]
NetworkAddressChange.Unix: fix error checking. (#65849)

2 years ago[wasm] Refactor script to load NPM modules for NodeJS on Helix (#65774)
Marek Fišera [Thu, 24 Feb 2022 18:54:31 +0000 (19:54 +0100)]
[wasm] Refactor script to load NPM modules for NodeJS on Helix (#65774)

- Refactor script to load NPM modules for NodeJS on Helix to tests.wasm.targets.
- Move NODE_TLS_REJECT_UNAUTHORIZED=0 to LocalEchoServer.props.

2 years agoFix Queryable-to-Enumerable overload mapping logic (#65569)
Eirik Tsarpalis [Thu, 24 Feb 2022 18:48:07 +0000 (18:48 +0000)]
Fix Queryable-to-Enumerable overload mapping logic (#65569)

* Fix Queryable-to-Enumerable overload mapping logic

* fix linker warnings

* address feedback

* use strict order when calculating maximal elements

2 years ago Handle direct addresses for statics in `IsFieldAddr` (#64846)
SingleAccretion [Thu, 24 Feb 2022 15:58:18 +0000 (18:58 +0300)]
 Handle direct addresses for statics in `IsFieldAddr` (#64846)

* DEBUG-ONLY: FieldInfo

Allows this change to be tested via SPMI.

* Handle direct addresses in IsFieldAddr

* Always use NotAField in IsFieldAddr

No diffs.

* Revert "DEBUG-ONLY: FieldInfo"

This reverts commit b17817e0354a63319256a0fa0d21b74c2cfbf781.

2 years agoAdd support for sending CA names in handshake on Linux and OSX (#65195)
Radek Zikmund [Thu, 24 Feb 2022 12:54:34 +0000 (13:54 +0100)]
Add support for sending CA names in handshake on Linux and OSX (#65195)

2 years ago[main] Update dependencies from 10 repositories (#65504)
dotnet-maestro[bot] [Thu, 24 Feb 2022 12:49:02 +0000 (13:49 +0100)]
[main] Update dependencies from 10 repositories (#65504)

* Update dependencies from https://github.com/dotnet/icu build 20220216.2

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.3.22115.2 -> To Version 7.0.0-preview.3.22116.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220216.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.22115.1 -> To Version 7.0.0-beta.22116.1

* Update dependencies from https://github.com/dotnet/emsdk build 20220216.2

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-alpha.2.22111.1 -> To Version 7.0.0-preview.3.22116.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220216.1

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22115.3 -> To Version 7.0.0-preview1.22116.1

* Update dependencies from https://github.com/dotnet/arcade build 20220217.2

Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
 From Version 2.5.1-beta.22114.7 -> To Version 2.5.1-beta.22117.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220219.1

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22115.3 -> To Version 7.0.0-preview1.22119.1

* Update dependencies from https://github.com/dotnet/runtime build 20220220.1

runtime.native.System.IO.Ports , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json , Microsoft.NET.Sdk.IL
 From Version 7.0.0-preview.2.22113.2 -> To Version 7.0.0-preview.3.22120.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20220221.2

optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.22078.3 -> To Version 1.0.0-prerelease.22121.2

* Update dependencies from https://github.com/dotnet/icu build 20220221.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.2.22081.1 -> To Version 7.0.0-preview.3.22121.1

* Update dependencies from https://github.com/dotnet/xharness build 20220221.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22114.1 -> To Version 1.0.0-prerelease.22121.1

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220221.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.22115.1 -> To Version 7.0.0-beta.22121.1

* Update dependencies from https://github.com/dotnet/emsdk build 20220221.1

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-alpha.2.22077.1 -> To Version 7.0.0-preview.3.22121.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20220221.2

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.22114.2 -> To Version 11.1.0-alpha.1.22121.2

* Update dependencies from https://github.com/dotnet/arcade build 20220222.3

Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
 From Version 2.5.1-beta.22114.7 -> To Version 2.5.1-beta.22122.3

* Update dependencies from https://github.com/dotnet/icu build 20220222.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.2.22081.1 -> To Version 7.0.0-preview.3.22122.1

* Update dependencies from https://github.com/dotnet/emsdk build 20220222.1

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-alpha.2.22077.1 -> To Version 7.0.0-preview.3.22122.1

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20220222.2

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.2-alpha.0.22114.2 -> To Version 1.0.2-alpha.0.22122.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoFix nullability mismatch between `ref` and `src` in `Microsoft.Extensions.Caching...
Maksym Koshovyi [Thu, 24 Feb 2022 12:45:45 +0000 (14:45 +0200)]
Fix nullability mismatch between `ref` and `src` in `Microsoft.Extensions.Caching.Abstractions` (#65804)

* Update PostEvictionDelegate.cs

* Fix GetOrCreateAsync

2 years agoAdd [NotNullWhen(true)] to Enum.TryParse overloads (#65827)
Stephen Toub [Thu, 24 Feb 2022 12:44:26 +0000 (07:44 -0500)]
Add [NotNullWhen(true)] to Enum.TryParse overloads (#65827)

2 years agoAdd RegexGenerator to System.ComponentModel.TypeConverter. (#62325)
Stephen A. Imhoff [Thu, 24 Feb 2022 12:43:27 +0000 (04:43 -0800)]
Add RegexGenerator to System.ComponentModel.TypeConverter. (#62325)

* Add RegGen to System.ComponentModel.TypeConverter.

Added to src, not to test (no test found)

* Change to targets generator enablement

* Correct RegGen for System.ComponentModel.TypeConverter

* Remove extra space

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
* Remove .NetF inclusion definition

* Remove implicit regex generator entrypoint

* Remove regex generator enabled variable target.

* Update eng/generators.targets

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
2 years agoUnify reading from procfs to get network related information (#63696)
Radek Zikmund [Thu, 24 Feb 2022 12:33:34 +0000 (13:33 +0100)]
Unify reading from procfs to get network related information (#63696)

Throw NetworkInformationException instead of PNSE

2 years agoUse SECPKG_ATTR_REMOTE_CERT_CHAIN to retrieve server cert during handshake (#65134)
Radek Zikmund [Thu, 24 Feb 2022 12:29:33 +0000 (13:29 +0100)]
Use SECPKG_ATTR_REMOTE_CERT_CHAIN to retrieve server cert during handshake (#65134)

This allows us to query peer cert even before Tls Handshake completes.

2 years ago[wasm][debugger] Optional param fix 56251 (#64970)
Ilona Tomkowicz [Thu, 24 Feb 2022 12:19:59 +0000 (13:19 +0100)]
[wasm][debugger] Optional param fix 56251 (#64970)

* Optional parameter fix.

* Working version of optional parameter support, requires refactoring.

* Refactored.

* Fixed failing tests.

* Simplified tests.

* @radical's parenthesis refactor.

Co-authored-by: Ankit Jain <radical@gmail.com>
* Add nullable tests, rename mixed params function.

* Applied @radical suggestions + fixed tests failing because of double separator.

* Capitalised params first letter, removed explicit getters.

* Applied @radical's and @lewing's comments where it was possible.

* Applied @radical's suggestions.

* Handle Linq with ParamsCnt = methodParamsCnt. OptionalParamsCnt not used anymore.

* Fix: previos commit worked only in tests, not in browser.

* Applied @radical's approach.

* Fixed ParamsInfo so that it will be loaded on demand only.

* Update src/mono/wasm/debugger/tests/debugger-test/debugger-evaluate-test.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoUse TargetFramework singular for tests
Viktor Hofer [Sat, 12 Feb 2022 14:47:35 +0000 (15:47 +0100)]
Use TargetFramework singular for tests

Use TargetFramework instead of TargetFrameworks property whenever a
test project targets a single target framework only.
This avoid unnecessary outer builds and evaluations and makes the build
faster.

2 years agosfx+oob split, shim project refactoring, P2Ps
Viktor Hofer [Tue, 18 Jan 2022 15:07:01 +0000 (16:07 +0100)]
sfx+oob split, shim project refactoring, P2Ps

Split the build of shared framework and out-of-band projects so that
it's possible to just build the shard framework projects, which was
requested by the CLR teams. In the next infrastructure rollout, the
current "libs.ref+libs.src" subsets should be removed. Generate the
targeting pack with an incomplete (without shims) frameworklist as part
of the "libs.sfx" subset.

Build the shim projects after the shared framework and oob projects and
re-generate the targeting pack's frameworklist to include the shims.

Refactor the shims so that they aren't grouped anymore by generated &
manual. Instead group them by "ref" and "src" same as other libraries
in the tree which allows to reference the source project shims and read
from the ReferenceAssembly metadata.

Use ProjectReferences in traversal projects and shim projects instead
of named references that point to binplace directories (see graph below)
This allows to build parts of the product dynamically, i.e. the shim
projects, apicompat.proj, sfx.proj and oob.proj.

2 years agoMove ApiCompat files into own directory
Viktor Hofer [Tue, 18 Jan 2022 15:03:50 +0000 (16:03 +0100)]
Move ApiCompat files into own directory

2 years agoEqualize promoted (#64206)
Peter Sollich [Thu, 24 Feb 2022 11:16:22 +0000 (12:16 +0100)]
Equalize promoted (#64206)

I have observed that in server GC scenarios, the amount of promoted memory is often very uneven between heaps, which leads to suboptimal work distribution between server GC threads.

The PR introduces a new method equalize_promoted_bytes that attemps to even out the promoted memory between heaps by moving regions from heaps with lots of promotion of heaps with less promotion.

The algorithm used removes regions from heaps that have more than average promotion. These surplus regions are arranged into size classes by the amount of promoted memory in them. The heaps are also arranged into size classes by how much their promoted memory is short of the average promoted memory per heap.

Then we repeatedly move the surplus region with the most promoted memory to the heap with the biggest deficit. If the heap still has a deficit, it is reconsidered under its new deficit size class. Otherwise, it now has average or more promoted memory and is removed from further consideration.

Because regions may now move between heaps, it is no longer true that the finalization queue entry for an object is always on the same heap as the object itself. This necessitated moving the call to finalize_queue->UpdatePromotedGenerations to a later point in time when all threads have finished updating the final generation for a region.

2 years agoChanges to reduce committed memory: (#65367)
Peter Sollich [Thu, 24 Feb 2022 10:17:16 +0000 (11:17 +0100)]
Changes to reduce committed memory: (#65367)

* Changes to reduce committed memory:
- Be more careful about estimating what is needed in the future
- Decommit regions that haven't been used in 20 GCs
- Keep regions sorted by decreasing commit size and increasing age
- Insturmentation enhancements

* Address code review feedback:
- optimize add_region_in_descending_order to search backwards if the region to be added is not fully committed
- adjust dprintf levels
- fix formatting issues
- made merge_sort_by_committed_and_age more efficient
- fix comment to use symbolic constant instead of number
- added new helper generation_start_segment_rw

2 years agoUpdate area-owners and fabricbot to reflect libraries area pod changes (#65830)
Jeff Handley [Thu, 24 Feb 2022 09:41:08 +0000 (01:41 -0800)]
Update area-owners and fabricbot to reflect libraries area pod changes (#65830)

* Update area-owners to use area team names for the libraries area pods

* Update fabricbot for libraries pod changes; remove configs for old project boards

* Remove intra-team consultants from libraries areas

2 years agoUpdate dependencies from https://github.com/dotnet/linker build 20220222.1 (#65772)
dotnet-maestro[bot] [Thu, 24 Feb 2022 09:01:40 +0000 (10:01 +0100)]
Update dependencies from https://github.com/dotnet/linker build 20220222.1 (#65772)

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22121.2 -> To Version 7.0.100-1.22122.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[mono] Throw a MarshalDirectiveException when marshalling generic instances as return...
monojenkins [Thu, 24 Feb 2022 08:53:59 +0000 (03:53 -0500)]
[mono] Throw a MarshalDirectiveException when marshalling generic instances as return types from pinvoke callbacks. (#65743)

Fixes https://github.com/dotnet/runtime/issues/63962.

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
2 years agoProcess.GetProcessById bugfix (#64723)
Evgeny Peshkov [Thu, 24 Feb 2022 07:52:15 +0000 (10:52 +0300)]
Process.GetProcessById bugfix (#64723)

* Bugfix: Process.GetProcessById claims killed process is still alive in .NET Core #63937

* Added test for GetProcessById with killed process

Co-authored-by: epeshk <>
2 years ago[wasm] Use `--emit-symbol-map` to generate a `dotnet.js.symbols` (#65162)
Ankit Jain [Thu, 24 Feb 2022 07:31:56 +0000 (02:31 -0500)]
[wasm] Use `--emit-symbol-map` to generate a `dotnet.js.symbols` (#65162)

* [wasm] Use --emit-symbol-map to generate a dotnet.js.symbols

.. and package it in the runtime pack. This can be disabled with
`$(WasmEmitSymbolMap)`.

* wasm.proj: cleanup

* [wasm] honor XunitShowProgress property

* [wasm] avoid extra build when publishing

* [wasm] WasmAppBuilder: Fix handling of ExtraFilesToDeploy

It incorrectly treated `TargetPath` metadata as a directory.

* [wasm] Disable generation of symbol maps by default

- this is needed because the sdk needs to handle this file specifically,
  and would break tests.
- Once, the sdk gets the fix, then we can turn this on by default.

- For tests, turn it on by default

* [wasm] Deploy dotnet.js.symbols with the tests

* cleanup

* [wasm] dotnet-install.sh logs errors from curl, while trying older urls,

.. don't let that fail the build.

* [wasm] Temporarily disable WasmEmitSymbolMap by default

.. because sdk needs a fix for blazor projects to handle
`dotnet.js.symbols`.

But explicitly enable this for tests.

* Address review feedback

2 years agofix few Filesystem tests on FreeBSD (#65059)
Tomas Weinfurt [Thu, 24 Feb 2022 07:19:21 +0000 (23:19 -0800)]
fix few Filesystem tests on FreeBSD (#65059)

* fix few FileSystem tests on FreeBSD

* fix MoveDirectory_FailToMoveLowerCaseDirectoryWhenUpperCaseDirectoryExists

* feedback from review

2 years agoReduce alignment of dispatch maps (#65823)
Michal Strehovský [Thu, 24 Feb 2022 05:49:00 +0000 (14:49 +0900)]
Reduce alignment of dispatch maps (#65823)

We've been aligning these at 16 bytes [since dispatch maps were added](https://github.com/dotnet/corert/pull/626) in 2016. Not clear where the 16 came from. Rhbind seems to be aligning these at pointer boundaries, but we only place `ushort`s in here.

This likely results in some size savings.

2 years ago[MonoAPI] Split type and function headers, add MONO_API_FUNCTION macro (#65446)
Aleksey Kliger (λgeek) [Thu, 24 Feb 2022 03:52:46 +0000 (22:52 -0500)]
[MonoAPI] Split type and function headers, add MONO_API_FUNCTION macro (#65446)

* [monoapi] Split type and function headers, add MONO_API_FUNCTION macro

The idea is that the function header can be included multiple times with different definitions of MONO_API_FUNCTION in order to make it easier to re-used the definitions for embedding the runtime in late-binding scenarios

* rename public mono/mini subdirectory to mono/jit

  To match how embedders see the tree.

  Update the runtime to include <mono/jit/jit.h> instead of <mono/mini/jit.h>.

  No change in public API

* Add needed includes to mobile testing host templates

* add unstable API comment to the details headers, too

* use install(FILES) to copy the headers

  not other stray files to the include dir

* update CODEOWNERS

* Remove duplicate definitions of mono_event_get_remove_method

  This was already duplicated before the header reorganization, e.g. here https://github.com/dotnet/runtime/blob/b9a55b4f52243325359ced26e3d4b31ccacdc381/src/native/public/mono/metadata/class.h#L279-L282

2 years agoRemove checks and settings for Internal.Runtime.CompilerServices.Unsafe since that...
Jeremy Koritzinsky [Thu, 24 Feb 2022 03:17:58 +0000 (19:17 -0800)]
Remove checks and settings for Internal.Runtime.CompilerServices.Unsafe since that type is gone (#65809)

2 years agoUpdate GeneratedDllImportAttribute CharSet -> StringMarshalling (#65544)
Elinor Fung [Thu, 24 Feb 2022 02:36:10 +0000 (18:36 -0800)]
Update GeneratedDllImportAttribute CharSet -> StringMarshalling (#65544)

2 years ago[wasm] Misc Debugger improvements (including tests) (#65752)
Ankit Jain [Thu, 24 Feb 2022 01:08:23 +0000 (20:08 -0500)]
[wasm] Misc Debugger improvements (including tests) (#65752)

* [wasm][debugger] Fail test if an assertion is detected

* [wasm][debugger] Make DevToolsProxy's `pending_ops` thread-safe

Currently, `pending_ops` can get written by different threads at the
same time, and also read in parallel. This causes tests to randomly fail
with:

```
DevToolsProxy::Run: Exception System.ArgumentException: The tasks argument included a null value. (Parameter 'tasks')
    at System.Threading.Tasks.Task.WhenAny(Task[] tasks)
    at Microsoft.WebAssembly.Diagnostics.DevToolsProxy.Run(Uri browserUri, WebSocket ideSocket) in /_/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsProxy.cs:line 269
```

Instead, we use `Channel<T>` to add the ops, and then read those in
the main loop, and add to the *local* `pending_ops` list.

* [wasm] Install chrome for debugger tests

- controlled by `$(InstallChromeForDebuggerTests)` which defaults to
`true` for non-CI docker containers
- Useful for using the correct chrome version when testing locally, or
on codespaces

- Also, add support for detecting, and defaulting to such an
installation

* [wasm][debugger] Disable tests failing with runtime assertions

`DebuggerTests.EvaluateOnCallFrameTests.EvaluateSimpleMethodCallsError`: https://github.com/dotnet/runtime/issues/65744
`DebuggerTests.ArrayTests.InvalidArrayId`: https://github.com/dotnet/runtime/issues/65742

* [wasm][debugger] Fix NRE with `"null"` condition for a breakpoint

`ConditionalBreakpoint` test fails.
The test with condition=`"null"` failed with a NRE, instead of correctly
handling it as a condition that returns null.

```
Unable evaluate conditional breakpoint: System.Exception: Internal Error: Unable to run (null ),
    error: Object reference not set to an instance of an object..
    ---> System.NullReferenceException: Object reference not set to an instance of an object.
            at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 399
            --- End of inner exception stack trace ---
            at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 407
            at Microsoft.WebAssembly.Diagnostics.MonoProxy.EvaluateCondition(SessionId sessionId, ExecutionContext context, Frame mono_frame, Breakpoint bp, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 801 condition:null
```

* [wasm] Improve default message for ReturnAsErrorException,

.. since we seem to be not catching them as intended in many places.

* [wasm] Better log, and surface errors in evaluation conditional

.. breakpoints.
Catch the proper exception `ReturnAsErrorException`, so we can get the
actual error message. And log that as an error for the user too.

* [wasm][debugger] Allow setting proxy port for BrowserDebugHost

.. with `--proxy-port=<port>`.

Fixes https://github.com/dotnet/runtime/issues/65209 .

* [wasm][debugger] Handle errors in getting value for locals

Essentially, catch, and skip.

* message cleanup

* remove trailing space

2 years agoDisable packaging for DllImportGenerator for now (#65795)
Viktor Hofer [Wed, 23 Feb 2022 22:45:30 +0000 (23:45 +0100)]
Disable packaging for DllImportGenerator for now (#65795)

* Disable packaging for DllImportGenerator for now

For reasoning see https://github.com/dotnet/runtime/issues/65495#issuecomment-1049111768.

2 years agoAdd proposed plan for the COM source generator (#60143)
Jeremy Koritzinsky [Wed, 23 Feb 2022 22:26:24 +0000 (14:26 -0800)]
Add proposed plan for the COM source generator (#60143)

2 years ago[wasm][debugger] Add per-test ids, and save logs to files for the test, and proxy...
Ankit Jain [Wed, 23 Feb 2022 20:00:00 +0000 (15:00 -0500)]
[wasm][debugger] Add per-test ids, and save logs to files for the test, and proxy messages (#63564)

* [wasm][debugger] Add test ids, and log test output, and proxy messages

.. to files.

* log level cleanup

* [wasm][debugger] Allow setting proxy port for BrowserDebugHost

.. with `--proxy-port=<port>`.

Fixes https://github.com/dotnet/runtime/issues/65209 .

2 years ago[LoongArch64] submit some compiling depended files. (#65769)
Qiao Pengcheng [Wed, 23 Feb 2022 18:59:06 +0000 (02:59 +0800)]
[LoongArch64] submit some compiling depended files. (#65769)

2 years agoMake NegotiatedCipherSuiteTests.SupportedNonTls13CipherSuites lazy (#65771)
Radek Zikmund [Wed, 23 Feb 2022 18:08:05 +0000 (19:08 +0100)]
Make NegotiatedCipherSuiteTests.SupportedNonTls13CipherSuites lazy (#65771)

This greatly reduces number of exceptions thrown when debugging
System.Net.Security tests on Unix platforms

2 years agoChange default of SslServerAuthenticationOptions.AllowRenegotiation to false (#65777)
Radek Zikmund [Wed, 23 Feb 2022 17:42:12 +0000 (18:42 +0100)]
Change default of SslServerAuthenticationOptions.AllowRenegotiation to false (#65777)

Fixes #65547

2 years agoImplement HttpTelemetry for HTTP/3 (#65644)
Miha Zupan [Wed, 23 Feb 2022 16:28:51 +0000 (08:28 -0800)]
Implement HttpTelemetry for HTTP/3 (#65644)

2 years agoOptimize the Regex source generator's handling of `Compilation` objects. (#65431)
Theodore Tsirpanis [Wed, 23 Feb 2022 13:54:47 +0000 (15:54 +0200)]
Optimize the Regex source generator's handling of `Compilation` objects. (#65431)

* Optimize the Regex source generator's handling of Compilation objects.

* Use the common downlevel IsExternalInit file in the regex source generator.

And remove a now-unused file.

* Address PR feedback; revert to the old way of matching symbols.

* Fix an outdated comment.

2 years agoAdd missing GC.SuppressFinalize (#64997)
Adam Sitnik [Wed, 23 Feb 2022 09:24:01 +0000 (10:24 +0100)]
Add missing GC.SuppressFinalize (#64997)

2 years ago[EventPipe] Fix reverse connection socket leaking to child processes. (#65365)
Juan Hoyos [Wed, 23 Feb 2022 08:21:20 +0000 (00:21 -0800)]
[EventPipe] Fix reverse connection socket leaking to child processes. (#65365)

* [EventPipe] Fix reverse connection socket leaking to child processes.

2 years agoFix unwanted session caching in mutual authentication tests (#65739)
Radek Zikmund [Wed, 23 Feb 2022 08:01:56 +0000 (09:01 +0100)]
Fix unwanted session caching in mutual authentication tests (#65739)

2 years agoJIT: Faster vector == Vector128.Zero on arm64 (#65632)
Egor Bogatov [Wed, 23 Feb 2022 07:40:50 +0000 (10:40 +0300)]
JIT: Faster vector == Vector128.Zero on arm64 (#65632)

2 years ago[wasm][tests] Fix use of `RandomTest*Orderer` with trimming (#65754)
Ankit Jain [Wed, 23 Feb 2022 05:12:02 +0000 (00:12 -0500)]
[wasm][tests] Fix use of `RandomTest*Orderer` with trimming (#65754)

With trimming the tests would fail to load the types:
```
[21:11:50] info: Discovered:  System.Runtime.Tests.dll (found 6200 of 6302 test cases)
[21:11:50] info: Could not find type 'TestUtilities.RandomTestCaseOrderer' in TestUtilities for assembly-level test case orderer
[21:11:50] info: Could not find type 'TestUtilities.RandomTestCollectionOrderer' in TestUtilities for assembly-level test collection orderer
```

2 years agoFix entrypoint name. (#65745)
Jeremy Koritzinsky [Wed, 23 Feb 2022 03:28:40 +0000 (19:28 -0800)]
Fix entrypoint name. (#65745)

Fixes #65648

2 years agoFix inlining of IPAddress ctor (#65735)
Stephen Toub [Wed, 23 Feb 2022 02:55:47 +0000 (21:55 -0500)]
Fix inlining of IPAddress ctor (#65735)

2 years agoCleanup platform-specific ifdefs (#65624)
Jan Kotas [Wed, 23 Feb 2022 02:01:04 +0000 (18:01 -0800)]
Cleanup platform-specific ifdefs (#65624)

2 years ago[mono][jit] Remove support for -O=-float32, i.e. treating r4 values as r8 on the...
Zoltan Varga [Wed, 23 Feb 2022 01:44:00 +0000 (20:44 -0500)]
[mono][jit] Remove support for -O=-float32, i.e. treating r4 values as r8 on the IL stack. (#65740)

This is not compatible with coreclr, and it has been disabled
and untested for a long time.

2 years agoDeduplicate some HWI codegen code (#65302)
SingleAccretion [Wed, 23 Feb 2022 01:14:51 +0000 (04:14 +0300)]
Deduplicate some HWI codegen code (#65302)

* Add OperandDesc

* Clean two 'instr_XYZ' methods up

* Clean HWI codegen up using OperandDesc

2 years ago[docs] Create mono-thread-state-machine.md (#65720)
Aleksey Kliger (λgeek) [Wed, 23 Feb 2022 00:50:33 +0000 (19:50 -0500)]
[docs] Create mono-thread-state-machine.md (#65720)

* Create mono-thread-state-machine.md

  Add the thread state machine design document

* Add some sequence diagrams

* Add hybrid suspend race sequence diagram

* More details on self-transitions

* fix coop GC suspend discussion

* undo accidental deletion

2 years ago[mono] Remove an usage of g_utf8_strup (), its not needed. (#65727)
Zoltan Varga [Tue, 22 Feb 2022 22:11:12 +0000 (17:11 -0500)]
[mono] Remove an usage of g_utf8_strup (), its not needed. (#65727)

2 years agoAdd back StructWithPublicDefaultConstructor test (#65616)
Badre BSAILA [Tue, 22 Feb 2022 20:48:40 +0000 (21:48 +0100)]
Add back StructWithPublicDefaultConstructor test (#65616)

2 years ago[wasm][debugger] Add support for using Conditional* attributes for tests (#65684)
Ankit Jain [Tue, 22 Feb 2022 20:02:28 +0000 (15:02 -0500)]
[wasm][debugger] Add support for using Conditional* attributes for tests (#65684)

- Discoverer for `ActiveIssue` doesn't seem to be running, so that is
  not working right now.
- Only, `ConditionalFact`, and `ConditionalTheory` work

2 years agoAlways dispose inner stream in StreamPipeWriter.Complete* (#65462)
William Godbe [Tue, 22 Feb 2022 17:41:06 +0000 (09:41 -0800)]
Always dispose inner stream in StreamPipeWriter.Complete* (#65462)

* Always dispose inner stream in StreamPipeWriter.Complete*

* Add tests

* Fixup

* Update StreamPipeWriterTests.cs

2 years agoDisable no_tiered_compilation scenario for mono in run-test-job.yml (#65701)
Alexander Köplinger [Tue, 22 Feb 2022 17:34:03 +0000 (18:34 +0100)]
Disable no_tiered_compilation scenario for mono in run-test-job.yml (#65701)

Mono doesn't do tiered compilation today so we're just duplicating work that runs the same config.

2 years agoNetworkAddressChange.Unix: use async Socket API to wait for events. (#64614)
Tom Deseyn [Tue, 22 Feb 2022 17:31:45 +0000 (18:31 +0100)]
NetworkAddressChange.Unix: use async Socket API to wait for events. (#64614)

* NetworkAddressChange.Unix: use async Socket API to wait for events.

By replacing the raw handle with a Socket, we ensure only the handle
we own gets used.

By using the Socket async APIs we no longer need a dedicated Thread
to synchronously read the events.

* Fix compilation.

* PR feedback.

* Add logging of unexpected errors.

* Assert lock is entered.

2 years agoAllow SslStream in ConnectCallback (#63851)
Tomas Weinfurt [Tue, 22 Feb 2022 17:22:55 +0000 (09:22 -0800)]
Allow SslStream in ConnectCallback (#63851)

* Allow SslStream in ConnectCallback

* fix win7

* disable win7

2 years ago[main] Update dependencies from dotnet/linker (#65561)
dotnet-maestro[bot] [Tue, 22 Feb 2022 17:08:37 +0000 (18:08 +0100)]
[main] Update dependencies from dotnet/linker (#65561)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
2 years agoFix slngen.proj and update solution files (#65711)
Viktor Hofer [Tue, 22 Feb 2022 16:18:54 +0000 (17:18 +0100)]
Fix slngen.proj and update solution files (#65711)

* Fix slngen.proj

The SolutionName property is defined by the SDK and hence the condition was always true. Also the star (*) didn't expand when using the ValurOrDefault msbuild function. Fixing this by using a different name `SolutionNameOverride` and avoiding the ValueOrDefault msbuild function.

* Update solution files

Updating the solution files as those changed because of
microsoft/slngen@cb57e28 and apparently the solution files never were
updated.

2 years agoDo not set GLOB_REF for invariant indirections (#65709)
SingleAccretion [Tue, 22 Feb 2022 15:37:25 +0000 (18:37 +0300)]
Do not set GLOB_REF for invariant indirections (#65709)

The GTF_GLOB_REF flag in the compiler has the meaning that
the node marked with it produces a value that could be modified
by a call or an indirect store. It is used for optimizations
that need to know whether it is safe to reorder two trees.

Invariant indirections, by definition, always produce the
same value, and as such do not need to be marked with GLOB_REF.

Some nice diffs from args sorting: string literals can now
be put in the "late args" list directly (without a temp).

2 years ago[mono][interp] Fix conv.r.un from r4 (#65697)
Vlad Brezae [Tue, 22 Feb 2022 14:43:53 +0000 (16:43 +0200)]
[mono][interp] Fix conv.r.un from r4 (#65697)

2 years agoFix scheduled search in issue cleanup (#65699)
Eirik Tsarpalis [Tue, 22 Feb 2022 14:28:42 +0000 (14:28 +0000)]
Fix scheduled search in issue cleanup (#65699)

2 years agoAdded OnesComplement, Sqrt, Negate vector intrinsics (#65438)
Meri Khamoyan [Tue, 22 Feb 2022 11:58:49 +0000 (15:58 +0400)]
Added OnesComplement, Sqrt, Negate vector intrinsics (#65438)

* Added Not, Sqrt, Negate vector intrinsics

2 years agoRoll out automated issue cleanup (#65576)
Eirik Tsarpalis [Tue, 22 Feb 2022 10:22:29 +0000 (10:22 +0000)]
Roll out automated issue cleanup (#65576)

* Roll out automated issue cleanup

* Update .github/fabricbot.json

* Update .github/fabricbot.json

2 years agoEnsure all expected paths are logged on test failure (#65666)
Adam Sitnik [Tue, 22 Feb 2022 09:40:20 +0000 (10:40 +0100)]
Ensure all expected paths are logged on test failure (#65666)

* move duplicated logic to a method

* ensure all paths are logged, so we can diagnose #65601

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoMore clean up for RegexOptions.NonBacktracking (#65479)
Stephen Toub [Tue, 22 Feb 2022 00:12:47 +0000 (19:12 -0500)]
More clean up for RegexOptions.NonBacktracking (#65479)

* More clean up for RegexOptions.NonBacktracking

- Added more comments
- Removed some dead code and ifdef'd some code to DEBUG-only
- Updated an IComparable implementation to IComparable<T>
- Sealed some internal types
- Made UnicodeCategoryTheory into a static type
- Made CharSetSolver into a singleton
- Renamed a bunch of Mk* methods to Create*
- Renamed Watchdog
- Removed duplicative helper functions
- Fixed thread-safety of UnicodeCategoryTheory (in practice it was probably fine but we now have true singletons)
- Changed some iterators to be lists
- Used var less
- Cleaned up the set parsing code in RegexNodeConverter
- Lazily-initialized a bunch of members of SymbolicRegexBuilder
- Fixed a bug in the handling of \w
- And some other style stuff...

* Rename file

2 years agoFix Type.IsPublic for pointer and byref types (#65156)
Buyaa Namnan [Mon, 21 Feb 2022 23:35:46 +0000 (15:35 -0800)]
Fix Type.IsPublic for pointer and byref types (#65156)

2 years ago[wasm] Add support for a random test case orderer, for xunit tests (#65628)
Ankit Jain [Mon, 21 Feb 2022 21:58:09 +0000 (16:58 -0500)]
[wasm] Add support for a random test case orderer, for xunit tests (#65628)

* [wasm] Add support for a random test case orderer, for xunit tests

This is enabled by default for wasm with
`$(XUnitUseRandomizedTestOrderer)=true`.

When the library tests run, they print two messages like:

```
  info: Using random seed for test cases: 700149826
  info: Using random seed for collections: 700149826
  info: Starting:    System.Collections.Immutable.Tests.dll
```

These seeds are picked randomly every time the tests are run. To run the
tests with a specific seed, use environment variable
`XUNIT_RANDOM_ORDER_SEED`.

When running with tests, this can be used as:

    `WasmXHarnessMonoArgs="--setenv=XUNIT_RANDOM_ORDER_SEED=<seed>`

* Enable test orderer only for libraries tests

* [wasm] Automatically pass XUNIT_RANDOM_ORDER_SEED envvar to wasm apps

* Disable random test ordering for `System.Xml.RW.XmlWriterApi.Tests`

`System.Xml.Tests.TCCloseOutput.*` tests seem to depend on the order of
execution.

```
[06:35:14] fail: [FAIL] System.Xml.Tests.TCCloseOutput.CloseOutput_4(utils: XmlWriterUtils { Async = False, WriterType = UTF8Writer }, outputType: "Stream")
[06:35:14] info: System.IO.FileNotFoundException : File Not Found: writer.out
[06:35:14] info:    at XmlCoreTest.Common.FilePathUtil.getStream(String filename)
[06:35:14] info:    at System.Xml.Tests.TCCloseOutput.CloseOutput_4(XmlWriterUtils utils, String outputType)
[06:35:14] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

* [wasm] Disable random tests ordering for `System.Runtime.Loader`

It seems to cause failures like, reproducible with
`XUNIT_RANDOM_ORDER_SEED=2106784294`:

```
[06:25:43] fail: [FAIL] System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(alc: "Empty", assemblyName: "System.Runtime.Loader.Tests", culture: "en")
[06:25:43] info: Assert.Same() Failure
[06:25:43] info: Expected: "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0
[06:25:43] info: Actual:   "Empty" System.Runtime.Loader.AssemblyLoadContext #4
[06:25:43] info:    at System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(String alc, String assemblyName, String culture)
[06:25:43] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

* [wasm] Disable random test ordering for `System.Runtime.Numerics`

Randomized runs seem to fail with:

```
[03:29:54] info: Starting:    System.Runtime.Numerics.Tests.dll
[03:29:58] fail: [FAIL] System.Numerics.Tests.cast_toTest.RunDoubleExplicitCastToBigIntegerTests
[03:29:58] info: Assert.Equal() Failure
[03:29:58] info:           ↓ (pos 0)
[03:29:58] info: Expected: -0
[03:29:58] info: Actual:   0
[03:29:58] info:           ↑ (pos 0)
[03:29:58] info:    at System.Numerics.Tests.cast_toTest.VerifyDoubleExplicitCastToBigInteger(Double value)
[03:29:58] info:    at System.Numerics.Tests.cast_toTest.RunDoubleExplicitCastToBigIntegerTests()
[03:29:58] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

Reproducible with `XUNIT_RANDOM_SEED_ORDER=1883302047`.

* Add issues for the failing tests

2 years agoFix PGO jobs on official builds (#65669)
Alexander Köplinger [Mon, 21 Feb 2022 21:02:29 +0000 (22:02 +0100)]
Fix PGO jobs on official builds (#65669)

After https://github.com/dotnet/runtime/pull/65603 the official build failed because we missed passing in the `isOfficialBuild` variable on the PGO jobs.

* Don't sign PGO bits

* Don't run upload-intermediate-artifacts-step.yml for PGO leg

2 years agoDo not number partial definitions and `ARGPLACE` nodes (#64898)
SingleAccretion [Mon, 21 Feb 2022 19:25:35 +0000 (22:25 +0300)]
Do not number partial definitions and `ARGPLACE` nodes (#64898)

* Refactor LCL_VAR/FLD numbering

Do not number "partial definitions" - it is simply wasted work.

* Don't create unnecessary unique VNs

For ARGPLACE nodes, they will be overwritten when numbering the call.
For nodes that do not produce values, they serve no purpose, and just
waste memory.

Also, delete RET_EXPR/FTN_ADDR handling. They will never appear in VN.

* Fix printing for ASG(struct, CALL)

2 years agoJIT: revise approach for x64 OSR epilogs (#65609)
Andy Ayers [Mon, 21 Feb 2022 19:08:33 +0000 (11:08 -0800)]
JIT: revise approach for x64 OSR epilogs (#65609)

Rework x64 OSR so OSR methods have standard epilogs.

Details in attached doc.

2 years agoMove more things out of Internal/Cryptography
Kevin Jones [Mon, 21 Feb 2022 18:17:32 +0000 (13:17 -0500)]
Move more things out of Internal/Cryptography

2 years agoCleanup CLRConfig (#65655)
Adeel Mujahid [Mon, 21 Feb 2022 17:01:43 +0000 (19:01 +0200)]
Cleanup CLRConfig (#65655)

* Cleanup CLRConfig

Co-authored-by: Robin Sue <robinsue@live.de>
2 years agoFix liveness for dead non-removable partial definitions (#65618)
SingleAccretion [Mon, 21 Feb 2022 16:47:16 +0000 (19:47 +0300)]
Fix liveness for dead non-removable partial definitions (#65618)

* Harmonize front-end liveness with SSA

It is the case that in our SSA model "partial defs" are considered uses.

However, liveness was not considering them as such in one particular
case: when a dead partial store wasn't removed. The consequence of this
is that SSA would miss pushing a definition for the "use" portion of the
partial def.

This change fixes that.

Notably, back-end liveness does not need to pessimize itself like that
because we don't have SSA in the backend.

* Add test

2 years agoMove iOS/tvOS simulator and Android emulator legs from runtime-staging to runtime...
Maxim Lipnin [Mon, 21 Feb 2022 16:00:48 +0000 (19:00 +0300)]
Move iOS/tvOS simulator and Android emulator legs from runtime-staging to runtime-extra-platforms pipeline (#65551)

This change is to move the Apple mobile simulator (iOS/tvOS x64, iOS arm64) and Android emulator (x86/x64) CI leg definitions, used to build the whole product using Mono and run libraries tests, from runtime-staging to runtime-extra-platforms pipeline. The iOS simulator arm64 leg will remain on rolling build until we can get significantly more devices.

2 years agoFix several casing mismatches causing failures on Unix (#65639)
Tomáš Rylek [Mon, 21 Feb 2022 14:16:42 +0000 (15:16 +0100)]
Fix several casing mismatches causing failures on Unix (#65639)

While there might be a way to make the merged test wrapper infra tolerant to these casing
mismatches, in general they amount to one-off typos and I believe they are worth fixing.

Thanks

Tomas

2 years agoAlways build ref pack even in servicing releases (#65579)
Santiago Fernandez Madero [Mon, 21 Feb 2022 12:17:41 +0000 (04:17 -0800)]
Always build ref pack even in servicing releases (#65579)

This was already done in release/6.0 branch, this is just making sure we have it in main so that in future servicing branches this is already taken care of.

2 years agoAllow to run tests for internal AzDo PRs (#65603)
Santiago Fernandez Madero [Mon, 21 Feb 2022 12:12:44 +0000 (04:12 -0800)]
Allow to run tests for internal AzDo PRs (#65603)

Addresses https://github.com/dotnet/runtime/issues/47328

This allows to run tests when submitting PRs in AzDO.

2 years agoTreat TZCNT/POPCNT/LZCNT as never negative (#64951)
TrymPet [Mon, 21 Feb 2022 10:29:02 +0000 (11:29 +0100)]
Treat TZCNT/POPCNT/LZCNT as never negative (#64951)

2 years agoSuppress some new trimmer warnings (#65580)
Vitek Karas [Mon, 21 Feb 2022 10:28:47 +0000 (02:28 -0800)]
Suppress some new trimmer warnings (#65580)

The next update of linker will improve some data flow analysis and this uncovers more warnings in the libraries.
None of these warnings are a real problem, they're all basically inability to express the desired behavior with the current annotation system.

This change suppresses the new warnings.