diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 7105be64755915..f851dc5ef58659 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -193,7 +193,7 @@ jobs: # Browser WebAssembly - ${{ if eq(parameters.platform, 'browser_wasm') }}: - - Ubuntu.1804.Amd64.Open + - (Ubuntu.1804.Amd64)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-webassembly # Browser WebAssembly Firefox - ${{ if eq(parameters.platform, 'browser_wasm_firefox') }}: diff --git a/eng/testing/WasmRunnerAOTTemplate.sh b/eng/testing/WasmRunnerAOTTemplate.sh index e44faf7f8c0aa1..b012eafabdef45 100644 --- a/eng/testing/WasmRunnerAOTTemplate.sh +++ b/eng/testing/WasmRunnerAOTTemplate.sh @@ -35,8 +35,10 @@ if [[ "$XHARNESS_COMMAND" == "test" ]]; then if [[ -z "$JS_ENGINE" ]]; then if [[ "$SCENARIO" == "WasmTestOnNodeJS" || "$SCENARIO" == "wasmtestonnodejs" ]]; then JS_ENGINE="--engine=NodeJS" + JS_ENGINE_ARGS="$JS_ENGINE_ARGS --engine-arg=--experimental-wasm-simd" else JS_ENGINE="--engine=V8" + JS_ENGINE_ARGS="$JS_ENGINE_ARGS --engine-arg=--experimental-wasm-simd" fi fi diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 8a66c083a9f21c..f40547f9213c26 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -35,6 +35,21 @@ local + + + <_ExtraTrimmerArgs Condition="'$(WasmEnableSIMD)' == 'true'">$(_ExtraTrimmerArgs) --substitutions "$(MonoProjectRoot)\wasm\build\ILLink.Substitutions.WasmIntrinsics.xml" + <_ExtraTrimmerArgs Condition="'$(WasmEnableSIMD)' != 'true'">$(_ExtraTrimmerArgs) --substitutions "$(MonoProjectRoot)\wasm\build\ILLink.Substitutions.NoWasmIntrinsics.xml" + + <_AOT_InternalForceInterpretAssemblies Include="@(HighAotMemoryUsageAssembly)" /> diff --git a/src/libraries/System.Numerics.Vectors/tests/GenericVectorTests.cs b/src/libraries/System.Numerics.Vectors/tests/GenericVectorTests.cs index 207b7dc0e7b2d7..74b54a5437d2c6 100644 --- a/src/libraries/System.Numerics.Vectors/tests/GenericVectorTests.cs +++ b/src/libraries/System.Numerics.Vectors/tests/GenericVectorTests.cs @@ -27,6 +27,7 @@ static GenericVectorTests() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/81785", TestPlatforms.Browser)] public unsafe void IsHardwareAcceleratedTest() { MethodInfo methodInfo = typeof(Vector).GetMethod("get_IsHardwareAccelerated"); diff --git a/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector128Tests.cs b/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector128Tests.cs index 22f1b7a20ca67d..3894d835a60b08 100644 --- a/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector128Tests.cs +++ b/src/libraries/System.Runtime.Intrinsics/tests/Vectors/Vector128Tests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Reflection; using System.Runtime.InteropServices; @@ -11,6 +12,8 @@ namespace System.Runtime.Intrinsics.Tests.Vectors public sealed class Vector128Tests { [Fact] + [DynamicDependency(DynamicallyAccessedMemberTypes.PublicProperties, typeof(Vector128))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/81785", TestPlatforms.Browser)] public unsafe void Vector128IsHardwareAcceleratedTest() { MethodInfo methodInfo = typeof(Vector128).GetMethod("get_IsHardwareAccelerated"); diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets index 30654620bc14b6..2a40f18884fa24 100644 --- a/src/libraries/sendtohelix-wasm.targets +++ b/src/libraries/sendtohelix-wasm.targets @@ -46,7 +46,7 @@ true true - true + false true true diff --git a/src/mono/mono/mini/simd-intrinsics.c b/src/mono/mono/mini/simd-intrinsics.c index bf01b02fb67144..f9cdea34a5db9f 100644 --- a/src/mono/mono/mini/simd-intrinsics.c +++ b/src/mono/mono/mini/simd-intrinsics.c @@ -1954,7 +1954,8 @@ emit_vector_2_3_4 (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *f id = lookup_intrins (vector2_methods, sizeof (vector2_methods), cmethod); if (id == -1) { - check_no_intrinsic_cattr (cmethod); + // https://github.com/dotnet/runtime/issues/81961 + // check_no_intrinsic_cattr (cmethod); return NULL; } diff --git a/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs b/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs index cf311557c27f2e..9c812950126165 100644 --- a/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs +++ b/src/mono/wasm/Wasm.Build.Tests/HostRunner/NodeJSHostRunner.cs @@ -8,8 +8,8 @@ namespace Wasm.Build.Tests; public class NodeJSHostRunner : IHostRunner { public string GetTestCommand() => "wasm test"; - public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace"; - public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale}"; + public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --engine-arg=--experimental-wasm-simd"; + public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale} --engine-arg=--experimental-wasm-simd"; public bool UseWasmConsoleOutput() => true; public bool CanRunWBT() => true; } diff --git a/src/mono/wasm/Wasm.Build.Tests/HostRunner/V8HostRunner.cs b/src/mono/wasm/Wasm.Build.Tests/HostRunner/V8HostRunner.cs index 885aba29ad4634..76067e46417794 100644 --- a/src/mono/wasm/Wasm.Build.Tests/HostRunner/V8HostRunner.cs +++ b/src/mono/wasm/Wasm.Build.Tests/HostRunner/V8HostRunner.cs @@ -9,7 +9,7 @@ namespace Wasm.Build.Tests; public class V8HostRunner : IHostRunner { - private string GetXharnessArgs(string jsRelativePath) => $"--js-file={jsRelativePath} --engine=V8 -v trace"; + private string GetXharnessArgs(string jsRelativePath) => $"--js-file={jsRelativePath} --engine=V8 -v trace --engine-arg=--experimental-wasm-simd"; public string GetTestCommand() => "wasm test"; public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => GetXharnessArgs(options.jsRelativePath); diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs index 26aa0a7e62ce43..58219660acf114 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs @@ -18,7 +18,7 @@ public WasmSIMDTests(ITestOutputHelper output, SharedBuildPerTestClassFixture bu [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ false, RunHost.All })] - public void BuildWithSIMD_NoAOT_ShouldRelink(BuildArgs buildArgs, RunHost host, string id) + public void BuildWithSIMD_NoAOT_ShouldNotRelink(BuildArgs buildArgs, RunHost host, string id) { string projectName = $"sim_with_workload_no_aot"; buildArgs = buildArgs with { ProjectName = projectName }; @@ -29,7 +29,7 @@ public void BuildWithSIMD_NoAOT_ShouldRelink(BuildArgs buildArgs, RunHost host, new BuildProjectOptions( InitProject: () => File.WriteAllText(Path.Combine(_projectDir!, "Program.cs"), s_simdProgramText), Publish: false, - DotnetWasmFromRuntimePack: false)); + DotnetWasmFromRuntimePack: true)); if (!_buildContext.TryGetBuildFor(buildArgs, out _)) { diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index 112e861724728c..ce4c063a5806a2 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -113,8 +113,6 @@ true - true - true false @@ -125,7 +123,6 @@ true true - true false @@ -203,7 +200,7 @@ <_EmccCommonFlags Include="-v" Condition="'$(EmccVerbose)' != 'false'" /> <_EmccCommonFlags Include="-s DISABLE_EXCEPTION_CATCHING=0" Condition="'$(WasmEnableExceptionHandling)' == 'false'" /> <_EmccCommonFlags Include="-fwasm-exceptions" Condition="'$(WasmEnableExceptionHandling)' == 'true'" /> - <_EmccCommonFlags Include="-msimd128" Condition="'$(WasmEnableSIMD)' == 'true'" /> + <_EmccCommonFlags Include="-msimd128" Condition="'$(WasmEnableSIMD)' == 'true' and '$(_WasmShouldAOT)' == 'true'" /> <_EmccIncludePaths Include="$(_WasmIntermediateOutputPath.TrimEnd('\/'))" /> <_EmccIncludePaths Include="$(_WasmRuntimePackIncludeDir)mono-2.0" /> diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index f9e80e23a62684..3df67afc3f0dbb 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -95,7 +95,7 @@ true false - false + true diff --git a/src/mono/wasm/templates/templates/console/runtimeconfig.template.json b/src/mono/wasm/templates/templates/console/runtimeconfig.template.json index 4fac1499aad381..0be5fb5929fcd5 100644 --- a/src/mono/wasm/templates/templates/console/runtimeconfig.template.json +++ b/src/mono/wasm/templates/templates/console/runtimeconfig.template.json @@ -4,12 +4,10 @@ { "name": "node", "js-path": "main.mjs", - "Host": "nodejs" - }, - { - "name": "v8", - "js-path": "main.mjs", - "Host": "v8" + "Host": "nodejs", + "host-args": [ + "--experimental-wasm-simd" + ] } ] }