Skip to content

[API Proposal]: Mark Vector-related APIs as caller-unsafe #128075

Open

Description

@EgorBo

Background and motivation

#125145 Annotate All Vector-related APIs as caller-unsafe because all of these either:

  • Perform memory accesses without bound checks
  • May return uninitialized memory in their components.

I'm using a diff format where + indicates that it's now caller-unsafe and - indicates the unsafe modifier has been removed (a non-breaking change).

API Proposal

namespace System.Runtime.Intrinsics

namespace System.Runtime.Intrinsics

public static partial class Vector64
{
+   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
+   unsafe
    public static Vector64<byte> CreateScalarUnsafe(byte value)
+   unsafe
    public static Vector64<double> CreateScalarUnsafe(double value)
+   unsafe
    public static Vector64<short> CreateScalarUnsafe(short value)
+   unsafe
    public static Vector64<int> CreateScalarUnsafe(int value)
+   unsafe
    public static Vector64<long> CreateScalarUnsafe(long value)
+   unsafe
    public static Vector64<nint> CreateScalarUnsafe(nint value)
+   unsafe
    public static Vector64<nuint> CreateScalarUnsafe(nuint value)
+   unsafe
    public static Vector64<sbyte> CreateScalarUnsafe(sbyte value)
+   unsafe
    public static Vector64<float> CreateScalarUnsafe(float value)
+   unsafe
    public static Vector64<ushort> CreateScalarUnsafe(ushort value)
+   unsafe
    public static Vector64<uint> CreateScalarUnsafe(uint value)
+   unsafe
    public static Vector64<ulong> CreateScalarUnsafe(ulong value)
+   unsafe
    public static Vector64<T> CreateScalarUnsafe<T>(T value)

+   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
+   unsafe
    public static Vector64<T> LoadUnsafe<T>(ref readonly T source)
+   unsafe
    public static Vector64<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)

+   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
+   unsafe
    public static void StoreUnsafe<T>(this Vector64<T> source, ref T destination)
+   unsafe
    public static void StoreUnsafe<T>(this Vector64<T> source, ref T destination, nuint elementOffset)

+   /// <safety>Widens to a larger vector, leaving the upper elements uninitialized.</safety>
+   unsafe
    public static Vector128<T> ToVector128Unsafe<T>(this Vector64<T> vector)
}

public static partial class Vector128
{
+   /// <safety>Reinterprets the value as a 128-bit vector, leaving the upper elements uninitialized.</safety>
+   unsafe
    public static Vector128<float> AsVector128Unsafe(this System.Numerics.Vector2 value)
+   unsafe
    public static Vector128<float> AsVector128Unsafe(this System.Numerics.Vector3 value)

+   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
+   unsafe
    public static Vector128<byte> CreateScalarUnsafe(byte value)
+   unsafe
    public static Vector128<double> CreateScalarUnsafe(double value)
+   unsafe
    public static Vector128<short> CreateScalarUnsafe(short value)
+   unsafe
    public static Vector128<int> CreateScalarUnsafe(int value)
+   unsafe
    public static Vector128<long> CreateScalarUnsafe(long value)
+   unsafe
    public static Vector128<nint> CreateScalarUnsafe(nint value)
+   unsafe
    public static Vector128<nuint> CreateScalarUnsafe(nuint value)
+   unsafe
    public static Vector128<sbyte> CreateScalarUnsafe(sbyte value)
+   unsafe
    public static Vector128<float> CreateScalarUnsafe(float value)
+   unsafe
    public static Vector128<ushort> CreateScalarUnsafe(ushort value)
+   unsafe
    public static Vector128<uint> CreateScalarUnsafe(uint value)
+   unsafe
    public static Vector128<ulong> CreateScalarUnsafe(ulong value)
+   unsafe
    public static Vector128<T> CreateScalarUnsafe<T>(T value)

+   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
+   unsafe
    public static Vector128<T> LoadUnsafe<T>(ref readonly T source)
+   unsafe
    public static Vector128<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)

+   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
+   unsafe
    public static void StoreUnsafe<T>(this Vector128<T> source, ref T destination)
+   unsafe
    public static void StoreUnsafe<T>(this Vector128<T> source, ref T destination, nuint elementOffset)

+   /// <safety>Widens to a larger vector, leaving the upper elements uninitialized.</safety>
+   unsafe
    public static Vector256<T> ToVector256Unsafe<T>(this Vector128<T> vector)
}

public static partial class Vector256
{
+   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
+   unsafe
    public static Vector256<byte> CreateScalarUnsafe(byte value)
+   unsafe
    public static Vector256<double> CreateScalarUnsafe(double value)
+   unsafe
    public static Vector256<short> CreateScalarUnsafe(short value)
+   unsafe
    public static Vector256<int> CreateScalarUnsafe(int value)
+   unsafe
    public static Vector256<long> CreateScalarUnsafe(long value)
+   unsafe
    public static Vector256<nint> CreateScalarUnsafe(nint value)
+   unsafe
    public static Vector256<nuint> CreateScalarUnsafe(nuint value)
+   unsafe
    public static Vector256<sbyte> CreateScalarUnsafe(sbyte value)
+   unsafe
    public static Vector256<float> CreateScalarUnsafe(float value)
+   unsafe
    public static Vector256<ushort> CreateScalarUnsafe(ushort value)
+   unsafe
    public static Vector256<uint> CreateScalarUnsafe(uint value)
+   unsafe
    public static Vector256<ulong> CreateScalarUnsafe(ulong value)
+   unsafe
    public static Vector256<T> CreateScalarUnsafe<T>(T value)

+   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
+   unsafe
    public static Vector256<T> LoadUnsafe<T>(ref readonly T source)
+   unsafe
    public static Vector256<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)

+   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
+   unsafe
    public static void StoreUnsafe<T>(this Vector256<T> source, ref T destination)
+   unsafe
    public static void StoreUnsafe<T>(this Vector256<T> source, ref T destination, nuint elementOffset)

+   /// <safety>Widens to a larger vector, leaving the upper elements uninitialized.</safety>
+   unsafe
    public static Vector512<T> ToVector512Unsafe<T>(this Vector256<T> vector)
}

public static partial class Vector512
{
+   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
+   unsafe
    public static Vector512<byte> CreateScalarUnsafe(byte value)
+   unsafe
    public static Vector512<double> CreateScalarUnsafe(double value)
+   unsafe
    public static Vector512<short> CreateScalarUnsafe(short value)
+   unsafe
    public static Vector512<int> CreateScalarUnsafe(int value)
+   unsafe
    public static Vector512<long> CreateScalarUnsafe(long value)
+   unsafe
    public static Vector512<nint> CreateScalarUnsafe(nint value)
+   unsafe
    public static Vector512<nuint> CreateScalarUnsafe(nuint value)
+   unsafe
    public static Vector512<sbyte> CreateScalarUnsafe(sbyte value)
+   unsafe
    public static Vector512<float> CreateScalarUnsafe(float value)
+   unsafe
    public static Vector512<ushort> CreateScalarUnsafe(ushort value)
+   unsafe
    public static Vector512<uint> CreateScalarUnsafe(uint value)
+   unsafe
    public static Vector512<ulong> CreateScalarUnsafe(ulong value)
+   unsafe
    public static Vector512<T> CreateScalarUnsafe<T>(T value)

+   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
+   unsafe
    public static Vector512<T> LoadUnsafe<T>(ref readonly T source)
+   unsafe
    public static Vector512<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)

+   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
+   unsafe
    public static void StoreUnsafe<T>(this Vector512<T> source, ref T destination)
+   unsafe
    public static void StoreUnsafe<T>(this Vector512<T> source, ref T destination, nuint elementOffset)
}

namespace System.Numerics

namespace System.Numerics

public static partial class Vector
{
+   /// <safety>Widens to a larger vector, leaving the upper elements uninitialized.</safety>
+   unsafe
    public static Vector3 AsVector3Unsafe(this Vector2 value)
+   unsafe
    public static Vector4 AsVector4Unsafe(this Vector2 value)
+   unsafe
    public static Vector4 AsVector4Unsafe(this Vector3 value)

+   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
+   unsafe
    public static Vector<T> CreateScalarUnsafe<T>(T value)

+   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
+   unsafe
    public static Vector<T> LoadUnsafe<T>(ref readonly T source)
+   unsafe
    public static Vector<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)

+   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
+   unsafe
    public static void StoreUnsafe<T>(this Vector<T> source, ref T destination)
+   unsafe
    public static void StoreUnsafe(this Vector2 source, ref float destination)
+   unsafe
    public static void StoreUnsafe(this Vector3 source, ref float destination)
+   unsafe
    public static void StoreUnsafe(this Vector4 source, ref float destination)
+   unsafe
    public static void StoreUnsafe<T>(this Vector<T> source, ref T destination, nuint elementOffset)
+   unsafe
    public static void StoreUnsafe(this Vector2 source, ref float destination, nuint elementOffset)
+   unsafe
    public static void StoreUnsafe(this Vector3 source, ref float destination, nuint elementOffset)
+   unsafe
    public static void StoreUnsafe(this Vector4 source, ref float destination, nuint elementOffset)
}

public partial struct Vector2
{
+   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
+   unsafe
    public static Vector2 CreateScalarUnsafe(float x)

+   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
+   unsafe
    public static Vector2 LoadUnsafe(ref readonly float source)
+   unsafe
    public static Vector2 LoadUnsafe(ref readonly float source, nuint elementOffset)
}

public partial struct Vector3
{
+   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
+   unsafe
    public static Vector3 CreateScalarUnsafe(float x)

+   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
+   unsafe
    public static Vector3 LoadUnsafe(ref readonly float source)
+   unsafe
    public static Vector3 LoadUnsafe(ref readonly float source, nuint elementOffset)
}

public partial struct Vector4
{
+   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
+   unsafe
    public static Vector4 CreateScalarUnsafe(float x)

+   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
+   unsafe
    public static Vector4 LoadUnsafe(ref readonly float source)
+   unsafe
    public static Vector4 LoadUnsafe(ref readonly float source, nuint elementOffset)
}

API Usage

All these apis now require an unsafe context to call them.

Alternative Designs

No response

Risks

No response

Activity

  1. added
    api-suggestion
    on May 12, 2026
  2. added
    untriaged
    on May 12, 2026
  3. dotnet-policy-service commented on May 12, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
    See info in area-owners.md if you want to be subscribed.

  4. EgorBo commented on May 12, 2026

    @EgorBo
    MemberAuthor

    NOTE: it doesn't include APIs in direct intrinsics, those will be annotated separately. E.g.:

    namespace System.Runtime.Intrinsics.Arm
    
    public abstract partial class Sve : AdvSimd
    {
    +   public static unsafe void GatherPrefetch16Bit(Vector<short> mask, Vector<ulong> addresses, [ConstantExpected] SvePrefetchType prefetchType)
  5. added
    api-ready-for-review
    and removed
    api-suggestion
    untriaged
    on Jun 23, 2026
  6. added this to the 11.0.0 milestone on Jun 23, 2026
  7. bartonjs commented on Jul 30, 2026

    @bartonjs
    Member

    Video

    Looks good as proposed

    namespace System.Runtime.Intrinsics
    
    public static partial class Vector64
    {
    +   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
    +   unsafe
        public static Vector64<byte> CreateScalarUnsafe(byte value)
    +   unsafe
        public static Vector64<double> CreateScalarUnsafe(double value)
    +   unsafe
        public static Vector64<short> CreateScalarUnsafe(short value)
    +   unsafe
        public static Vector64<int> CreateScalarUnsafe(int value)
    +   unsafe
        public static Vector64<long> CreateScalarUnsafe(long value)
    +   unsafe
        public static Vector64<nint> CreateScalarUnsafe(nint value)
    +   unsafe
        public static Vector64<nuint> CreateScalarUnsafe(nuint value)
    +   unsafe
        public static Vector64<sbyte> CreateScalarUnsafe(sbyte value)
    +   unsafe
        public static Vector64<float> CreateScalarUnsafe(float value)
    +   unsafe
        public static Vector64<ushort> CreateScalarUnsafe(ushort value)
    +   unsafe
        public static Vector64<uint> CreateScalarUnsafe(uint value)
    +   unsafe
        public static Vector64<ulong> CreateScalarUnsafe(ulong value)
    +   unsafe
        public static Vector64<T> CreateScalarUnsafe<T>(T value)
    
    +   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
    +   unsafe
        public static Vector64<T> LoadUnsafe<T>(ref readonly T source)
    +   unsafe
        public static Vector64<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)
    
    +   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
    +   unsafe
        public static void StoreUnsafe<T>(this Vector64<T> source, ref T destination)
    +   unsafe
        public static void StoreUnsafe<T>(this Vector64<T> source, ref T destination, nuint elementOffset)
    
    +   /// <safety>Widens to a larger vector, leaving the upper elements uninitialized.</safety>
    +   unsafe
        public static Vector128<T> ToVector128Unsafe<T>(this Vector64<T> vector)
    }
    
    public static partial class Vector128
    {
    +   /// <safety>Reinterprets the value as a 128-bit vector, leaving the upper elements uninitialized.</safety>
    +   unsafe
        public static Vector128<float> AsVector128Unsafe(this System.Numerics.Vector2 value)
    +   unsafe
        public static Vector128<float> AsVector128Unsafe(this System.Numerics.Vector3 value)
    
    +   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
    +   unsafe
        public static Vector128<byte> CreateScalarUnsafe(byte value)
    +   unsafe
        public static Vector128<double> CreateScalarUnsafe(double value)
    +   unsafe
        public static Vector128<short> CreateScalarUnsafe(short value)
    +   unsafe
        public static Vector128<int> CreateScalarUnsafe(int value)
    +   unsafe
        public static Vector128<long> CreateScalarUnsafe(long value)
    +   unsafe
        public static Vector128<nint> CreateScalarUnsafe(nint value)
    +   unsafe
        public static Vector128<nuint> CreateScalarUnsafe(nuint value)
    +   unsafe
        public static Vector128<sbyte> CreateScalarUnsafe(sbyte value)
    +   unsafe
        public static Vector128<float> CreateScalarUnsafe(float value)
    +   unsafe
        public static Vector128<ushort> CreateScalarUnsafe(ushort value)
    +   unsafe
        public static Vector128<uint> CreateScalarUnsafe(uint value)
    +   unsafe
        public static Vector128<ulong> CreateScalarUnsafe(ulong value)
    +   unsafe
        public static Vector128<T> CreateScalarUnsafe<T>(T value)
    
    +   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
    +   unsafe
        public static Vector128<T> LoadUnsafe<T>(ref readonly T source)
    +   unsafe
        public static Vector128<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)
    
    +   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
    +   unsafe
        public static void StoreUnsafe<T>(this Vector128<T> source, ref T destination)
    +   unsafe
        public static void StoreUnsafe<T>(this Vector128<T> source, ref T destination, nuint elementOffset)
    
    +   /// <safety>Widens to a larger vector, leaving the upper elements uninitialized.</safety>
    +   unsafe
        public static Vector256<T> ToVector256Unsafe<T>(this Vector128<T> vector)
    }
    
    public static partial class Vector256
    {
    +   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
    +   unsafe
        public static Vector256<byte> CreateScalarUnsafe(byte value)
    +   unsafe
        public static Vector256<double> CreateScalarUnsafe(double value)
    +   unsafe
        public static Vector256<short> CreateScalarUnsafe(short value)
    +   unsafe
        public static Vector256<int> CreateScalarUnsafe(int value)
    +   unsafe
        public static Vector256<long> CreateScalarUnsafe(long value)
    +   unsafe
        public static Vector256<nint> CreateScalarUnsafe(nint value)
    +   unsafe
        public static Vector256<nuint> CreateScalarUnsafe(nuint value)
    +   unsafe
        public static Vector256<sbyte> CreateScalarUnsafe(sbyte value)
    +   unsafe
        public static Vector256<float> CreateScalarUnsafe(float value)
    +   unsafe
        public static Vector256<ushort> CreateScalarUnsafe(ushort value)
    +   unsafe
        public static Vector256<uint> CreateScalarUnsafe(uint value)
    +   unsafe
        public static Vector256<ulong> CreateScalarUnsafe(ulong value)
    +   unsafe
        public static Vector256<T> CreateScalarUnsafe<T>(T value)
    
    +   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
    +   unsafe
        public static Vector256<T> LoadUnsafe<T>(ref readonly T source)
    +   unsafe
        public static Vector256<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)
    
    +   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
    +   unsafe
        public static void StoreUnsafe<T>(this Vector256<T> source, ref T destination)
    +   unsafe
        public static void StoreUnsafe<T>(this Vector256<T> source, ref T destination, nuint elementOffset)
    
    +   /// <safety>Widens to a larger vector, leaving the upper elements uninitialized.</safety>
    +   unsafe
        public static Vector512<T> ToVector512Unsafe<T>(this Vector256<T> vector)
    }
    
    public static partial class Vector512
    {
    +   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
    +   unsafe
        public static Vector512<byte> CreateScalarUnsafe(byte value)
    +   unsafe
        public static Vector512<double> CreateScalarUnsafe(double value)
    +   unsafe
        public static Vector512<short> CreateScalarUnsafe(short value)
    +   unsafe
        public static Vector512<int> CreateScalarUnsafe(int value)
    +   unsafe
        public static Vector512<long> CreateScalarUnsafe(long value)
    +   unsafe
        public static Vector512<nint> CreateScalarUnsafe(nint value)
    +   unsafe
        public static Vector512<nuint> CreateScalarUnsafe(nuint value)
    +   unsafe
        public static Vector512<sbyte> CreateScalarUnsafe(sbyte value)
    +   unsafe
        public static Vector512<float> CreateScalarUnsafe(float value)
    +   unsafe
        public static Vector512<ushort> CreateScalarUnsafe(ushort value)
    +   unsafe
        public static Vector512<uint> CreateScalarUnsafe(uint value)
    +   unsafe
        public static Vector512<ulong> CreateScalarUnsafe(ulong value)
    +   unsafe
        public static Vector512<T> CreateScalarUnsafe<T>(T value)
    
    +   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
    +   unsafe
        public static Vector512<T> LoadUnsafe<T>(ref readonly T source)
    +   unsafe
        public static Vector512<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)
    
    +   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
    +   unsafe
        public static void StoreUnsafe<T>(this Vector512<T> source, ref T destination)
    +   unsafe
        public static void StoreUnsafe<T>(this Vector512<T> source, ref T destination, nuint elementOffset)
    }
    namespace System.Numerics
    
    public static partial class Vector
    {
    +   /// <safety>Widens to a larger vector, leaving the upper elements uninitialized.</safety>
    +   unsafe
        public static Vector3 AsVector3Unsafe(this Vector2 value)
    +   unsafe
        public static Vector4 AsVector4Unsafe(this Vector2 value)
    +   unsafe
        public static Vector4 AsVector4Unsafe(this Vector3 value)
    
    +   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
    +   unsafe
        public static Vector<T> CreateScalarUnsafe<T>(T value)
    
    +   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
    +   unsafe
        public static Vector<T> LoadUnsafe<T>(ref readonly T source)
    +   unsafe
        public static Vector<T> LoadUnsafe<T>(ref readonly T source, nuint elementOffset)
    
    +   /// <safety>Stores a full vector starting at the given reference with no bounds check; may write past the end of the destination.</safety>
    +   unsafe
        public static void StoreUnsafe<T>(this Vector<T> source, ref T destination)
    +   unsafe
        public static void StoreUnsafe(this Vector2 source, ref float destination)
    +   unsafe
        public static void StoreUnsafe(this Vector3 source, ref float destination)
    +   unsafe
        public static void StoreUnsafe(this Vector4 source, ref float destination)
    +   unsafe
        public static void StoreUnsafe<T>(this Vector<T> source, ref T destination, nuint elementOffset)
    +   unsafe
        public static void StoreUnsafe(this Vector2 source, ref float destination, nuint elementOffset)
    +   unsafe
        public static void StoreUnsafe(this Vector3 source, ref float destination, nuint elementOffset)
    +   unsafe
        public static void StoreUnsafe(this Vector4 source, ref float destination, nuint elementOffset)
    }
    
    public partial struct Vector2
    {
    +   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
    +   unsafe
        public static Vector2 CreateScalarUnsafe(float x)
    
    +   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
    +   unsafe
        public static Vector2 LoadUnsafe(ref readonly float source)
    +   unsafe
        public static Vector2 LoadUnsafe(ref readonly float source, nuint elementOffset)
    }
    
    public partial struct Vector3
    {
    +   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
    +   unsafe
        public static Vector3 CreateScalarUnsafe(float x)
    
    +   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
    +   unsafe
        public static Vector3 LoadUnsafe(ref readonly float source)
    +   unsafe
        public static Vector3 LoadUnsafe(ref readonly float source, nuint elementOffset)
    }
    
    public partial struct Vector4
    {
    +   /// <safety>Initializes only the lowest element and leaves the remaining elements uninitialized; reading them observes undefined data.</safety>
    +   unsafe
        public static Vector4 CreateScalarUnsafe(float x)
    
    +   /// <safety>Loads a full vector starting at the given reference with no bounds check; may read past the end of the source.</safety>
    +   unsafe
        public static Vector4 LoadUnsafe(ref readonly float source)
    +   unsafe
        public static Vector4 LoadUnsafe(ref readonly float source, nuint elementOffset)
    }
  8. added
    api-approved
    and removed
    api-ready-for-review
    on Jul 30, 2026
  9. modified the milestones: 11.0.0, 12.0.0 on Sep 9, 2026
  10. jeffhandley commented on Sep 9, 2026

    @jeffhandley
    Member

    @EgorBo I moved this to .NET 12. Please pull back in to .NET 11 if that's still the target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api-approvedarea-System.Runtime.Intrinsicsreduce-unsafe

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions