@litert-lm/core 0.13.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +2 -2
  2. package/dist/conversation.d.ts +11 -3
  3. package/dist/conversation.d.ts.map +1 -1
  4. package/dist/conversation.js +68 -50
  5. package/dist/conversation.js.map +1 -1
  6. package/dist/conversation_config.d.ts +68 -22
  7. package/dist/conversation_config.d.ts.map +1 -1
  8. package/dist/engine.js +5 -2
  9. package/dist/engine.js.map +1 -1
  10. package/dist/engine_settings.d.ts +2 -1
  11. package/dist/engine_settings.d.ts.map +1 -1
  12. package/dist/engine_settings.js +4 -0
  13. package/dist/engine_settings.js.map +1 -1
  14. package/dist/index.d.ts +4 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +4 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/litertlm_web.js +1 -1
  19. package/dist/load.d.ts.map +1 -1
  20. package/dist/load.js +9 -2
  21. package/dist/load.js.map +1 -1
  22. package/dist/load_litertlm.d.ts +1 -1
  23. package/dist/load_litertlm.d.ts.map +1 -1
  24. package/dist/load_litertlm.js +14 -2
  25. package/dist/load_litertlm.js.map +1 -1
  26. package/dist/orchestration/auto_tool_chat.d.ts +82 -0
  27. package/dist/orchestration/auto_tool_chat.d.ts.map +1 -0
  28. package/dist/orchestration/auto_tool_chat.js +304 -0
  29. package/dist/orchestration/auto_tool_chat.js.map +1 -0
  30. package/dist/orchestration/chat_interface.d.ts +30 -0
  31. package/dist/orchestration/chat_interface.d.ts.map +1 -0
  32. package/dist/orchestration/chat_interface.js +17 -0
  33. package/dist/orchestration/chat_interface.js.map +1 -0
  34. package/dist/orchestration/webmcp_tool.d.ts +41 -0
  35. package/dist/orchestration/webmcp_tool.d.ts.map +1 -0
  36. package/dist/orchestration/webmcp_tool.js +32 -0
  37. package/dist/orchestration/webmcp_tool.js.map +1 -0
  38. package/dist/session.d.ts +5 -0
  39. package/dist/session.d.ts.map +1 -1
  40. package/dist/session.js +19 -0
  41. package/dist/session.js.map +1 -1
  42. package/dist/testing/fakes.d.ts +67 -0
  43. package/dist/testing/fakes.d.ts.map +1 -0
  44. package/dist/testing/fakes.js +125 -0
  45. package/dist/testing/fakes.js.map +1 -0
  46. package/dist/testing/index.d.ts +17 -0
  47. package/dist/testing/index.d.ts.map +1 -0
  48. package/dist/testing/index.js +17 -0
  49. package/dist/testing/index.js.map +1 -0
  50. package/dist/wasm_binding_types.d.ts +17 -3
  51. package/dist/wasm_binding_types.d.ts.map +1 -1
  52. package/dist/wasm_binding_types.js.map +1 -1
  53. package/dist/wasm_feature_detect.d.ts +3 -0
  54. package/dist/wasm_feature_detect.d.ts.map +1 -1
  55. package/dist/wasm_feature_detect.js +22 -0
  56. package/dist/wasm_feature_detect.js.map +1 -1
  57. package/package.json +15 -1
  58. package/wasm/litertlm_wasm_asyncify_internal.js +8619 -0
  59. package/wasm/litertlm_wasm_asyncify_internal.wasm +0 -0
  60. package/wasm/litertlm_wasm_compat_asyncify_internal.js +8628 -0
  61. package/wasm/litertlm_wasm_compat_asyncify_internal.wasm +0 -0
  62. package/wasm/litertlm_wasm_compat_internal.js +83 -70
  63. package/wasm/litertlm_wasm_compat_internal.wasm +0 -0
  64. package/wasm/litertlm_wasm_internal.js +83 -70
  65. package/wasm/litertlm_wasm_internal.wasm +0 -0
@@ -9,8 +9,7 @@ var ModuleFactory = (() => {
9
9
  // In EXPORT_ES6 mode we can just use 'import.meta.url'.
10
10
  var _scriptName = globalThis.document?.currentScript?.src;
11
11
  return async function(moduleArg = {}) {
12
- var moduleRtn;
13
-
12
+ var Module = moduleArg;
14
13
  // include: shell.js
15
14
  // include: minimum_runtime_check.js
16
15
  // end include: minimum_runtime_check.js
@@ -27,8 +26,6 @@ var ModuleFactory = (() => {
27
26
  // after the generated code, you will need to define var Module = {};
28
27
  // before the code. Then that object will be used in the code, and you
29
28
  // can continue to use Module afterwards as well.
30
- var Module = moduleArg;
31
-
32
29
  // Determine the runtime environment we are in. You can customize this by
33
30
  // setting the ENVIRONMENT setting at compile time (see settings.js).
34
31
  // Attempt to auto-detect the environment
@@ -207,8 +204,6 @@ class EmscriptenSjLj extends EmscriptenEH {}
207
204
  // end include: runtime_exceptions.js
208
205
  // include: runtime_debug.js
209
206
  // end include: runtime_debug.js
210
- var readyPromiseResolve, readyPromiseReject;
211
-
212
207
  // Memory management
213
208
  var runtimeInitialized = false;
214
209
 
@@ -286,7 +281,6 @@ function postRun() {
286
281
  // though it can.
287
282
  // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.
288
283
  /** @suppress {checkTypes} */ var e = new WebAssembly.RuntimeError(what);
289
- readyPromiseReject?.(e);
290
284
  // Throw the error whether or not MODULARIZE is set because abort is used
291
285
  // in code paths apart from instantiation where an exception is expected
292
286
  // to be thrown when abort is called.
@@ -6991,6 +6985,7 @@ var WebGPU = {
6991
6985
  20: "texture-formats-tier2",
6992
6986
  21: "primitive-index",
6993
6987
  22: "texture-component-swizzle",
6988
+ 23: "subgroup-size-control",
6994
6989
  327692: "chromium-experimental-unorm16-texture-formats",
6995
6990
  327729: "chromium-experimental-multi-draw-indirect"
6996
6991
  },
@@ -7017,9 +7012,9 @@ var WebGPU = {
7017
7012
  TextureSampleType: [ , , "float", "unfilterable-float", "depth", "sint", "uint" ],
7018
7013
  TextureViewDimension: [ , "1d", "2d", "2d-array", "cube", "cube-array", "3d" ],
7019
7014
  ToneMappingMode: [ , "standard", "extended" ],
7020
- VertexFormat: [ , "uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra" ],
7015
+ VertexFormat: [ , "uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra", "snorm10-10-10-2" ],
7021
7016
  VertexStepMode: [ , "vertex", "instance" ],
7022
- WGSLLanguageFeatureName: [ , "readonly_and_readwrite_storage_textures", "packed_4x8_integer_dot_product", "unrestricted_pointer_parameters", "pointer_composite_access", "uniform_buffer_standard_layout", "subgroup_id", "texture_and_sampler_let", "subgroup_uniformity", "texture_formats_tier1", "linear_indexing" ]
7017
+ WGSLLanguageFeatureName: [ , "readonly_and_readwrite_storage_textures", "packed_4x8_integer_dot_product", "unrestricted_pointer_parameters", "pointer_composite_access", "uniform_buffer_standard_layout", "subgroup_id", "texture_and_sampler_let", "subgroup_uniformity", "texture_formats_tier1", "linear_indexing", "immediate_address_space" ]
7023
7018
  };
7024
7019
 
7025
7020
  function _emscripten_webgpu_get_device() {
@@ -7902,6 +7897,11 @@ function _wgpuTextureCreateView(texturePtr, descriptor) {
7902
7897
  return ptr;
7903
7898
  }
7904
7899
 
7900
+ function _wgpuTextureDestroy(texturePtr) {
7901
+ texturePtr >>>= 0;
7902
+ WebGPU.getJsObject(texturePtr).destroy();
7903
+ }
7904
+
7905
7905
  function _wgpuTextureGetDepthOrArrayLayers(texturePtr) {
7906
7906
  texturePtr >>>= 0;
7907
7907
  var texture = WebGPU.getJsObject(texturePtr);
@@ -7984,11 +7984,11 @@ Module["FS_createLazyFile"] = FS_createLazyFile;
7984
7984
  // End JS library exports
7985
7985
  // end include: postlibrary.js
7986
7986
  var ASM_CONSTS = {
7987
- 2079340: $0 => {
7987
+ 2207593: () => !!Module["preinitializedWebGPUDevice"],
7988
+ 2207644: $0 => {
7988
7989
  const device = WebGPU.getJsObject($0);
7989
7990
  return device.features.has("subgroups");
7990
- },
7991
- 2079424: () => !!Module["preinitializedWebGPUDevice"]
7991
+ }
7992
7992
  };
7993
7993
 
7994
7994
  function custom_emscripten_dbgn(str, len) {
@@ -8019,33 +8019,6 @@ function ThrowError(val_handle) {
8019
8019
 
8020
8020
  ThrowError.sig = "vi";
8021
8021
 
8022
- function JsGetDeviceMinSubgroupSize(deviceId) {
8023
- const device = WebGPU.getJsObject(deviceId);
8024
- return device.adapterInfo.subgroupMinSize || device.limits.minSubgroupSize;
8025
- }
8026
-
8027
- JsGetDeviceMinSubgroupSize.sig = "ii";
8028
-
8029
- function JsGetDeviceMaxSubgroupSize(deviceId) {
8030
- const device = WebGPU.getJsObject(deviceId);
8031
- return device.adapterInfo.subgroupMaxSize || device.limits.maxSubgroupSize;
8032
- }
8033
-
8034
- JsGetDeviceMaxSubgroupSize.sig = "ii";
8035
-
8036
- function __asyncjs__ReadBufferDataJs(buffer_handle, data_ptr) {
8037
- return Asyncify.handleAsync(async () => {
8038
- const gpuReadBuffer = WebGPU.getJsObject(buffer_handle);
8039
- await gpuReadBuffer.mapAsync(GPUMapMode.READ);
8040
- const arrayBuffer = gpuReadBuffer.getMappedRange();
8041
- const u8view = new Uint8Array(arrayBuffer);
8042
- HEAPU8.set(u8view, data_ptr >>> 0 >>> 0);
8043
- gpuReadBuffer.unmap();
8044
- });
8045
- }
8046
-
8047
- __asyncjs__ReadBufferDataJs.sig = "vii";
8048
-
8049
8022
  function GetAdapterArchitecture() {
8050
8023
  const device = Module["preinitializedWebGPUDevice"];
8051
8024
  const architecture = device.adapterInfo ? device.adapterInfo.architecture : "Unknown";
@@ -8078,6 +8051,56 @@ function GetAdapterVendor() {
8078
8051
 
8079
8052
  GetAdapterVendor.sig = "i";
8080
8053
 
8054
+ function JsGetDeviceMinSubgroupSize(deviceId) {
8055
+ const device = WebGPU.getJsObject(deviceId);
8056
+ return device.adapterInfo.subgroupMinSize || device.limits.minSubgroupSize;
8057
+ }
8058
+
8059
+ JsGetDeviceMinSubgroupSize.sig = "ii";
8060
+
8061
+ function JsGetDeviceMaxSubgroupSize(deviceId) {
8062
+ const device = WebGPU.getJsObject(deviceId);
8063
+ return device.adapterInfo.subgroupMaxSize || device.limits.maxSubgroupSize;
8064
+ }
8065
+
8066
+ JsGetDeviceMaxSubgroupSize.sig = "ii";
8067
+
8068
+ function __asyncjs__ReadBufferDataJs(buffer_handle, data_ptr) {
8069
+ return Asyncify.handleAsync(async () => {
8070
+ const gpuReadBuffer = WebGPU.getJsObject(buffer_handle);
8071
+ await gpuReadBuffer.mapAsync(GPUMapMode.READ);
8072
+ const arrayBuffer = gpuReadBuffer.getMappedRange();
8073
+ const u8view = new Uint8Array(arrayBuffer);
8074
+ HEAPU8.set(u8view, data_ptr >>> 0 >>> 0);
8075
+ gpuReadBuffer.unmap();
8076
+ });
8077
+ }
8078
+
8079
+ __asyncjs__ReadBufferDataJs.sig = "vii";
8080
+
8081
+ function __asyncjs__CallStreamWeightsOnWeb(tfl_ids, wgpu_buffers, offsets, lengths, count) {
8082
+ return Asyncify.handleAsync(async () => {
8083
+ const callback = Module.getStreamWeightsCallback();
8084
+ if (typeof callback !== "function") {
8085
+ console.error("Stream weights callback is not registered or is not a function");
8086
+ return 1;
8087
+ }
8088
+ const tflIdsArray = new Int32Array(Module.HEAP32.buffer, tfl_ids, count);
8089
+ const wgpuBuffersArray = new Uint32Array(Module.HEAPU32.buffer, wgpu_buffers, count);
8090
+ const offsetsArray = new Float64Array(Module.HEAPF64.buffer, offsets, count);
8091
+ const lengthsArray = new Float64Array(Module.HEAPF64.buffer, lengths, count);
8092
+ try {
8093
+ await callback(new Int32Array(tflIdsArray), new Uint32Array(wgpuBuffersArray), new Float64Array(offsetsArray), new Float64Array(lengthsArray));
8094
+ } catch (e) {
8095
+ console.error("Error in streamWeightsOnWeb:", e);
8096
+ return 1;
8097
+ }
8098
+ return 0;
8099
+ });
8100
+ }
8101
+
8102
+ __asyncjs__CallStreamWeightsOnWeb.sig = "iiiiii";
8103
+
8081
8104
  function hardware_concurrency() {
8082
8105
  var concurrency = 1;
8083
8106
  try {
@@ -8089,7 +8112,7 @@ function hardware_concurrency() {
8089
8112
  hardware_concurrency.sig = "i";
8090
8113
 
8091
8114
  // Imports from the Wasm binary.
8092
- var _malloc, _free, _ma_device__on_notification_unlocked, _ma_malloc_emscripten, _ma_free_emscripten, _ma_device_process_pcm_frames_capture__webaudio, _ma_device_process_pcm_frames_playback__webaudio, _wgpuDeviceAddRef, _emwgpuCreateBindGroup, _emwgpuCreateBindGroupLayout, _emwgpuCreateCommandBuffer, _emwgpuCreateCommandEncoder, _emwgpuCreateComputePassEncoder, _emwgpuCreateComputePipeline, _emwgpuCreateExternalTexture, _emwgpuCreatePipelineLayout, _emwgpuCreateQuerySet, _emwgpuCreateRenderBundle, _emwgpuCreateRenderBundleEncoder, _emwgpuCreateRenderPassEncoder, _emwgpuCreateRenderPipeline, _emwgpuCreateSampler, _emwgpuCreateSurface, _emwgpuCreateTexture, _emwgpuCreateTextureView, _emwgpuCreateAdapter, _emwgpuImportBuffer, _emwgpuCreateDevice, _emwgpuCreateQueue, _emwgpuCreateShaderModule, _emwgpuOnCreateComputePipelineCompleted, _emwgpuOnMapAsyncCompleted, _emwgpuOnWorkDoneCompleted, ___getTypeName, _emscripten_builtin_memalign, _memalign, __emscripten_stack_restore, __emscripten_stack_alloc, _emscripten_stack_get_current, memory, _kVersionStampBuildChangelistStr, _kVersionStampCitcSnapshotStr, _kVersionStampCitcWorkspaceIdStr, _kVersionStampSourceUriStr, _kVersionStampBuildClientStr, _kVersionStampBuildClientMintStatusStr, _kVersionStampBuildCompilerStr, _kVersionStampBuildDateTimePstStr, _kVersionStampBuildDepotPathStr, _kVersionStampBuildIdStr, _kVersionStampBuildInfoStr, _kVersionStampBuildLabelStr, _kVersionStampBuildTargetStr, _kVersionStampBuildTimestampStr, _kVersionStampBuildToolStr, _kVersionStampG3BuildTargetStr, _kVersionStampVerifiableStr, _kVersionStampBuildFdoTypeStr, _kVersionStampBuildBaselineChangelistStr, _kVersionStampBuildLtoTypeStr, _kVersionStampBuildPropellerTypeStr, _kVersionStampBuildPghoTypeStr, _kVersionStampBuildUsernameStr, _kVersionStampBuildHostnameStr, _kVersionStampBuildDirectoryStr, _kVersionStampBuildChangelistInt, _kVersionStampCitcSnapshotInt, _kVersionStampBuildClientMintStatusInt, _kVersionStampBuildTimestampInt, _kVersionStampVerifiableInt, _kVersionStampBuildCoverageEnabledInt, _kVersionStampBuildBaselineChangelistInt, _kVersionStampPrecookedTimestampStr, _kVersionStampPrecookedClientInfoStr, __indirect_function_table, _kVersionStampBuildHasHardeningProtobuf, wasmMemory, wasmTable;
8115
+ var _malloc, _free, _ma_device__on_notification_unlocked, _ma_malloc_emscripten, _ma_free_emscripten, _ma_device_process_pcm_frames_capture__webaudio, _ma_device_process_pcm_frames_playback__webaudio, _wgpuDeviceAddRef, _emwgpuCreateBindGroup, _emwgpuCreateBindGroupLayout, _emwgpuCreateCommandBuffer, _emwgpuCreateCommandEncoder, _emwgpuCreateComputePassEncoder, _emwgpuCreateComputePipeline, _emwgpuCreateExternalTexture, _emwgpuCreatePipelineLayout, _emwgpuCreateQuerySet, _emwgpuCreateRenderBundle, _emwgpuCreateRenderBundleEncoder, _emwgpuCreateRenderPassEncoder, _emwgpuCreateRenderPipeline, _emwgpuCreateSampler, _emwgpuCreateSurface, _emwgpuCreateTexture, _emwgpuCreateTextureView, _emwgpuCreateAdapter, _emwgpuImportBuffer, _emwgpuCreateDevice, _emwgpuCreateQueue, _emwgpuCreateShaderModule, _emwgpuOnCreateComputePipelineCompleted, _emwgpuOnMapAsyncCompleted, _emwgpuOnWorkDoneCompleted, ___getTypeName, _emscripten_builtin_memalign, _memalign, __emscripten_stack_restore, __emscripten_stack_alloc, _emscripten_stack_get_current, memory, _kVersionStampBuildChangelistStr, _kVersionStampCitcSnapshotStr, _kVersionStampCitcWorkspaceIdStr, _kVersionStampSourceUriStr, _kVersionStampBuildClientStr, _kVersionStampBuildClientMintStatusStr, _kVersionStampBuildCompilerStr, _kVersionStampBuildDateTimePstStr, _kVersionStampBuildDepotPathStr, _kVersionStampBuildIdStr, _kVersionStampBuildInfoStr, _kVersionStampBuildLabelStr, _kVersionStampBuildTargetStr, _kVersionStampBuildTimestampStr, _kVersionStampBuildToolStr, _kVersionStampG3BuildTargetStr, _kVersionStampVerifiableStr, _kVersionStampBuildFdoTypeStr, _kVersionStampBuildBaselineChangelistStr, _kVersionStampBuildLtoTypeStr, _kVersionStampBuildPropellerTypeStr, _kVersionStampBuildPghoTypeStr, _kVersionStampBuildFdoProfileChangelistStr, _kVersionStampBuildMemprofProfileChangelistStr, _kVersionStampBuildUsernameStr, _kVersionStampBuildHostnameStr, _kVersionStampBuildDirectoryStr, _kVersionStampBuildChangelistInt, _kVersionStampCitcSnapshotInt, _kVersionStampBuildClientMintStatusInt, _kVersionStampBuildTimestampInt, _kVersionStampVerifiableInt, _kVersionStampBuildCoverageEnabledInt, _kVersionStampBuildBaselineChangelistInt, _kVersionStampPrecookedTimestampStr, _kVersionStampPrecookedClientInfoStr, __indirect_function_table, _kVersionStampBuildHasHardeningProtobuf, wasmMemory, wasmTable;
8093
8116
 
8094
8117
  function assignWasmExports(wasmExports) {
8095
8118
  _malloc = Module["_malloc"] = wasmExports["malloc"];
@@ -8154,6 +8177,8 @@ function assignWasmExports(wasmExports) {
8154
8177
  _kVersionStampBuildLtoTypeStr = Module["_kVersionStampBuildLtoTypeStr"] = (wasmExports["kVersionStampBuildLtoTypeStr"].value) >>> 0;
8155
8178
  _kVersionStampBuildPropellerTypeStr = Module["_kVersionStampBuildPropellerTypeStr"] = (wasmExports["kVersionStampBuildPropellerTypeStr"].value) >>> 0;
8156
8179
  _kVersionStampBuildPghoTypeStr = Module["_kVersionStampBuildPghoTypeStr"] = (wasmExports["kVersionStampBuildPghoTypeStr"].value) >>> 0;
8180
+ _kVersionStampBuildFdoProfileChangelistStr = Module["_kVersionStampBuildFdoProfileChangelistStr"] = (wasmExports["kVersionStampBuildFdoProfileChangelistStr"].value) >>> 0;
8181
+ _kVersionStampBuildMemprofProfileChangelistStr = Module["_kVersionStampBuildMemprofProfileChangelistStr"] = (wasmExports["kVersionStampBuildMemprofProfileChangelistStr"].value) >>> 0;
8157
8182
  _kVersionStampBuildUsernameStr = Module["_kVersionStampBuildUsernameStr"] = (wasmExports["kVersionStampBuildUsernameStr"].value) >>> 0;
8158
8183
  _kVersionStampBuildHostnameStr = Module["_kVersionStampBuildHostnameStr"] = (wasmExports["kVersionStampBuildHostnameStr"].value) >>> 0;
8159
8184
  _kVersionStampBuildDirectoryStr = Module["_kVersionStampBuildDirectoryStr"] = (wasmExports["kVersionStampBuildDirectoryStr"].value) >>> 0;
@@ -8180,6 +8205,7 @@ var wasmImports = {
8180
8205
  /** @export */ JsGetDeviceMinSubgroupSize,
8181
8206
  /** @export */ ThrowError,
8182
8207
  /** @export */ _Unwind_RaiseException: __Unwind_RaiseException,
8208
+ /** @export */ __asyncjs__CallStreamWeightsOnWeb,
8183
8209
  /** @export */ __asyncjs__ReadBufferDataJs,
8184
8210
  /** @export */ __syscall_dup: ___syscall_dup,
8185
8211
  /** @export */ __syscall_faccessat: ___syscall_faccessat,
@@ -8303,6 +8329,7 @@ var wasmImports = {
8303
8329
  /** @export */ wgpuQueueWriteBuffer: _wgpuQueueWriteBuffer,
8304
8330
  /** @export */ wgpuQueueWriteTexture: _wgpuQueueWriteTexture,
8305
8331
  /** @export */ wgpuTextureCreateView: _wgpuTextureCreateView,
8332
+ /** @export */ wgpuTextureDestroy: _wgpuTextureDestroy,
8306
8333
  /** @export */ wgpuTextureGetDepthOrArrayLayers: _wgpuTextureGetDepthOrArrayLayers,
8307
8334
  /** @export */ wgpuTextureGetHeight: _wgpuTextureGetHeight,
8308
8335
  /** @export */ wgpuTextureGetWidth: _wgpuTextureGetWidth
@@ -8329,16 +8356,14 @@ function applySignatureConversions(wasmExports) {
8329
8356
 
8330
8357
  // include: postamble.js
8331
8358
  // === Auto-generated postamble setup entry stuff ===
8332
- function run() {
8359
+ async function run() {
8333
8360
  if (runDependencies > 0) {
8334
- dependenciesFulfilled = run;
8335
- return;
8361
+ await new Promise(resolve => dependenciesFulfilled = resolve);
8336
8362
  }
8337
8363
  preRun();
8338
8364
  // a preRun added a dependency, run will be called later
8339
8365
  if (runDependencies > 0) {
8340
- dependenciesFulfilled = run;
8341
- return;
8366
+ await new Promise(resolve => dependenciesFulfilled = resolve);
8342
8367
  }
8343
8368
  async function doRun() {
8344
8369
  // run may have just been called through dependencies being fulfilled just in this very frame,
@@ -8346,16 +8371,20 @@ function run() {
8346
8371
  Module["calledRun"] = true;
8347
8372
  if (ABORT) return;
8348
8373
  initRuntime();
8349
- readyPromiseResolve?.(Module);
8350
8374
  Module["onRuntimeInitialized"]?.();
8351
8375
  postRun();
8352
8376
  }
8353
8377
  if (Module["setStatus"]) {
8354
8378
  Module["setStatus"]("Running...");
8355
- setTimeout(() => {
8356
- setTimeout(() => Module["setStatus"](""), 1);
8357
- doRun();
8358
- }, 1);
8379
+ // Yield the main thread to allow the browser to paint "Running...", then clear
8380
+ // the status text after the synchronous doRun() completes.
8381
+ await new Promise(resolve => {
8382
+ setTimeout(() => {
8383
+ setTimeout(() => Module["setStatus"](""), 1);
8384
+ doRun();
8385
+ resolve();
8386
+ }, 1);
8387
+ });
8359
8388
  } else {
8360
8389
  doRun();
8361
8390
  }
@@ -8365,28 +8394,12 @@ var wasmExports;
8365
8394
 
8366
8395
  // In modularize mode the generated code is within a factory function so we
8367
8396
  // can use await here (since it's not top-level-await).
8368
- wasmExports = await (createWasm());
8369
-
8370
- run();
8371
-
8372
- // end include: postamble.js
8373
- // include: postamble_modularize.js
8374
- // In MODULARIZE mode we wrap the generated code in a factory function
8375
- // and return either the Module itself, or a promise of the module.
8376
- // We assign to the `moduleRtn` global here and configure closure to see
8377
- // this as an extern so it won't get minified.
8378
- if (runtimeInitialized) {
8379
- moduleRtn = Module;
8380
- } else {
8381
- // Set up the promise that indicates the Module is initialized
8382
- moduleRtn = new Promise((resolve, reject) => {
8383
- readyPromiseResolve = resolve;
8384
- readyPromiseReject = reject;
8385
- });
8386
- }
8397
+ wasmExports = await createWasm();
8398
+
8399
+ await run();
8387
8400
 
8388
8401
 
8389
- return moduleRtn;
8402
+ return Module;
8390
8403
  };
8391
8404
  })();
8392
8405
 
@@ -9,8 +9,7 @@ var ModuleFactory = (() => {
9
9
  // In EXPORT_ES6 mode we can just use 'import.meta.url'.
10
10
  var _scriptName = globalThis.document?.currentScript?.src;
11
11
  return async function(moduleArg = {}) {
12
- var moduleRtn;
13
-
12
+ var Module = moduleArg;
14
13
  // include: shell.js
15
14
  // include: minimum_runtime_check.js
16
15
  // end include: minimum_runtime_check.js
@@ -27,8 +26,6 @@ var ModuleFactory = (() => {
27
26
  // after the generated code, you will need to define var Module = {};
28
27
  // before the code. Then that object will be used in the code, and you
29
28
  // can continue to use Module afterwards as well.
30
- var Module = moduleArg;
31
-
32
29
  // Determine the runtime environment we are in. You can customize this by
33
30
  // setting the ENVIRONMENT setting at compile time (see settings.js).
34
31
  // Attempt to auto-detect the environment
@@ -207,8 +204,6 @@ class EmscriptenSjLj extends EmscriptenEH {}
207
204
  // end include: runtime_exceptions.js
208
205
  // include: runtime_debug.js
209
206
  // end include: runtime_debug.js
210
- var readyPromiseResolve, readyPromiseReject;
211
-
212
207
  // Memory management
213
208
  var runtimeInitialized = false;
214
209
 
@@ -286,7 +281,6 @@ function postRun() {
286
281
  // though it can.
287
282
  // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.
288
283
  /** @suppress {checkTypes} */ var e = new WebAssembly.RuntimeError(what);
289
- readyPromiseReject?.(e);
290
284
  // Throw the error whether or not MODULARIZE is set because abort is used
291
285
  // in code paths apart from instantiation where an exception is expected
292
286
  // to be thrown when abort is called.
@@ -6991,6 +6985,7 @@ var WebGPU = {
6991
6985
  20: "texture-formats-tier2",
6992
6986
  21: "primitive-index",
6993
6987
  22: "texture-component-swizzle",
6988
+ 23: "subgroup-size-control",
6994
6989
  327692: "chromium-experimental-unorm16-texture-formats",
6995
6990
  327729: "chromium-experimental-multi-draw-indirect"
6996
6991
  },
@@ -7017,9 +7012,9 @@ var WebGPU = {
7017
7012
  TextureSampleType: [ , , "float", "unfilterable-float", "depth", "sint", "uint" ],
7018
7013
  TextureViewDimension: [ , "1d", "2d", "2d-array", "cube", "cube-array", "3d" ],
7019
7014
  ToneMappingMode: [ , "standard", "extended" ],
7020
- VertexFormat: [ , "uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra" ],
7015
+ VertexFormat: [ , "uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra", "snorm10-10-10-2" ],
7021
7016
  VertexStepMode: [ , "vertex", "instance" ],
7022
- WGSLLanguageFeatureName: [ , "readonly_and_readwrite_storage_textures", "packed_4x8_integer_dot_product", "unrestricted_pointer_parameters", "pointer_composite_access", "uniform_buffer_standard_layout", "subgroup_id", "texture_and_sampler_let", "subgroup_uniformity", "texture_formats_tier1", "linear_indexing" ]
7017
+ WGSLLanguageFeatureName: [ , "readonly_and_readwrite_storage_textures", "packed_4x8_integer_dot_product", "unrestricted_pointer_parameters", "pointer_composite_access", "uniform_buffer_standard_layout", "subgroup_id", "texture_and_sampler_let", "subgroup_uniformity", "texture_formats_tier1", "linear_indexing", "immediate_address_space" ]
7023
7018
  };
7024
7019
 
7025
7020
  function _emscripten_webgpu_get_device() {
@@ -7902,6 +7897,11 @@ function _wgpuTextureCreateView(texturePtr, descriptor) {
7902
7897
  return ptr;
7903
7898
  }
7904
7899
 
7900
+ function _wgpuTextureDestroy(texturePtr) {
7901
+ texturePtr >>>= 0;
7902
+ WebGPU.getJsObject(texturePtr).destroy();
7903
+ }
7904
+
7905
7905
  function _wgpuTextureGetDepthOrArrayLayers(texturePtr) {
7906
7906
  texturePtr >>>= 0;
7907
7907
  var texture = WebGPU.getJsObject(texturePtr);
@@ -7984,11 +7984,11 @@ Module["FS_createLazyFile"] = FS_createLazyFile;
7984
7984
  // End JS library exports
7985
7985
  // end include: postlibrary.js
7986
7986
  var ASM_CONSTS = {
7987
- 2079276: $0 => {
7987
+ 2207465: () => !!Module["preinitializedWebGPUDevice"],
7988
+ 2207516: $0 => {
7988
7989
  const device = WebGPU.getJsObject($0);
7989
7990
  return device.features.has("subgroups");
7990
- },
7991
- 2079360: () => !!Module["preinitializedWebGPUDevice"]
7991
+ }
7992
7992
  };
7993
7993
 
7994
7994
  function custom_emscripten_dbgn(str, len) {
@@ -8019,33 +8019,6 @@ function ThrowError(val_handle) {
8019
8019
 
8020
8020
  ThrowError.sig = "vi";
8021
8021
 
8022
- function JsGetDeviceMinSubgroupSize(deviceId) {
8023
- const device = WebGPU.getJsObject(deviceId);
8024
- return device.adapterInfo.subgroupMinSize || device.limits.minSubgroupSize;
8025
- }
8026
-
8027
- JsGetDeviceMinSubgroupSize.sig = "ii";
8028
-
8029
- function JsGetDeviceMaxSubgroupSize(deviceId) {
8030
- const device = WebGPU.getJsObject(deviceId);
8031
- return device.adapterInfo.subgroupMaxSize || device.limits.maxSubgroupSize;
8032
- }
8033
-
8034
- JsGetDeviceMaxSubgroupSize.sig = "ii";
8035
-
8036
- function __asyncjs__ReadBufferDataJs(buffer_handle, data_ptr) {
8037
- return Asyncify.handleAsync(async () => {
8038
- const gpuReadBuffer = WebGPU.getJsObject(buffer_handle);
8039
- await gpuReadBuffer.mapAsync(GPUMapMode.READ);
8040
- const arrayBuffer = gpuReadBuffer.getMappedRange();
8041
- const u8view = new Uint8Array(arrayBuffer);
8042
- HEAPU8.set(u8view, data_ptr >>> 0 >>> 0);
8043
- gpuReadBuffer.unmap();
8044
- });
8045
- }
8046
-
8047
- __asyncjs__ReadBufferDataJs.sig = "vii";
8048
-
8049
8022
  function GetAdapterArchitecture() {
8050
8023
  const device = Module["preinitializedWebGPUDevice"];
8051
8024
  const architecture = device.adapterInfo ? device.adapterInfo.architecture : "Unknown";
@@ -8078,8 +8051,58 @@ function GetAdapterVendor() {
8078
8051
 
8079
8052
  GetAdapterVendor.sig = "i";
8080
8053
 
8054
+ function JsGetDeviceMinSubgroupSize(deviceId) {
8055
+ const device = WebGPU.getJsObject(deviceId);
8056
+ return device.adapterInfo.subgroupMinSize || device.limits.minSubgroupSize;
8057
+ }
8058
+
8059
+ JsGetDeviceMinSubgroupSize.sig = "ii";
8060
+
8061
+ function JsGetDeviceMaxSubgroupSize(deviceId) {
8062
+ const device = WebGPU.getJsObject(deviceId);
8063
+ return device.adapterInfo.subgroupMaxSize || device.limits.maxSubgroupSize;
8064
+ }
8065
+
8066
+ JsGetDeviceMaxSubgroupSize.sig = "ii";
8067
+
8068
+ function __asyncjs__ReadBufferDataJs(buffer_handle, data_ptr) {
8069
+ return Asyncify.handleAsync(async () => {
8070
+ const gpuReadBuffer = WebGPU.getJsObject(buffer_handle);
8071
+ await gpuReadBuffer.mapAsync(GPUMapMode.READ);
8072
+ const arrayBuffer = gpuReadBuffer.getMappedRange();
8073
+ const u8view = new Uint8Array(arrayBuffer);
8074
+ HEAPU8.set(u8view, data_ptr >>> 0 >>> 0);
8075
+ gpuReadBuffer.unmap();
8076
+ });
8077
+ }
8078
+
8079
+ __asyncjs__ReadBufferDataJs.sig = "vii";
8080
+
8081
+ function __asyncjs__CallStreamWeightsOnWeb(tfl_ids, wgpu_buffers, offsets, lengths, count) {
8082
+ return Asyncify.handleAsync(async () => {
8083
+ const callback = Module.getStreamWeightsCallback();
8084
+ if (typeof callback !== "function") {
8085
+ console.error("Stream weights callback is not registered or is not a function");
8086
+ return 1;
8087
+ }
8088
+ const tflIdsArray = new Int32Array(Module.HEAP32.buffer, tfl_ids, count);
8089
+ const wgpuBuffersArray = new Uint32Array(Module.HEAPU32.buffer, wgpu_buffers, count);
8090
+ const offsetsArray = new Float64Array(Module.HEAPF64.buffer, offsets, count);
8091
+ const lengthsArray = new Float64Array(Module.HEAPF64.buffer, lengths, count);
8092
+ try {
8093
+ await callback(new Int32Array(tflIdsArray), new Uint32Array(wgpuBuffersArray), new Float64Array(offsetsArray), new Float64Array(lengthsArray));
8094
+ } catch (e) {
8095
+ console.error("Error in streamWeightsOnWeb:", e);
8096
+ return 1;
8097
+ }
8098
+ return 0;
8099
+ });
8100
+ }
8101
+
8102
+ __asyncjs__CallStreamWeightsOnWeb.sig = "iiiiii";
8103
+
8081
8104
  // Imports from the Wasm binary.
8082
- var _malloc, _free, _ma_device__on_notification_unlocked, _ma_malloc_emscripten, _ma_free_emscripten, _ma_device_process_pcm_frames_capture__webaudio, _ma_device_process_pcm_frames_playback__webaudio, _wgpuDeviceAddRef, _emwgpuCreateBindGroup, _emwgpuCreateBindGroupLayout, _emwgpuCreateCommandBuffer, _emwgpuCreateCommandEncoder, _emwgpuCreateComputePassEncoder, _emwgpuCreateComputePipeline, _emwgpuCreateExternalTexture, _emwgpuCreatePipelineLayout, _emwgpuCreateQuerySet, _emwgpuCreateRenderBundle, _emwgpuCreateRenderBundleEncoder, _emwgpuCreateRenderPassEncoder, _emwgpuCreateRenderPipeline, _emwgpuCreateSampler, _emwgpuCreateSurface, _emwgpuCreateTexture, _emwgpuCreateTextureView, _emwgpuCreateAdapter, _emwgpuImportBuffer, _emwgpuCreateDevice, _emwgpuCreateQueue, _emwgpuCreateShaderModule, _emwgpuOnCreateComputePipelineCompleted, _emwgpuOnMapAsyncCompleted, _emwgpuOnWorkDoneCompleted, ___getTypeName, _emscripten_builtin_memalign, _memalign, __emscripten_stack_restore, __emscripten_stack_alloc, _emscripten_stack_get_current, memory, _kVersionStampBuildChangelistStr, _kVersionStampCitcSnapshotStr, _kVersionStampCitcWorkspaceIdStr, _kVersionStampSourceUriStr, _kVersionStampBuildClientStr, _kVersionStampBuildClientMintStatusStr, _kVersionStampBuildCompilerStr, _kVersionStampBuildDateTimePstStr, _kVersionStampBuildDepotPathStr, _kVersionStampBuildIdStr, _kVersionStampBuildInfoStr, _kVersionStampBuildLabelStr, _kVersionStampBuildTargetStr, _kVersionStampBuildTimestampStr, _kVersionStampBuildToolStr, _kVersionStampG3BuildTargetStr, _kVersionStampVerifiableStr, _kVersionStampBuildFdoTypeStr, _kVersionStampBuildBaselineChangelistStr, _kVersionStampBuildLtoTypeStr, _kVersionStampBuildPropellerTypeStr, _kVersionStampBuildPghoTypeStr, _kVersionStampBuildUsernameStr, _kVersionStampBuildHostnameStr, _kVersionStampBuildDirectoryStr, _kVersionStampBuildChangelistInt, _kVersionStampCitcSnapshotInt, _kVersionStampBuildClientMintStatusInt, _kVersionStampBuildTimestampInt, _kVersionStampVerifiableInt, _kVersionStampBuildCoverageEnabledInt, _kVersionStampBuildBaselineChangelistInt, _kVersionStampPrecookedTimestampStr, _kVersionStampPrecookedClientInfoStr, __indirect_function_table, _kVersionStampBuildHasHardeningProtobuf, wasmMemory, wasmTable;
8105
+ var _malloc, _free, _ma_device__on_notification_unlocked, _ma_malloc_emscripten, _ma_free_emscripten, _ma_device_process_pcm_frames_capture__webaudio, _ma_device_process_pcm_frames_playback__webaudio, _wgpuDeviceAddRef, _emwgpuCreateBindGroup, _emwgpuCreateBindGroupLayout, _emwgpuCreateCommandBuffer, _emwgpuCreateCommandEncoder, _emwgpuCreateComputePassEncoder, _emwgpuCreateComputePipeline, _emwgpuCreateExternalTexture, _emwgpuCreatePipelineLayout, _emwgpuCreateQuerySet, _emwgpuCreateRenderBundle, _emwgpuCreateRenderBundleEncoder, _emwgpuCreateRenderPassEncoder, _emwgpuCreateRenderPipeline, _emwgpuCreateSampler, _emwgpuCreateSurface, _emwgpuCreateTexture, _emwgpuCreateTextureView, _emwgpuCreateAdapter, _emwgpuImportBuffer, _emwgpuCreateDevice, _emwgpuCreateQueue, _emwgpuCreateShaderModule, _emwgpuOnCreateComputePipelineCompleted, _emwgpuOnMapAsyncCompleted, _emwgpuOnWorkDoneCompleted, ___getTypeName, _emscripten_builtin_memalign, _memalign, __emscripten_stack_restore, __emscripten_stack_alloc, _emscripten_stack_get_current, memory, _kVersionStampBuildChangelistStr, _kVersionStampCitcSnapshotStr, _kVersionStampCitcWorkspaceIdStr, _kVersionStampSourceUriStr, _kVersionStampBuildClientStr, _kVersionStampBuildClientMintStatusStr, _kVersionStampBuildCompilerStr, _kVersionStampBuildDateTimePstStr, _kVersionStampBuildDepotPathStr, _kVersionStampBuildIdStr, _kVersionStampBuildInfoStr, _kVersionStampBuildLabelStr, _kVersionStampBuildTargetStr, _kVersionStampBuildTimestampStr, _kVersionStampBuildToolStr, _kVersionStampG3BuildTargetStr, _kVersionStampVerifiableStr, _kVersionStampBuildFdoTypeStr, _kVersionStampBuildBaselineChangelistStr, _kVersionStampBuildLtoTypeStr, _kVersionStampBuildPropellerTypeStr, _kVersionStampBuildPghoTypeStr, _kVersionStampBuildFdoProfileChangelistStr, _kVersionStampBuildMemprofProfileChangelistStr, _kVersionStampBuildUsernameStr, _kVersionStampBuildHostnameStr, _kVersionStampBuildDirectoryStr, _kVersionStampBuildChangelistInt, _kVersionStampCitcSnapshotInt, _kVersionStampBuildClientMintStatusInt, _kVersionStampBuildTimestampInt, _kVersionStampVerifiableInt, _kVersionStampBuildCoverageEnabledInt, _kVersionStampBuildBaselineChangelistInt, _kVersionStampPrecookedTimestampStr, _kVersionStampPrecookedClientInfoStr, __indirect_function_table, _kVersionStampBuildHasHardeningProtobuf, wasmMemory, wasmTable;
8083
8106
 
8084
8107
  function assignWasmExports(wasmExports) {
8085
8108
  _malloc = Module["_malloc"] = wasmExports["malloc"];
@@ -8144,6 +8167,8 @@ function assignWasmExports(wasmExports) {
8144
8167
  _kVersionStampBuildLtoTypeStr = Module["_kVersionStampBuildLtoTypeStr"] = (wasmExports["kVersionStampBuildLtoTypeStr"].value) >>> 0;
8145
8168
  _kVersionStampBuildPropellerTypeStr = Module["_kVersionStampBuildPropellerTypeStr"] = (wasmExports["kVersionStampBuildPropellerTypeStr"].value) >>> 0;
8146
8169
  _kVersionStampBuildPghoTypeStr = Module["_kVersionStampBuildPghoTypeStr"] = (wasmExports["kVersionStampBuildPghoTypeStr"].value) >>> 0;
8170
+ _kVersionStampBuildFdoProfileChangelistStr = Module["_kVersionStampBuildFdoProfileChangelistStr"] = (wasmExports["kVersionStampBuildFdoProfileChangelistStr"].value) >>> 0;
8171
+ _kVersionStampBuildMemprofProfileChangelistStr = Module["_kVersionStampBuildMemprofProfileChangelistStr"] = (wasmExports["kVersionStampBuildMemprofProfileChangelistStr"].value) >>> 0;
8147
8172
  _kVersionStampBuildUsernameStr = Module["_kVersionStampBuildUsernameStr"] = (wasmExports["kVersionStampBuildUsernameStr"].value) >>> 0;
8148
8173
  _kVersionStampBuildHostnameStr = Module["_kVersionStampBuildHostnameStr"] = (wasmExports["kVersionStampBuildHostnameStr"].value) >>> 0;
8149
8174
  _kVersionStampBuildDirectoryStr = Module["_kVersionStampBuildDirectoryStr"] = (wasmExports["kVersionStampBuildDirectoryStr"].value) >>> 0;
@@ -8170,6 +8195,7 @@ var wasmImports = {
8170
8195
  /** @export */ JsGetDeviceMinSubgroupSize,
8171
8196
  /** @export */ ThrowError,
8172
8197
  /** @export */ _Unwind_RaiseException: __Unwind_RaiseException,
8198
+ /** @export */ __asyncjs__CallStreamWeightsOnWeb,
8173
8199
  /** @export */ __asyncjs__ReadBufferDataJs,
8174
8200
  /** @export */ __syscall_dup: ___syscall_dup,
8175
8201
  /** @export */ __syscall_faccessat: ___syscall_faccessat,
@@ -8292,6 +8318,7 @@ var wasmImports = {
8292
8318
  /** @export */ wgpuQueueWriteBuffer: _wgpuQueueWriteBuffer,
8293
8319
  /** @export */ wgpuQueueWriteTexture: _wgpuQueueWriteTexture,
8294
8320
  /** @export */ wgpuTextureCreateView: _wgpuTextureCreateView,
8321
+ /** @export */ wgpuTextureDestroy: _wgpuTextureDestroy,
8295
8322
  /** @export */ wgpuTextureGetDepthOrArrayLayers: _wgpuTextureGetDepthOrArrayLayers,
8296
8323
  /** @export */ wgpuTextureGetHeight: _wgpuTextureGetHeight,
8297
8324
  /** @export */ wgpuTextureGetWidth: _wgpuTextureGetWidth
@@ -8318,16 +8345,14 @@ function applySignatureConversions(wasmExports) {
8318
8345
 
8319
8346
  // include: postamble.js
8320
8347
  // === Auto-generated postamble setup entry stuff ===
8321
- function run() {
8348
+ async function run() {
8322
8349
  if (runDependencies > 0) {
8323
- dependenciesFulfilled = run;
8324
- return;
8350
+ await new Promise(resolve => dependenciesFulfilled = resolve);
8325
8351
  }
8326
8352
  preRun();
8327
8353
  // a preRun added a dependency, run will be called later
8328
8354
  if (runDependencies > 0) {
8329
- dependenciesFulfilled = run;
8330
- return;
8355
+ await new Promise(resolve => dependenciesFulfilled = resolve);
8331
8356
  }
8332
8357
  async function doRun() {
8333
8358
  // run may have just been called through dependencies being fulfilled just in this very frame,
@@ -8335,16 +8360,20 @@ function run() {
8335
8360
  Module["calledRun"] = true;
8336
8361
  if (ABORT) return;
8337
8362
  initRuntime();
8338
- readyPromiseResolve?.(Module);
8339
8363
  Module["onRuntimeInitialized"]?.();
8340
8364
  postRun();
8341
8365
  }
8342
8366
  if (Module["setStatus"]) {
8343
8367
  Module["setStatus"]("Running...");
8344
- setTimeout(() => {
8345
- setTimeout(() => Module["setStatus"](""), 1);
8346
- doRun();
8347
- }, 1);
8368
+ // Yield the main thread to allow the browser to paint "Running...", then clear
8369
+ // the status text after the synchronous doRun() completes.
8370
+ await new Promise(resolve => {
8371
+ setTimeout(() => {
8372
+ setTimeout(() => Module["setStatus"](""), 1);
8373
+ doRun();
8374
+ resolve();
8375
+ }, 1);
8376
+ });
8348
8377
  } else {
8349
8378
  doRun();
8350
8379
  }
@@ -8354,28 +8383,12 @@ var wasmExports;
8354
8383
 
8355
8384
  // In modularize mode the generated code is within a factory function so we
8356
8385
  // can use await here (since it's not top-level-await).
8357
- wasmExports = await (createWasm());
8358
-
8359
- run();
8360
-
8361
- // end include: postamble.js
8362
- // include: postamble_modularize.js
8363
- // In MODULARIZE mode we wrap the generated code in a factory function
8364
- // and return either the Module itself, or a promise of the module.
8365
- // We assign to the `moduleRtn` global here and configure closure to see
8366
- // this as an extern so it won't get minified.
8367
- if (runtimeInitialized) {
8368
- moduleRtn = Module;
8369
- } else {
8370
- // Set up the promise that indicates the Module is initialized
8371
- moduleRtn = new Promise((resolve, reject) => {
8372
- readyPromiseResolve = resolve;
8373
- readyPromiseReject = reject;
8374
- });
8375
- }
8386
+ wasmExports = await createWasm();
8387
+
8388
+ await run();
8376
8389
 
8377
8390
 
8378
- return moduleRtn;
8391
+ return Module;
8379
8392
  };
8380
8393
  })();
8381
8394
 
Binary file