Repository navigation
test: detect runtime accessor and IL generator contract changes - #567
Open
jogibear9988 wants to merge 1 commit into
Open
jogibear9988 wants to merge 1 commit into
jogibear9988 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect runtime-internal changes before optimizations silently disappear
Related to #560. Add strict CoreCLR runtime-contract tests on current master (
734314ed), without changing production compilation or introducing a generator dependency.UnsafeAccessordeclarations against the executing runtime: exact owner, member name, instance/static shape, field/byref type, method parameters and return type.--runtime-accessor-contractsfor isolated execution. Document the scope and Explore internal accessor with compile checks https://github.com/aelij/IgnoresAccessChecksToGenerator #560 investigation in test/RuntimeAccessorContracts.md.These validate the executing runtime, not merely the SDK references. Framework 4.7.2 has a different implementation and is excluded from this fixture. An intentional change to the accessor contract should update the tests too.
Validation
Windows ARM64, SDK 10.0.301:
ReuseDynamicILGeneratorin a separate process. The test reports the unavailable helper and missing reuse; the isolated runner exits nonzero as intended.MultiplyCheckedmismatch inLightExpressionTests; .NET 8 crashes inIssue346by-ref float post-increment. Both reproduce by invoking the unchangedRunAllTestsentry point in a fresh process without running the new fixture. They are not fixed or skipped here.Reproduce the isolated checks:
Findings behind #560
The stock IgnoresAccessChecksToGenerator publicizes internal members, leaving private ones inaccessible. It could be extended to publicize private members/nested types in build-time references. However, framework reference assemblies omit the relevant runtime types; the stock 0.8.0 package also fails when publicizing our installed .NET 10 CoreLib implementation with
Writing mixed-mode assemblies is not supported. An implementation-derived metadata-only facade is a possible further investigation; replacing the installed runtime is unnecessary.Direct typed reuse helpers might reduce initialization work or delegate dispatch. Replacing existing UnsafeAccessor field access is not an established speedup. Those are separate experiments requiring compilation/startup/allocation measurements; this PR makes no performance claim and changes no emitted application IL.