[release/11.0] Fix a trim a NAOT trim regression - #132590
Open
github-actions[bot] wants to merge 2 commits into
Open
[release/11.0] Fix a trim a NAOT trim regression#132590github-actions[bot] wants to merge 2 commits into
github-actions[bot] wants to merge 2 commits into
Conversation
Moves `Number`'s primitive Decimal32/64/128 coefficient data to RVA-backed spans and computes the remaining small structured constants on demand. Managed caches that still require initialization are isolated in nested holder types, so `Number` no longer has a static constructor and unused data can be trimmed. Formatting patterns now use switch-selected RVA byte spans rather than managed string arrays. Direct byte handling was within benchmark noise versus the prior implementation: currency `-1.9%`, number `-1.2%`, and percent `+0.2%`, with unchanged allocations. Validated CoreCLR, NativeAOT, and Mono builds and all 77,366 `System.Runtime.Tests`. > [!NOTE] > This pull request was created with GitHub Copilot. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-numerics |
Member
|
CC. @MichalStrehovsky for the backport, which fixes the regression you identified. -- Is getting the full numbers from https://github.com/MichalStrehovsky/rt-sz something anyone can do, or do you need to be the one to open the issue? |
Member
Anyone can open an issue. The only problem is with adding labels but this doesn't need labels. I've opened one at MichalStrehovsky/rt-sz#252. I've never tried this with a non-main PR, but RC1 is not too far from main at this point so it might work. |
jkotas
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #132550 and #132576 to
release/11.0.Customer Impact
These changes reduce NativeAOT application size and avoid unnecessary startup work by removing the
Numberstatic constructor and deferring the ICU-onlyCompareInfosearch values andEncodingTablename cache until they are used.The official size report measured:
Regression
#132550 fixes a NativeAOT size regression introduced by #131019, which added the Decimal32/64/128 transcendental coefficient tables to the data rooted by
Number's static initialization. #132576 is an additional optimization found during the same investigation for two pre-existing CoreLib caches.Testing
The combined backport passed checked CoreLib and NativeAOT CoreLib builds, a Release NativeAOT build, 61,658
System.Globalization.Tests, 14,695System.Text.Encoding.Tests, and 77,365System.Runtime.Tests, with zero failures. The invariant-globalization NativeAOT Hello World was also built and run at the servicing baseline, after #132550, and after both changes.Risk
Low. Both changes only alter internal initialization and data representation, are direct backports of merged main work, and do not change public API or intended behavior. The affected CoreLib, globalization, encoding,
System.Runtime, and NativeAOT surfaces were validated, including the full relevant test suites and before/after NativeAOT application builds.Note
This pull request description was prepared with GitHub Copilot.