Skip to content

V11.0.0/double digits chore - #8

Open
gimlichael wants to merge 10 commits into
masterfrom
v11.0.0/double-digits-chore
Open

gimlichael wants to merge 10 commits into
masterfrom
v11.0.0/double-digits-chore

Conversation

@gimlichael

Copy link
Copy Markdown
Member

This pull request brings in the reviewed upstream changes from coverlet-coverage/coverlet that fix exception-handler instrumentation and dynamic exclude filtering, updates the Microsoft Testing Platform dependency to 2.5.2, and records the synchronization in the fork's documentation.

Exception-handler instrumentation:

  • Branch trampolines are skipped when an open-ended exception-handler region would pull them into a protected block, which could produce invalid IL in optimized loops; an inline or branch-local fallback keeps both branch paths recorded
  • Instrumentation iterates over the original IL snapshot, so injected instructions no longer shift which instructions are processed
  • Regression coverage with JIT-preparation checks covers the Issue 2058 loop and try/finally shapes

Dynamic exclude filters:

  • Assemblies loaded in the controller process are excluded by exact name, which prevents a loaded helper such as MSS.Tools.xUnit from excluding a system under test such as MSS.Tools.Markdown
  • Assembly filters may contain hyphens, and the related core and MTP tests and usage documentation are updated to match

Dependency updates:

  • Microsoft Testing Platform is updated from 2.5.1 to 2.5.2 through the central package version

Documentation and release notes:

  • The root changelog records the adopted fixes and the dependency update
  • UPSTREAM.md records the reviewed upstream tip, the disposition of each incoming commit, and the validation performed for this operation

dependabot Bot and others added 10 commits November 1, 2026 09:40
…t-coverage#2062)

---
updated-dependencies:
- dependency-name: dotnet-reportgenerator-globaltool
  dependency-version: 5.5.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…overlet-coverage#2061)

Bumps [danielpalme/ReportGenerator-GitHub-Action](https://github.com/danielpalme/reportgenerator-github-action) from 5.5.11 to 5.5.12.
- [Release notes](https://github.com/danielpalme/reportgenerator-github-action/releases)
- [Commits](danielpalme/ReportGenerator-GitHub-Action@5.5.11...5.5.12)

---
updated-dependencies:
- dependency-name: danielpalme/ReportGenerator-GitHub-Action
  dependency-version: 5.5.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.38.2 to 4.39.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v4.38.2...v4.39.1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.39.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….2 (coverlet-coverage#2066)

---
updated-dependencies:
- dependency-name: Microsoft.Testing.Extensions.AzureDevOpsReport
  dependency-version: 2.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Prevent invalid IL from branch trampolines

Detect unsafe exception-handler boundaries and fall back to inline instrumentation. Preserve original `TryStart` boundaries to avoid invalid loop and `try/finally` IL.

Add issue coverlet-coverage#2058 regression coverage, sample control-flow methods, and JIT-preparation validation with diagnostic IL output.

* Fix EH boundaries for instrumented loop back-edges

Update exception-handler boundary rewriting so `TryStart` follows inserted branch-target instructions, preserving intra-try back-edges in optimized `do/while` loops. Add Issue 2058 release-instrumentation coverage and a `try/finally` loop regression sample.

* Prevent invalid IL near handler starts

Add ILVerify 10.0.14 as a local tool and recommend it for IL investigations. Track instructions immediately preceding exception-handler `TryStart` offsets and skip unsafe taken-branch counter injection when trampolines are unavailable, preserving inline fallback for other cases.

* use runtime specific dotnet tool versions

* Fix path for dotnet-tools.json copy script

* Fix branch instrumentation near EH boundaries

Use local branch trampolines when standard trampolines are unavailable before exception-handler boundaries. Refactor branch candidate registration, track local trampoline redirections, and preserve branch hit tracking across netstandard2.0.

Extend Issue 2058 coverage tests to verify both branch paths and filter recorded branch entries with LINQ.

* Iterate instrumentation over original IL

Process the pre-instrumentation instruction snapshot with a stable index
instead of traversing the mutable instruction list. Remove manual index
adjustments so injected instructions cannot alter iteration or cause original
instructions to be skipped or processed incorrectly. Preserve target mapping
and instruction-target replacement after instrumentation.
…ge#2069)

* Narrow Dynamic Exclude Filters for Loaded Assemblies

* Allow hyphen for assembly names
@gimlichael gimlichael self-assigned this Nov 3, 2026
@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect coverage instrumentation and assembly selection in Coverlet runs.

The PR appears safe to merge, with a non-blocking gap in tests for executed coverage counts.

Fix All in CodexFindings

  1. P2 Wrong coverage passes these tests ▶
Fix with agent prompt
### Issue 1
test/coverlet.core.coverage.tests/Coverage/CoverageTests.Issue2058.cs:75-77
The new tests prepare the methods for JIT compilation but never run them. `AssertMethodHasBothBranchPaths` only checks that some branches in the method have `Path` 0 and 1. It would still pass if the new local trampoline skipped a counter or one conditional lost a path.

Keep these checks for invalid IL, and add a bounded companion sample that runs both outcomes and checks each conditional's branch and line hit counts.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR updates exception-handler instrumentation, narrows exclusions for loaded assemblies, and updates Microsoft Testing Platform to 2.5.2.

  • Coverage instrumentation keeps branch counters out of unsafe exception regions.
  • Loaded helper assemblies get exact exclusions, while package names keep wildcard exclusions.
  • The MTP integration and its related packages use version 2.5.2.
  • The synchronization record tracks the reviewed upstream changes and their disposition.

No tests were run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Taken branch] --> B{End-of-method trampoline safe?}
  B -->|Yes| C[Append counter and jump]
  B -->|No| D{Target immediately before try start?}
  D -->|Yes, supported branch| E[Insert local counter and jump]
  D -->|Otherwise| F[Insert counter at target]
  C --> G[Continue at destination]
  E --> G
  F --> G
Loading

Reviews (1) · Last reviewed commit: "✅ verify windows release tests and updat..." · Reviewed by Greptile

Comment on lines +75 to +77
Assert.NotEmpty(branches);
Assert.Contains(branches, b => b.Path == 0);
Assert.Contains(branches, b => b.Path == 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Wrong coverage passes these tests

The new tests prepare the methods for JIT compilation but never run them. AssertMethodHasBothBranchPaths only checks that some branches in the method have Path 0 and 1. It would still pass if the new local trampoline skipped a counter or one conditional lost a path.

Keep these checks for invalid IL, and add a bounded companion sample that runs both outcomes and checks each conditional's branch and line hit counts.

Knowledge Base Used: Core coverage tests

Prompt To Fix With AI
This is a comment left during a code review.
Path: test/coverlet.core.coverage.tests/Coverage/CoverageTests.Issue2058.cs
Line: 75-77

Comment:
**Wrong coverage passes these tests**

The new tests prepare the methods for JIT compilation but never run them. `AssertMethodHasBothBranchPaths` only checks that some branches in the method have `Path` 0 and 1. It would still pass if the new local trampoline skipped a counter or one conditional lost a path.

Keep these checks for invalid IL, and add a bounded companion sample that runs both outcomes and checks each conditional's branch and line hit counts.

**Knowledge Base Used:** [Core coverage tests](https://app.greptile.com/-/switch-tenant?tenant=geekle&next=%2Fcustom-context%2Fknowledge-base%2Fcodebeltnet%2Fcoverlet%2F-%2Fdocs%2Fcore-coverage-tests.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants