Skip to content

ref: Record that Android assembly store v4 never shipped - #5609

Merged
jamescrosswell merged 1 commit into
feat/assemblystore-index-sizingfrom
ref/assemblystore-v4-never-shipped
Sep 23, 2026
Merged

jamescrosswell merged 1 commit into
feat/assemblystore-index-sizingfrom
ref/assemblystore-v4-never-shipped

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

Stacked on #5577 — this PR's diff is only the comment/attribution corrections and one added test case.

Closes #5604

Summary

#5604 flagged a new commit under the upstream code we vendor into src/Sentry.Android.AssemblyReader/: 8f7c4d4, "[CoreCLR] Remove assembly store decompression cache" (dotnet/android#12780). Reviewing it: it does affect us, and in our favour.

Upstream remeasured the opt-in decompression cache and found it made startup worse (+162 ms TTID, +179 ms TTFD), so they removed it — and with it the content_id header field it needed, restoring assembly store format version 3 for both CoreCLR and MonoVM. Verified on dotnet/android main:

  • AssemblyStoreGenerator.cs emits ASSEMBLY_STORE_FORMAT_VERSION_CORECLR_64BIT = 0x80000003
  • StoreReader_V2.Classes.cs has no content_id; Header.NativeSize is a flat 5 * sizeof(uint) const
  • StoreReader_V2.cs no longer lists the _V4 | ABI versions, and has dropped ASSEMBLY_STORE_FORMAT_NUMBER_MASK

main is the .NET 11 branch — there is no release/11.0.1xx, and eng/Versions.props carries AndroidPackVersion 37.2.0 with suffix rc.2. The revert (2026-09-15) predates rc.2, while our global.json pins 11.0.100-rc.1 / workload 11.0.100-rc.1.26458.5 (2026-09-08), the last build that emitted v4. So v4 never shipped, and .NET 11 GA will emit v3.

What this means for the stack

Changes

  • File headers in StoreReader.cs / StoreReader.Classes.cs and V2/ATTRIBUTION.txt said v4 "ships in .NET 11". It doesn't — they now say previews only, and record the revert as a sync point.
  • The // Must match the ASSEMBLY_STORE_FORMAT_VERSION native constant note on the v4 constant is stale; no native constant has that value any more.
  • StoreReaderTests had a synthetic v4 64-bit store with 32-bit hashes but no v3 equivalent — i.e. no coverage of the shape .NET 11 GA will actually produce. Added.

🤖 Generated with Claude Code

dotnet/android#12780 removed the opt-in decompression cache and restored
assembly store format version 3 for CoreCLR, so v4 only ever existed in
.NET 11 previews. Correct the vendored file headers and ATTRIBUTION,
which claimed v4 ships in .NET 11.

.NET 11 GA emits v3 with CoreCLR's 32-bit CRC32 name hashes on 64-bit
ABIs - a shape the synthetic store tests did not cover. Add it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jamescrosswell jamescrosswell added the skip-changelog Suppress automatic changelog generation via Craft label Sep 22, 2026
@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.80%. Comparing base (8877577) to head (a4f9683).
⚠️ Report is 4 commits behind head on feat/assemblystore-index-sizing.

Additional details and impacted files
@@                         Coverage Diff                         @@
##           feat/assemblystore-index-sizing    #5609      +/-   ##
===================================================================
- Coverage                            74.90%   74.80%   -0.11%     
===================================================================
  Files                                  515      515              
  Lines                                18916    18916              
  Branches                              3693     3693              
===================================================================
- Hits                                 14169    14150      -19     
- Misses                                3872     3890      +18     
- Partials                               875      876       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell jamescrosswell added this to the 7.0.0 milestone Sep 22, 2026
@jamescrosswell
jamescrosswell marked this pull request as ready for review September 23, 2026 23:11
@jamescrosswell
jamescrosswell merged commit 79b8f74 into feat/assemblystore-index-sizing Sep 23, 2026
41 of 42 checks passed
@jamescrosswell
jamescrosswell deleted the ref/assemblystore-v4-never-shipped branch September 23, 2026 23:11
@github-actions github-actions Bot added the risk: low PR risk score: low label Sep 23, 2026
jamescrosswell added a commit that referenced this pull request Oct 6, 2026
* feat: Accept Android assembly store v4 versions and read content_id header

v4 stores (CoreCLR, .NET 11) add a content_id field to the header, so the
index starts 8 bytes later. Header.NativeSize is now derived from the format
number rather than being a constant.

Refs #5454

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat: Decompress Zstandard-compressed Android assemblies

.NET 11 compresses assemblies with Zstandard (XAZS) instead of LZ4 (XALZ).
The 12-byte header is unchanged, so only the magic and the codec differ.
Zstandard uses the BCL ZstandardDecoder on net11.0; the net10.0 build
throws NotSupportedException, since only .NET 11 apps produce XAZS.

Refs #5346

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Accept API verifier changes

* Accept API verifier changes

* feat: Derive Android assembly store index entry size from the header

The index entry layout was inferred from the ABI bitness (plus a compile-time
TFM check for the ignore flag). CoreCLR v4 stores use 32-bit CRC32 name
hashes on every ABI, so on 64-bit ABIs the reader read the index 4 bytes per
entry too far and failed in Prepare(). The entry size is now
index_size / index_entry_count, and anything other than the two v3/v4 layouts
is rejected as corrupt.

With this, .NET 11 APKs are readable, so the net11 APK tests are re-enabled.

Refs #5454

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: Refresh Android assembly reader upstream attribution

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test: Don't compile ArchiveUtilsTests for Android

Assembly.Location is empty on Android, so the static initializer threw and
every test in the class failed on the device runs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: Trim comments

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix: Resolve debug images for Android assemblies without a file location

On .NET 11 (CoreCLR) Android, assemblies loaded from the assembly store report
Module.FullyQualifiedName as <Unknown>, so DebugStackTrace bailed out before
calling the assembly reader and events had no debug images. When an assembly
reader is configured, fall back to Module.ScopeName, which is the file name
the store is indexed by.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: Trim comments

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat: Decompress Zstandard-compressed Android assemblies

.NET 11 compresses assemblies with Zstandard (XAZS) instead of LZ4 (XALZ).
The 12-byte header is unchanged, so only the magic and the codec differ.
Zstandard uses the BCL ZstandardDecoder on net11.0; the net10.0 build
throws NotSupportedException, since only .NET 11 apps produce XAZS.

Refs #5346

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test: Don't compile ArchiveUtilsTests for Android

Assembly.Location is empty on Android, so the static initializer threw and
every test in the class failed on the device runs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: Trim comments

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* refactor: Address review feedback on Zstandard decompression

Magic numbers become internal constants the tests share, and the
DecompressZstandard helper is inlined - its assemblyName parameter was
unused on .NET 11.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* refactor: Address review feedback on .NET 11 assembly store support

Names the magic values in the test fixtures, shares the format number mask
with the reader, skips the output buffer allocation when a Zstandard payload
can't be decompressed, and logs why reading an assembly failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* ref: Record that assembly store v4 never shipped in .NET 11 (#5609)

dotnet/android#12780 removed the opt-in decompression cache and restored
assembly store format version 3 for CoreCLR, so v4 only ever existed in
.NET 11 previews. Correct the vendored file headers and ATTRIBUTION,
which claimed v4 ships in .NET 11.

.NET 11 GA emits v3 with CoreCLR's 32-bit CRC32 name hashes on 64-bit
ABIs - a shape the synthetic store tests did not cover. Add it.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low skip-changelog Suppress automatic changelog generation via Craft

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Upstream change detected: dotnet/android .github/skills/read-assembly-store/src/AssemblyStore @ 8f7c4d4

1 participant