Skip to content

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Sep 14, 2025

No description provided.

@BrzVlad BrzVlad force-pushed the feature-compressed-interface-bitmap branch from 180637e to 48e02a5 Compare September 15, 2025 12:27
Before this commit we were doing changes on the published data which is problematic for multithreaded environments. We ensure the bitmap is fully processed before publishing it so that we can rely on the data dependency memory ordering constraint for correctness.
@BrzVlad BrzVlad force-pushed the feature-compressed-interface-bitmap branch from 48e02a5 to b62f455 Compare September 15, 2025 14:28
@BrzVlad BrzVlad marked this pull request as ready for review September 15, 2025 14:28
@Copilot Copilot AI review requested due to automatic review settings September 15, 2025 14:28
@BrzVlad BrzVlad requested a review from thaystg as a code owner September 15, 2025 14:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables the compressed interface bitmap feature by default in the Mono runtime. This optimization compresses the interface bitmap used for interface type checking, reducing memory usage.

Key changes:

  • Remove the MONO_SMALL_CONFIG conditional compilation guard for compressed interface bitmap
  • Add explicit type casting to avoid compiler warnings
  • Improve variable naming for clarity

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/mono/mono/metadata/class-internals.h Removes conditional compilation guard, enabling compressed interface bitmap by default
src/mono/mono/metadata/class-setup-vtable.c Improves variable naming and adds type cast for offset parameter
src/mono/mono/metadata/class-init.c Adds explicit uint8_t casts to prevent potential compiler warnings
src/mono/mono/mini/type-checking.c Adds explicit type cast for offset parameter to target_mgreg_t

@lateralusX
Copy link
Member

lateralusX commented Sep 15, 2025

I assume the idea is to enable compressed bitmaps on all platforms to measure perf impact and then decide on additional actions, like if it should be default on just some platforms, if it should be a dynamic option or not etc. If so, I think we should also create a tracking issue and link it to this PR describing the different work items, where this is the first step.

@lateralusX lateralusX self-requested a review September 15, 2025 15:12
Copy link
Member

@lateralusX lateralusX left a comment

Choose a reason for hiding this comment

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

The wide impact of the change, default on all platforms, is mainly to measure overhead. This will be followed up with additional changes based on perf data to either limit change to a set of platforms and/or add ability to enable/disable interface map compression dynamically (aot/runtime arguments). I also think we should link a tracking issue to this PR since it is one work item in a set of work items to resolve the underlying issue.

@BrzVlad
Copy link
Member Author

BrzVlad commented Sep 15, 2025

/ba-g wasm build tests known failure

@BrzVlad BrzVlad merged commit ef589b8 into dotnet:main Sep 15, 2025
68 of 70 checks passed
BrzVlad added a commit to BrzVlad/runtime that referenced this pull request Sep 17, 2025
…t#119694)

* [mono][metadata] Enable compressed interface bitmap by default

* Fix build on windows

* Fix publishing of compressed bitmap

Before this commit we were doing changes on the published data which is problematic for multithreaded environments. We ensure the bitmap is fully processed before publishing it so that we can rely on the data dependency memory ordering constraint for correctness.
BrzVlad added a commit to BrzVlad/runtime that referenced this pull request Sep 22, 2025
…t#119694)

* [mono][metadata] Enable compressed interface bitmap by default

* Fix build on windows

* Fix publishing of compressed bitmap

Before this commit we were doing changes on the published data which is problematic for multithreaded environments. We ensure the bitmap is fully processed before publishing it so that we can rely on the data dependency memory ordering constraint for correctness.
agocke pushed a commit that referenced this pull request Sep 22, 2025
…able (#119953)

* [mono][metadata] Enable compressed interface bitmap by default (#119694)

* [mono][metadata] Enable compressed interface bitmap by default

* Fix build on windows

* Fix publishing of compressed bitmap

Before this commit we were doing changes on the published data which is problematic for multithreaded environments. We ensure the bitmap is fully processed before publishing it so that we can rely on the data dependency memory ordering constraint for correctness.

* [mono] Enable configuration at runtime of the compressed interface bitmap feature (#119881)

* Add option to configure use of compressed interface bitmaps

This optimization is disabled by default. Enable it with `MONO_COMPRESSED_INTERFACE_BITMAP=1`

* Add support for detecting mismatch with aot images
BrzVlad added a commit to BrzVlad/runtime that referenced this pull request Sep 23, 2025
…t#119694)

* [mono][metadata] Enable compressed interface bitmap by default

* Fix build on windows

* Fix publishing of compressed bitmap

Before this commit we were doing changes on the published data which is problematic for multithreaded environments. We ensure the bitmap is fully processed before publishing it so that we can rely on the data dependency memory ordering constraint for correctness.
BrzVlad added a commit to BrzVlad/runtime that referenced this pull request Sep 26, 2025
…t#119694)

* [mono][metadata] Enable compressed interface bitmap by default

* Fix build on windows

* Fix publishing of compressed bitmap

Before this commit we were doing changes on the published data which is problematic for multithreaded environments. We ensure the bitmap is fully processed before publishing it so that we can rely on the data dependency memory ordering constraint for correctness.
steveisok pushed a commit that referenced this pull request Oct 1, 2025
…ble (#120154)

* [mono][metadata] Enable compressed interface bitmap by default (#119694)

* [mono][metadata] Enable compressed interface bitmap by default

* Fix build on windows

* Fix publishing of compressed bitmap

Before this commit we were doing changes on the published data which is problematic for multithreaded environments. We ensure the bitmap is fully processed before publishing it so that we can rely on the data dependency memory ordering constraint for correctness.

* [mono] Enable configuration at runtime of the compressed interface bitmap feature (#119881)

* Add option to configure use of compressed interface bitmaps

This optimization is disabled by default. Enable it with `MONO_COMPRESSED_INTERFACE_BITMAP=1`

* Add support for detecting mismatch with aot images
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants