Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
56 changes: 56 additions & 0 deletions eng/pipelines/common/templates/wasm-aot-runtime-test-131537.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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)
# before merging anything real.

parameters:
alwaysRun: false
isExtraPlatformsBuild: false
isWasmOnlyBuild: false
platforms: []
extraBuildArgs: ''
useHelixMonitor: false

jobs:

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms: ${{ parameters.platforms }}
variables:
- name: alwaysRunVar
value: ${{ parameters.alwaysRun }}
- name: timeoutPerTestInMinutes
value: 20
- name: timeoutPerTestCollectionInMinutes
value: 200
jobParameters:
testGroup: innerloop
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
nameSuffix: AllSubsets_Mono_RuntimeTests_AOT_131537
# No runtimeVariant (i.e. not monointerpreter): we want corelib AOT'd, and
# the test csproj force-interprets only test131537.dll via
# _AOT_InternalForceInterpretAssemblies — reproducing the failing config.
buildArgs: -s mono+libs -c $(_BuildConfig) /p:MonoEnableAssertMessages=true /p:InstallV8ForTests=false ${{ parameters.extraBuildArgs }}
timeoutInMinutes: 180
condition: eq(variables['alwaysRunVar'], true)
postBuildSteps:
- template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
parameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)_AOT_131537
# 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.
# _BuildAllTestGroupsForBrowser: this test is in group 3 (Pri0), and browser CI
# otherwise builds only group 1 (#114123); safe here since only one test is scoped.
testBuildArgs: tree Loader/classloader/generics/regressions/131537 /p:RunAOTCompilation=true /p:InstallV8ForTests=false /p:_BuildAllTestGroupsForBrowser=true
scenarios:
- WasmTestOnChrome
useHelixMonitor: ${{ parameters.useHelixMonitor }}
extraVariablesTemplates:
- template: /eng/pipelines/common/templates/runtimes/test-variables.yml
12 changes: 12 additions & 0 deletions eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@ jobs:
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
useHelixMonitor: ${{ variables.enableHelixJobMonitor }}

# TEMP (wasm-aot-131537-validation): Mono AOT + Chrome runtime-test lane scoped to
# Loader/classloader/generics/regressions/131537 only. Remove before merging.
- template: /eng/pipelines/common/templates/wasm-aot-runtime-test-131537.yml
parameters:
platforms:
- browser_wasm
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
alwaysRun: ${{ parameters.isWasmOnlyBuild }}
useHelixMonitor: ${{ variables.enableHelixJobMonitor }}

- ${{ if and(ne(parameters.isRollingBuild, true), ne(parameters.excludeOptional, true)) }}:
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/metadata/jit-icall-reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ MONO_JIT_ICALL (mono_get_native_calli_wrapper) \
MONO_JIT_ICALL (mono_get_special_static_data) \
MONO_JIT_ICALL (mono_gsharedvt_constrained_call) \
MONO_JIT_ICALL (mono_gsharedvt_value_copy) \
MONO_JIT_ICALL (mono_helper_box_nullable) \
MONO_JIT_ICALL (mono_helper_compile_generic_method) \
MONO_JIT_ICALL (mono_helper_ldstr) \
MONO_JIT_ICALL (mono_helper_ldstr_mscorlib) \
Expand Down
9 changes: 0 additions & 9 deletions src/mono/mono/mini/jit-icalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,15 +1169,6 @@ mono_helper_newobj_mscorlib (guint32 idx)
return obj;
}

MonoObject*
mono_helper_box_nullable (gpointer vbuf, MonoClass *klass)
{
ERROR_DECL (error);
MonoObject *result = mono_nullable_box (vbuf, klass, error);
mono_error_set_pending_exception (error);
return result;
}

/*
* On some architectures, gdb doesn't like encountering the cpu breakpoint instructions
* in generated code. So instead we emit a call to this function and place a gdb
Expand Down
2 changes: 0 additions & 2 deletions src/mono/mono/mini/jit-icalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ ICALL_EXPORT MonoString *mono_helper_ldstr_mscorlib (guint32 idx);

ICALL_EXPORT MonoObject *mono_helper_newobj_mscorlib (guint32 idx);

ICALL_EXPORT MonoObject *mono_helper_box_nullable (gpointer vbuf, MonoClass *klass);

ICALL_EXPORT double mono_fsub (double a, double b);

ICALL_EXPORT double mono_fadd (double a, double b);
Expand Down
42 changes: 11 additions & 31 deletions src/mono/mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -3403,26 +3403,6 @@ handle_alloc (MonoCompile *cfg, MonoClass *klass, gboolean for_box, int context_
return mono_emit_jit_icall_id (cfg, alloc_ftn, iargs);
}

/*
* Box a gsharedvt Nullable<T> via a non-generic runtime helper, passing the value by
* address and the concrete class from the rgctx. This avoids a per-T box wrapper that
* cannot be emitted at AOT time when the consuming assembly runs interpreted.
*/
static MonoInst*
mini_emit_nullable_box_helper (MonoCompile *cfg, MonoInst *val, MonoClass *klass, int context_used)
{
MonoInst *iargs [2], *addr, *var;

var = get_vreg_to_inst (cfg, val->dreg);
if (!var)
var = mono_compile_create_var_for_vreg (cfg, m_class_get_byval_arg (klass), OP_LOCAL, val->dreg);
EMIT_NEW_VARLOADA (cfg, addr, var, var->inst_vtype);

iargs [0] = addr;
iargs [1] = mini_emit_get_rgctx_klass (cfg, context_used, klass, MONO_RGCTX_INFO_KLASS);
return mono_emit_jit_icall (cfg, mono_helper_box_nullable, iargs);
}

/*
* Returns NULL and set the cfg exception on error.
*/
Expand All @@ -3445,9 +3425,11 @@ mini_emit_box (MonoCompile *cfg, MonoInst *val, MonoClass *klass, int context_us
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);
} else {
Expand Down Expand Up @@ -3513,14 +3495,9 @@ mini_emit_box (MonoCompile *cfg, MonoInst *val, MonoClass *klass, int context_us
/* Nullable case */
MONO_START_BB (cfg, is_nullable_bb);

if (cfg->llvm_only) {
MonoInst *box_call = mini_emit_nullable_box_helper (cfg, val, klass, context_used);
EMIT_NEW_UNALU (cfg, res, OP_MOVE, dreg, box_call->dreg);
res->type = STACK_OBJ;
res->klass = klass;
} else {
{
MonoInst *box_addr = mini_emit_get_gsharedvt_info_klass (cfg, klass,
MONO_RGCTX_INFO_NULLABLE_CLASS_BOX);
MONO_RGCTX_INFO_NULLABLE_CLASS_BOX);
MonoInst *box_call;
MonoMethodSignature *box_sig;

Expand All @@ -3533,7 +3510,10 @@ mini_emit_box (MonoCompile *cfg, MonoInst *val, MonoClass *klass, int context_us
box_sig->param_count = 1;
box_sig->params [0] = m_class_get_byval_arg (klass);

box_call = mini_emit_calli (cfg, box_sig, &val, box_addr, NULL, NULL);
if (cfg->llvm_only)
box_call = mini_emit_llvmonly_calli (cfg, box_sig, &val, box_addr);
else
box_call = mini_emit_calli (cfg, box_sig, &val, box_addr, NULL, NULL);
EMIT_NEW_UNALU (cfg, res, OP_MOVE, dreg, box_call->dreg);
res->type = STACK_OBJ;
res->klass = klass;
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -5114,7 +5114,6 @@ register_icalls (void)
register_icall (mono_helper_ldstr, mono_icall_sig_object_ptr_int, FALSE);
register_icall (mono_helper_ldstr_mscorlib, mono_icall_sig_object_int, FALSE);
register_icall (mono_helper_newobj_mscorlib, mono_icall_sig_object_int, FALSE);
register_icall (mono_helper_box_nullable, mono_icall_sig_object_ptr_ptr, FALSE);
register_icall (mono_value_copy_internal, mono_icall_sig_void_ptr_ptr_ptr, FALSE);
register_icall (mono_object_castclass_unbox, mono_icall_sig_object_object_ptr, FALSE);
register_icall (mono_break, mono_icall_sig_void, TRUE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<CLRTestPriority>1</CLRTestPriority>
<!-- TEMP (wasm-aot-131537-validation): Pri0 so the innerloop wasm runtime-tests lanes include it. Revert to 1. -->
<CLRTestPriority>0</CLRTestPriority>
Comment on lines +3 to +4
<!-- TEMP (wasm-aot-131537-validation): self-contained merged runner so it produces a wasm Helix work item
(non-merged Loader tests have no wasm work-item path). Mirrors GC/.../largearraytest.csproj. -->
<HasMergedInTests>true</HasMergedInTests>
</PropertyGroup>
<ItemGroup>
<Compile Include="test131537.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(TestLibraryProjectPath)" />
</ItemGroup>
<ItemGroup>
<!-- Reproduce the WasmTestOnChrome-MONO-ST configuration from #131537:
corelib is AOT'd but this test assembly runs in the interpreter, so the
object(Nullable<T>) gsharedvt out-sig wrapper is not emitted by AOT.
This item is ignored on non-wasm-AOT runtimes. -->
<_AOT_InternalForceInterpretAssemblies Include="test131537.dll" />
</ItemGroup>

<Import Project="$(TestSourceDir)MergedTestRunner.targets" />
</Project>
3 changes: 2 additions & 1 deletion src/tests/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="BuildManagedTestGroup" Properties="__TestGroupToBuild=1;__SkipRestorePackages=1" />
<!-- ActiveIssue https://github.com/dotnet/runtime/issues/114123
The groups 2..n are disabled for browser target because they get OOM kill in CI.
TEMP (wasm-aot-131537-validation): _BuildAllTestGroupsForBrowser opts a tree-scoped build back into groups 2..n on browser CI (safe because only one test is in scope).
-->
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="BuildManagedTestGroup" Properties="__TestGroupToBuild=%(_GroupStartsWith.GroupNumber);__SkipRestorePackages=1"
Condition="'$(TargetOS)' != 'browser' or '$(ContinuousIntegrationBuild)' != 'true'"
Condition="'$(TargetOS)' != 'browser' or '$(ContinuousIntegrationBuild)' != 'true' or '$(_BuildAllTestGroupsForBrowser)' == 'true'"
/>
</Target>

Expand Down
Loading