Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<MicrosoftNETILLinkPackageVersion>10.0.0-rc.1.25555.107</MicrosoftNETILLinkPackageVersion>
<SystemThreadingChannelsPackageVersion>10.0.0-rc.1.25555.107</SystemThreadingChannelsPackageVersion>
<MicrosoftExtensionsLoggingPackageVersion>10.0.0-rc.1.25555.107</MicrosoftExtensionsLoggingPackageVersion>
<BenchmarkDotNetVersion>0.16.0-nightly.20260226.451</BenchmarkDotNetVersion>
<BenchmarkDotNetVersion>0.16.0-nightly.20260320.467</BenchmarkDotNetVersion>
<MicrosoftNETRuntimeEmscripten3156Nodewinx64Version>10.0.0-rc.1.25555.107</MicrosoftNETRuntimeEmscripten3156Nodewinx64Version>
<MicrosoftDotNetXHarnessCLIVersion>11.0.0-prerelease.26064.3</MicrosoftDotNetXHarnessCLIVersion>
</PropertyGroup>
Expand Down
25 changes: 25 additions & 0 deletions eng/pipelines/runtime-perf-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ parameters:
configs:
- linux_x64
- windows_x64
- name: viperMicroR2RInterpreter
type: object
default:
enabled: true
configs:
- linux_x64
- name: monoMicro
type: object
default:
Expand Down Expand Up @@ -272,6 +278,25 @@ jobs:
${{ each parameter in parameters.jobParameters }}:
${{ parameter.key }}: ${{ parameter.value }}

# CoreCLR Viper microbenchmarks Composite R2R with interpreter fallback — controlled by viperMicroR2RInterpreter toggle.
- ${{ if eq(parameters.viperMicroR2RInterpreter.enabled, true) }}:
- template: /eng/pipelines/common/platform-matrix.yml@${{ parameters.runtimeRepoAlias }}
parameters:
jobTemplate: /eng/pipelines/templates/runtime-perf-job.yml@${{ parameters.performanceRepoAlias }}
buildConfig: release
runtimeFlavor: coreclr
platforms: ${{ parameters.viperMicroR2RInterpreter.configs }}
jobParameters:
liveLibrariesBuildConfig: Release
runtimeType: coreclr_r2r_interpreter
runKind: micro
logicalMachine: 'perfviper'
runtimeRepoAlias: ${{ parameters.runtimeRepoAlias }}
performanceRepoAlias: ${{ parameters.performanceRepoAlias }}
additionalJobIdentifier: 'R2RInterpreter'
${{ each parameter in parameters.jobParameters }}:
${{ parameter.key }}: ${{ parameter.value }}

# run coreclr crossgen perf job
- ${{ if false }}: # Disabling as all crossgen jobs are failing at the moment - https://github.com/dotnet/performance/issues/4819
- template: /eng/pipelines/common/platform-matrix.yml@${{ parameters.runtimeRepoAlias }}
Expand Down
11 changes: 10 additions & 1 deletion eng/pipelines/templates/runtime-perf-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# Test job depends on the corresponding build job
${{ if eq(parameters.downloadSpecificBuild.buildId, '') }}:
dependsOn:
- ${{ if not(in(parameters.runtimeType, 'AndroidMono', 'AndroidCoreCLR', 'iOSMono', 'iOSCoreCLR', 'iOSNativeAOT', 'wasm', 'wasm_coreclr', 'mono')) }}:
- ${{ if not(in(parameters.runtimeType, 'AndroidMono', 'AndroidCoreCLR', 'iOSMono', 'iOSCoreCLR', 'iOSNativeAOT', 'wasm', 'wasm_coreclr', 'mono', 'coreclr_r2r_interpreter')) }}:
- ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, 'coreclr') }}
- ${{ if and(eq(parameters.runtimeType, 'mono'), ne(parameters.codeGenType, 'AOT')) }}:
- ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, 'mono') }}
Expand All @@ -57,6 +57,8 @@ jobs:
- ${{ 'build_ios_arm64_release_iOSCoreCLR' }}
- ${{ if eq(parameters.runtimeType, 'iOSNativeAOT')}}:
- ${{ 'build_ios_arm64_release_iOSNativeAOT' }}
- ${{ if eq(parameters.runtimeType, 'coreclr_r2r_interpreter')}}:
- ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, 'coreclr_r2r_interpreter') }}

variables:
- name: librariesDownloadDir
Expand Down Expand Up @@ -141,6 +143,13 @@ jobs:
artifactFileName: 'BuildArtifacts_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_$(buildConfigUpper)_${{ parameters.runtimeType }}$(archiveExtension)'
artifactName: 'BuildArtifacts_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_$(buildConfigUpper)_${{ parameters.runtimeType }}'
displayName: 'Runtime artifacts'
- ${{ elseif eq(parameters.runtimeType, 'coreclr_r2r_interpreter') }}:
- template: /eng/pipelines/templates/download-artifact-step.yml
parameters:
unpackFolder: $(librariesDownloadDir)/bin
artifactFileName: 'BuildArtifacts_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_$(buildConfigUpper)_coreclr_r2r_interpreter$(archiveExtension)'
artifactName: 'BuildArtifacts_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_$(buildConfigUpper)_coreclr_r2r_interpreter'
displayName: 'R2R Interpreter Runtime artifacts'
- ${{ elseif or(eq(parameters.runtimeType, 'AndroidMono'), eq(parameters.runtimeType, 'AndroidCoreCLR'))}}:
# Download artifacts for Android Testing
- template: /eng/pipelines/templates/download-artifact-step.yml
Expand Down
46 changes: 45 additions & 1 deletion scripts/build_runtime_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"build_coreroot_payload_simple",
"build_mono_payload",
"build_monoaot_payload",
"build_r2r_interpreter_payload",
"build_wasm_payload",
"build_wasm_coreclr_payload",
]
Expand Down Expand Up @@ -371,4 +372,47 @@ def build_wasm_coreclr_payload(
else:
getLogger().warning("Microsoft.NETCore.App.Ref pack not found – cannot determine version")

_set_permissions_recursive([wasm_dotnet_dir, wasm_built_nugets_dir], mode=0o664)
_set_permissions_recursive([wasm_dotnet_dir, wasm_built_nugets_dir], mode=0o664)


def build_r2r_interpreter_payload(
artifacts_archive_or_dir: str,
payload_dest: str,
os_group: str,
architecture: str,
) -> None:
"""Build a Composite R2R with interpreter fallback payload.

Stages the runtime pack and crossgen2 tool from a runtime build produced
with ``-dynamiccodecompiled false``. The crossgen2 files are placed under
a ``tools/`` subdirectory as required by the SDK's
``ResolveReadyToRunCompilers`` target.

Args:
artifacts_archive_or_dir: Path to the build artifacts (archive or directory).
payload_dest: Destination root for the payload.
os_group: Target OS group (e.g. "linux").
architecture: Target architecture (e.g. "x64").
"""
runtimepack_dir = os.path.join(payload_dest, "runtimepack")
crossgen2_tools_dir = os.path.join(payload_dest, "crossgen2", "tools")
os.makedirs(runtimepack_dir, exist_ok=True)
os.makedirs(crossgen2_tools_dir, exist_ok=True)

extract_archive_or_copy(
artifacts_archive_or_dir,
runtimepack_dir,
prefix=f"microsoft.netcore.app.runtime.{os_group}-{architecture}/Release/",
)

extract_archive_or_copy(
artifacts_archive_or_dir,
crossgen2_tools_dir,
prefix=f"crossgen2_publish/{architecture}/Release/",
)

# Ensure crossgen2 is executable
if os_group != "windows":
crossgen2_executable = os.path.join(crossgen2_tools_dir, "crossgen2")
if os.path.exists(crossgen2_executable):
os.chmod(crossgen2_executable, 0o755)
26 changes: 26 additions & 0 deletions scripts/run_performance_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,20 @@ def get_bdn_arguments(
"--wasmProcessTimeout", "20"
]

if runtime_type == "coreclr_r2r_interpreter":
if os_group == "windows":
bdn_arguments += [
"--runtimes", "r2r11_0",
"--customruntimepack", "%HELIX_CORRELATION_PAYLOAD%\\r2r_interpreter\\runtimepack",
"--aotcompilerpath", "%HELIX_CORRELATION_PAYLOAD%\\r2r_interpreter\\crossgen2",
]
else:
bdn_arguments += [
"--runtimes", "r2r11_0",
"--customruntimepack", "$HELIX_CORRELATION_PAYLOAD/r2r_interpreter/runtimepack",
"--aotcompilerpath", "$HELIX_CORRELATION_PAYLOAD/r2r_interpreter/crossgen2",
]

if category_exclusions:
bdn_arguments += ["--category-exclusion-filter", *set(category_exclusions)]

Expand Down Expand Up @@ -911,6 +925,18 @@ def run_performance_job(args: RunPerformanceJobArgs):
getLogger().info("Copying MonoAOT build to payload directory")
build_monoaot_payload(linux_mono_aot_dir, monoaot_dotnet_path, args.architecture)

use_r2r_interpreter = False
if args.runtime_type == "coreclr_r2r_interpreter":
use_r2r_interpreter = True
Comment on lines +918 to +920
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use_r2r_interpreter is assigned but never referenced later in run_performance_job, which makes the new code path harder to reason about and suggests a missing integration step. Either remove the variable entirely, or use it to drive whatever behavior difference is intended for the coreclr_r2r_interpreter runtime type (e.g., selecting a different dotnet install/payload logic).

Suggested change
use_r2r_interpreter = False
if args.runtime_type == "coreclr_r2r_interpreter":
use_r2r_interpreter = True
if args.runtime_type == "coreclr_r2r_interpreter":

Copilot uses AI. Check for mistakes.
if not args.libraries_download_dir:
raise Exception("Libraries not downloaded for R2R interpreter")

r2r_interpreter_dir = os.path.join(args.libraries_download_dir, "bin")
r2r_interpreter_payload = os.path.join(payload_dir, "r2r_interpreter")

getLogger().info("Copying R2R interpreter build to payload directory")
build_r2r_interpreter_payload(r2r_interpreter_dir, r2r_interpreter_payload, args.os_group, args.architecture)

use_core_run = False
use_baseline_core_run = False
if not args.performance_repo_ci and args.runtime_type == "coreclr":
Expand Down