Skip to content

[TrimmableTypeMap] Run full on-device test suite with trimmable type map #11054

Description

@simonrozsival

Part of #10788
Related to #11017

Summary

The CI already runs the main on-device test suite (Mono.Android.NET-Tests.csproj + Java.Interop-Tests.NET.csproj) with multiple flavors: CoreCLR, NativeAOT, Interpreter, TrimModePartial, AotLlvm, etc. (see stage-package-tests.yaml). There is no flavor that sets _AndroidTypeMapImplementation=trimmable.

Before the trimmable type map can become the default, we need to run the full existing test suite with it and triage any failures.

What to do

1. Add a new CI test flavor

Add a new entry in build-tools/automation/yaml-templates/stage-package-tests.yaml:

- testName: TrimmableTypeMap
  extraBuildArgs: >-
    -p:TestsFlavor=TrimmableTypeMap
    -p:_AndroidTypeMapImplementation=trimmable
    -p:UseMonoRuntime=false

2. Handle expected exclusions

Some test categories will need to be excluded initially:

Add exclusion logic in Mono.Android.NET-Tests.csproj similar to the existing CoreCLR/NativeAOT exclusions:

<ExcludeCategories Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' ">$(ExcludeCategories):NativeTypeMap</ExcludeCategories>

3. Triage and fix failures

Run the suite, categorize failures:

  • Build failures — the trimmable build pipeline doesn't handle something the test project needs
  • Runtime type resolution failures — types not found in the trimmable type map
  • JCW/RegisterNatives failures — Java-to-managed callbacks broken
  • Binding-specific failures — specific binding patterns the scanner doesn't handle

Each distinct failure class should get its own sub-issue if not already tracked.

Acceptance criteria

  • A new TrimmableTypeMap test flavor exists in CI
  • The full Mono.Android.NET-Tests suite builds and deploys with _AndroidTypeMapImplementation=trimmable
  • Test results are triaged: passing tests pass, known gaps are excluded with tracking issues
  • No unexpected regressions vs the CoreCLR flavor (same tests should pass minus known typemap gaps)

Dependencies

Notes

This is the broadest validation of the trimmable type map. The existing test sub-issues in #11017 target specific test files; this issue is about running everything and seeing what breaks.

Activity

  1. added this to the .NET 11 milestone on Mar 30, 2026
  2. simonrozsival commented on May 5, 2026

    @simonrozsival
    MemberAuthor

    Completed by #11091, which added the CoreCLRTrimmable Mono.Android.NET-Tests lane, got the trimmable test app building/running, and triaged the remaining known exclusions. The remaining zero-exclusion work is tracked in #11170 and related follow-up PRs.

  3. locked and limited conversation to collaborators on Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    copilot`copilot-cli` or other AIs were used to author thisneeds-triageIssues that need to be assigned.trimmable-type-map

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions