Repository navigation
Group cold-exclusive WebAssembly R2R imports before layout - #107
Merged
Merged
Conversation
Co-authored-by: Copilot <[email protected]>
jtschuster
marked this pull request as ready for review
October 29, 2026 23:35
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.
Summary
Follow-up to dotnet#136607, targeting
jtschuster/runtime:wasm-r2r-partitioned-modules.Classify import ownership before object emission assigns table indices and offsets, then place primary-needed cells before cold-exclusive cells within every import table. Apply the same partition key to each parallel signature-RVA entry; retain the existing deterministic comparison within each group. Reuse this ownership result when extracting auxiliary data rather than rediscovering ownership after layout.
GC reference maps now retain import identities and follow physical cell order, including empty records for non-method cells and the 1024-record lookup stride. Table identities, entry sizes, alignment, relocation targets, and pointer-scaled fixup-list encoding are unchanged; their dependent offsets are generated from the partitioned layout.
Keep eager, shared, unused, and resident-data-referenced imports primary. Determine signature ownership after symbol deduplication, preserving signatures shared with primary cells or directly referenced by resident data. Stably group cold-exclusive signature blobs at the end of data emission.
Safety boundaries
Coverage and validation
Passed
WasmImportLayoutTests.cs, run against that built compiler using a session-only project and the existing xUnit 2.9.3 console runner. This bypasses the normal test project's native-artifact staging requirement; it does not substitute for the full compiler suite.npm --prefix src/native run test:auxiliary-modules: 17 passed, including both activation orders, idempotence, empty-body activation, and the added resolved-data preservation assertions. TypeScript 5.9.2 was restored to a session-only directory and selected withTYPESCRIPT_PATHafter the repository's npm restore encountered a registry connection reset.git diff --check.Not run / blocked
ILCompiler.ReadyToRun.Tests.csprojbuild/test invocation was attempted. After restoring the required SDK and bypassing an unavailable NuGet audit endpoint and SDK R2R package download, it stops while staging missingartifacts/bin/coreclr/browser.wasm.Release/x64/libjitinterface_x64.so.PartitionedR2RActivationruntime variants were not run. Their existing managed fixture is extended to exercise mixed and shared type imports and a generic import before, between, and after activation. All-hot/all-cold boundary coverage is retained.No whole-application performance or download-size claim is made. Full native/runtime validation remains necessary before merging.