From 5ac04aea72ee48cff76b8678fea221fe08aceaf9 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Mon, 5 Sep 2022 16:09:05 -0400 Subject: [PATCH 1/5] [wasm] Add support for running `System.Runtime.Intrinsics` tests with .. SIMD enabled, as part of smoke tests. --- eng/testing/tests.wasm.targets | 2 + .../System.Runtime.Intrinsics.Tests.csproj | 4 ++ .../tests/wasm.helix.targets | 47 +++++++++++++++++++ src/libraries/sendtohelix-wasm.targets | 4 +- src/libraries/tests.proj | 8 +++- 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 src/libraries/System.Runtime.Intrinsics/tests/wasm.helix.targets diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index b4187faf8f6dda..b85acb34fb6196 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -105,6 +105,8 @@ <_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration) <_AOTBuildCommand>$(_AOTBuildCommand) /p:RunAOTCompilation=$(RunAOTCompilation) + <_AOTBuildCommand Condition="'$(BrowserHost)' == 'windows'">$(_AOTBuildCommand) %AOT_BUILD_ARGS% + <_AOTBuildCommand Condition="'$(BrowserHost)' != 'windows'">$(_AOTBuildCommand) %24AOT_BUILD_ARGS <_AOTBuildCommand>$(_AOTBuildCommand) $(_ShellCommandSeparator) cd wasm_build/AppBundle $(_AOTBuildCommand) diff --git a/src/libraries/System.Runtime.Intrinsics/tests/System.Runtime.Intrinsics.Tests.csproj b/src/libraries/System.Runtime.Intrinsics/tests/System.Runtime.Intrinsics.Tests.csproj index 3009539cc05335..6c0187cf21ff84 100644 --- a/src/libraries/System.Runtime.Intrinsics/tests/System.Runtime.Intrinsics.Tests.csproj +++ b/src/libraries/System.Runtime.Intrinsics/tests/System.Runtime.Intrinsics.Tests.csproj @@ -7,6 +7,10 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser $(Features.Replace('nullablePublicOnly', '') + + wasm.helix.targets + $(WasmXHarnessArgs) --engine-arg=--experimental-wasm-simd diff --git a/src/libraries/System.Runtime.Intrinsics/tests/wasm.helix.targets b/src/libraries/System.Runtime.Intrinsics/tests/wasm.helix.targets new file mode 100644 index 00000000000000..123452beb0a883 --- /dev/null +++ b/src/libraries/System.Runtime.Intrinsics/tests/wasm.helix.targets @@ -0,0 +1,47 @@ + + + $(HelixExtensionTargets);_AddHelixRuntimeIntrinsicsItems + <_RuntimeIntrinsicsProjectName>System.Runtime.Intrinsics.Tests + + + + + + + <_AOTBuildArgsSIMD Condition="'$(OS)' != 'Windows_NT'">export "WasmXHarnessArgs=$WasmXHarnessArgs --engine-arg=--experimental-wasm-simd" + <_AOTBuildArgsSIMD Condition="'$(OS)' == 'Windows_NT'">set "WasmXHarnessArgs=%WasmXHarnessArgs% --engine-arg=--experimental-wasm-simd" + + + + <_AOTBuildArgsSIMD Condition="'$(OS)' != 'Windows_NT'">$(_AOTBuildArgsSIMD) "AOT_BUILD_ARGS=-p:WasmEnableSIMD=true" + <_AOTBuildArgsSIMD Condition="'$(OS)' == 'Windows_NT'">$(_AOTBuildArgsSIMD) "AOT_BUILD_ARGS=-p:WasmEnableSIMD=true" + + + + + + + + $(TestArchiveTestsDir)$(_RuntimeIntrinsicsProjectName).zip + $(HelixCommand) + $(_workItemTimeout) + + + + $(TestArchiveTestsDir)$(_RuntimeIntrinsicsProjectName).zip + $(HelixCommand) + $(_workItemTimeout) + + $(_AOTBuildArgsSIMD) + + + <_RuntimeIntrinsicsHelixItem + Include="@(HelixWorkItem)" + Condition="$([System.String]::new('%(HelixWorkItem.Identity)').EndsWith('-$(_RuntimeIntrinsicsProjectName)'))" /> + + + + + diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets index 82b14495dd5267..ed76264134f306 100644 --- a/src/libraries/sendtohelix-wasm.targets +++ b/src/libraries/sendtohelix-wasm.targets @@ -305,7 +305,9 @@ <_EmSdkFiles Include="$(EMSDK_PATH)\**\*" Exclude="$(EMSDK_PATH)\.git\**\*" /> - + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 8e6d4712feee36..07349a0d3d4497 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -19,6 +19,7 @@ false false + true false @@ -545,7 +546,12 @@ - + + + + From b8633e859313d43c91be02a2a4238f2a2887b9b9 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Mon, 5 Sep 2022 16:15:31 -0400 Subject: [PATCH 2/5] [wasm] Add a new `runtime-wasm-features` pipeline .. which has only a SIMD_AOT job for now. --- eng/pipelines/runtime-wasm-features.yml | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 eng/pipelines/runtime-wasm-features.yml diff --git a/eng/pipelines/runtime-wasm-features.yml b/eng/pipelines/runtime-wasm-features.yml new file mode 100644 index 00000000000000..940b59c800ab25 --- /dev/null +++ b/eng/pipelines/runtime-wasm-features.yml @@ -0,0 +1,27 @@ +# This pipeline is meant to be run manually. It contains +# jobs that exercise extra/optional features for wasm, eg. SIMD + +trigger: none + +variables: + - template: /eng/pipelines/common/variables.yml + +jobs: + +# Evaluate paths +- template: /eng/pipelines/common/evaluate-default-paths.yml + +# Run AOT tests with SIMD enabled +- template: /eng/pipelines/common/templates/wasm-library-tests.yml + parameters: + platforms: + - Browser_wasm + nameSuffix: _SIMD_AOT + isExtraPlatformsBuild: false + isWasmOnlyBuild: true + extraBuildArgs: /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true + extraHelixArgs: /p:NeedsToBuildWasmAppsOnHelix=true /p:WasmEnableSIMD=true + runSmokeOnlyArg: '' + alwaysRun: true + scenarios: + - WasmTestOnNodeJS From 75c09b60454d95b11e26a974509a5e1e5ece2304 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Mon, 5 Sep 2022 16:28:10 -0400 Subject: [PATCH 3/5] [wasm] Add SIMD_AOT job to runtime-wasm for now, as we can't add new pipelines --- eng/pipelines/runtime-wasm.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/eng/pipelines/runtime-wasm.yml b/eng/pipelines/runtime-wasm.yml index 62de930be9d1f9..208917df170042 100644 --- a/eng/pipelines/runtime-wasm.yml +++ b/eng/pipelines/runtime-wasm.yml @@ -19,3 +19,18 @@ jobs: parameters: isWasmOnlyBuild: ${{ variables.isWasmOnlyBuild }} isRollingBuild: ${{ variables.isRollingBuild }} + +# Run AOT tests with SIMD enabled +- template: /eng/pipelines/common/templates/wasm-library-tests.yml + parameters: + platforms: + - Browser_wasm + nameSuffix: _SIMD_AOT + isExtraPlatformsBuild: false + isWasmOnlyBuild: true + extraBuildArgs: /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true + extraHelixArgs: /p:NeedsToBuildWasmAppsOnHelix=true /p:WasmEnableSIMD=true + runSmokeOnlyArg: '' + alwaysRun: true + scenarios: + - WasmTestOnNodeJS From 40164a1063867bd3d11830ef1cfc10f9feb1816e Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 6 Sep 2022 14:20:46 -0400 Subject: [PATCH 4/5] Fix browser-simd run --- .../System.Runtime.Intrinsics/tests/wasm.helix.targets | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Runtime.Intrinsics/tests/wasm.helix.targets b/src/libraries/System.Runtime.Intrinsics/tests/wasm.helix.targets index 123452beb0a883..65123620588e8d 100644 --- a/src/libraries/System.Runtime.Intrinsics/tests/wasm.helix.targets +++ b/src/libraries/System.Runtime.Intrinsics/tests/wasm.helix.targets @@ -9,13 +9,15 @@ Condition="'$(NeedsToBuildWasmAppsOnHelix)' == 'true' and ('$(Scenario)' == 'WasmTestOnNodeJs' or '$(Scenario)' == 'WasmTestOnBrowser')"> - <_AOTBuildArgsSIMD Condition="'$(OS)' != 'Windows_NT'">export "WasmXHarnessArgs=$WasmXHarnessArgs --engine-arg=--experimental-wasm-simd" - <_AOTBuildArgsSIMD Condition="'$(OS)' == 'Windows_NT'">set "WasmXHarnessArgs=%WasmXHarnessArgs% --engine-arg=--experimental-wasm-simd" + <_AOTBuildArgsSIMD Condition="'$(OS)' != 'Windows_NT'">"WasmXHarnessArgs=$WasmXHarnessArgs --engine-arg=--experimental-wasm-simd" + <_AOTBuildArgsSIMD Condition="'$(OS)' == 'Windows_NT'">"WasmXHarnessArgs=%WasmXHarnessArgs% --engine-arg=--experimental-wasm-simd" <_AOTBuildArgsSIMD Condition="'$(OS)' != 'Windows_NT'">$(_AOTBuildArgsSIMD) "AOT_BUILD_ARGS=-p:WasmEnableSIMD=true" - <_AOTBuildArgsSIMD Condition="'$(OS)' == 'Windows_NT'">$(_AOTBuildArgsSIMD) "AOT_BUILD_ARGS=-p:WasmEnableSIMD=true" + + <_AOTBuildArgsSIMD Condition="'$(OS)' != 'Windows_NT'">export $(_AOTBuildArgsSIMD) + <_AOTBuildArgsSIMD Condition="'$(OS)' == 'Windows_NT'">set $(_AOTBuildArgsSIMD) From 9044f6b2040bbfa112feaa648d6a244b98df5995 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 7 Sep 2022 20:25:04 -0400 Subject: [PATCH 5/5] [wasm] Mark simd job as unstable for now Issues: https://github.com/dotnet/runtime/issues/75044 and https://github.com/dotnet/runtime/issues/75098 --- eng/pipelines/runtime-wasm.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/pipelines/runtime-wasm.yml b/eng/pipelines/runtime-wasm.yml index 208917df170042..04eac67a9399cf 100644 --- a/eng/pipelines/runtime-wasm.yml +++ b/eng/pipelines/runtime-wasm.yml @@ -32,5 +32,9 @@ jobs: extraHelixArgs: /p:NeedsToBuildWasmAppsOnHelix=true /p:WasmEnableSIMD=true runSmokeOnlyArg: '' alwaysRun: true + # failures due to + # https://github.com/dotnet/runtime/issues/75044 + # and https://github.com/dotnet/runtime/issues/75098 + shouldContinueOnError: true scenarios: - WasmTestOnNodeJS