@litert-lm/core 0.17.1 → 0.18.1
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.
- package/dist/conversation_config.d.ts +3 -3
- package/dist/conversation_config.d.ts.map +1 -1
- package/dist/embedding_engine.d.ts.map +1 -1
- package/dist/embedding_engine.js +7 -14
- package/dist/embedding_engine.js.map +1 -1
- package/dist/embedding_engine_settings.d.ts +23 -0
- package/dist/embedding_engine_settings.d.ts.map +1 -1
- package/dist/embedding_engine_settings.js +11 -3
- package/dist/embedding_engine_settings.js.map +1 -1
- package/dist/litertlm_web.js +1 -1
- package/dist/readable_stream_data_stream_wrapper.d.ts +18 -10
- package/dist/readable_stream_data_stream_wrapper.d.ts.map +1 -1
- package/dist/readable_stream_data_stream_wrapper.js.map +1 -1
- package/dist/stream_utils.d.ts +0 -5
- package/dist/stream_utils.d.ts.map +1 -1
- package/dist/stream_utils.js +0 -60
- package/dist/stream_utils.js.map +1 -1
- package/dist/wasm_binding_types.d.ts +4 -5
- package/dist/wasm_binding_types.d.ts.map +1 -1
- package/package.json +2 -3
- package/wasm/litertlm_wasm_asyncify_internal.js +316 -416
- package/wasm/litertlm_wasm_asyncify_internal.wasm +2 -2
- package/wasm/litertlm_wasm_compat_asyncify_internal.js +317 -417
- package/wasm/litertlm_wasm_compat_asyncify_internal.wasm +2 -2
- package/wasm/litertlm_wasm_compat_internal.js +27 -127
- package/wasm/litertlm_wasm_compat_internal.wasm +0 -0
- package/wasm/litertlm_wasm_internal.js +27 -127
- package/wasm/litertlm_wasm_internal.wasm +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/wasm/litertlm_wasm_compat_asyncify_internal.wasm
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 36052518 bytes
|
|
4
|
+
sha256: 5acb377f24f2646c9b201897ced9ce700c7ec3599c0e21f375a866cf458e62c7
|
|
@@ -572,8 +572,8 @@ var Browser = {
|
|
|
572
572
|
var ret = "";
|
|
573
573
|
var leftchar = 0;
|
|
574
574
|
var leftbits = 0;
|
|
575
|
-
for (var
|
|
576
|
-
leftchar = (leftchar << 8) |
|
|
575
|
+
for (var byte of data) {
|
|
576
|
+
leftchar = (leftchar << 8) | byte;
|
|
577
577
|
leftbits += 8;
|
|
578
578
|
while (leftbits >= 6) {
|
|
579
579
|
var curr = (leftchar >> (leftbits - 6)) & 63;
|
|
@@ -930,76 +930,9 @@ var stackRestore = val => __emscripten_stack_restore(val);
|
|
|
930
930
|
|
|
931
931
|
var stackSave = () => _emscripten_stack_get_current();
|
|
932
932
|
|
|
933
|
-
|
|
934
|
-
// excPtr - Thrown object pointer to wrap. Metadata pointer is calculated from it.
|
|
935
|
-
constructor(excPtr) {
|
|
936
|
-
this.excPtr = excPtr;
|
|
937
|
-
this.ptr = excPtr - 24;
|
|
938
|
-
}
|
|
939
|
-
set_type(type) {
|
|
940
|
-
HEAPU32[(((this.ptr) + (4)) >>> 2) >>> 0] = type;
|
|
941
|
-
}
|
|
942
|
-
get_type() {
|
|
943
|
-
return HEAPU32[(((this.ptr) + (4)) >>> 2) >>> 0];
|
|
944
|
-
}
|
|
945
|
-
set_destructor(destructor) {
|
|
946
|
-
HEAPU32[(((this.ptr) + (8)) >>> 2) >>> 0] = destructor;
|
|
947
|
-
}
|
|
948
|
-
get_destructor() {
|
|
949
|
-
return HEAPU32[(((this.ptr) + (8)) >>> 2) >>> 0];
|
|
950
|
-
}
|
|
951
|
-
set_caught(caught) {
|
|
952
|
-
caught = caught ? 1 : 0;
|
|
953
|
-
HEAP8[(this.ptr) + (12) >>> 0] = caught;
|
|
954
|
-
}
|
|
955
|
-
get_caught() {
|
|
956
|
-
return HEAP8[(this.ptr) + (12) >>> 0] != 0;
|
|
957
|
-
}
|
|
958
|
-
set_rethrown(rethrown) {
|
|
959
|
-
rethrown = rethrown ? 1 : 0;
|
|
960
|
-
HEAP8[(this.ptr) + (13) >>> 0] = rethrown;
|
|
961
|
-
}
|
|
962
|
-
get_rethrown() {
|
|
963
|
-
return HEAP8[(this.ptr) + (13) >>> 0] != 0;
|
|
964
|
-
}
|
|
965
|
-
// Initialize native structure fields. Should be called once after allocated.
|
|
966
|
-
init(type, destructor) {
|
|
967
|
-
this.set_adjusted_ptr(0);
|
|
968
|
-
this.set_type(type);
|
|
969
|
-
this.set_destructor(destructor);
|
|
970
|
-
}
|
|
971
|
-
set_adjusted_ptr(adjustedPtr) {
|
|
972
|
-
HEAPU32[(((this.ptr) + (16)) >>> 2) >>> 0] = adjustedPtr;
|
|
973
|
-
}
|
|
974
|
-
get_adjusted_ptr() {
|
|
975
|
-
return HEAPU32[(((this.ptr) + (16)) >>> 2) >>> 0];
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
var uncaughtExceptionCount = 0;
|
|
980
|
-
|
|
981
|
-
var INT53_MAX = 9007199254740992;
|
|
982
|
-
|
|
983
|
-
var INT53_MIN = -9007199254740992;
|
|
984
|
-
|
|
985
|
-
var bigintToI53Checked = num => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num);
|
|
986
|
-
|
|
987
|
-
function ___cxa_throw(ptr, type, destructor) {
|
|
988
|
-
ptr >>>= 0;
|
|
989
|
-
type >>>= 0;
|
|
990
|
-
destructor >>>= 0;
|
|
991
|
-
var info = new ExceptionInfo(ptr);
|
|
992
|
-
// Initialize ExceptionInfo content after it was allocated in __cxa_allocate_exception.
|
|
993
|
-
info.init(type, destructor);
|
|
994
|
-
uncaughtExceptionCount++;
|
|
933
|
+
var __Unwind_RaiseException = ex => {
|
|
995
934
|
abort();
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
function __Unwind_RaiseException(ex) {
|
|
999
|
-
ex >>>= 0;
|
|
1000
|
-
err("Warning: _Unwind_RaiseException is not correctly implemented");
|
|
1001
|
-
return ___cxa_throw(ex, 0, 0);
|
|
1002
|
-
}
|
|
935
|
+
};
|
|
1003
936
|
|
|
1004
937
|
var PATH = {
|
|
1005
938
|
isAbs: path => path.charAt(0) === "/",
|
|
@@ -1313,12 +1246,15 @@ var TTY = {
|
|
|
1313
1246
|
} catch (e) {
|
|
1314
1247
|
throw new FS.ErrnoError(29);
|
|
1315
1248
|
}
|
|
1316
|
-
if (result === undefined && bytesRead
|
|
1249
|
+
if (result === undefined && !bytesRead) {
|
|
1317
1250
|
throw new FS.ErrnoError(6);
|
|
1318
1251
|
}
|
|
1319
1252
|
if (result === null || result === undefined) break;
|
|
1320
1253
|
bytesRead++;
|
|
1321
1254
|
buffer[offset + i] = result;
|
|
1255
|
+
// We currently only support canonical mode (ICANON), where
|
|
1256
|
+
// read(2) returns as soon as a line delimiter is read.
|
|
1257
|
+
if (result === 10) break;
|
|
1322
1258
|
}
|
|
1323
1259
|
if (bytesRead) {
|
|
1324
1260
|
stream.node.atime = Date.now();
|
|
@@ -1646,7 +1582,7 @@ var MEMFS = {
|
|
|
1646
1582
|
if (canOwn) {
|
|
1647
1583
|
node.contents = buffer.subarray(offset, offset + length);
|
|
1648
1584
|
node.usedBytes = length;
|
|
1649
|
-
} else if (node.usedBytes
|
|
1585
|
+
} else if (!node.usedBytes && !position) {
|
|
1650
1586
|
// If this is a simple first write to an empty file, do a fast set since we don't need to care about old data.
|
|
1651
1587
|
node.contents = buffer.slice(offset, offset + length);
|
|
1652
1588
|
node.usedBytes = length;
|
|
@@ -2987,7 +2923,7 @@ var FS = {
|
|
|
2987
2923
|
// to write to file opened in read-only mode with MAP_PRIVATE flag,
|
|
2988
2924
|
// as all modifications will be visible only in the memory of
|
|
2989
2925
|
// the current process.
|
|
2990
|
-
if ((prot & 2)
|
|
2926
|
+
if ((prot & 2) && !(flags & 2) && (stream.flags & 2097155) !== 2) {
|
|
2991
2927
|
throw new FS.ErrnoError(2);
|
|
2992
2928
|
}
|
|
2993
2929
|
if ((stream.flags & 2097155) === 1) {
|
|
@@ -3080,7 +3016,7 @@ var FS = {
|
|
|
3080
3016
|
// use a buffer to avoid overhead of individual crypto calls per byte
|
|
3081
3017
|
var randomBuffer = new Uint8Array(1024), randomLeft = 0;
|
|
3082
3018
|
var randomByte = () => {
|
|
3083
|
-
if (randomLeft
|
|
3019
|
+
if (!randomLeft) {
|
|
3084
3020
|
randomFill(randomBuffer);
|
|
3085
3021
|
randomLeft = randomBuffer.byteLength;
|
|
3086
3022
|
}
|
|
@@ -3299,7 +3235,7 @@ var FS = {
|
|
|
3299
3235
|
} catch (e) {
|
|
3300
3236
|
throw new FS.ErrnoError(29);
|
|
3301
3237
|
}
|
|
3302
|
-
if (result === undefined && bytesRead
|
|
3238
|
+
if (result === undefined && !bytesRead) {
|
|
3303
3239
|
throw new FS.ErrnoError(6);
|
|
3304
3240
|
}
|
|
3305
3241
|
if (result === null || result === undefined) break;
|
|
@@ -3618,6 +3554,12 @@ function ___syscall_dup(fd) {
|
|
|
3618
3554
|
}
|
|
3619
3555
|
}
|
|
3620
3556
|
|
|
3557
|
+
var INT53_MAX = 9007199254740992;
|
|
3558
|
+
|
|
3559
|
+
var INT53_MIN = -9007199254740992;
|
|
3560
|
+
|
|
3561
|
+
var bigintToI53Checked = num => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num);
|
|
3562
|
+
|
|
3621
3563
|
function ___syscall_faccessat(dirfd, path, amode, flags) {
|
|
3622
3564
|
path >>>= 0;
|
|
3623
3565
|
try {
|
|
@@ -3747,7 +3689,7 @@ function ___syscall_getcwd(buf, size) {
|
|
|
3747
3689
|
buf >>>= 0;
|
|
3748
3690
|
size >>>= 0;
|
|
3749
3691
|
try {
|
|
3750
|
-
if (size
|
|
3692
|
+
if (!size) return -28;
|
|
3751
3693
|
var cwd = FS.cwd();
|
|
3752
3694
|
var cwdLengthInBytes = lengthBytesUTF8(cwd) + 1;
|
|
3753
3695
|
if (size < cwdLengthInBytes) return -68;
|
|
@@ -5381,7 +5323,7 @@ var enumReadValueFromPointer = (name, width, signed) => {
|
|
|
5381
5323
|
|
|
5382
5324
|
function getEnumValueType(rawValueType) {
|
|
5383
5325
|
// This must match the values of enum_value_type in wire.h
|
|
5384
|
-
return rawValueType
|
|
5326
|
+
return !rawValueType ? "object" : (rawValueType === 1 ? "number" : "string");
|
|
5385
5327
|
}
|
|
5386
5328
|
|
|
5387
5329
|
/** @suppress {globalThis} */ function __embind_register_enum(rawType, name, size, isSigned, rawValueType) {
|
|
@@ -7035,9 +6977,9 @@ var WebGPU = {
|
|
|
7035
6977
|
let configsPtr = 0;
|
|
7036
6978
|
if (info.subgroupMatrixConfigs) {
|
|
7037
6979
|
configCount = info.subgroupMatrixConfigs.length;
|
|
7038
|
-
configsPtr = _malloc(configCount *
|
|
6980
|
+
configsPtr = _malloc(configCount * 28);
|
|
7039
6981
|
for (const [i, cfg] of info.subgroupMatrixConfigs.entries()) {
|
|
7040
|
-
const ptr = configsPtr + i *
|
|
6982
|
+
const ptr = configsPtr + i * 28;
|
|
7041
6983
|
const componentType = WebGPU.SubgroupMatrixComponentType.indexOf(cfg.componentType);
|
|
7042
6984
|
const resultComponentType = WebGPU.SubgroupMatrixComponentType.indexOf(cfg.resultComponentType);
|
|
7043
6985
|
HEAP32[((ptr) >>> 2) >>> 0] = componentType;
|
|
@@ -7088,6 +7030,8 @@ var WebGPU = {
|
|
|
7088
7030
|
21: "primitive-index",
|
|
7089
7031
|
22: "texture-component-swizzle",
|
|
7090
7032
|
23: "subgroup-size-control",
|
|
7033
|
+
24: "texture-compression-unaligned",
|
|
7034
|
+
25: "atomic-vec2u-min-max",
|
|
7091
7035
|
327692: "chromium-experimental-unorm16-texture-formats",
|
|
7092
7036
|
327729: "chromium-experimental-multi-draw-indirect",
|
|
7093
7037
|
327732: "chromium-experimental-subgroup-matrix"
|
|
@@ -7508,7 +7452,7 @@ function _fd_seek(fd, offset, whence, newOffset) {
|
|
|
7508
7452
|
var stream = SYSCALLS.getStreamFromFD(fd);
|
|
7509
7453
|
FS.llseek(stream, offset, whence);
|
|
7510
7454
|
HEAP64[((newOffset) >>> 3) >>> 0] = BigInt(stream.position);
|
|
7511
|
-
if (stream.getdents && offset
|
|
7455
|
+
if (stream.getdents && !offset && whence === 0) stream.getdents = null;
|
|
7512
7456
|
// reset readdir state
|
|
7513
7457
|
return 0;
|
|
7514
7458
|
} catch (e) {
|
|
@@ -7706,14 +7650,6 @@ function _wgpuComputePassEncoderSetPipeline(passPtr, pipelinePtr) {
|
|
|
7706
7650
|
pass.setPipeline(pipeline);
|
|
7707
7651
|
}
|
|
7708
7652
|
|
|
7709
|
-
function _wgpuComputePipelineGetBindGroupLayout(pipelinePtr, groupIndex) {
|
|
7710
|
-
pipelinePtr >>>= 0;
|
|
7711
|
-
var pipeline = WebGPU.getJsObject(pipelinePtr);
|
|
7712
|
-
var ptr = _emwgpuCreateBindGroupLayout(0);
|
|
7713
|
-
WebGPU.Internals.jsObjectInsert(ptr, pipeline.getBindGroupLayout(groupIndex));
|
|
7714
|
-
return ptr;
|
|
7715
|
-
}
|
|
7716
|
-
|
|
7717
7653
|
var _wgpuDeviceCreateBindGroup = function(devicePtr, descriptor) {
|
|
7718
7654
|
devicePtr >>>= 0;
|
|
7719
7655
|
descriptor >>>= 0;
|
|
@@ -8113,8 +8049,8 @@ Module["WebGPU"] = WebGPU;
|
|
|
8113
8049
|
// End JS library exports
|
|
8114
8050
|
// end include: postlibrary.js
|
|
8115
8051
|
var ASM_CONSTS = {
|
|
8116
|
-
|
|
8117
|
-
|
|
8052
|
+
2374585: () => !!Module["preinitializedWebGPUDevice"],
|
|
8053
|
+
2374636: $0 => {
|
|
8118
8054
|
const device = WebGPU.getJsObject($0);
|
|
8119
8055
|
return device.features.has("subgroups");
|
|
8120
8056
|
}
|
|
@@ -8207,40 +8143,6 @@ function __asyncjs__ReadBufferDataJs(buffer_handle, data_ptr) {
|
|
|
8207
8143
|
|
|
8208
8144
|
__asyncjs__ReadBufferDataJs.sig = "vii";
|
|
8209
8145
|
|
|
8210
|
-
function __asyncjs__CallStreamWeightsOnWeb(tfl_ids, wgpu_buffers, offsets, lengths, count) {
|
|
8211
|
-
return Asyncify.handleAsync(async () => {
|
|
8212
|
-
const callback = Module.getStreamWeightsCallback();
|
|
8213
|
-
if (typeof callback !== "function") {
|
|
8214
|
-
console.error("Stream weights callback is not registered or is not a function");
|
|
8215
|
-
return 1;
|
|
8216
|
-
}
|
|
8217
|
-
const view = new DataView(Module.HEAPU8.buffer);
|
|
8218
|
-
const tflIdsPtr = tfl_ids >>> 0;
|
|
8219
|
-
const wgpuBuffersPtr = wgpu_buffers >>> 0;
|
|
8220
|
-
const offsetsPtr = offsets >>> 0;
|
|
8221
|
-
const lengthsPtr = lengths >>> 0;
|
|
8222
|
-
const tflIdsArray = new Int32Array(count);
|
|
8223
|
-
const wgpuBuffersArray = new Uint32Array(count);
|
|
8224
|
-
const offsetsArray = new Float64Array(count);
|
|
8225
|
-
const lengthsArray = new Float64Array(count);
|
|
8226
|
-
for (let i = 0; i < count; i++) {
|
|
8227
|
-
tflIdsArray[i] = view.getInt32(tflIdsPtr + i * 4, true);
|
|
8228
|
-
wgpuBuffersArray[i] = view.getUint32(wgpuBuffersPtr + i * 4, true);
|
|
8229
|
-
offsetsArray[i] = view.getFloat64(offsetsPtr + i * 8, true);
|
|
8230
|
-
lengthsArray[i] = view.getFloat64(lengthsPtr + i * 8, true);
|
|
8231
|
-
}
|
|
8232
|
-
try {
|
|
8233
|
-
await callback(tflIdsArray, wgpuBuffersArray, offsetsArray, lengthsArray);
|
|
8234
|
-
} catch (e) {
|
|
8235
|
-
console.error("Error in streamWeightsOnWeb:", e);
|
|
8236
|
-
return 1;
|
|
8237
|
-
}
|
|
8238
|
-
return 0;
|
|
8239
|
-
});
|
|
8240
|
-
}
|
|
8241
|
-
|
|
8242
|
-
__asyncjs__CallStreamWeightsOnWeb.sig = "iiiiii";
|
|
8243
|
-
|
|
8244
8146
|
function hardware_concurrency() {
|
|
8245
8147
|
var concurrency = 1;
|
|
8246
8148
|
try {
|
|
@@ -8345,7 +8247,6 @@ var wasmImports = {
|
|
|
8345
8247
|
/** @export */ JsGetDeviceMinSubgroupSize,
|
|
8346
8248
|
/** @export */ ThrowError,
|
|
8347
8249
|
/** @export */ _Unwind_RaiseException: __Unwind_RaiseException,
|
|
8348
|
-
/** @export */ __asyncjs__CallStreamWeightsOnWeb,
|
|
8349
8250
|
/** @export */ __asyncjs__ReadBufferDataJs,
|
|
8350
8251
|
/** @export */ __syscall_dup: ___syscall_dup,
|
|
8351
8252
|
/** @export */ __syscall_faccessat: ___syscall_faccessat,
|
|
@@ -8458,7 +8359,6 @@ var wasmImports = {
|
|
|
8458
8359
|
/** @export */ wgpuComputePassEncoderEnd: _wgpuComputePassEncoderEnd,
|
|
8459
8360
|
/** @export */ wgpuComputePassEncoderSetBindGroup: _wgpuComputePassEncoderSetBindGroup,
|
|
8460
8361
|
/** @export */ wgpuComputePassEncoderSetPipeline: _wgpuComputePassEncoderSetPipeline,
|
|
8461
|
-
/** @export */ wgpuComputePipelineGetBindGroupLayout: _wgpuComputePipelineGetBindGroupLayout,
|
|
8462
8362
|
/** @export */ wgpuDeviceCreateBindGroup: _wgpuDeviceCreateBindGroup,
|
|
8463
8363
|
/** @export */ wgpuDeviceCreateBindGroupLayout: _wgpuDeviceCreateBindGroupLayout,
|
|
8464
8364
|
/** @export */ wgpuDeviceCreateCommandEncoder: _wgpuDeviceCreateCommandEncoder,
|
|
Binary file
|
|
@@ -572,8 +572,8 @@ var Browser = {
|
|
|
572
572
|
var ret = "";
|
|
573
573
|
var leftchar = 0;
|
|
574
574
|
var leftbits = 0;
|
|
575
|
-
for (var
|
|
576
|
-
leftchar = (leftchar << 8) |
|
|
575
|
+
for (var byte of data) {
|
|
576
|
+
leftchar = (leftchar << 8) | byte;
|
|
577
577
|
leftbits += 8;
|
|
578
578
|
while (leftbits >= 6) {
|
|
579
579
|
var curr = (leftchar >> (leftbits - 6)) & 63;
|
|
@@ -930,76 +930,9 @@ var stackRestore = val => __emscripten_stack_restore(val);
|
|
|
930
930
|
|
|
931
931
|
var stackSave = () => _emscripten_stack_get_current();
|
|
932
932
|
|
|
933
|
-
|
|
934
|
-
// excPtr - Thrown object pointer to wrap. Metadata pointer is calculated from it.
|
|
935
|
-
constructor(excPtr) {
|
|
936
|
-
this.excPtr = excPtr;
|
|
937
|
-
this.ptr = excPtr - 24;
|
|
938
|
-
}
|
|
939
|
-
set_type(type) {
|
|
940
|
-
HEAPU32[(((this.ptr) + (4)) >>> 2) >>> 0] = type;
|
|
941
|
-
}
|
|
942
|
-
get_type() {
|
|
943
|
-
return HEAPU32[(((this.ptr) + (4)) >>> 2) >>> 0];
|
|
944
|
-
}
|
|
945
|
-
set_destructor(destructor) {
|
|
946
|
-
HEAPU32[(((this.ptr) + (8)) >>> 2) >>> 0] = destructor;
|
|
947
|
-
}
|
|
948
|
-
get_destructor() {
|
|
949
|
-
return HEAPU32[(((this.ptr) + (8)) >>> 2) >>> 0];
|
|
950
|
-
}
|
|
951
|
-
set_caught(caught) {
|
|
952
|
-
caught = caught ? 1 : 0;
|
|
953
|
-
HEAP8[(this.ptr) + (12) >>> 0] = caught;
|
|
954
|
-
}
|
|
955
|
-
get_caught() {
|
|
956
|
-
return HEAP8[(this.ptr) + (12) >>> 0] != 0;
|
|
957
|
-
}
|
|
958
|
-
set_rethrown(rethrown) {
|
|
959
|
-
rethrown = rethrown ? 1 : 0;
|
|
960
|
-
HEAP8[(this.ptr) + (13) >>> 0] = rethrown;
|
|
961
|
-
}
|
|
962
|
-
get_rethrown() {
|
|
963
|
-
return HEAP8[(this.ptr) + (13) >>> 0] != 0;
|
|
964
|
-
}
|
|
965
|
-
// Initialize native structure fields. Should be called once after allocated.
|
|
966
|
-
init(type, destructor) {
|
|
967
|
-
this.set_adjusted_ptr(0);
|
|
968
|
-
this.set_type(type);
|
|
969
|
-
this.set_destructor(destructor);
|
|
970
|
-
}
|
|
971
|
-
set_adjusted_ptr(adjustedPtr) {
|
|
972
|
-
HEAPU32[(((this.ptr) + (16)) >>> 2) >>> 0] = adjustedPtr;
|
|
973
|
-
}
|
|
974
|
-
get_adjusted_ptr() {
|
|
975
|
-
return HEAPU32[(((this.ptr) + (16)) >>> 2) >>> 0];
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
var uncaughtExceptionCount = 0;
|
|
980
|
-
|
|
981
|
-
var INT53_MAX = 9007199254740992;
|
|
982
|
-
|
|
983
|
-
var INT53_MIN = -9007199254740992;
|
|
984
|
-
|
|
985
|
-
var bigintToI53Checked = num => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num);
|
|
986
|
-
|
|
987
|
-
function ___cxa_throw(ptr, type, destructor) {
|
|
988
|
-
ptr >>>= 0;
|
|
989
|
-
type >>>= 0;
|
|
990
|
-
destructor >>>= 0;
|
|
991
|
-
var info = new ExceptionInfo(ptr);
|
|
992
|
-
// Initialize ExceptionInfo content after it was allocated in __cxa_allocate_exception.
|
|
993
|
-
info.init(type, destructor);
|
|
994
|
-
uncaughtExceptionCount++;
|
|
933
|
+
var __Unwind_RaiseException = ex => {
|
|
995
934
|
abort();
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
function __Unwind_RaiseException(ex) {
|
|
999
|
-
ex >>>= 0;
|
|
1000
|
-
err("Warning: _Unwind_RaiseException is not correctly implemented");
|
|
1001
|
-
return ___cxa_throw(ex, 0, 0);
|
|
1002
|
-
}
|
|
935
|
+
};
|
|
1003
936
|
|
|
1004
937
|
var PATH = {
|
|
1005
938
|
isAbs: path => path.charAt(0) === "/",
|
|
@@ -1313,12 +1246,15 @@ var TTY = {
|
|
|
1313
1246
|
} catch (e) {
|
|
1314
1247
|
throw new FS.ErrnoError(29);
|
|
1315
1248
|
}
|
|
1316
|
-
if (result === undefined && bytesRead
|
|
1249
|
+
if (result === undefined && !bytesRead) {
|
|
1317
1250
|
throw new FS.ErrnoError(6);
|
|
1318
1251
|
}
|
|
1319
1252
|
if (result === null || result === undefined) break;
|
|
1320
1253
|
bytesRead++;
|
|
1321
1254
|
buffer[offset + i] = result;
|
|
1255
|
+
// We currently only support canonical mode (ICANON), where
|
|
1256
|
+
// read(2) returns as soon as a line delimiter is read.
|
|
1257
|
+
if (result === 10) break;
|
|
1322
1258
|
}
|
|
1323
1259
|
if (bytesRead) {
|
|
1324
1260
|
stream.node.atime = Date.now();
|
|
@@ -1646,7 +1582,7 @@ var MEMFS = {
|
|
|
1646
1582
|
if (canOwn) {
|
|
1647
1583
|
node.contents = buffer.subarray(offset, offset + length);
|
|
1648
1584
|
node.usedBytes = length;
|
|
1649
|
-
} else if (node.usedBytes
|
|
1585
|
+
} else if (!node.usedBytes && !position) {
|
|
1650
1586
|
// If this is a simple first write to an empty file, do a fast set since we don't need to care about old data.
|
|
1651
1587
|
node.contents = buffer.slice(offset, offset + length);
|
|
1652
1588
|
node.usedBytes = length;
|
|
@@ -2987,7 +2923,7 @@ var FS = {
|
|
|
2987
2923
|
// to write to file opened in read-only mode with MAP_PRIVATE flag,
|
|
2988
2924
|
// as all modifications will be visible only in the memory of
|
|
2989
2925
|
// the current process.
|
|
2990
|
-
if ((prot & 2)
|
|
2926
|
+
if ((prot & 2) && !(flags & 2) && (stream.flags & 2097155) !== 2) {
|
|
2991
2927
|
throw new FS.ErrnoError(2);
|
|
2992
2928
|
}
|
|
2993
2929
|
if ((stream.flags & 2097155) === 1) {
|
|
@@ -3080,7 +3016,7 @@ var FS = {
|
|
|
3080
3016
|
// use a buffer to avoid overhead of individual crypto calls per byte
|
|
3081
3017
|
var randomBuffer = new Uint8Array(1024), randomLeft = 0;
|
|
3082
3018
|
var randomByte = () => {
|
|
3083
|
-
if (randomLeft
|
|
3019
|
+
if (!randomLeft) {
|
|
3084
3020
|
randomFill(randomBuffer);
|
|
3085
3021
|
randomLeft = randomBuffer.byteLength;
|
|
3086
3022
|
}
|
|
@@ -3299,7 +3235,7 @@ var FS = {
|
|
|
3299
3235
|
} catch (e) {
|
|
3300
3236
|
throw new FS.ErrnoError(29);
|
|
3301
3237
|
}
|
|
3302
|
-
if (result === undefined && bytesRead
|
|
3238
|
+
if (result === undefined && !bytesRead) {
|
|
3303
3239
|
throw new FS.ErrnoError(6);
|
|
3304
3240
|
}
|
|
3305
3241
|
if (result === null || result === undefined) break;
|
|
@@ -3618,6 +3554,12 @@ function ___syscall_dup(fd) {
|
|
|
3618
3554
|
}
|
|
3619
3555
|
}
|
|
3620
3556
|
|
|
3557
|
+
var INT53_MAX = 9007199254740992;
|
|
3558
|
+
|
|
3559
|
+
var INT53_MIN = -9007199254740992;
|
|
3560
|
+
|
|
3561
|
+
var bigintToI53Checked = num => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num);
|
|
3562
|
+
|
|
3621
3563
|
function ___syscall_faccessat(dirfd, path, amode, flags) {
|
|
3622
3564
|
path >>>= 0;
|
|
3623
3565
|
try {
|
|
@@ -3747,7 +3689,7 @@ function ___syscall_getcwd(buf, size) {
|
|
|
3747
3689
|
buf >>>= 0;
|
|
3748
3690
|
size >>>= 0;
|
|
3749
3691
|
try {
|
|
3750
|
-
if (size
|
|
3692
|
+
if (!size) return -28;
|
|
3751
3693
|
var cwd = FS.cwd();
|
|
3752
3694
|
var cwdLengthInBytes = lengthBytesUTF8(cwd) + 1;
|
|
3753
3695
|
if (size < cwdLengthInBytes) return -68;
|
|
@@ -5381,7 +5323,7 @@ var enumReadValueFromPointer = (name, width, signed) => {
|
|
|
5381
5323
|
|
|
5382
5324
|
function getEnumValueType(rawValueType) {
|
|
5383
5325
|
// This must match the values of enum_value_type in wire.h
|
|
5384
|
-
return rawValueType
|
|
5326
|
+
return !rawValueType ? "object" : (rawValueType === 1 ? "number" : "string");
|
|
5385
5327
|
}
|
|
5386
5328
|
|
|
5387
5329
|
/** @suppress {globalThis} */ function __embind_register_enum(rawType, name, size, isSigned, rawValueType) {
|
|
@@ -7035,9 +6977,9 @@ var WebGPU = {
|
|
|
7035
6977
|
let configsPtr = 0;
|
|
7036
6978
|
if (info.subgroupMatrixConfigs) {
|
|
7037
6979
|
configCount = info.subgroupMatrixConfigs.length;
|
|
7038
|
-
configsPtr = _malloc(configCount *
|
|
6980
|
+
configsPtr = _malloc(configCount * 28);
|
|
7039
6981
|
for (const [i, cfg] of info.subgroupMatrixConfigs.entries()) {
|
|
7040
|
-
const ptr = configsPtr + i *
|
|
6982
|
+
const ptr = configsPtr + i * 28;
|
|
7041
6983
|
const componentType = WebGPU.SubgroupMatrixComponentType.indexOf(cfg.componentType);
|
|
7042
6984
|
const resultComponentType = WebGPU.SubgroupMatrixComponentType.indexOf(cfg.resultComponentType);
|
|
7043
6985
|
HEAP32[((ptr) >>> 2) >>> 0] = componentType;
|
|
@@ -7088,6 +7030,8 @@ var WebGPU = {
|
|
|
7088
7030
|
21: "primitive-index",
|
|
7089
7031
|
22: "texture-component-swizzle",
|
|
7090
7032
|
23: "subgroup-size-control",
|
|
7033
|
+
24: "texture-compression-unaligned",
|
|
7034
|
+
25: "atomic-vec2u-min-max",
|
|
7091
7035
|
327692: "chromium-experimental-unorm16-texture-formats",
|
|
7092
7036
|
327729: "chromium-experimental-multi-draw-indirect",
|
|
7093
7037
|
327732: "chromium-experimental-subgroup-matrix"
|
|
@@ -7508,7 +7452,7 @@ function _fd_seek(fd, offset, whence, newOffset) {
|
|
|
7508
7452
|
var stream = SYSCALLS.getStreamFromFD(fd);
|
|
7509
7453
|
FS.llseek(stream, offset, whence);
|
|
7510
7454
|
HEAP64[((newOffset) >>> 3) >>> 0] = BigInt(stream.position);
|
|
7511
|
-
if (stream.getdents && offset
|
|
7455
|
+
if (stream.getdents && !offset && whence === 0) stream.getdents = null;
|
|
7512
7456
|
// reset readdir state
|
|
7513
7457
|
return 0;
|
|
7514
7458
|
} catch (e) {
|
|
@@ -7706,14 +7650,6 @@ function _wgpuComputePassEncoderSetPipeline(passPtr, pipelinePtr) {
|
|
|
7706
7650
|
pass.setPipeline(pipeline);
|
|
7707
7651
|
}
|
|
7708
7652
|
|
|
7709
|
-
function _wgpuComputePipelineGetBindGroupLayout(pipelinePtr, groupIndex) {
|
|
7710
|
-
pipelinePtr >>>= 0;
|
|
7711
|
-
var pipeline = WebGPU.getJsObject(pipelinePtr);
|
|
7712
|
-
var ptr = _emwgpuCreateBindGroupLayout(0);
|
|
7713
|
-
WebGPU.Internals.jsObjectInsert(ptr, pipeline.getBindGroupLayout(groupIndex));
|
|
7714
|
-
return ptr;
|
|
7715
|
-
}
|
|
7716
|
-
|
|
7717
7653
|
var _wgpuDeviceCreateBindGroup = function(devicePtr, descriptor) {
|
|
7718
7654
|
devicePtr >>>= 0;
|
|
7719
7655
|
descriptor >>>= 0;
|
|
@@ -8113,8 +8049,8 @@ Module["WebGPU"] = WebGPU;
|
|
|
8113
8049
|
// End JS library exports
|
|
8114
8050
|
// end include: postlibrary.js
|
|
8115
8051
|
var ASM_CONSTS = {
|
|
8116
|
-
|
|
8117
|
-
|
|
8052
|
+
2374457: () => !!Module["preinitializedWebGPUDevice"],
|
|
8053
|
+
2374508: $0 => {
|
|
8118
8054
|
const device = WebGPU.getJsObject($0);
|
|
8119
8055
|
return device.features.has("subgroups");
|
|
8120
8056
|
}
|
|
@@ -8207,40 +8143,6 @@ function __asyncjs__ReadBufferDataJs(buffer_handle, data_ptr) {
|
|
|
8207
8143
|
|
|
8208
8144
|
__asyncjs__ReadBufferDataJs.sig = "vii";
|
|
8209
8145
|
|
|
8210
|
-
function __asyncjs__CallStreamWeightsOnWeb(tfl_ids, wgpu_buffers, offsets, lengths, count) {
|
|
8211
|
-
return Asyncify.handleAsync(async () => {
|
|
8212
|
-
const callback = Module.getStreamWeightsCallback();
|
|
8213
|
-
if (typeof callback !== "function") {
|
|
8214
|
-
console.error("Stream weights callback is not registered or is not a function");
|
|
8215
|
-
return 1;
|
|
8216
|
-
}
|
|
8217
|
-
const view = new DataView(Module.HEAPU8.buffer);
|
|
8218
|
-
const tflIdsPtr = tfl_ids >>> 0;
|
|
8219
|
-
const wgpuBuffersPtr = wgpu_buffers >>> 0;
|
|
8220
|
-
const offsetsPtr = offsets >>> 0;
|
|
8221
|
-
const lengthsPtr = lengths >>> 0;
|
|
8222
|
-
const tflIdsArray = new Int32Array(count);
|
|
8223
|
-
const wgpuBuffersArray = new Uint32Array(count);
|
|
8224
|
-
const offsetsArray = new Float64Array(count);
|
|
8225
|
-
const lengthsArray = new Float64Array(count);
|
|
8226
|
-
for (let i = 0; i < count; i++) {
|
|
8227
|
-
tflIdsArray[i] = view.getInt32(tflIdsPtr + i * 4, true);
|
|
8228
|
-
wgpuBuffersArray[i] = view.getUint32(wgpuBuffersPtr + i * 4, true);
|
|
8229
|
-
offsetsArray[i] = view.getFloat64(offsetsPtr + i * 8, true);
|
|
8230
|
-
lengthsArray[i] = view.getFloat64(lengthsPtr + i * 8, true);
|
|
8231
|
-
}
|
|
8232
|
-
try {
|
|
8233
|
-
await callback(tflIdsArray, wgpuBuffersArray, offsetsArray, lengthsArray);
|
|
8234
|
-
} catch (e) {
|
|
8235
|
-
console.error("Error in streamWeightsOnWeb:", e);
|
|
8236
|
-
return 1;
|
|
8237
|
-
}
|
|
8238
|
-
return 0;
|
|
8239
|
-
});
|
|
8240
|
-
}
|
|
8241
|
-
|
|
8242
|
-
__asyncjs__CallStreamWeightsOnWeb.sig = "iiiiii";
|
|
8243
|
-
|
|
8244
8146
|
// Imports from the Wasm binary.
|
|
8245
8147
|
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;
|
|
8246
8148
|
|
|
@@ -8335,7 +8237,6 @@ var wasmImports = {
|
|
|
8335
8237
|
/** @export */ JsGetDeviceMinSubgroupSize,
|
|
8336
8238
|
/** @export */ ThrowError,
|
|
8337
8239
|
/** @export */ _Unwind_RaiseException: __Unwind_RaiseException,
|
|
8338
|
-
/** @export */ __asyncjs__CallStreamWeightsOnWeb,
|
|
8339
8240
|
/** @export */ __asyncjs__ReadBufferDataJs,
|
|
8340
8241
|
/** @export */ __syscall_dup: ___syscall_dup,
|
|
8341
8242
|
/** @export */ __syscall_faccessat: ___syscall_faccessat,
|
|
@@ -8447,7 +8348,6 @@ var wasmImports = {
|
|
|
8447
8348
|
/** @export */ wgpuComputePassEncoderEnd: _wgpuComputePassEncoderEnd,
|
|
8448
8349
|
/** @export */ wgpuComputePassEncoderSetBindGroup: _wgpuComputePassEncoderSetBindGroup,
|
|
8449
8350
|
/** @export */ wgpuComputePassEncoderSetPipeline: _wgpuComputePassEncoderSetPipeline,
|
|
8450
|
-
/** @export */ wgpuComputePipelineGetBindGroupLayout: _wgpuComputePipelineGetBindGroupLayout,
|
|
8451
8351
|
/** @export */ wgpuDeviceCreateBindGroup: _wgpuDeviceCreateBindGroup,
|
|
8452
8352
|
/** @export */ wgpuDeviceCreateBindGroupLayout: _wgpuDeviceCreateBindGroupLayout,
|
|
8453
8353
|
/** @export */ wgpuDeviceCreateCommandEncoder: _wgpuDeviceCreateCommandEncoder,
|
|
Binary file
|