Where runtime Helix minutes go, and why WebAssembly is a large share

Ouverte
#138,441 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
20/100
Type d'issue
Documentation
Clarté
À clarifier
Activité
Active
Stack technique
csharp, github-actions, wasm
Domaine
ci-cd, performance

Piste de recherche

This issue is an informational analysis and does not propose a specific change. It references eng/pipelines/runtime.yml and evaluate-default-paths.yml, plus the Chrome and Wasmtime library-test templates; read those alongside the trigger observations in section B3. The issue offers several options for discussion, but does not identify an agreed action or a completion criterion.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area-Infrastructure untriaged

This issue summarizes where dotnet/runtime Helix time went over the last seven days. It explains why WebAssembly accounts for a large share and lists some options that may be worth a closer look. It is informational only and does not propose a specific change.

/cc @lewing @steveisok

Data and method

  • Window: Nov 20, 21:47 UTC – Nov 27, 21:47 UTC (7 days).
  • Source: Helix WorkItems joined to Jobs in the engsrvprod / engineeringdata Kusto database.
  • Scope: Jobs whose source is dotnet/runtime. This includes PRs, rolling CI, and other builds on every branch.
  • Measure: Total time that completed work items spent running, from start to finish. It does not measure VM uptime, CPU time, billing, queue wait, or Azure Pipelines build-agent time.
  • Counting: Each attempt is counted once. Work that began before the window is counted only from the start of the window.
  • WebAssembly: Any Helix job that ran in a *-helix-webassembly* container, on either Linux or Windows hosts.

A. How dotnet/runtime Helix minutes are spent

Category Work items Minutes Share PR minutes CI minutes
Windows (not WebAssembly) 1,332,965 2,111,664 36.8% 1,163,795 738,527
WebAssembly (browser + WASI) 313,021 1,480,909 25.8% 1,082,460 397,028
Linux x64 and other 852,801 758,870 13.2% 351,863 219,980
Linux arm64 712,804 685,811 11.9% 328,158 211,027
macOS 536,577 563,575 9.8% 229,210 333,189
Android 61,429 139,687 2.4% 70,146 69,486
Total 5,740,516 3,225,632

WebAssembly is about a quarter of all runtime Helix minutes and about a third (33.6%) of PR minutes. Of the 388 runtime PRs that sent any work to Helix in this window, 358 (92%) ran WebAssembly jobs. Those PRs averaged about 22 WebAssembly Helix jobs each.

B. Why WebAssembly minutes are high

B1. Where the WebAssembly minutes go
Workload Minutes Share of WebAssembly PRs that ran it PR minutes per PR Average minutes per item
Wasm.Build.Tests (SDK app-build tests) 602,823 40.7% 93 ~4,850 20.1
Library tests in Chrome 465,685 31.4% 360 ~760 5.9
Library tests in Wasmtime (WASI) 182,802 12.3% 330 ~530 1.8
CoreCLR runtime tests (src/tests) 176,833 11.9% 367 ~370 2.3
Library tests in Firefox, V8, and others 52,766 3.6% 359 ~130 —

By host OS, minutes are split about evenly: ~755k on Windows-hosted containers and ~726k on Linux-hosted containers.

  • Windows-hosted Wasm.Build.Tests account for about 488k minutes, the largest single bucket. They average about 30 minutes per work item, compared with about 8.4 minutes per item on Linux.
  • Windows-hosted Chrome library tests account for about 205k minutes. They come from release/10.0 and release/11.0 builds and from PRs. These are mostly Mono jobs (WasmTestOnChrome-ST-* and WasmTestOnChrome-MONO-ST-*). main no longer has Windows Chrome library-test jobs.
B2. Tests take longer per run under WebAssembly

Median runtime in minutes for passing runs of the same test assembly. The native baseline combines several runtime configurations, so treat these ratios as rough.

Test assembly Native Linux x64 Chrome Firefox V8 Wasmtime
System.Text.Encodings.Web.Tests 0.35 1.63 1.78 1.53 15.77
System.Collections.Immutable.Tests 1.05 3.54 3.75 2.15 13.75
System.Globalization.Tests 0.88 1.68 1.58 0.98 10.23
System.Linq.Expressions.Tests 0.48 1.67 1.57 1.90 8.36
System.Runtime.Tests 1.93 3.27 19.04 13.87 18.38

In browsers, the same tests usually take about 1.5–4× as long as native runs. In Wasmtime they often take 10–45× as long. These durations include host and browser startup and test setup, not just WebAssembly execution.

B3. Pipeline triggers

The following refers to eng/pipelines/runtime.yml and its templates at main commit 5b65c8d4.

  1. The libraries path filter matches almost any change. In evaluate-default-paths.yml, the libraries subset has only an exclude list. It therefore matches most changes outside src/coreclr, src/mono, src/tests, and the other excluded paths. This filter is one of the triggers for both of these jobs:

    • The CoreCLR Chrome library-test job (wasm-coreclr-library-tests.yml, scenarios: WasmTestOnChrome).
    • The CoreCLR Wasmtime library-test job (wasi-wasm-coreclr-library-tests.yml).

    Both templates have a shouldRunSmokeOnly: onLibrariesAndIllinkChanges mode. In that mode, a change that touches libraries or ILLink but nothing WebAssembly-specific runs only the smoke tests. runtime.yml does not use that mode for the main Chrome or Wasmtime jobs, so they run the full suites. Only the _SmokeFirefoxV8, _Smoke_R2R, and WASI _R2R jobs are smoke-only.

  2. The wasm_coreclr_runtimetests filter includes all of src/coreclr/* and src/tests/*. Any CoreCLR or test change therefore triggers:

    • The browser and WASI CoreCLR builds.
    • The WASI CoreCLR runtime tests, both interpreter and ReadyToRun.
    • The browser CoreCLR runtime tests. These also run on any change that matches the coreclr filter.
  3. Wasm.Build.Tests are triggered rarely but cost a lot per run. The wasmbuildtests filter is narrow, along with the ILLink and dependency-flow triggers. Even so, each run sends about 10 Helix jobs that total about 2,300 minutes, mainly on Windows. Active WebAssembly PRs push many times. For example, #138027 used about 28k Wasm.Build.Tests minutes in this window.

    • Of the 93 PRs, dotnet-maestro dependency and code-flow PRs accounted for about 66k of the 451k PR minutes.
    • A few PRs whose titles don't suggest WebAssembly changes also triggered Wasm.Build.Tests, such as #137944 (PAL cleanup) and #137670 (EventPipe file permissions). It may be worth checking which filter they matched.
  4. Rolling builds run every WebAssembly job (alwaysRun: isRollingBuild). They are already batched and scheduled twice a day. Rolling CI used about 397k WebAssembly minutes in this window.

C. Options that may be worth a closer look

These are listed only for discussion. Each one trades some coverage for fewer minutes, and the WebAssembly owners are best placed to judge whether that trade is acceptable.

  1. Use smoke-only mode for library-only changes. Pass shouldRunSmokeOnly: onLibrariesAndIllinkChanges to the main CoreCLR Chrome and Wasmtime library-test jobs. Full runs would still happen on rolling builds, outer loop, and changes that match a WebAssembly-specific filter. On Linux, these two jobs used about 360k PR minutes in this window.
  2. Narrow wasm_coreclr_runtimetests. Instead of all of src/coreclr/* and src/tests/*, it could cover only the WebAssembly-relevant areas, such as src/coreclr/vm/wasm, the interpreter, the JIT, crossgen2/ReadyToRun, and WebAssembly test infrastructure. This would reduce how often the browser and WASI builds and runtime tests run.
  3. Look at the Windows-hosted Wasm.Build.Tests jobs. Each work item takes about 3.5× as long as on Linux, and these jobs account for about a third of all WebAssembly minutes. Options include running a subset on PRs and the full matrix on rolling builds. Another is reducing the per-run fan-out (the Workloads, Webcil, Fingerprinting, and Bundler combinations).
  4. Review the slowest Wasmtime suites. Some assemblies run 10–45× slower than native. Splitting, trimming, or moving the heaviest ones to outer loop could help without removing WASI coverage.
  5. Check why some PRs triggered Wasm.Build.Tests. Some PRs that seem unrelated to WebAssembly did, as noted in B3.3.
  6. Review release-branch Windows Chrome (Mono) jobs. They used about 205k minutes this week in release/10.0 and release/11.0, through rolling builds and PRs.

Queries are available on request.

Langage dominant
C#
Étoiles
18.5k
Forks
5.8k
Merge moyen
2 j 8 h
PR mergées (30 j)
597

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de dotnet/runtime

Toutes les issues de dotnet/runtime

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.