Skip to content

Fix .NET 6 Guid conversion on CPUs without SSSE3 - #118

Open
dajiaohuang wants to merge 1 commit into
Cysharp:masterfrom
dajiaohuang:fix/net6-guid-ssse3-20261015
Open

dajiaohuang wants to merge 1 commit into
Cysharp:masterfrom
dajiaohuang:fix/net6-guid-ssse3-20261015

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

On .NET 6 with SSE3 available but SSSE3 unavailable, Ulid.ToGuid() and new Ulid(Guid) enter the vector shuffle path, then throw NotImplementedException. This prevents the advertised Guid conversion even for ordinary valid ULIDs. This matches the report in #106 (closed by the stale automation, with no maintainer rejection).

IsVector128Supported checks Sse3.IsSupported, while Shuffle actually requires Ssse3.IsSupported on .NET 6.

Change

Require SSSE3 at the existing dispatch point so unsupported processors use the existing scalar conversion. No additional fallback, retry, public API or byte mapping changes. The Unity copy was regenerated by the existing Ulid.csproj post-build copy target.

Validation

  • Existing Guid tests on the unchanged base: four failures with NotImplementedException using dotnet test tests/Ulid.Tests/Ulid.Tests.csproj -c Release -p:TargetFramework=net6.0 -p:TargetFrameworks=net6.0 --environment COMPlus_EnableSSSE3=0 --filter FullyQualifiedName~Guid.
  • After the change: all 17 core tests pass on native .NET 6.0.11 with SSSE3 disabled (including those four existing regression tests).
  • Release solution build and symbol pack pass.
  • All 33 existing solution tests pass normally, with hardware intrinsics/SSE2 disabled, and with SSE2 disabled alone. These net7.0 test assemblies ran on .NET 8.0.22 via DOTNET_ROLL_FORWARD=Major because native .NET 7 is not installed.

Tested on Windows x64, SDK 10.0.100. Existing EOL/dependency/assembly warnings remain. Unity editor, big-endian hardware and physical SSE3-only hardware were not exercised; no performance claim is made.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant