Repository navigation
[wasm][coreclr] Default browser ReadyToRun publishing to composite - #136486
Conversation
Preserve per-assembly opt-outs across consumer and in-tree builds, including nested sample publishes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 519ad6c4-3702-45c6-bb99-0e2ad8573d04
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
|
/azp run runtime-coreclr crossgen2, runtime-coreclr crossgen2 outerloop, runtime-libraries-coreclr outerloop, runtime-wasm-libtests Note CI runs requested by the user via GitHub Copilot. |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run runtime-coreclr crossgen2, runtime-coreclr crossgen2 outerloop, runtime-libraries-coreclr outerloop, runtime-wasm-libtests |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run runtime-libraries-coreclr outerloop Note Rerun requested by the user; this comment was generated by GitHub Copilot. |
|
No pipelines are associated with this pull request. |
|
CI results for head
The browser R2R retry completed its build without memory warnings, submitted the full test payload, and finished all 29 test batches. Both wasm failures in that retry have verified main matches:
The native pri0 pipeline's red result is a separate macOS x64 host-library timezone failure matched to #136758, not a pri0 runtime-test failure. The native R2R outerloop signature assertion and composite EventPipe failure signatures have direct matches in main build 1659123. The regular runtime pipeline's Linux Mono WasmBuildTests provisioning failure also occurs on main build 1658830. The expanded matrix is not fully green, and not every native host-library outerloop failure has been individually classified. Note This CI summary was prepared with GitHub Copilot. |
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Set PublishReadyToRunComposite directly in browser props whenever it is unset, without depending on runtime selection. Remove the early-target import, separate defaults file, and duplicate in-tree assignment. Preserve explicit overrides and keep ReadyToRun itself opt-in. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 519ad6c4-3702-45c6-bb99-0e2ad8573d04
|
/ba-g the failure is unrelated |
…or composite R2R images (#137113) Component assemblies of a multi-assembly composite R2R image never set `ReadyToRunInfo::m_pLoadedImageBase`. Only the composite image's own `ReadyToRunInfo` and single-assembly images set it (`readytoruninfo.cpp`, non-component branch), and the loader heap zero-fills, so the cDAC reads 0 for every component module. The native runtime never reads this field; it uses `m_pComposite->GetImage()`. Impact: - **WebAssembly (browser/WASI):** the composite image's virtual-IP range is registered under a component module. `FindVirtualIPRangeSection` rejects ranges whose module has a null `LoadedImageBase`, so no composite R2R code resolves and stack walks stop at the first explicit Frame. Since composite became the browser default (#136486), every cDAC walk of a `PublishReadyToRun` browser app stops this way. - **All platforms:** `FrameHelpers.FindGCRefMap` computed `indirection - 0`, so GCRefMaps for `StubDispatchFrame`/`ExternalMethodFrame` import cells in composite images were not found. Fix: `Data.ReadyToRunInfo.LoadedImageBase` is now read through `CompositeInfo`, the same pattern `EntryPointToMethodDescMap` already uses. `CompositeInfo` points to itself for non-component images, so this is a no-op there. There is no runtime or descriptor change, so it works against runtimes that have already shipped. The `ExecutionManager.md`/`StackWalk.md` docs are updated. Validation: - Composite cases added to `GetMethodDesc_R2R_WasmVirtualIPRangeList_ResolvesCapturedShape` and `FindGCRefMap_ResolvesImportRecord`; both fail without the fix. `dotnet test src/native/managed/cdac/tests/UnitTests`: 4046 passed. - Live, browser-wasm (nightly 12.0.0-alpha.1.26555.106), nesm cDAC stack-walk rig: a composite `PublishReadyToRun` app went from 2 frames (InitialNativeContext + InlinedCallFrame) to a full walk. That walk has 22 frames, R2R and interpreted, through both InterpreterFrames, all named. 24/24 pass across 6 modes (break, pause, JSImport, locals; R2R and interpreter-only) on the composite and per-assembly publishes, nesm workarounds on and off. Frame names match an independent static R2R oracle; R2R locals read the expected source values. The runtime side of the same composite image-base issue was fixed in #131243; this is the cDAC counterpart. > [!NOTE] > This PR description was drafted with GitHub Copilot. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Summary
Default CoreCLR browser-wasm ReadyToRun publishing to composite mode. ReadyToRun itself remains opt-in through
PublishReadyToRun=true;PublishReadyToRunComposite=falseretains per-assembly publishing.falsevalue..r2r.wasmnaming.Composite browser publishing was added in #134618. This change selects that existing mode by default; it does not enable ReadyToRun by default or resolve #132466.
Compatibility
Applications already opting into browser CoreCLR ReadyToRun will now publish a composite owner and component WebCIL stubs. They need WebCIL enabled and wasm-aware ReadyToRun SDK tasks. Existing validation and compatibility shims are retained.
To keep the previous per-assembly mode:
Mono defaults are unchanged. This does not change runtime-pack/CoreLib compilation or introduce a new public API.
Validation
Passed: zero errors, with four NU1902/NU1903 package-advisory warnings in the packaging-test dependencies.
./dotnet.sh build src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj -c Release \ --disable-build-servers -nr:false \ -p:TargetOS=browser -p:TargetArchitecture=wasm -p:RuntimeFlavor=CoreCLR \ -p:TestUsingWorkloads=true -p:InstallWorkloadForTesting=false \ -p:InstallChromeForTests=false -p:InstallFirefoxForTests=false -p:InstallV8ForTests=false \ -p:WasmToolCacheDir="$PWD/.dotnet/wasm-tools/"Passed: zero warnings and errors.
Focused Chrome execution using the built native SDK directly:
NativeLibraryTests.ProjectWithNativeReference_ReadyToRun, with its original setup: 1 passed, 0 failed, 0 skipped with the single composite opt-out. Removing only that opt-out made the same test fail the existing SDK naming guard: the SDK plannedWasmBasicTestApp.r2r.dllinstead of.r2r.wasm. No theory expansion, new assertions, or helper refactoring remains.ReadyToRunTestscomposite publish and WebCIL-negative cases: 4 passed, 0 failed, 0 skipped. The local native-SDK import was restricted to explicit native relinks; the earlier ad-hoc runner had unintentionally enabled native relinking in a non-native case. The current run covers trimmed, untrimmed, native-relinked, repeated publish, and composite → per-assembly → composite switching.The workload-installed test lane could not be prepared because its manifest also requests unbuilt Mono runtime/AOT packs. The focused runs instead used the no-workload SDK with explicit imports of the built CoreCLR native SDK targets and the local Emscripten toolchain. This is local execution evidence, not a successful workload-installation or CI result.
XHARNESS_COMMAND=test-browser ./dotnet.sh build -t:Test \ src/libraries/System.Memory/tests/System.Memory.Tests.csproj -c Release \ --disable-build-servers -nr:false \ -p:TargetOS=browser -p:TargetArchitecture=wasm -p:RuntimeFlavor=CoreCLR \ -p:TestWasmReadyToRun=true -p:EnableAggressiveTrimming=true \ -p:Scenario=WasmTestOnChrome -p:InstallChromeForTests=true \ -p:WasmToolCacheDir="$PWD/.dotnet/wasm-tools/"Passed: 52,252 passed, 0 failed, 2 skipped. No explicit composite property was supplied. The boot config identifies
System.Memory.Tests.r2r.wasmas the composite owner, and its table size is nonzero.Additional local checks:
git diff --checkpassed.Review status
Independent Claude Sonnet 5.5 and Gemini 4 Argon reviews were completed. The sample opt-out forwarding gap and missing diagnostic guidance were fixed and reviewed by both models. The remaining human-review considerations are acceptance of the SDK compatibility/default-policy change, cross-platform CI, and comparative performance data before any performance claim.
Not run: the full Wasm.Build.Tests suite, cross-platform CI, or comparative WebAssembly performance measurements.
Note
This change and PR description were prepared with GitHub Copilot.