[wasi] .NET 10: WasmEnableSIMD with AOT fails because WasiApp.targets has -msimd128 commented out
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp, wasm
- Domain
- build-system
Research direction
Start with the .NET 10 WasiApp.targets file in Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk and compare its SIMD flag with the .NET 11 version. Run the reported dotnet publish -c Release reproduction; done means the AOT publish succeeds and produces an app that prints 42.
Written by the indexing model from the issue text.
Description
Description
With the .NET 10 SDK 10.0.401 and the wasi-experimental workload 10.0.12, a wasi-wasm app with WasmEnableSIMD and RunAOTCompilation fails to publish. WasiApp.targets in Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk 10.0.12 has the SIMD flag commented out:
<!--<_WasiClangCommonFlags Include="-msimd128" Condition="'$(WasmEnableSIMD)' == 'true'" />-->
so the AOT bitcode, which uses SIMD, is compiled by wasi-sdk's clang for a target without SIMD, and the LLVM backend aborts. The same line is active in the .NET 11 workload (11.0.0-rc.3.26522.148), so this looks like a fix that .NET 10 servicing is missing.
Found while building a SIMD-enabled Mono AOT baseline for the benchmarks of NetWasm, an ahead-of-time C# to WebAssembly compiler.
Reproduction Steps
macOS arm64, wasi-sdk 25.0 (the version the 10.0 targets expect), WASI_SDK_PATH set.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
<RunAOTCompilation>true</RunAOTCompilation>
<WasmSingleFileBundle>true</WasmSingleFileBundle>
<WasmEnableSIMD>true</WasmEnableSIMD>
</PropertyGroup>
</Project>
System.Console.WriteLine(42);
dotnet publish -c Release
Expected behavior
An AOT-compiled AppBundle/Hello.wasm that prints 42, as without WasmEnableSIMD.
Actual behavior
WasmApp.Common.targets(816,5): error : Failed to compile .../obj/Release/net10.0/wasi-wasm/wasm/for-publish/aot-instances.dll.bc -> .../aot-instances.dll.o
error : clang version 19.1.5-wasi-sdk (https://github.com/llvm/llvm-project ab4b5a2db582958af1ee308a790cfdb42bd24720)
error : Target: wasm32-unknown-wasip2
fatal error: error in backend: Do not know how to split this operator's operand!
Regression?
Not checked against earlier 10.0 servicing releases. The .NET 11 RC3 targets have the line enabled.
Known Workarounds
Add <WasiClangFlags>-msimd128</WasiClangFlags> to the project. With it the app publishes and prints 42 under Wasmtime.
Configuration
- .NET SDK 10.0.401,
wasi-experimentalworkload 10.0.12 (manifest 10.0.112) - wasi-sdk 25.0 (clang 19.1.5-wasi-sdk), macOS arm64
Other information
Uncommenting the -msimd128 line in the 10.0 WasiApp.targets, as in 11.0, should fix it.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 5.8k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 596
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
area-Extensions-FileSystem untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/runtime#136989 · 1 comment ·
Maintainers usually reply within 1 day
-
area-Extensions-Configuration bug source-generator untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/runtime#136972 · 1 comment ·
Maintainers usually reply within 1 day
-
area-System.ComponentModel untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotnet/runtime#136608 · 2 comments ·
Maintainers usually reply within 1 day
-
MemoryMappedFile (Windows): failed MEM_COMMIT is ignored, accessor over reserved memory crashes the processPossibly taken @RutulPatel8 claimed this 3 days ago. Openarea-System.IO bug untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/runtime#136599 · 1 comment ·
Maintainers usually reply within 1 day
-
area-System.IO untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dotnet/runtime#136577 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
The Recommended preset turns on Import Uno DSP, which only works with the Material themePossibly taken @agneszitte claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
unoplatform/uno.templates#2388 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
eyalgolan/statecraft-israel#2732 ·
Maintainers usually reply within 1 day
-
要トリアージ
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
kind/chore status/draft
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Altinn/altinn-events#1158 ·
Maintainers usually reply within 1 day
-
S: Untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Trauma-Station/Trauma-Station#5285 ·
Maintainers usually reply within 1 day