From 7e9e36bc884af222671d508d11a4ab08f66a6747 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 22 Jul 2024 11:22:25 -0700 Subject: [PATCH 1/7] Mark the new tensor APIs as experimental for .NET 9 --- .../ref/System.Numerics.Tensors.netcore.cs | 8 ++++++++ .../System.Numerics.Tensors/src/System/NIndex.cs | 1 + .../System.Numerics.Tensors/src/System/NRange.cs | 1 + .../System/Numerics/Tensors/netcore/IReadOnlyTensor.cs | 1 + .../src/System/Numerics/Tensors/netcore/ITensor.cs | 2 ++ .../System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs | 1 + .../src/System/Numerics/Tensors/netcore/Tensor.Factory.cs | 1 + .../src/System/Numerics/Tensors/netcore/Tensor.cs | 2 ++ .../System/Numerics/Tensors/netcore/TensorExtensions.cs | 2 ++ .../src/System/Numerics/Tensors/netcore/TensorHelpers.cs | 2 ++ 10 files changed, 21 insertions(+) diff --git a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs index 820b2ea99058f..49bb81059dee1 100644 --- a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs +++ b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs @@ -6,6 +6,7 @@ namespace System.Buffers { + [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] public readonly partial struct NIndex : System.IEquatable { private readonly int _dummyPrimitive; @@ -29,6 +30,7 @@ namespace System.Buffers public System.Index ToIndexUnchecked() { throw null; } public override string ToString() { throw null; } } + [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] public readonly partial struct NRange : System.IEquatable { private readonly int _dummyPrimitive; @@ -53,6 +55,7 @@ namespace System.Buffers } namespace System.Numerics.Tensors { + [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] public partial interface IReadOnlyTensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable where TSelf : System.Numerics.Tensors.IReadOnlyTensor { static abstract TSelf? Empty { get; } @@ -80,6 +83,7 @@ public partial interface IReadOnlyTensor : System.Collections.Generic. bool TryCopyTo(scoped System.Numerics.Tensors.TensorSpan destination); bool TryFlattenTo(scoped System.Span destination); } + [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] public partial interface ITensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor where TSelf : System.Numerics.Tensors.ITensor { bool IsReadOnly { get; } @@ -98,6 +102,7 @@ public partial interface ITensor : System.Collections.Generic.IEnumera void Fill(T value); new ref T GetPinnableReference(); } + [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] public readonly ref partial struct ReadOnlyTensorSpan { private readonly object _dummy; @@ -157,6 +162,7 @@ public ref partial struct Enumerator public bool MoveNext() { throw null; } } } + [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] public static partial class Tensor { public static System.Numerics.Tensors.Tensor Abs(in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.INumberBase { throw null; } @@ -674,6 +680,7 @@ public static void Truncate(System.ReadOnlySpan x, System.Span destinat public static void Xor(System.ReadOnlySpan x, System.ReadOnlySpan y, System.Span destination) where T : System.Numerics.IBitwiseOperators { } public static void Xor(System.ReadOnlySpan x, T y, System.Span destination) where T : System.Numerics.IBitwiseOperators { } } + [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] public readonly ref partial struct TensorSpan { private readonly object _dummy; @@ -735,6 +742,7 @@ public ref partial struct Enumerator public bool MoveNext() { throw null; } } } + [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] public sealed partial class Tensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor, T>, System.Numerics.Tensors.ITensor, T> { internal Tensor() { } diff --git a/src/libraries/System.Numerics.Tensors/src/System/NIndex.cs b/src/libraries/System.Numerics.Tensors/src/System/NIndex.cs index 512d1ecb7ac5b..1d6ebb64e3280 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/NIndex.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/NIndex.cs @@ -14,6 +14,7 @@ namespace System.Buffers /// int lastElement = someArray[^1]; // lastElement = 5 /// /// + [Experimental("SNTEXP0001")] public readonly struct NIndex : IEquatable { private readonly nint _value; diff --git a/src/libraries/System.Numerics.Tensors/src/System/NRange.cs b/src/libraries/System.Numerics.Tensors/src/System/NRange.cs index 974407fae1679..bde8422bafba6 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/NRange.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/NRange.cs @@ -15,6 +15,7 @@ namespace System.Buffers /// int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 } /// /// + [Experimental("SNTEXP0001")] public readonly struct NRange : IEquatable { /// Represent the inclusive start NIndex of the NRange. diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor.cs index e9072f160bb60..36819146a1af6 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor.cs @@ -7,6 +7,7 @@ namespace System.Numerics.Tensors { + [Experimental("SNTEXP0001")] public interface IReadOnlyTensor : IEnumerable where TSelf : IReadOnlyTensor { diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ITensor.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ITensor.cs index b88169543aa6f..2cd1798adf9ae 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ITensor.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ITensor.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; +using System.Diagnostics.CodeAnalysis; namespace System.Numerics.Tensors { + [Experimental("SNTEXP0001")] public interface ITensor : IReadOnlyTensor where TSelf : ITensor diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs index 7fd72d6e47a6c..29d896d78f0b0 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs @@ -21,6 +21,7 @@ namespace System.Numerics.Tensors /// [DebuggerTypeProxy(typeof(TensorSpanDebugView<>))] [DebuggerDisplay("{ToString(),raw}")] + [Experimental("SNTEXP0001")] public readonly ref struct ReadOnlyTensorSpan { /// A byref or a native ptr. diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.Factory.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.Factory.cs index dea1d54b0a3ba..5c9d78558cd71 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.Factory.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.Factory.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.InteropServices; using Microsoft.VisualBasic; diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs index 92030f4877d4c..36188d56a1ec7 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection.Metadata.Ecma335; using System.Runtime.CompilerServices; @@ -17,6 +18,7 @@ namespace System.Numerics.Tensors { + [Experimental("SNTEXP0001")] public sealed class Tensor : ITensor, T> { diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs index 506655fd13234..039012a15bf4c 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs @@ -11,12 +11,14 @@ using static System.Runtime.InteropServices.JavaScript.JSType; using System.Security.Cryptography; using System.Runtime.Serialization; +using System.Diagnostics.CodeAnalysis; #pragma warning disable CS8601 // Possible null reference assignment. #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. namespace System.Numerics.Tensors { + [Experimental("SNTEXP0001")] public static partial class Tensor { #region AsReadOnlySpan diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorHelpers.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorHelpers.cs index 76e541a25be1c..96c739552b1ef 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorHelpers.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorHelpers.cs @@ -2,11 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.InteropServices; namespace System.Numerics.Tensors { + [Experimental("SNTEXP0001")] internal static class TensorHelpers { From 85c2c9a9659e9b3abd065e735f10409f877f1df4 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 22 Jul 2024 13:36:07 -0700 Subject: [PATCH 2/7] Apply SNTEXP0001 to other internal API --- .../src/System/Numerics/Tensors/netcore/TensorShape.cs | 2 ++ .../src/System/Numerics/Tensors/netcore/TensorSpan.cs | 1 + .../src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs | 3 +++ .../src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs | 3 +++ 4 files changed, 9 insertions(+) diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs index f3b4380cc3f29..7bc10e0f7b288 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs @@ -8,6 +8,8 @@ namespace System.Numerics.Tensors { + + [Experimental("SNTEXP0001")] internal readonly struct TensorShape { // Used to determine when we need to allocate a metadata array diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs index 66a7940256fc6..27623bcdd86ca 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs @@ -21,6 +21,7 @@ namespace System.Numerics.Tensors /// [DebuggerTypeProxy(typeof(TensorSpanDebugView<>))] [DebuggerDisplay("{ToString(),raw}")] + [Experimental("SNTEXP0001")] public readonly ref struct TensorSpan { /// A byref or a native ptr. diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs index ab6073a52341a..26f0de6b19b5c 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs @@ -2,9 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace System.Numerics.Tensors { + + [Experimental("SNTEXP0001")] internal sealed class TensorSpanDebugView { private readonly T[] _array; diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs index 313f4556e5add..ee84ee35821ae 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs @@ -4,12 +4,15 @@ using System.Buffers; using System.Collections.Specialized; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; namespace System.Numerics.Tensors { + + [Experimental("SNTEXP0001")] internal static partial class TensorSpanHelpers { internal static bool AreShapesTheSame(ReadOnlyTensorSpan tensor1, ReadOnlyTensorSpan tensor2) From 6a66f6ef47e6ed30cb33463ab0e8928997c11c57 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 22 Jul 2024 14:05:17 -0700 Subject: [PATCH 3/7] Suppress SNTEXP0001 in System.Numerics.Tensors.Tests --- .../tests/System.Numerics.Tensors.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj b/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj index 136e487d70d0a..db0820d96c1e1 100644 --- a/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj +++ b/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj @@ -3,6 +3,7 @@ $(NetCoreAppCurrent);$(NetFrameworkMinimum) true + $(NoWarn);SNTEXP0001 From 754ba624e49d631968798e010431bdd9cdacc778 Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Mon, 22 Jul 2024 14:49:12 -0700 Subject: [PATCH 4/7] Use SYSLIB5001. Central registration of experimental API diagnostic ids. --- docs/project/list-of-diagnostics.md | 17 ++++++++++++ .../System.Numerics.Tensors.sln | 26 ++++++++++++------- .../ref/System.Numerics.Tensors.netcore.cs | 16 ++++++------ .../src/System.Numerics.Tensors.csproj | 3 +++ .../src/System/NIndex.cs | 2 +- .../src/System/NRange.cs | 2 +- .../Tensors/netcore/IReadOnlyTensor.cs | 2 +- .../Numerics/Tensors/netcore/ITensor.cs | 2 +- .../Tensors/netcore/ReadOnlyTensorSpan.cs | 2 +- .../System/Numerics/Tensors/netcore/Tensor.cs | 2 +- .../Tensors/netcore/TensorExtensions.cs | 2 +- .../Numerics/Tensors/netcore/TensorHelpers.cs | 2 +- .../Numerics/Tensors/netcore/TensorShape.cs | 2 +- .../Numerics/Tensors/netcore/TensorSpan.cs | 2 +- .../Tensors/netcore/TensorSpanDebugView.cs | 2 +- .../Tensors/netcore/TensorSpanHelpers.cs | 2 +- .../System.Numerics.Tensors.Tests.csproj | 3 ++- 17 files changed, 59 insertions(+), 30 deletions(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index c8295e99c70b6..6f3c52063df44 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -276,3 +276,20 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL | __`SYSLIBSUPPRESS0001`__ | CA1822 | Do not offer to make methods static when the methods need to be instance methods for a custom marshaller shape. | | __`SYSLIBSUPPRESS0002`__ | IL2026 | ConfigurationBindingGenerator: suppress RequiresUnreferencedCode diagnostic for binding call that has been intercepted by a generated static variant. | | __`SYSLIBSUPPRESS0003`__ | IL3050 | ConfigurationBindingGenerator: suppress RequiresDynamicCode diagnostic for binding call that has been intercepted by a generated static variant. | + +## Experimental APIs + +APIs can be marked as `[Experimental]` if their shape or functionality is included in a release but not yet officially supported. Experimental APIs offer the opportunity to collect customer feedback on these APIs in a major release, usually refining the APIs and removing the `[Experimental]` attribute in the next release. The `[Experimental]` attribute differs from `[RequiresPreviewFeatures]`, wherein: + +* `[RequiresPreviewFeatures]` APIs require a corresponding preview feature in another product area such as the compiler or SDK +* `[Experimental]` APIs are entirely self-contained within the libraries and do not require preview features in other parts of the product + +The diagnostic id values reserved for experimental APIs are `SYSLIB5001` through `SYSLIB5999`. When marking an API as `[Experimental]`, claim the next three-digit identifier in the `SYSLIB5###` sequence and add it to the list below. The URL template for all experimental APIs is `https://aka.ms/dotnet-warnings/{0}`. The `{0}` placeholder is replaced by the compiler with the `SYSLIB5###` identifier. + +### Experimental Diagnostics (`SYSLIB5001` - `SYSLIB5999`) + +Diagnostic id values for experimental APIs must not be recycled, as that could silently opt customers into new experimental APIs where they had previously suppressed the ID for a previous usage of the value. + +| Diagnostic ID | Introduced | Removed | Description | +| :---------------- | ---------: | ------: | :---------- | +| __`SYSLIB5001`__ | .NET 9 | TBD | `Tensor` and related APIs in System.Numerics.Tensors are experimental in .NET 9 | diff --git a/src/libraries/System.Numerics.Tensors/System.Numerics.Tensors.sln b/src/libraries/System.Numerics.Tensors/System.Numerics.Tensors.sln index 959740a6408ae..6859052616e8d 100644 --- a/src/libraries/System.Numerics.Tensors/System.Numerics.Tensors.sln +++ b/src/libraries/System.Numerics.Tensors/System.Numerics.Tensors.sln @@ -1,4 +1,8 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35027.167 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{9F20CEA1-2216-4432-BBBD-F01E05D17F23}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bcl.Numerics", "..\Microsoft.Bcl.Numerics\ref\Microsoft.Bcl.Numerics.csproj", "{D311ABE4-10A9-4BB1-89CE-6358C55501A8}" @@ -35,11 +39,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DF0561A1-3AB EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{841A2FA4-A95F-4612-A8B9-AD2EF769BC71}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "tools\gen", "{A21C99E7-E22B-470E-BF48-56B00AFE3D34}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{A21C99E7-E22B-470E-BF48-56B00AFE3D34}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "tools\src", "{25B37C75-C737-4AE8-9260-74A79870C8B8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{25B37C75-C737-4AE8-9260-74A79870C8B8}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "tools\ref", "{9482D7C5-F37C-40FC-B057-A16C1ED1C121}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{9482D7C5-F37C-40FC-B057-A16C1ED1C121}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B}" EndProject @@ -111,24 +115,28 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {9F20CEA1-2216-4432-BBBD-F01E05D17F23} = {DE94CA7D-BB10-4865-85A6-6B694631247F} - {46AD9423-D8C3-44BB-A201-1CCCAB4C6DAF} = {DE94CA7D-BB10-4865-85A6-6B694631247F} - {4AF6A02D-82C8-4898-9EDF-01F107C25061} = {DE94CA7D-BB10-4865-85A6-6B694631247F} {D311ABE4-10A9-4BB1-89CE-6358C55501A8} = {7AC4B2C7-A55C-4C4F-9B02-77F5CBFFF4AB} - {21CB448A-3882-4337-B416-D1A3E0BCFFC5} = {7AC4B2C7-A55C-4C4F-9B02-77F5CBFFF4AB} {1578185F-C4FA-4866-936B-E62AAEDD03B7} = {DF0561A1-3AB8-4B51-AFB4-392EE1DD6247} + {21CB448A-3882-4337-B416-D1A3E0BCFFC5} = {7AC4B2C7-A55C-4C4F-9B02-77F5CBFFF4AB} {848DD000-3D22-4A25-A9D9-05AFF857A116} = {DF0561A1-3AB8-4B51-AFB4-392EE1DD6247} + {46AD9423-D8C3-44BB-A201-1CCCAB4C6DAF} = {DE94CA7D-BB10-4865-85A6-6B694631247F} + {4AF6A02D-82C8-4898-9EDF-01F107C25061} = {DE94CA7D-BB10-4865-85A6-6B694631247F} {4588351F-4233-4957-B84C-7F8E22B8888A} = {841A2FA4-A95F-4612-A8B9-AD2EF769BC71} {DB954E01-898A-4FE2-A3AA-180D041AB08F} = {841A2FA4-A95F-4612-A8B9-AD2EF769BC71} {04FC0651-B9D0-448A-A28B-11B1D4A897F4} = {A21C99E7-E22B-470E-BF48-56B00AFE3D34} {683A7D28-CC55-4375-848D-E659075ECEE4} = {A21C99E7-E22B-470E-BF48-56B00AFE3D34} - {A21C99E7-E22B-470E-BF48-56B00AFE3D34} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} {1CBEAEA8-2CA1-4B07-9930-35A785205852} = {25B37C75-C737-4AE8-9260-74A79870C8B8} {BA7828B1-7953-47A0-AE5A-E22B501C4BD0} = {25B37C75-C737-4AE8-9260-74A79870C8B8} - {25B37C75-C737-4AE8-9260-74A79870C8B8} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} {57E57290-3A6A-43F8-8764-D4DC8151F89C} = {9482D7C5-F37C-40FC-B057-A16C1ED1C121} + {A21C99E7-E22B-470E-BF48-56B00AFE3D34} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} + {25B37C75-C737-4AE8-9260-74A79870C8B8} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} {9482D7C5-F37C-40FC-B057-A16C1ED1C121} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {10A5F2C3-5230-4916-9D4D-BBDB94851037} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{683a7d28-cc55-4375-848d-e659075ecee4}*SharedItemsImports = 5 + ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{ba7828b1-7953-47a0-ae5a-e22b501c4bd0}*SharedItemsImports = 5 + EndGlobalSection EndGlobal diff --git a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs index 49bb81059dee1..95e877bb6ccdd 100644 --- a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs +++ b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs @@ -6,7 +6,7 @@ namespace System.Buffers { - [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public readonly partial struct NIndex : System.IEquatable { private readonly int _dummyPrimitive; @@ -30,7 +30,7 @@ namespace System.Buffers public System.Index ToIndexUnchecked() { throw null; } public override string ToString() { throw null; } } - [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] public readonly partial struct NRange : System.IEquatable { private readonly int _dummyPrimitive; @@ -55,7 +55,7 @@ namespace System.Buffers } namespace System.Numerics.Tensors { - [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] public partial interface IReadOnlyTensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable where TSelf : System.Numerics.Tensors.IReadOnlyTensor { static abstract TSelf? Empty { get; } @@ -83,7 +83,7 @@ public partial interface IReadOnlyTensor : System.Collections.Generic. bool TryCopyTo(scoped System.Numerics.Tensors.TensorSpan destination); bool TryFlattenTo(scoped System.Span destination); } - [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] public partial interface ITensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor where TSelf : System.Numerics.Tensors.ITensor { bool IsReadOnly { get; } @@ -102,7 +102,7 @@ public partial interface ITensor : System.Collections.Generic.IEnumera void Fill(T value); new ref T GetPinnableReference(); } - [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] public readonly ref partial struct ReadOnlyTensorSpan { private readonly object _dummy; @@ -162,7 +162,7 @@ public ref partial struct Enumerator public bool MoveNext() { throw null; } } } - [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] public static partial class Tensor { public static System.Numerics.Tensors.Tensor Abs(in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.INumberBase { throw null; } @@ -680,7 +680,7 @@ public static void Truncate(System.ReadOnlySpan x, System.Span destinat public static void Xor(System.ReadOnlySpan x, System.ReadOnlySpan y, System.Span destination) where T : System.Numerics.IBitwiseOperators { } public static void Xor(System.ReadOnlySpan x, T y, System.Span destination) where T : System.Numerics.IBitwiseOperators { } } - [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] public readonly ref partial struct TensorSpan { private readonly object _dummy; @@ -742,7 +742,7 @@ public ref partial struct Enumerator public bool MoveNext() { throw null; } } } - [System.Diagnostics.CodeAnalysis.Experimental("SNTEXP0001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] public sealed partial class Tensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor, T>, System.Numerics.Tensors.ITensor, T> { internal Tensor() { } diff --git a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj index b653420933405..a00f26dde57de 100644 --- a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj +++ b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj @@ -7,12 +7,15 @@ Provides support for operating over tensors. ReferenceAssemblyExclusions.txt true + + $(NoWarn);SYSLIB5001 + diff --git a/src/libraries/System.Numerics.Tensors/src/System/NIndex.cs b/src/libraries/System.Numerics.Tensors/src/System/NIndex.cs index 1d6ebb64e3280..0ccfebea718b7 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/NIndex.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/NIndex.cs @@ -14,7 +14,7 @@ namespace System.Buffers /// int lastElement = someArray[^1]; // lastElement = 5 /// /// - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] public readonly struct NIndex : IEquatable { private readonly nint _value; diff --git a/src/libraries/System.Numerics.Tensors/src/System/NRange.cs b/src/libraries/System.Numerics.Tensors/src/System/NRange.cs index bde8422bafba6..5335da4488e1f 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/NRange.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/NRange.cs @@ -15,7 +15,7 @@ namespace System.Buffers /// int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 } /// /// - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] public readonly struct NRange : IEquatable { /// Represent the inclusive start NIndex of the NRange. diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor.cs index 36819146a1af6..de5611c765edc 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/IReadOnlyTensor.cs @@ -7,7 +7,7 @@ namespace System.Numerics.Tensors { - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] public interface IReadOnlyTensor : IEnumerable where TSelf : IReadOnlyTensor { diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ITensor.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ITensor.cs index 2cd1798adf9ae..83abcc1def2fb 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ITensor.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ITensor.cs @@ -6,7 +6,7 @@ namespace System.Numerics.Tensors { - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] public interface ITensor : IReadOnlyTensor where TSelf : ITensor diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs index 29d896d78f0b0..5122ca3e8513a 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/ReadOnlyTensorSpan.cs @@ -21,7 +21,7 @@ namespace System.Numerics.Tensors /// [DebuggerTypeProxy(typeof(TensorSpanDebugView<>))] [DebuggerDisplay("{ToString(),raw}")] - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] public readonly ref struct ReadOnlyTensorSpan { /// A byref or a native ptr. diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs index 36188d56a1ec7..48d87aa7ca6da 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/Tensor.cs @@ -18,7 +18,7 @@ namespace System.Numerics.Tensors { - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] public sealed class Tensor : ITensor, T> { diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs index 039012a15bf4c..904bf14c63437 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs @@ -18,7 +18,7 @@ namespace System.Numerics.Tensors { - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] public static partial class Tensor { #region AsReadOnlySpan diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorHelpers.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorHelpers.cs index 96c739552b1ef..163075ce5c13d 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorHelpers.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorHelpers.cs @@ -8,7 +8,7 @@ namespace System.Numerics.Tensors { - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] internal static class TensorHelpers { diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs index 7bc10e0f7b288..5aa155efff6a4 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorShape.cs @@ -9,7 +9,7 @@ namespace System.Numerics.Tensors { - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] internal readonly struct TensorShape { // Used to determine when we need to allocate a metadata array diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs index 27623bcdd86ca..c2d12bd7e814c 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpan.cs @@ -21,7 +21,7 @@ namespace System.Numerics.Tensors /// [DebuggerTypeProxy(typeof(TensorSpanDebugView<>))] [DebuggerDisplay("{ToString(),raw}")] - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] public readonly ref struct TensorSpan { /// A byref or a native ptr. diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs index 26f0de6b19b5c..4b694d7d72f57 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanDebugView.cs @@ -7,7 +7,7 @@ namespace System.Numerics.Tensors { - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] internal sealed class TensorSpanDebugView { private readonly T[] _array; diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs index ee84ee35821ae..d84b1130c96c3 100644 --- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs +++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorSpanHelpers.cs @@ -12,7 +12,7 @@ namespace System.Numerics.Tensors { - [Experimental("SNTEXP0001")] + [Experimental(Experimentals.TensorTDiagId, UrlFormat = Experimentals.SharedUrlFormat)] internal static partial class TensorSpanHelpers { internal static bool AreShapesTheSame(ReadOnlyTensorSpan tensor1, ReadOnlyTensorSpan tensor2) diff --git a/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj b/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj index db0820d96c1e1..dbdfad69dc531 100644 --- a/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj +++ b/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj @@ -3,7 +3,8 @@ $(NetCoreAppCurrent);$(NetFrameworkMinimum) true - $(NoWarn);SNTEXP0001 + + $(NoWarn);SYSLIB5001 From 2abdd18ad5c27a874c6ce8f2a5b9c12f00a8e813 Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Mon, 22 Jul 2024 14:49:43 -0700 Subject: [PATCH 5/7] Add Experimentals.cs (missed in prior commit) --- .../Common/src/System/Experimentals.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/libraries/Common/src/System/Experimentals.cs diff --git a/src/libraries/Common/src/System/Experimentals.cs b/src/libraries/Common/src/System/Experimentals.cs new file mode 100644 index 0000000000000..befcdca48327d --- /dev/null +++ b/src/libraries/Common/src/System/Experimentals.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System +{ + internal static class Experimentals + { + internal const string SharedUrlFormat = "https://aka.ms/dotnet-warnings/{0}"; + + // Please see docs\project\list-of-diagnostics.md for instructions on the steps required + // to introduce an experimental API, claim a diagnostic id, and ensure the + // "aka.ms/dotnet-warnings/{0}" URL points to documentation for the API. + // The diagnostic IDs reserved for experimental APIs are SYSLIB5### (SYSLIB5001 - SYSLIB5999). + + // When an API is no longer marked as experimental, the diagnostic ID should be removed from this file + // but retained in the table in docs\project\list-of-diagnostics.md to prevent reuse. Be sure to remove + // suppressions from the codebase as well. + + // Tensor and related APIs are marked as [Experimental] in .NET 9 + internal const string TensorTDiagId = "SYSLIB5001"; + + // When adding a new diagnostic ID, add it to the table in docs\project\list-of-diagnostics.md as well. + // Keep new const identifiers above this comment. + } +} From b4baee96784046c8b4636c9afb6d7177d57923ae Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Mon, 22 Jul 2024 15:01:32 -0700 Subject: [PATCH 6/7] Revert SLN changes. Add UrlFormat property to attributes where missing. --- .../System.Numerics.Tensors.sln | 26 +++++++------------ .../ref/System.Numerics.Tensors.netcore.cs | 14 +++++----- .../src/System.Numerics.Tensors.csproj | 2 +- .../System.Numerics.Tensors.Tests.csproj | 2 +- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/src/libraries/System.Numerics.Tensors/System.Numerics.Tensors.sln b/src/libraries/System.Numerics.Tensors/System.Numerics.Tensors.sln index 6859052616e8d..959740a6408ae 100644 --- a/src/libraries/System.Numerics.Tensors/System.Numerics.Tensors.sln +++ b/src/libraries/System.Numerics.Tensors/System.Numerics.Tensors.sln @@ -1,8 +1,4 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.10.35027.167 -MinimumVisualStudioVersion = 10.0.40219.1 +Microsoft Visual Studio Solution File, Format Version 12.00 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{9F20CEA1-2216-4432-BBBD-F01E05D17F23}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bcl.Numerics", "..\Microsoft.Bcl.Numerics\ref\Microsoft.Bcl.Numerics.csproj", "{D311ABE4-10A9-4BB1-89CE-6358C55501A8}" @@ -39,11 +35,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DF0561A1-3AB EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{841A2FA4-A95F-4612-A8B9-AD2EF769BC71}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{A21C99E7-E22B-470E-BF48-56B00AFE3D34}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "tools\gen", "{A21C99E7-E22B-470E-BF48-56B00AFE3D34}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{25B37C75-C737-4AE8-9260-74A79870C8B8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "tools\src", "{25B37C75-C737-4AE8-9260-74A79870C8B8}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{9482D7C5-F37C-40FC-B057-A16C1ED1C121}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "tools\ref", "{9482D7C5-F37C-40FC-B057-A16C1ED1C121}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B}" EndProject @@ -115,28 +111,24 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {9F20CEA1-2216-4432-BBBD-F01E05D17F23} = {DE94CA7D-BB10-4865-85A6-6B694631247F} + {46AD9423-D8C3-44BB-A201-1CCCAB4C6DAF} = {DE94CA7D-BB10-4865-85A6-6B694631247F} + {4AF6A02D-82C8-4898-9EDF-01F107C25061} = {DE94CA7D-BB10-4865-85A6-6B694631247F} {D311ABE4-10A9-4BB1-89CE-6358C55501A8} = {7AC4B2C7-A55C-4C4F-9B02-77F5CBFFF4AB} - {1578185F-C4FA-4866-936B-E62AAEDD03B7} = {DF0561A1-3AB8-4B51-AFB4-392EE1DD6247} {21CB448A-3882-4337-B416-D1A3E0BCFFC5} = {7AC4B2C7-A55C-4C4F-9B02-77F5CBFFF4AB} + {1578185F-C4FA-4866-936B-E62AAEDD03B7} = {DF0561A1-3AB8-4B51-AFB4-392EE1DD6247} {848DD000-3D22-4A25-A9D9-05AFF857A116} = {DF0561A1-3AB8-4B51-AFB4-392EE1DD6247} - {46AD9423-D8C3-44BB-A201-1CCCAB4C6DAF} = {DE94CA7D-BB10-4865-85A6-6B694631247F} - {4AF6A02D-82C8-4898-9EDF-01F107C25061} = {DE94CA7D-BB10-4865-85A6-6B694631247F} {4588351F-4233-4957-B84C-7F8E22B8888A} = {841A2FA4-A95F-4612-A8B9-AD2EF769BC71} {DB954E01-898A-4FE2-A3AA-180D041AB08F} = {841A2FA4-A95F-4612-A8B9-AD2EF769BC71} {04FC0651-B9D0-448A-A28B-11B1D4A897F4} = {A21C99E7-E22B-470E-BF48-56B00AFE3D34} {683A7D28-CC55-4375-848D-E659075ECEE4} = {A21C99E7-E22B-470E-BF48-56B00AFE3D34} + {A21C99E7-E22B-470E-BF48-56B00AFE3D34} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} {1CBEAEA8-2CA1-4B07-9930-35A785205852} = {25B37C75-C737-4AE8-9260-74A79870C8B8} {BA7828B1-7953-47A0-AE5A-E22B501C4BD0} = {25B37C75-C737-4AE8-9260-74A79870C8B8} - {57E57290-3A6A-43F8-8764-D4DC8151F89C} = {9482D7C5-F37C-40FC-B057-A16C1ED1C121} - {A21C99E7-E22B-470E-BF48-56B00AFE3D34} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} {25B37C75-C737-4AE8-9260-74A79870C8B8} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} + {57E57290-3A6A-43F8-8764-D4DC8151F89C} = {9482D7C5-F37C-40FC-B057-A16C1ED1C121} {9482D7C5-F37C-40FC-B057-A16C1ED1C121} = {F9C2AAB1-C7B0-4E43-BB18-4FB16F6E272B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {10A5F2C3-5230-4916-9D4D-BBDB94851037} EndGlobalSection - GlobalSection(SharedMSBuildProjectFiles) = preSolution - ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{683a7d28-cc55-4375-848d-e659075ecee4}*SharedItemsImports = 5 - ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{ba7828b1-7953-47a0-ae5a-e22b501c4bd0}*SharedItemsImports = 5 - EndGlobalSection EndGlobal diff --git a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs index 95e877bb6ccdd..9a4b08633db1d 100644 --- a/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs +++ b/src/libraries/System.Numerics.Tensors/ref/System.Numerics.Tensors.netcore.cs @@ -30,7 +30,7 @@ namespace System.Buffers public System.Index ToIndexUnchecked() { throw null; } public override string ToString() { throw null; } } - [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public readonly partial struct NRange : System.IEquatable { private readonly int _dummyPrimitive; @@ -55,7 +55,7 @@ namespace System.Buffers } namespace System.Numerics.Tensors { - [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public partial interface IReadOnlyTensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable where TSelf : System.Numerics.Tensors.IReadOnlyTensor { static abstract TSelf? Empty { get; } @@ -83,7 +83,7 @@ public partial interface IReadOnlyTensor : System.Collections.Generic. bool TryCopyTo(scoped System.Numerics.Tensors.TensorSpan destination); bool TryFlattenTo(scoped System.Span destination); } - [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public partial interface ITensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor where TSelf : System.Numerics.Tensors.ITensor { bool IsReadOnly { get; } @@ -102,7 +102,7 @@ public partial interface ITensor : System.Collections.Generic.IEnumera void Fill(T value); new ref T GetPinnableReference(); } - [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public readonly ref partial struct ReadOnlyTensorSpan { private readonly object _dummy; @@ -162,7 +162,7 @@ public ref partial struct Enumerator public bool MoveNext() { throw null; } } } - [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public static partial class Tensor { public static System.Numerics.Tensors.Tensor Abs(in System.Numerics.Tensors.ReadOnlyTensorSpan x) where T : System.Numerics.INumberBase { throw null; } @@ -680,7 +680,7 @@ public static void Truncate(System.ReadOnlySpan x, System.Span destinat public static void Xor(System.ReadOnlySpan x, System.ReadOnlySpan y, System.Span destination) where T : System.Numerics.IBitwiseOperators { } public static void Xor(System.ReadOnlySpan x, T y, System.Span destination) where T : System.Numerics.IBitwiseOperators { } } - [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public readonly ref partial struct TensorSpan { private readonly object _dummy; @@ -742,7 +742,7 @@ public ref partial struct Enumerator public bool MoveNext() { throw null; } } } - [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001")] + [System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public sealed partial class Tensor : System.Collections.Generic.IEnumerable, System.Collections.IEnumerable, System.Numerics.Tensors.IReadOnlyTensor, T>, System.Numerics.Tensors.ITensor, T> { internal Tensor() { } diff --git a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj index a00f26dde57de..9b4b736bd0689 100644 --- a/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj +++ b/src/libraries/System.Numerics.Tensors/src/System.Numerics.Tensors.csproj @@ -7,7 +7,7 @@ Provides support for operating over tensors. ReferenceAssemblyExclusions.txt true - + $(NoWarn);SYSLIB5001 diff --git a/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj b/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj index dbdfad69dc531..cce46f3a5eb64 100644 --- a/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj +++ b/src/libraries/System.Numerics.Tensors/tests/System.Numerics.Tensors.Tests.csproj @@ -3,7 +3,7 @@ $(NetCoreAppCurrent);$(NetFrameworkMinimum) true - + $(NoWarn);SYSLIB5001 From 5bb1e6e69a54cfc4dd53bd2308704442b742ba7b Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 22 Jul 2024 15:35:19 -0700 Subject: [PATCH 7/7] Ensure the net8 tensors tests also don't warn for the experimental API usage --- .../Net8Tests/System.Numerics.Tensors.Net8.Tests.csproj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Numerics.Tensors/tests/Net8Tests/System.Numerics.Tensors.Net8.Tests.csproj b/src/libraries/System.Numerics.Tensors/tests/Net8Tests/System.Numerics.Tensors.Net8.Tests.csproj index 1f8f82a11dc84..1240240ca52b8 100644 --- a/src/libraries/System.Numerics.Tensors/tests/Net8Tests/System.Numerics.Tensors.Net8.Tests.csproj +++ b/src/libraries/System.Numerics.Tensors/tests/Net8Tests/System.Numerics.Tensors.Net8.Tests.csproj @@ -6,11 +6,12 @@ --> - + $(NetCoreAppCurrent) true $(DefineConstants);SNT_NET8_TESTS + $(NoWarn);SYSLIB5001 @@ -21,7 +22,7 @@ - + TargetFramework=net8.0