Skip to content

ILVerify: skip six verifiability rules in validation-only mode - #137970

Draft
pcshrosbree wants to merge 1 commit into
dotnet:mainfrom
pcshrosbree:feat/ilverify-validation-relax-rules
Draft

pcshrosbree wants to merge 1 commit into
dotnet:mainfrom
pcshrosbree:feat/ilverify-validation-relax-rules

Conversation

@pcshrosbree

@pcshrosbree pcshrosbree commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: In validation-only mode, ILVerify stops reporting six errors for rules that only verifiable IL must follow. Verification mode is unchanged. This draft is not for review until it is marked ready.

What changes

  • No longer reported in validation-only mode: InitLocals, BackwardBranch, EndfilterStack, ReturnPtrToStack, ThisMismatch and ConstrainedTypeNoInterfaceImpl. Verification mode still reports all six.
  • Tests: the existing tests for these errors get a _Validation_Valid suffix, so each also checks that validation-only mode accepts the method. A new InitLocalsTests.il covers InitLocals, which had no test on main.

Changes since the last push

Rebased on main after #137938 merged. The jmp, cpblk and initblk validity checks and their tests are no longer in this PR; they will come as separate PRs. Main already skips the blanket Unverifiable error for instructions that are never verifiable, so this PR no longer lists it. The README is unchanged.

Testing

ILVerification.Tests passes 1,090 of 1,090 in Release on linux-x64. To check the tests, I temporarily changed the code so that validation-only mode reported each of the six errors again. Each change failed the tests named for that error. Changes that stopped verification mode from reporting them also failed tests.

Contributes to #37391.

Note

This PR was prepared with AI assistance (Anthropic Claude and OpenAI Codex), under my direction. I reviewed it before posting.

@github-actions github-actions Bot added the area-Tools-ILVerification Issues related to ilverify tool and IL verification in general label Nov 20, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 20, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

In validation-only mode, stop reporting six rules that only verifiable IL
must follow: InitLocals, BackwardBranch, EndfilterStack, ReturnPtrToStack,
ThisMismatch and ConstrainedTypeNoInterfaceImpl. Verification output is
unchanged.
@pcshrosbree
pcshrosbree force-pushed the feat/ilverify-validation-relax-rules branch from 431eb02 to 2a81b0a Compare November 25, 2026 06:19
@pcshrosbree pcshrosbree changed the title ILVerify: skip verifiability rules not about managed references ILVerify: skip six verifiability rules in validation-only mode Nov 25, 2026

This branch has not been deployed

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

Labels

area-Tools-ILVerification Issues related to ilverify tool and IL verification in general community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant