Skip to content

dotnet-pgo: Filter off-list references when merging MIBCs - #138546

Open
pavelsavara wants to merge 1 commit into
mainfrom
pavelsavara/pgo-filter-mibc-references
Open

pavelsavara wants to merge 1 commit into
mainfrom
pavelsavara/pgo-filter-mibc-references

Conversation

@pavelsavara

Copy link
Copy Markdown
Member

Summary

dotnet-pgo merge --include-reference filters method groups but can still emit a reference to an excluded assembly through a retained method's PGO data. Browser ReadyToRun profiles collected for #137502 exposed this with application types and methods recorded by framework code.

Apply the allowlist when writing those references. Replace excluded type and method handles with unknown samples, omit excluded weighted call targets, and skip methods whose signatures need an excluded assembly. Retain the numeric counters. Merges without an allowlist are unchanged.

Validation

  • D:\.dotnet\dotnet.exe build .\src\coreclr\tools\dotnet-pgo\tests\dotnet-pgo.Tests.csproj -c Debug '-t:Build;Test' -p:UseDefaultTestHost=true -bl:artifacts\log\dotnet-pgo-after.binlog ? build passed with zero warnings and errors; all 9 tests passed. Before the fix, the allowlist regression case failed because the excluded assembly was still in PE metadata.
  • Re-merged the saved Havit R2R profile with the SDK assembly allowlist and checked the binary MIBC's assembly reference table. No off-list references remained. All 11,616 method rows and their numeric counters were unchanged, including 10,036 rows with nonzero edge counts.

Note

This PR description was prepared with GitHub Copilot.

Apply the merge assembly allowlist when emitting profile references. Keep type and method histogram samples as unknowns when their targets are excluded, so numeric counters and permitted profile data remain useful.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@pavelsavara

Copy link
Copy Markdown
Member Author

cc @dotnet/wasm-contrib

@pavelsavara pavelsavara added this to the 12.0.0 milestone Nov 30, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants