[wasi] .NET 10: WasmEnableSIMD with AOT fails because WasiApp.targets has -msimd128 commented out
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- csharp, wasm
- 领域
- build-system
调研方向
从 Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk 中的 .NET 10 文件 WasiApp.targets 开始,并将其 SIMD 标志与 .NET 11 版本进行比较。运行报告中的复现命令 dotnet publish -c Release;当 AOT 发布成功并生成一个输出 42 的应用时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- C#
- 星标
- 18.4k
- 派生
- 5.8k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 620
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/runtime 的其他 Issue
-
area-System.ComponentModel untriaged
难度 2/5 1-3 小时 新手友好度 65/100
dotnet/runtime#136608 · 2 条评论 ·
维护者通常 1 天内回复
-
area-System.IO bug untriaged
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/runtime#136599 · 1 条评论 ·
维护者通常 1 天内回复
-
area-System.IO untriaged
难度 2/5 1-3 小时 新手友好度 76/100
dotnet/runtime#136577 · 1 条评论 ·
维护者通常 1 天内回复
-
[mono] Native memory leak on the first invoke of every open-instance delegate to a virtual method未关闭area-VM-meta-mono untriaged
难度 2/5 1-3 小时 新手友好度 72/100
dotnet/runtime#136284 · 6 个 reaction ·
维护者通常 1 天内回复
-
Several MemoryExtensions.LastIndexOfAnyExcept overloads incorrectly document "first occurrence"可能重新可做 @ehsan-raoufi 于 8 天前认领,目前没有进行中的 PR。 未关闭area-System.Memory untriaged
难度 1/5 1 小时以内 新手友好度 83/100
dotnet/runtime#136282 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug effort:S P3
难度 2/5 1-3 小时 新手友好度 72/100
nightscout/nocturne#3219 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug P2
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复