Skip to content

Commit 86d994f

Browse files
authored
Merge pull request #9 from Reloaded-Project/update-runners-fix-hashcode-bug
Update runners & fix JIT tiering hashcode bug
2 parents 5bb23c2 + 5c84e09 commit 86d994f

File tree

3 files changed

+38
-38
lines changed

3 files changed

+38
-38
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,37 @@ jobs:
1616
build:
1717
strategy:
1818
matrix:
19-
os:
20-
- windows-latest
21-
- ubuntu-latest
22-
- macos-13
23-
targetFramework:
24-
- net8.0
25-
- net7.0
26-
- net6.0
27-
- net5.0
28-
- netcoreapp3.1
29-
platform:
30-
- x64
3119
include:
32-
- os: windows-latest
33-
targetFramework: net48
34-
platform: x64
35-
- os: windows-latest
36-
targetFramework: net48
37-
platform: x86
38-
- os: windows-latest
39-
targetFramework: net7.0
40-
platform: x86
41-
- os: windows-latest
42-
targetFramework: net6.0
43-
platform: x86
44-
- os: windows-latest
45-
targetFramework: net5.0
46-
platform: x86
47-
- os: windows-latest
48-
targetFramework: netcoreapp3.1
49-
platform: x86
20+
# .NET 8.0 Tests
21+
- { os: windows-latest, targetFramework: net8.0, platform: x64 }
22+
- { os: ubuntu-latest, targetFramework: net8.0, platform: x64 }
23+
- { os: macos-15-intel, targetFramework: net8.0, platform: x64 }
24+
25+
# .NET 7.0 Tests
26+
- { os: windows-latest, targetFramework: net7.0, platform: x64 }
27+
- { os: ubuntu-latest, targetFramework: net7.0, platform: x64 }
28+
- { os: macos-15-intel, targetFramework: net7.0, platform: x64 }
29+
- { os: windows-latest, targetFramework: net7.0, platform: x86 }
30+
31+
# .NET 6.0 Tests
32+
- { os: windows-latest, targetFramework: net6.0, platform: x64 }
33+
- { os: ubuntu-latest, targetFramework: net6.0, platform: x64 }
34+
- { os: macos-15-intel, targetFramework: net6.0, platform: x64 }
35+
- { os: windows-latest, targetFramework: net6.0, platform: x86 }
36+
37+
# .NET 5.0 Tests (no Ubuntu, libSSL issues)
38+
- { os: windows-latest, targetFramework: net5.0, platform: x64 }
39+
- { os: macos-15-intel, targetFramework: net5.0, platform: x64 }
40+
- { os: windows-latest, targetFramework: net5.0, platform: x86 }
41+
42+
# .NET Core 3.1 Tests (no Ubuntu, libSSL issues)
43+
- { os: windows-latest, targetFramework: netcoreapp3.1, platform: x64 }
44+
- { os: macos-15-intel, targetFramework: netcoreapp3.1, platform: x64 }
45+
- { os: windows-latest, targetFramework: netcoreapp3.1, platform: x86 }
46+
47+
# .NET Framework 4.8 Tests (Windows only)
48+
- { os: windows-latest, targetFramework: net48, platform: x64 }
49+
- { os: windows-latest, targetFramework: net48, platform: x86 }
5050

5151
runs-on: ${{ matrix.os }}
5252
steps:

src/Reloaded.Memory/Internals/Algorithms/UnstableStringHash.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ internal static class UnstableStringHash
2626
/// </remarks>
2727
[ExcludeFromCodeCoverage] // "Cannot be accurately measured without multiple architectures. Known good impl." This is still tested tho.
2828
[SuppressMessage("ReSharper", "InconsistentNaming")]
29+
#if NET5_0_OR_GREATER
30+
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
31+
#else
2932
[MethodImpl(MethodImplOptions.AggressiveInlining)]
33+
#endif
3034
internal static unsafe nuint GetHashCodeUnstable(this ReadOnlySpan<char> text)
3135
{
3236
#if NET7_0_OR_GREATER
@@ -51,9 +55,7 @@ internal static unsafe nuint GetHashCodeUnstable(this ReadOnlySpan<char> text)
5155
}
5256

5357
#if NET7_0_OR_GREATER
54-
#if NET8_0 // Bug in .NET 8 seems to cause this to not re-jit to tier1 till like 200k calls on Linux x64
5558
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
56-
#endif
5759
internal static unsafe UIntPtr UnstableHashVec128(this ReadOnlySpan<char> text)
5860
{
5961
fixed (char* src = &text.GetPinnableReference())
@@ -118,9 +120,7 @@ internal static unsafe UIntPtr UnstableHashVec128(this ReadOnlySpan<char> text)
118120
}
119121
}
120122

121-
#if NET8_0 // Bug in .NET 8 seems to cause this to not re-jit to tier1 till like 200k calls on Linux x64
122123
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
123-
#endif
124124
internal static unsafe UIntPtr UnstableHashVec256(this ReadOnlySpan<char> text)
125125
{
126126
fixed (char* src = &text.GetPinnableReference())

src/Reloaded.Memory/Internals/Algorithms/UnstableStringHashLower.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ internal static class UnstableStringHashLower
3030
/// </remarks>
3131
[ExcludeFromCodeCoverage] // "Cannot be accurately measured without multiple architectures. Known good impl." This is still tested tho.
3232
[SuppressMessage("ReSharper", "InconsistentNaming")]
33+
#if NET5_0_OR_GREATER
34+
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
35+
#else
3336
[MethodImpl(MethodImplOptions.AggressiveInlining)]
37+
#endif
3438
internal static unsafe nuint GetHashCodeUnstableLower(this ReadOnlySpan<char> text)
3539
{
3640
#if NET7_0_OR_GREATER
@@ -99,9 +103,7 @@ internal static unsafe nuint GetHashCodeUnstableLowerSlow(this ReadOnlySpan<char
99103
}
100104

101105
#if NET7_0_OR_GREATER
102-
#if NET8_0 // Bug in .NET 8 seems to cause this to not re-jit to tier1 till like 200k calls on Linux x64
103106
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
104-
#endif
105107
internal static unsafe UIntPtr UnstableHashVec128Lower(this ReadOnlySpan<char> text)
106108
{
107109
fixed (char* src = &text.GetPinnableReference())
@@ -222,9 +224,7 @@ internal static unsafe UIntPtr UnstableHashVec128Lower(this ReadOnlySpan<char> t
222224
return GetHashCodeUnstableLowerSlow(text);
223225
}
224226

225-
#if NET8_0 // Bug in .NET 8 seems to cause this to not re-jit to tier1 till like 200k calls on Linux x64
226227
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
227-
#endif
228228
internal static unsafe UIntPtr UnstableHashVec256Lower(this ReadOnlySpan<char> text)
229229
{
230230
fixed (char* src = &text.GetPinnableReference())

0 commit comments

Comments
 (0)