Conversation
Add a coreclr_r2r_composite_v8 job (r2rRunType r2r_composite) alongside the per-assembly coreclr_r2r_v8 lane. The mode flows through run_performance_job.py (R2RType=r2r_composite, a separate PerfLab history) to a new --wasm-ready-to-run-composite micro_benchmarks option, which sets PERFLAB_WASM_READY_TO_RUN_COMPOSITE for MSBuild. MicroBenchmarks.Wasm.targets now sets PublishReadyToRunComposite from the selected mode, validates it, and in composite mode verifies that exactly one <entry>.r2r.wasm composite image was produced with component inputs and that it was defined as the readyToRunComposite publish asset that GenerateWasmBootJson routes to coreAssembly. Depends on dotnet/runtime#134618. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The WASM targets file is not imported, so the composite configuration and validation do not run.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Adds an opt-in CoreCLR browser-WASM composite ReadyToRun microbenchmark lane with distinct result tracking.
Changes:
- Adds composite R2R CLI, validation, environment propagation, and job forwarding.
- Adds MSBuild output and publish-asset checks.
- Adds pipeline wiring, tests, and documentation.
| File | Summary |
|---|---|
src/benchmarks/micro/MicroBenchmarks.Wasm.targets |
Composite R2R configuration and validation; currently not imported by the project, so these changes are inactive. |
scripts/tests/test_wasm_coreclr_r2r.py |
Tests mode parsing, forwarding, configuration, and pipeline behavior. |
scripts/run_performance_job.py |
Propagates composite mode and result identity. |
scripts/micro_benchmarks.py |
Adds composite R2R CLI support. |
scripts/benchmarks_ci.py |
Accepts composite workload-source runs. |
eng/pipelines/templates/run-performance-job.yml |
Enables workload-source forwarding. |
eng/pipelines/runtime-wasm-perf-jobs.yml |
Defines the composite benchmark lane. |
docs/benchmarking-workflow-dotnet-runtime.md |
Documents composite R2R usage and dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
LoopedBard3
approved these changes
Sep 28, 2026
LoopedBard3
left a comment
Member
There was a problem hiding this comment.
This seems good to me, let's merge once we have the dependencies merged.
This was referenced Sep 28, 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.

Adds a CoreCLR browser-WASM composite ReadyToRun microbenchmark lane next to the per-assembly R2R lane from #5297.
Dependencies
[wasm][coreclr] Enable composite ReadyToRun publishing) must land, and the lane needs a perf-buildBrowserWasmCoreCLRartifact built from a runtime commit that includes it. Until then, the lane fails with the runtime's existingPublishReadyToRunComposite is not supported for CoreCLR browser-wasmerror._WasmCoreClrValidateCompositeTasks, which fails before the composite compile when the SDK's ReadyToRun tasks plan<entry>.r2r.dllinstead of<entry>.r2r.wasm. The SDK in the perf artifact (dotnet-none, pinned by runtime'sglobal.json) needs that change. The alternative is for the artifact to ship runtime'sCrossgen2Tasksand setCrossgen2SdkOverridePropsPath/Crossgen2SdkOverrideTargetsPath. Until one of those is in place, expect the first runs to fail fast with that clear error, not with a bad benchmark result.Changes
micro_benchmarks.py): new--wasm-ready-to-run-compositeoption that implies R2R.--wasm-ready-to-runstill means per-assembly. Both options require--wasm --wasm-runtime-flavor CoreCLR.configure_wasm_ready_to_runalways writes bothPERFLAB_WASM_READY_TO_RUNandPERFLAB_WASM_READY_TO_RUN_COMPOSITE, so a stale parent value can't select the wrong mode.benchmarks_ci.pyaccepts--wasm-workload-sourcewith either mode.run_performance_job.py):r2r_run_type == "r2r_composite"maps toR2RType=r2r_compositeand passes--wasm-ready-to-run-compositeto the Helix work item. The workload-source SDK cohort applies to both R2R modes.r2r_compositeis rejected for any runtime type other thanwasm_coreclr.MicroBenchmarks.Wasm.targets):PublishReadyToRunCompositenow comes from the selected mode.PublishTrimmed,TrimMode, WebCIL andContainerFormat=wasmare the same as before, so per-assembly mode is unchanged.ValidateWasmReadyToRunConfigurationchecks that the applied composite value matches the selected mode, and that composite mode is only used together with R2R.ValidateWasmReadyToRunOutputs(after_CreateR2RImages), composite mode: requires exactly one_ReadyToRunCompileListitem withCreateCompositeImage=true. ItsOutputR2RImagemust end in.r2r.wasmand exist on disk, and there must be at least one_ReadyToRunCompositeBuildInputor_ReadyToRunCompositeUnrootedBuildInput.ValidateWasmReadyToRunOutputs, per-assembly mode: now also fails if a composite image was planned.ValidateWasmReadyToRunCompositePublishAssets(afterProcessPublishFilesForWasm): requires exactly one_WasmCompositePublishStaticWebAssetwithAssetTraitValue=readyToRunComposite.GenerateWasmBootJsonroutes exactly that asset toresources.coreAssembly(withisCompositeImage). This catches a composite that was compiled but never shipped or loaded.coreclr_r2r_composite_v8job inruntime-wasm-perf-jobs.yml. It is identical tocoreclr_r2r_v8exceptr2rRunType: 'r2r_composite': same release-branch exclusion, payload, machine and engine. Therun-performance-job.ymlworkload-source condition now covers both R2R types.test_wasm_coreclr_r2r.pycovers mode parsing and validation, env configuration (including stale values), work item forwarding, run configuration, the MSBuild property and guard structure, and a check that the new pipeline lane matches the per-assembly lane apart from its identity. The docs describe the new option.Results identity
Composite runs report
R2RType=r2r_composite, so PerfLab keeps them in a separate history from per-assemblyR2RType=r2rand from the interpretedcoreclr_v8lane. Existing histories don't change.Risks to watch in the first validation run
--buildTimeout 1200: one composite covers the whole trimmed benchmark closure, including Roslyn (Microsoft.CodeAnalysis*). It is one large, serial compile rather than many small ones, and could exceed the BDN build timeout or the machine's memory.coreAssembly: the composite owner is loaded from the boot config'sresources.coreAssemblybefore CoreCLR initializes, with component stubs staying in the TPA. BDN's generated WASM host must use the SDK's boot config and loader unchanged. If it doesn't, stubs will fail-fast because they can't find the owner..wasmimage may noticeably move first-iteration and startup-sensitive numbers compared with per-assembly R2R.Notes (no changes made)
PublishReadyToRunExclude: none remain inMicroBenchmarks.csproj; Enable Jil for CoreCLR WASM R2R #5317, which removed the Jil exclusion, is already inmain. Any future exclusion would keep that assembly out of the composite (it would stay IL/interpreted), which is the expected composite behavior._AOT_InternalForceInterpretAssemblies(Roslyn): this is a Mono AOT item and has no effect on CoreCLR Crossgen2. In composite mode, Roslyn is compiled into the composite, the main contributor to the compile-time risk above. If that turns out too slow, a follow-up could excludeMicrosoft.CodeAnalysis*from the composite.Note
This PR description was generated with GitHub Copilot assistance.