Closed pavelsavara closed 1 week ago
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
@kg this is close to what you've been thinking about recently
thanks for doing the hard work on this! i agree on your estimated startup reduction, should be a win
we may need runtimeconfig.bin
to be loaded into VFS before we start mono. And I'm not sure about ICU data.
we may need
runtimeconfig.bin
to be loaded into VFS before we start mono. And I'm not sure about ICU data.
ICU data will only be needed if any runtime startup loads it. JS interop does with an accidental string operation right now. We could probably make it assert if there's an attempt to load ICU during this warming phase
I'm not sure if my recollection is correct but I think we explicitly load the icu data earlier than we need to as well. It might be worth exploring if we can delay it longer.
I'm not sure if my recollection is correct but I think we explicitly load the icu data earlier than we need to as well. It might be worth exploring if we can delay it longer.
This currently postpones all but core DLLs
/azp run runtime-wasm
Right now, this PR is not AOT friendly because AOT assumes that metadata would be available for all images.
we need System.Threading.Channels
to be part of the core for MT build. @maraf
Current CI fails with
[20:31:58] fail: [0x0118c038-dpty 20:31:58.466] MONO_WASM: start_runtime() failed {}
There is mono_runtime_class_init_full
on stack for most of them.
We need to land this after https://github.com/dotnet/sdk/pull/39689
we need to make ICU data "core" when the globalizationMode
not invariant
we need
System.Threading.Channels
to be part of the core for MT build. @maraf
with the last change maybe not. I need to try without.
hmm, Log
[13:54:11] fail: Error in mono_download_assets: RangeError: Start offset -1 is outside the bounds of the buffer
[13:54:11] fail: [--000eafbc-emsc 13:54:11.333] MONO_WASM: Start offset -1 is outside the bounds of the buffer
RangeError: Start offset -1 is outside the bounds of the buffer
at new Uint8Array (<anonymous>)
at http://127.0.0.1:41625/_framework/dotnet.runtime.js:3:77638
at Object.pa [as instantiate_asset] (http://127.0.0.1:41625/_framework/dotnet.runtime.js:3:77686)
at n (http://127.0.0.1:41625/_framework/dotnet.js:3:8629)
at async Promise.all (index 129)
[13:54:11] fail: [out of order message from the browser]: http://127.0.0.1:41625/_framework/dotnet.runtime.js 2:77637 Uncaught RangeError: Start offset -1 is outside the bounds of the buffer
[13:54:11] info: WASM EXIT 1
Above fail is ICU asset data being loaded into memory via mono_wasm_load_bytes_into_heap_persistent
on MT build in UI thread, while the mono is starting on deputy thread.
It seems that Module._sbrk
returned -1
🤯
@kg @lewing ideas ?
See also https://github.com/emscripten-core/emscripten/pull/20793/files
Maybe we should just retry if it returns -1 in MT builds? We may have just lost some sort of race. I'm surprised this is possible though, and it would suggest that malloc can fail if we're unlucky too.
It's kind of unrelated to this PR I moved the discussion to https://github.com/dotnet/runtime/issues/96546#issuecomment-2065933037
@maraf this is now unblocked, right ?
@maraf this is now unblocked, right ?
Yes, once https://github.com/dotnet/sdk/pull/39689 flows through installer and we get updated installer dependency for WBT
- make assets relative to
/
when not absolute
This is now unblocked in SDK
/ba-g all issues are known
60ms for firefox and 30ms for chrome during the cold start.
start MonoVM when essential DLLs are downloaded and continue downloading the rest of the assets
System.Private.CoreLib
System.Collections
System.Runtime.InteropServices.JavaScript
runtimeconfig.bin
dotnet.native.js.symbols
if presentI estimate that this could shave 50ms from cold start.
other changes
/
when not absoluteResurrection of https://github.com/dotnet/runtime/pull/93480