GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add opt-in non-reflective object comparer for NativeAOT by hydraxman · Pull Request #2308 · MessagePack-CSharp/MessagePack-CSharp Conversation
|
| Check | Result |
|---|---|
| net9.0 NativeAOT, opt-in, ILCompiler 9.0.20 | 98 assertions passed; zero build warnings |
| net10.0 NativeAOT, opt-in, ILCompiler 10.0.12 | 98 assertions passed; zero build warnings |
| net10.0 NativeAOT, legacy/default | 96 assertions passed; original one IL2060 and one IL3050 remain |
| net10.0 ARM64 NativeAOT, opt-in | Compiled and linked with zero warnings; not executed |
| net9.0 JIT, legacy / opt-in | 96 / 98 assertions passed |
Main MessagePack.Tests, net9.0 |
1086 passed, 6 existing skips, zero failures |
Main MessagePack.Tests, net472 |
1055 passed, 6 existing skips, zero failures |
| All five library target frameworks | Build passed with zero warnings/errors |
The opt-in native scan graphs contain zero nodes for ObjectFallbackEqualityComparer. The legacy negative control retains that implementation and its diagnostics, rather than suppressing them.
The native fixture covers all eight enum underlying types, a boxed-only enum with no typed enum factory call, primitive hash parity, equivalent floating-point/date representations, ordinary-hash collision fixtures, custom/enum overrides, cache reuse, clone isolation, unsupported-type rejection, and an exact-wire-format untrusted map round trip. The legacy checks use ordinary typed calls to demonstrate the existing NativeAOT behavior when the native generic instantiations are available; they do not claim support for arbitrary unseen types.
Linux execution and the full solution test suite were not performed locally.
From the repository root:
dotnet run --project tests\MessagePack.Security.NativeAotTests -c Release -p:PublishAot=false -p:NonReflectiveSecurity=false -- legacy dotnet run --project tests\MessagePack.Security.NativeAotTests -c Release -p:PublishAot=false -p:NonReflectiveSecurity=true -- opt-in dotnet publish tests\MessagePack.Security.NativeAotTests -c Release -r win-x64 -p:NonReflectiveSecurity=true -warnaserror -o bin\security-optin .\bin\security-optin\MessagePack.Security.NativeAotTests.exe opt-in
The fixture defaults to net9.0. -p:SecurityTestTargetFramework=net10.0 selects a newer executable target without retargeting the library. For the legacy native negative control, publish with -p:NonReflectiveSecurity=false, omit -warnaserror, and run with legacy. Add -p:IlcGenerateDgmlFile=true to inspect reachability.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Preserve the legacy default while adding an application-wide publish-time feature switch and a non-generic comparer extension point. Retain keyed hashing and unsupported-type rejection, document custom and boxed-enum migration, and add JIT/native regression coverage. Co-authored-by: Copilot <[email protected]> Copilot-Session: 786fa0e8-83da-46dc-a693-b17d03ded372
Co-authored-by: Copilot <[email protected]> Copilot-Session: 786fa0e8-83da-46dc-a693-b17d03ded372
|
@dotnet-policy-service agree [company="microsoft"] |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@dotnet-policy-service agree company="microsoft" |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@AArnott I've marked this ready for review. Could you take a look and approve the pending .NET and Unity workflow runs? The CLA check is now passing. The production change is confined to MessagePackSecurity.cs. The feature is off by default, preserving the existing behavior; opt-in consumers can use the new Type-based hook for statically known custom and enum comparers. Keyed hashing and unsupported-type rejection remain intact. Local Windows validation covers .NET 9/10 NativeAOT, both JIT modes, and the net9.0/net472 unit tests, with details in the PR description. The opt-in native fixture eliminates IL2060/IL3050 without suppressions. I'd particularly appreciate your feedback on the opt-in contract and the new extension point. Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Remove added README content, workflow job, and standalone fixture solution registration. Keep production and regression test contents unchanged; retain usage and validation details in the PR description. Co-authored-by: Copilot <[email protected]> Copilot-Session: 786fa0e8-83da-46dc-a693-b17d03ded372
Keep only concise API, enum hashing, and legacy test intent comments. Leave executable code unchanged. Co-authored-by: Copilot <[email protected]> Copilot-Session: 786fa0e8-83da-46dc-a693-b17d03ded372
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The NativeAOT fixture is not executed by CI, leaving the core feature without automated regression coverage.
Adds an opt-in NativeAOT-compatible object comparer while preserving legacy behavior by default.
Changes:
| File | Description |
|---|---|
src/MessagePack/MessagePackSecurity.cs |
Implements feature-switched comparer dispatch. |
tests/MessagePack.Tests/MessagePackSecurityTests.cs |
Adds comparer contract tests. |
tests/MessagePack.Security.NativeAotTests/Program.cs |
Exercises JIT and NativeAOT behavior. |
tests/MessagePack.Security.NativeAotTests/MessagePack.Security.NativeAotTests.csproj |
Configures the standalone AOT fixture. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.