Skip to content

[TEMP][DO NOT MERGE] Validate test131537 under Mono wasm-AOT on Chrome - #132315

Draft
pavelsavara wants to merge 5 commits into
dotnet:mainfrom
pavelsavara:wasm-aot-131537-validation
Draft

[TEMP][DO NOT MERGE] Validate test131537 under Mono wasm-AOT on Chrome#132315
pavelsavara wants to merge 5 commits into
dotnet:mainfrom
pavelsavara:wasm-aot-131537-validation

Conversation

@pavelsavara

@pavelsavara pavelsavara commented Aug 14, 2026

Copy link
Copy Markdown
Member

Purpose (temporary — do not merge)

Validation-only PR to confirm that the src/tests regression test Loader/classloader/generics/regressions/131537 actually runs under the Mono wasm-AOT configuration that reproduces #131537 (AOT'd corelib + force-interpreted test assembly).

Background: on the merged fix (#132153) this src/tests case is never executed under the failing config in any pipeline — the only Mono wasm runtime-tests lane is hardcoded testGroup: innerloop (Pri0) and runtimeVariant: monointerpreter (no AOT). The test is CLRTestPriority 1, so it's excluded there; and even at Pri0 that lane is pure interpreter. The real CI guard is the library test Number_AsCollectionElement_RoundTrip on WasmTestOnChrome-MONO.

Current branch state — expected RED

This branch has two temp commits:

  1. Move test to Pri0 + add the scoped Mono AOT + Chrome runtime-test lane, wired into runtime-wasm.
  2. Revert of the [mono][wasm] Box gsharedvt Nullable<T> via a wrapper-free runtime helper #132153 runtime fix (keeping the test) — so the AOT lane should show test131537 failing with function signature mismatch, proving the lane exercises the [wasm][mono][AOT] Number_AsCollectionElement_RoundTrip crashes with unction signature mismatch boxing Nullable<Int128> #131537 repro.

To see it go green: drop commit 2 (the revert) and re-run — with the fix present the same lane should pass. That's the red→green demonstration.

What the lane does (3 pipeline/test files)

  • Move the test to Pri0 so the innerloop wasm runtime-tests lanes include it (test131537.csproj).
  • Add a scoped Mono AOT + Chrome runtime-test lane (eng/pipelines/common/templates/wasm-aot-runtime-test-131537.yml):
    • -tree Loader/classloader/generics/regressions/131537 — builds only this test (keeps AOT cheap).
    • /p:RunAOTCompilation=true — AOT's corelib into the app; the csproj's _AOT_InternalForceInterpretAssemblies force-interprets test131537.dll → reproduces the failing mixed AOT+interp config.
    • scenarios: [WasmTestOnChrome].
    • No runtimeVariant: monointerpreter (we want corelib AOT'd, not everything interpreted).
  • Wire it into the runtime-wasm pipeline (runtime-extra-platforms-wasm.yml), gated to run only when triggered via runtime-wasm (alwaysRun = isWasmOnlyBuild).

How to run

/azp run runtime-wasm

Look for the job browser-wasm ... AllSubsets_Mono_RuntimeTests_AOT_131537.

Cleanup

All changes are temporary and marked TEMP. Revert the Pri0 change, drop the fix-revert commit, and delete the new template + its reference before merging anything real.

Note

This pull request (and description) was prepared with GitHub Copilot.

TEMP validation branch (do not merge):
- move test131537 to Pri0 so innerloop wasm runtime-tests include it
- add scoped Mono AOT + Chrome runtime-test lane (tree-scoped to 131537, RunAOTCompilation=true) wired into the runtime-wasm pipeline

Reproduces the AOT'd-corelib + force-interpreted-test-assembly config from dotnet#131537.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 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.

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) labels Aug 14, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a temporary CI validation lane to ensure the src/tests regression Loader/classloader/generics/regressions/131537 is actually executed under a Mono WASM configuration intended to mimic “AOT’d corelib + interpreted test assembly” on Chrome.

Changes:

  • Lower test131537’s CLRTestPriority to 0 (TEMP) so it can run in Pri0/innerloop filtering.
  • Add a new pipeline template for a scoped Mono WASM AOT + Chrome runtime-test job building only that test directory.
  • Wire the new template into runtime-extra-platforms-wasm.yml, gated via alwaysRun.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/tests/Loader/classloader/generics/regressions/131537/test131537.csproj TEMP change to Pri0 to make the test eligible for innerloop/Pri0 lanes.
eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml Adds a TEMP job template reference for the scoped AOT+Chrome validation lane.
eng/pipelines/common/templates/wasm-aot-runtime-test-131537.yml New TEMP template that builds/sends only the 131537 runtime test tree with RunAOTCompilation=true and runs on WasmTestOnChrome.

Comment on lines +3 to +4
<!-- TEMP (wasm-aot-131537-validation): Pri0 so the innerloop wasm runtime-tests lanes include it. Revert to 1. -->
<CLRTestPriority>0</CLRTestPriority>
Comment on lines +1 to +5
# TEMP (wasm-aot-131537-validation): validate that the src/tests regression test
# Loader/classloader/generics/regressions/131537 actually runs under the Mono
# wasm-AOT configuration that reproduces #131537 (AOT'd corelib + force-interpreted
# test assembly). Scoped to just that one test via `-tree`, AOT'd locally, run on
# Chrome. Delete this file (and its reference in runtime-extra-platforms-wasm.yml)
… catches regression

Drop this commit to restore green. With the mono fix reverted, the AOT+Chrome
lane should show test131537 failing with 'function signature mismatch', proving
the lane exercises the dotnet#131537 repro. Test files are intentionally kept.
Copilot AI review requested due to automatic review settings August 14, 2026 12:39
@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

eng/pipelines/common/templates/wasm-aot-runtime-test-131537.yml:50

  • testBuildArgs is passed verbatim to src/tests/build* (see eng/pipelines/common/templates/runtimes/build-runtime-tests.yml). The build scripts use -tree:<path> (or -tree <path>) to scope the test build; tree ... without the leading -tree will be treated as an unrecognized positional argument and will not reliably scope the build to this test.
            # Scope the runtime-test build to just this one test, and AOT it locally
            # (RunAOTCompilation=true) so corelib is AOT'd in the produced wasm app.
            testBuildArgs: tree Loader/classloader/generics/regressions/131537 /p:RunAOTCompilation=true /p:InstallV8ForTests=false
            scenarios:

Comment on lines 3423 to 3434
if (context_used) {
if (cfg->llvm_only) {
MonoInst *addr;
MonoMethodSignature *sig = mono_method_signature_internal (method);
if (mini_is_gsharedvt_klass (klass))
return mini_emit_nullable_box_helper (cfg, val, klass, context_used);
addr = emit_get_rgctx_method (cfg, context_used, method,
MONO_RGCTX_INFO_METHOD_FTNDESC);
addr = mini_emit_get_gsharedvt_info_klass (cfg, klass,
MONO_RGCTX_INFO_NULLABLE_CLASS_BOX);
else
addr = emit_get_rgctx_method (cfg, context_used, method,
MONO_RGCTX_INFO_METHOD_FTNDESC);
cfg->interp_in_signatures = g_slist_prepend_mempool (cfg->mempool, cfg->interp_in_signatures, sig);
return mini_emit_llvmonly_calli (cfg, sig, &val, addr);
Copilot AI review requested due to automatic review settings August 14, 2026 13:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Suppressed comments (2)

eng/pipelines/common/templates/wasm-aot-runtime-test-131537.yml:5

  • The header comment says the job is scoped via -tree, but the actual testBuildArgs use the tree <path> form. Both forms may work, but the comment is currently inconsistent with what the template runs, which can confuse anyone trying to reproduce/modify the lane.
# TEMP (wasm-aot-131537-validation): validate that the src/tests regression test
# Loader/classloader/generics/regressions/131537 actually runs under the Mono
# wasm-AOT configuration that reproduces #131537 (AOT'd corelib + force-interpreted
# test assembly). Scoped to just that one test via `-tree`, AOT'd locally, run on
# Chrome. Delete this file (and its reference in runtime-extra-platforms-wasm.yml)

eng/pipelines/common/templates/wasm-aot-runtime-test-131537.yml:55

  • This lane intends to run Mono wasm with corelib AOT (not monointerpreter), but the build-runtime-tests-and-send-to-helix.yml template defaults runtimeVariant to monointerpreter when not set. That would send the work item to Helix as monointerpreter and can defeat the purpose of validating the mixed AOT+interp configuration. Pass an explicit empty runtimeVariant here (or the correct AOT variant if required) to match the lane intent.
        - template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
          parameters:
            creator: dotnet-bot
            testRunNamePrefixSuffix: Mono_$(_BuildConfig)_AOT_131537
            # Build the single scoped test as a standalone wasm app (not merged) so it
            # yields its own Helix work item; merged mode drops a lone test (0 in group).
            buildAllTestsAsStandalone: true
            # Scope the runtime-test build to just this one test, and AOT it locally
            # (RunAOTCompilation=true) so corelib is AOT'd in the produced wasm app.
            testBuildArgs: tree Loader/classloader/generics/regressions/131537 /p:RunAOTCompilation=true /p:InstallV8ForTests=false
            scenarios:
              - WasmTestOnChrome
            useHelixMonitor: ${{ parameters.useHelixMonitor }}

@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI review requested due to automatic review settings August 14, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (2)

eng/pipelines/common/templates/wasm-aot-runtime-test-131537.yml:4

  • The header comment says the job is scoped via -tree, but the actual testBuildArgs uses the build script’s tree <subtree> form. Since src/tests/build.cmd recognizes tree (not -tree), it’s worth making the comment match what’s actually used to avoid confusion when someone copies this template.
# test assembly). Scoped to just that one test via `-tree`, AOT'd locally, run on

src/tests/build.proj:212

  • _BuildAllTestGroupsForBrowser re-enables building groups 2..n in browser CI, but the condition doesn’t actually require a tree-scoped build. If this flag is accidentally set in a non-tree browser CI run, it can reintroduce the OOM issue called out in #114123. Consider additionally gating on __BuildTestTree being set to something other than its default (just ;).
    <MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="BuildManagedTestGroup" Properties="__TestGroupToBuild=%(_GroupStartsWith.GroupNumber);__SkipRestorePackages=1"
        Condition="'$(TargetOS)' != 'browser' or '$(ContinuousIntegrationBuild)' != 'true' or '$(_BuildAllTestGroupsForBrowser)' == 'true'"
    />

@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI review requested due to automatic review settings August 14, 2026 17:04
@pavelsavara

Copy link
Copy Markdown
Member Author

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/tests/build.proj:212

  • The new browser-CI escape hatch for building managed test groups 2..n can be enabled by setting _BuildAllTestGroupsForBrowser=true, but the condition doesn’t currently enforce that the build is actually scoped (e.g., via tree). If this property is ever accidentally set without a tree filter, it could re-enable the full managed test build on browser CI and reintroduce the OOM-kill behavior described in #114123.

Consider additionally requiring __BuildTestTree to be set (the build scripts initialize it to %3B when no tree is provided) so the opt-in is safe-by-construction.

    <MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="BuildManagedTestGroup" Properties="__TestGroupToBuild=%(_GroupStartsWith.GroupNumber);__SkipRestorePackages=1"
        Condition="'$(TargetOS)' != 'browser' or '$(ContinuousIntegrationBuild)' != 'true' or '$(_BuildAllTestGroupsForBrowser)' == 'true'"
    />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Infrastructure-mono NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants