Skip to content

dotnet: update to .NET 11 and emit exnref natively - #329

Open
danleh wants to merge 1 commit into
WebKit:mainfrom
danleh:wasm-dotnet-11
Open

danleh wants to merge 1 commit into
WebKit:mainfrom
danleh:wasm-dotnet-11

Conversation

@danleh

@danleh danleh commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Part of #277. Follow-up to #188. cc @pavelsavara @maraf

Build dotnet-interp-wasm and dotnet-aot-wasm with .NET SDK 11.0.100-rc.3.26522.148 (was 9.0.305). The runtime pack's Emscripten moves from 3.1.56 to 6.0.3.

.NET 11 compiles the runtime and the AOT code with -fwasm-exceptions -sWASM_LEGACY_EXCEPTIONS=0, so the binaries use the standard exception-handling instructions (try_table, throw_ref) directly. build.sh no longer rewrites dotnet.native.wasm with wasm-opt --translate-to-exnref, the workaround from #188.

To review (6 files, +27/−27; build.sh writes the other 52: build.log, dotnet_sdk_info.txt and 50 files in build-interp/ and build-aot/):

  • src/global.json selects SDK 11.0.100-rc.3.26522.148, and dotnet.csproj targets net11.0.
  • The trimmed library set changed: System.Collections.Concurrent.wasm is gone and System.Security.Cryptography.wasm is new. JetStreamDriver.js (one line) and benchmark.js preload the new set.
  • The AOT build's boot config lists every assembly as a core assembly, so benchmark.js marks all AOT assemblies isCore.
  • The minifier renamed the function that logs the ArrayBuffer instantiation warning (w → v), so the perl command in build.sh that strips the warning now matches any one-letter name.
  • README.md drops stale notes about installing wasm-tools and patching import.meta.url for jsc.

The C# benchmark code does not change.

Binaries: a browser loads 2.6 MB more for the two tests (19.4 MB instead of 16.8 MB); most of it is the AOT dotnet.native.wasm, which grows by 1.56 MB (19%). With the .symbols files and the ICU data files that the tests do not load, the repository grows by 4.2 MB.

Scores (measured on a Linux x64 workstation with jsvu shells, each test alone in a fresh shell, 6 rounds; change of the mean score, rounds won in parentheses, bold = statistically significant at 95% confidence; @kmiller68 may want to check on macOS / arm64):

Test d8 (15.9.60) jsc (325217) SpiderMonkey (160.0b3)
dotnet-interp-wasm +1.3% (5/6) +3.7% (4/6) +2.1% (4/6)
dotnet-aot-wasm +3.5% (4/6) −1.7% (3/6) +0.8% (2/6)
Geomean +2.4% (5/6) +0.9% (3/6) +1.5% (3/6)
Test d8 First / Average jsc First / Average SpiderMonkey First / Average
dotnet-interp-wasm −2.9% / +3.1% +4.4% / +3.0% +0.2% / +3.4%
dotnet-aot-wasm −2.8% / +6.7% −9.2% / +1.4% −7.4% / +5.7%

The AOT dotnet.native.wasm is 19% larger, so the first iteration, which compiles it, takes longer (d8 −2.8%, jsc −9.2%, SpiderMonkey −7.4%), while later iterations improve (+6.7% / +1.4% / +5.7%).

.NET 11 GA is due on November 10, inside this PR's review window. I'll switch global.json to 11.0.100, rebuild and update the numbers before merging.

@danleh
danleh requested review from eqrion and kmiller68 November 3, 2026 17:33
@netlify

netlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for webkit-jetstream-preview ready!

Name Link
🔨 Latest commit ff4f556
🔍 Latest deploy log https://app.netlify.com/projects/webkit-jetstream-preview/deploys/6aea6bfe910fe44ae587cbd2
😎 Deploy Preview https://deploy-preview-329--webkit-jetstream-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@danleh danleh added the v3.1 label Nov 3, 2026
Build dotnet-interp-wasm and dotnet-aot-wasm with .NET SDK
11.0.100-rc.3.26522.148 (was 9.0.305). The runtime pack's Emscripten
moves from 3.1.56 to 6.0.3.

.NET 11 compiles the runtime and the AOT code with -fwasm-exceptions
-sWASM_LEGACY_EXCEPTIONS=0, so the binaries use the standard exception
handling instructions (try_table, throw_ref) directly. build.sh no
longer rewrites dotnet.native.wasm with `wasm-opt --translate-to-exnref`.

- src/global.json selects SDK 11.0.100-rc.3.26522.148, and
  dotnet.csproj targets net11.0.
- The trimmed library set changed: System.Collections.Concurrent.wasm is
  gone and System.Security.Cryptography.wasm is new. JetStreamDriver.js
  and benchmark.js preload the new set.
- The AOT build's boot config lists every assembly as a core assembly,
  so benchmark.js marks all assemblies isCore for AOT.
- The minifier renamed the function that logs the ArrayBuffer
  instantiation warning (w -> v), so the perl command that strips the
  warning now matches any one-letter name.
- README.md: drop the stale notes about installing wasm-tools from
  build.sh and patching import.meta.url for jsc.

The C# benchmark code is unchanged.

Score change, d8 (15.9.60) / jsc (325217) / SpiderMonkey (160.0b3) (each
test alone in a fresh shell, 6 rounds):
  dotnet-interp-wasm  +1.3% / +3.7% / +2.1%
  dotnet-aot-wasm     +3.5% / -1.7% / +0.8%
The AOT dotnet.native.wasm is 19% larger, so the first iteration, which
compiles it, takes longer (d8 -2.8%, jsc -9.2%, SpiderMonkey -7.4%),
while later iterations improve (+6.7% / +1.4% / +5.7%).

.NET 11 GA is expected on November 10, 2026. Then switch global.json
to 11.0.100 and rebuild.

Part of WebKit#277.

@maraf maraf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Just a note, .NET 11 GA is coming soon in case you would prefer a more official version (not that there will be any change in the WebAssembly workload).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants