Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Make runtime errors from simd and exception handling failures easy to understand #84574

Closed
lewing opened this issue Apr 10, 2023 · 6 comments · Fixed by #89387
Closed
Assignees
Labels
arch-wasm WebAssembly architecture area-Diagnostics-mono
Milestone

Comments

@lewing
Copy link
Member

lewing commented Apr 10, 2023

Now that we are enabling post MVP Wasm rutime features we should make sure that any runtime errors are clear and guide the developer on how to resolve the issue. Additionally we should consider adding messages during the build explaining that these features are enabled and that they impact compatibility.

Features which could be detected

  • wasm SIMD - old Safari
  • wasm EH
  • Threads/SharedArrayBuffer/WebWorker - Coop headers, old FireFox without ES6 workers
  • BigInt64Array - old Safari
  • CSP - http headers
  • WebSocket on NodeJS
@lewing lewing added arch-wasm WebAssembly architecture area-Diagnostics-mono labels Apr 10, 2023
@lewing lewing added this to the 8.0.0 milestone Apr 10, 2023
@ghost
Copy link

ghost commented Apr 10, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Now that we are enabling post MVP Wasm rutime features we should make sure that any runtime errors are clear and guide the developer on how to resolve the issue. Additionally we should consider adding messages during the build explaining that these features are enabled and that they impact compatibility.

Author: lewing
Assignees: -
Labels:

arch-wasm, area-Diagnostics-mono

Milestone: 8.0.0

@kg
Copy link
Member

kg commented Apr 11, 2023

On the client side, one option we have is to leverage jiterp's feature detection and run it on any failure to load dotnet.wasm, so we can use that information to choose an appropriate error message. The question still arises of how to message that load failure to the user, though, and that would require some decisions to happen at the Blazor level I think.

@pavelsavara
Copy link
Member

Once we have small loader module which would be loaded before the main emscripten script, we could use it to detect which features are available and choose the correct build flavor to load. See #85045

@pavelsavara
Copy link
Member

Should we take dependency on https://github.com/GoogleChromeLabs/wasm-feature-detect and bundle it into the loader module ?

@pavelsavara
Copy link
Member

    import { simd } from "https://unpkg.com/wasm-feature-detect@1.5.1/dist/esm/index.js";
    console.log("simd: "+ await simd());

only 764 bytes!

@lewing
Copy link
Member Author

lewing commented Jul 17, 2023

#89028 is an example

@pavelsavara pavelsavara self-assigned this Jul 24, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 24, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 25, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Diagnostics-mono
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants