databonk 0.0.4 → 0.2.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.
Files changed (45) hide show
  1. package/README.md +491 -96
  2. package/dist/dataframe-Bz1B7bIr.d.cts +1001 -0
  3. package/dist/dataframe-Bz1B7bIr.d.ts +1001 -0
  4. package/dist/index.cjs +5 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +366 -0
  7. package/dist/index.d.ts +354 -31
  8. package/dist/index.js +4 -40
  9. package/dist/index.js.map +1 -1
  10. package/dist/parallel-fv5h4BkA.d.cts +152 -0
  11. package/dist/parallel-fv5h4BkA.d.ts +152 -0
  12. package/dist/parquet.cjs +3 -0
  13. package/dist/parquet.cjs.map +1 -0
  14. package/dist/parquet.d.cts +57 -0
  15. package/dist/parquet.d.ts +57 -0
  16. package/dist/parquet.js +3 -0
  17. package/dist/parquet.js.map +1 -0
  18. package/dist/scalar.wasm +0 -0
  19. package/dist/simd-threads.wasm +0 -0
  20. package/dist/simd.wasm +0 -0
  21. package/dist/workers.cjs +102 -0
  22. package/dist/workers.cjs.map +1 -0
  23. package/dist/workers.d.cts +74 -0
  24. package/dist/workers.d.ts +74 -0
  25. package/dist/workers.js +102 -0
  26. package/dist/workers.js.map +1 -0
  27. package/package.json +93 -32
  28. package/build/release.d.ts +0 -719
  29. package/build/release.js +0 -774
  30. package/build/release.wasm +0 -0
  31. package/build/release.wasm.map +0 -1
  32. package/build/release.wat +0 -22633
  33. package/dist/dataframe.d.ts +0 -82
  34. package/dist/dataframe.d.ts.map +0 -1
  35. package/dist/dataframe.js +0 -318
  36. package/dist/dataframe.js.map +0 -1
  37. package/dist/index.d.ts.map +0 -1
  38. package/dist/loader.d.ts +0 -86
  39. package/dist/loader.d.ts.map +0 -1
  40. package/dist/loader.js +0 -147
  41. package/dist/loader.js.map +0 -1
  42. package/dist/shared-memory.d.ts +0 -64
  43. package/dist/shared-memory.d.ts.map +0 -1
  44. package/dist/shared-memory.js +0 -113
  45. package/dist/shared-memory.js.map +0 -1
@@ -1,82 +0,0 @@
1
- /**
2
- * JavaScript DataFrame wrapper for Databonk WASM module
3
- * Provides a Pandas-like API
4
- */
5
- import type { DatabonkModule } from './loader';
6
- import { ColumnType, ColumnView } from './shared-memory';
7
- /** Column specification for creating DataFrames */
8
- export interface ColumnSpec {
9
- name: string;
10
- data: Int32Array | Float32Array | Float64Array;
11
- type?: ColumnType;
12
- }
13
- /** GroupBy builder for fluent aggregation API */
14
- export declare class GroupByBuilder {
15
- private df;
16
- private keyColumn;
17
- private maxKey;
18
- constructor(df: DatabonkDataFrame, keyColumn: string, maxKey?: number);
19
- /** Sum aggregation on specified columns */
20
- sum(...valueColumns: string[]): DatabonkDataFrame;
21
- /** Mean aggregation on specified columns */
22
- mean(...valueColumns: string[]): DatabonkDataFrame;
23
- }
24
- /**
25
- * Main DataFrame class
26
- * Wraps the WASM DataFrame with a JavaScript-friendly API
27
- */
28
- export declare class DatabonkDataFrame {
29
- private module;
30
- private ptr;
31
- private _columnNames;
32
- private _rowCount;
33
- private stringPtrs;
34
- constructor(module: DatabonkModule, ptr: number);
35
- /** Get the number of rows */
36
- get rowCount(): number;
37
- /** Get the number of columns */
38
- get columnCount(): number;
39
- /** Get column names */
40
- get columns(): string[];
41
- /** Get the internal WASM pointer */
42
- get wasmPtr(): number;
43
- /**
44
- * Create a DataFrame from typed arrays
45
- */
46
- static fromTypedArrays(module: DatabonkModule, columns: ColumnSpec[]): Promise<DatabonkDataFrame>;
47
- /** Allocate a string in WASM memory and track it for cleanup */
48
- private allocString;
49
- /** Free tracked string pointers */
50
- private freeStrings;
51
- /** Sum of a column */
52
- sum(columnName: string): number;
53
- /** Mean of a column */
54
- mean(columnName: string): number;
55
- /** Minimum of a column */
56
- min(columnName: string): number;
57
- /** Maximum of a column */
58
- max(columnName: string): number;
59
- /** Count non-null values in a column */
60
- count(columnName: string): number;
61
- /** Add two columns, storing result in a new column */
62
- add(colA: string, colB: string, resultName: string): this;
63
- /** Subtract columns (colA - colB), storing result in a new column */
64
- sub(colA: string, colB: string, resultName: string): this;
65
- /** Multiply column by scalar, storing result in a new column */
66
- scalarMul(colName: string, scalar: number, resultName: string): this;
67
- /** Start a GroupBy operation */
68
- groupBy(keyColumn: string, maxKey?: number): GroupByBuilder;
69
- /** Internal: Perform groupBy sum */
70
- _groupBySum(keyColumn: string, valueColumns: string[], maxKey: number): DatabonkDataFrame;
71
- /** Internal: Perform groupBy mean */
72
- _groupByMean(keyColumn: string, valueColumns: string[], maxKey: number): DatabonkDataFrame;
73
- /** Inner join with another DataFrame */
74
- innerJoin(other: DatabonkDataFrame, leftKey: string, rightKey: string): DatabonkDataFrame;
75
- /** Get a zero-copy view of a column's data */
76
- getColumnView(columnName: string): ColumnView<Int32Array | Float32Array | Float64Array> | null;
77
- /** Check if a column exists */
78
- hasColumn(columnName: string): boolean;
79
- /** Free the DataFrame and associated WASM memory */
80
- free(): void;
81
- }
82
- //# sourceMappingURL=dataframe.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataframe.d.ts","sourceRoot":"","sources":["../src/dataframe.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,UAAU,EAA4D,MAAM,iBAAiB,CAAC;AAEnH,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,CAAC;IAC/C,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,iDAAiD;AACjD,qBAAa,cAAc;IACzB,OAAO,CAAC,EAAE,CAAoB;IAC9B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAS;gBAEX,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAAY;IAM1E,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AI;IAUzD,qEAAqE;IACrE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAUzD,gEAAgE;IAChE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAapE,gCAAgC;IAChC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAAY,GAAG,cAAc;IAIhE,oCAAoC;IACpC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,iBAAiB;IAuCzF,qCAAqC;IACrC,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,iBAAiB;IA8B1F,wCAAwC;IACxC,SAAS,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB;IA2BzF,8CAA8C;IAC9C,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,UAAU,GAAG,YAAY,GAAG,YAAY,CAAC,GAAG,IAAI;IAgB9F,+BAA+B;IAC/B,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAWtC,oDAAoD;IACpD,IAAI,IAAI,IAAI;CAOb"}
package/dist/dataframe.js DELETED
@@ -1,318 +0,0 @@
1
- /**
2
- * JavaScript DataFrame wrapper for Databonk WASM module
3
- * Provides a Pandas-like API
4
- */
5
- import { ColumnType, createTypedArrayView, allocateAndCopy } from './shared-memory';
6
- /** GroupBy builder for fluent aggregation API */
7
- export class GroupByBuilder {
8
- df;
9
- keyColumn;
10
- maxKey;
11
- constructor(df, keyColumn, maxKey = 256) {
12
- this.df = df;
13
- this.keyColumn = keyColumn;
14
- this.maxKey = maxKey;
15
- }
16
- /** Sum aggregation on specified columns */
17
- sum(...valueColumns) {
18
- return this.df._groupBySum(this.keyColumn, valueColumns, this.maxKey);
19
- }
20
- /** Mean aggregation on specified columns */
21
- mean(...valueColumns) {
22
- return this.df._groupByMean(this.keyColumn, valueColumns, this.maxKey);
23
- }
24
- }
25
- /**
26
- * Main DataFrame class
27
- * Wraps the WASM DataFrame with a JavaScript-friendly API
28
- */
29
- export class DatabonkDataFrame {
30
- module;
31
- ptr;
32
- _columnNames;
33
- _rowCount;
34
- stringPtrs = [];
35
- constructor(module, ptr) {
36
- this.module = module;
37
- this.ptr = ptr;
38
- this._rowCount = module.exports.getRowCount(ptr);
39
- this._columnNames = [];
40
- }
41
- /** Get the number of rows */
42
- get rowCount() {
43
- return this._rowCount;
44
- }
45
- /** Get the number of columns */
46
- get columnCount() {
47
- return this.module.exports.getColumnCount(this.ptr);
48
- }
49
- /** Get column names */
50
- get columns() {
51
- return [...this._columnNames];
52
- }
53
- /** Get the internal WASM pointer */
54
- get wasmPtr() {
55
- return this.ptr;
56
- }
57
- /**
58
- * Create a DataFrame from typed arrays
59
- */
60
- static async fromTypedArrays(module, columns) {
61
- if (columns.length === 0) {
62
- throw new Error('At least one column is required');
63
- }
64
- const rowCount = columns[0].data.length;
65
- // Validate all columns have same length
66
- for (const col of columns) {
67
- if (col.data.length !== rowCount) {
68
- throw new Error(`Column "${col.name}" has ${col.data.length} rows, expected ${rowCount}`);
69
- }
70
- }
71
- const { exports } = module;
72
- // Create an empty DataFrame with the row count
73
- const dfPtr = exports.createEmptyDataFrameWithRows(rowCount);
74
- // Add each column
75
- const columnNames = [];
76
- const stringPtrsToFree = [];
77
- for (const col of columns) {
78
- // Copy data to WASM memory
79
- const dataPtr = allocateAndCopy(module, col.data);
80
- // Allocate string for column name
81
- const namePtr = module.allocString(col.name);
82
- stringPtrsToFree.push(namePtr);
83
- // Determine type from data or explicit type
84
- let type;
85
- if (col.type !== undefined) {
86
- type = col.type;
87
- }
88
- else if (col.data instanceof Int32Array) {
89
- type = ColumnType.Int32;
90
- }
91
- else if (col.data instanceof Float32Array) {
92
- type = ColumnType.Float32;
93
- }
94
- else {
95
- type = ColumnType.Float64;
96
- }
97
- // Add column based on type
98
- switch (type) {
99
- case ColumnType.Int32:
100
- exports.addInt32ColumnToDataFrame(dfPtr, namePtr, dataPtr, rowCount);
101
- break;
102
- case ColumnType.Float32:
103
- exports.addFloat32ColumnToDataFrame(dfPtr, namePtr, dataPtr, rowCount);
104
- break;
105
- case ColumnType.Float64:
106
- exports.addFloat64ColumnToDataFrame(dfPtr, namePtr, dataPtr, rowCount);
107
- break;
108
- case ColumnType.Int64:
109
- exports.addInt64ColumnToDataFrame(dfPtr, namePtr, dataPtr, rowCount);
110
- break;
111
- default:
112
- throw new Error(`Unsupported column type: ${type}`);
113
- }
114
- // Free the data pointer (data was copied into the column)
115
- exports.freeBuffer(dataPtr);
116
- columnNames.push(col.name);
117
- }
118
- // Free string pointers
119
- for (const ptr of stringPtrsToFree) {
120
- module.freePtr(ptr);
121
- }
122
- // Create the wrapper
123
- const df = new DatabonkDataFrame(module, dfPtr);
124
- df._rowCount = rowCount;
125
- df._columnNames = columnNames;
126
- return df;
127
- }
128
- /** Allocate a string in WASM memory and track it for cleanup */
129
- allocString(str) {
130
- const ptr = this.module.allocString(str);
131
- this.stringPtrs.push(ptr);
132
- return ptr;
133
- }
134
- /** Free tracked string pointers */
135
- freeStrings() {
136
- for (const ptr of this.stringPtrs) {
137
- this.module.freePtr(ptr);
138
- }
139
- this.stringPtrs = [];
140
- }
141
- // ==========================================================================
142
- // Aggregations
143
- // ==========================================================================
144
- /** Sum of a column */
145
- sum(columnName) {
146
- const namePtr = this.allocString(columnName);
147
- const result = this.module.exports.dfSum(this.ptr, namePtr);
148
- this.freeStrings();
149
- return result;
150
- }
151
- /** Mean of a column */
152
- mean(columnName) {
153
- const namePtr = this.allocString(columnName);
154
- const result = this.module.exports.dfMean(this.ptr, namePtr);
155
- this.freeStrings();
156
- return result;
157
- }
158
- /** Minimum of a column */
159
- min(columnName) {
160
- const namePtr = this.allocString(columnName);
161
- const result = this.module.exports.dfMin(this.ptr, namePtr);
162
- this.freeStrings();
163
- return result;
164
- }
165
- /** Maximum of a column */
166
- max(columnName) {
167
- const namePtr = this.allocString(columnName);
168
- const result = this.module.exports.dfMax(this.ptr, namePtr);
169
- this.freeStrings();
170
- return result;
171
- }
172
- /** Count non-null values in a column */
173
- count(columnName) {
174
- const namePtr = this.allocString(columnName);
175
- const result = this.module.exports.dfCount(this.ptr, namePtr);
176
- this.freeStrings();
177
- return result;
178
- }
179
- // ==========================================================================
180
- // Column Math
181
- // ==========================================================================
182
- /** Add two columns, storing result in a new column */
183
- add(colA, colB, resultName) {
184
- const aPtr = this.allocString(colA);
185
- const bPtr = this.allocString(colB);
186
- const resultPtr = this.allocString(resultName);
187
- this.module.exports.dfAdd(this.ptr, aPtr, bPtr, resultPtr);
188
- this._columnNames.push(resultName);
189
- this.freeStrings();
190
- return this;
191
- }
192
- /** Subtract columns (colA - colB), storing result in a new column */
193
- sub(colA, colB, resultName) {
194
- const aPtr = this.allocString(colA);
195
- const bPtr = this.allocString(colB);
196
- const resultPtr = this.allocString(resultName);
197
- this.module.exports.dfSub(this.ptr, aPtr, bPtr, resultPtr);
198
- this._columnNames.push(resultName);
199
- this.freeStrings();
200
- return this;
201
- }
202
- /** Multiply column by scalar, storing result in a new column */
203
- scalarMul(colName, scalar, resultName) {
204
- const namePtr = this.allocString(colName);
205
- const resultPtr = this.allocString(resultName);
206
- this.module.exports.dfScalarMul(this.ptr, namePtr, scalar, resultPtr);
207
- this._columnNames.push(resultName);
208
- this.freeStrings();
209
- return this;
210
- }
211
- // ==========================================================================
212
- // GroupBy
213
- // ==========================================================================
214
- /** Start a GroupBy operation */
215
- groupBy(keyColumn, maxKey = 256) {
216
- return new GroupByBuilder(this, keyColumn, maxKey);
217
- }
218
- /** Internal: Perform groupBy sum */
219
- _groupBySum(keyColumn, valueColumns, maxKey) {
220
- if (this.ptr === 0) {
221
- throw new Error('Invalid DataFrame pointer');
222
- }
223
- // For simplicity, we perform groupBy on each value column separately
224
- // and create a result DataFrame. This works with the current WASM exports.
225
- // A more complete implementation would handle multiple columns in WASM.
226
- const keyPtr = this.allocString(keyColumn);
227
- // For now, we use the single-column version
228
- // The WASM module's groupBySum expects a string[] which is complex to pass
229
- // So we'll return an error if more than one value column is requested
230
- if (valueColumns.length > 1) {
231
- this.freeStrings();
232
- throw new Error('GroupBy with multiple value columns not yet supported. Use single column.');
233
- }
234
- if (valueColumns.length === 0) {
235
- this.freeStrings();
236
- throw new Error('At least one value column required');
237
- }
238
- const valuePtr = this.allocString(valueColumns[0]);
239
- // Note: The WASM groupBySum expects string[], which requires special handling
240
- // For now, this will likely not work correctly without WASM changes
241
- // We'll leave the call in place but the result may be invalid
242
- const resultPtr = this.module.exports.groupBySum(this.ptr, keyPtr, valuePtr, maxKey);
243
- this.freeStrings();
244
- const result = new DatabonkDataFrame(this.module, resultPtr);
245
- result._columnNames = [keyColumn, ...valueColumns];
246
- return result;
247
- }
248
- /** Internal: Perform groupBy mean */
249
- _groupByMean(keyColumn, valueColumns, maxKey) {
250
- if (this.ptr === 0) {
251
- throw new Error('Invalid DataFrame pointer');
252
- }
253
- if (valueColumns.length > 1) {
254
- throw new Error('GroupBy with multiple value columns not yet supported. Use single column.');
255
- }
256
- if (valueColumns.length === 0) {
257
- throw new Error('At least one value column required');
258
- }
259
- const keyPtr = this.allocString(keyColumn);
260
- const valuePtr = this.allocString(valueColumns[0]);
261
- const resultPtr = this.module.exports.groupByMeanAgg(this.ptr, keyPtr, valuePtr, maxKey);
262
- this.freeStrings();
263
- const result = new DatabonkDataFrame(this.module, resultPtr);
264
- result._columnNames = [keyColumn, ...valueColumns];
265
- return result;
266
- }
267
- // ==========================================================================
268
- // Joins
269
- // ==========================================================================
270
- /** Inner join with another DataFrame */
271
- innerJoin(other, leftKey, rightKey) {
272
- const leftKeyPtr = this.allocString(leftKey);
273
- const rightKeyPtr = this.allocString(rightKey);
274
- const resultPtr = this.module.exports.innerJoin(this.ptr, other.ptr, leftKeyPtr, rightKeyPtr);
275
- this.freeStrings();
276
- const result = new DatabonkDataFrame(this.module, resultPtr);
277
- // Merge column names
278
- result._columnNames = [
279
- ...this._columnNames,
280
- ...other._columnNames.filter(n => n !== rightKey && !this._columnNames.includes(n))
281
- ];
282
- return result;
283
- }
284
- // ==========================================================================
285
- // Column Access
286
- // ==========================================================================
287
- /** Get a zero-copy view of a column's data */
288
- getColumnView(columnName) {
289
- const namePtr = this.allocString(columnName);
290
- const ptr = this.module.exports.getColumnPtr(this.ptr, namePtr);
291
- const length = this.module.exports.getColumnLength(this.ptr, namePtr);
292
- const type = this.module.exports.getColumnType(this.ptr, namePtr);
293
- this.freeStrings();
294
- if (ptr === 0 || length === 0) {
295
- return null;
296
- }
297
- return createTypedArrayView(this.module, ptr, length, type);
298
- }
299
- /** Check if a column exists */
300
- hasColumn(columnName) {
301
- const namePtr = this.allocString(columnName);
302
- const result = this.module.exports.hasColumn(this.ptr, namePtr);
303
- this.freeStrings();
304
- return result;
305
- }
306
- // ==========================================================================
307
- // Cleanup
308
- // ==========================================================================
309
- /** Free the DataFrame and associated WASM memory */
310
- free() {
311
- if (this.ptr !== 0) {
312
- this.module.exports.freeDataFrame(this.ptr);
313
- this.ptr = 0;
314
- }
315
- this.freeStrings();
316
- }
317
- }
318
- //# sourceMappingURL=dataframe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataframe.js","sourceRoot":"","sources":["../src/dataframe.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,UAAU,EAAc,oBAAoB,EAAE,eAAe,EAAqB,MAAM,iBAAiB,CAAC;AASnH,iDAAiD;AACjD,MAAM,OAAO,cAAc;IACjB,EAAE,CAAoB;IACtB,SAAS,CAAS;IAClB,MAAM,CAAS;IAEvB,YAAY,EAAqB,EAAE,SAAiB,EAAE,SAAiB,GAAG;QACxE,IAAI,CAAC,EAAE,GAAG,E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-1,86 +0,0 @@
1
- /**
2
- * WASM Module Loader with SharedArrayBuffer support
3
- */
4
- /** WASM module exports type */
5
- export interface DatabonkWasm {
6
- memory: WebAssembly.Memory;
7
- allocateBuffer(byteLength: number): number;
8
- freeBuffer(ptr: number): void;
9
- createDataFrame(rowCount: number, columnNames: number, // pointer to string array
10
- columnTypes: number, // pointer to i32 array
11
- dataPtrs: number): number;
12
- createEmptyDataFrameWithRows(rowCount: number): number;
13
- addInt32ColumnToDataFrame(df: number, name: number, dataPtr: number, length: number): void;
14
- addFloat32ColumnToDataFrame(df: number, name: number, dataPtr: number, length: number): void;
15
- addFloat64ColumnToDataFrame(df: number, name: number, dataPtr: number, length: number): void;
16
- addInt64ColumnToDataFrame(df: number, name: number, dataPtr: number, length: number): void;
17
- simdSumF32(ptr: number, length: number): number;
18
- simdSumF64(ptr: number, length: number): number;
19
- simdMinF32(ptr: number, length: number): number;
20
- simdMinF64(ptr: number, length: number): number;
21
- simdMaxF32(ptr: number, length: number): number;
22
- simdMaxF64(ptr: number, length: number): number;
23
- getRowCount(df: number): number;
24
- getColumnCount(df: number): number;
25
- getColumnPtr(df: number, columnName: number): number;
26
- getColumnLength(df: number, columnName: number): number;
27
- getColumnType(df: number, columnName: number): number;
28
- hasColumn(df: number, columnName: number): boolean;
29
- freeDataFrame(df: number): void;
30
- dfSum(df: number, columnName: number): number;
31
- dfMean(df: number, columnName: number): number;
32
- dfMin(df: number, columnName: number): number;
33
- dfMax(df: number, columnName: number): number;
34
- dfCount(df: number, columnName: number): number;
35
- dfAdd(df: number, colA: number, colB: number, resultName: number): void;
36
- dfSub(df: number, colA: number, colB: number, resultName: number): void;
37
- dfScalarMul(df: number, colName: number, scalar: number, resultName: number): void;
38
- groupBySum(df: number, keyColumn: number, valueColumns: number, maxKey: number): number;
39
- groupByMeanAgg(df: number, keyColumn: number, valueColumns: number, maxKey: number): number;
40
- innerJoin(left: number, right: number, leftKey: number, rightKey: number): number;
41
- __new(size: number, id: number): number;
42
- __pin(ptr: number): number;
43
- __unpin(ptr: number): void;
44
- __collect(): void;
45
- }
46
- /** Loader options */
47
- export interface LoaderOptions {
48
- /** Path to WASM file (default: build/release.wasm) */
49
- wasmPath?: string;
50
- /** Initial memory pages (64KB each, default: 256 = 16MB) */
51
- initialMemory?: number;
52
- /** Maximum memory pages (default: 16384 = 1GB) */
53
- maximumMemory?: number;
54
- /** Use shared memory for SharedArrayBuffer support */
55
- sharedMemory?: boolean;
56
- }
57
- /** Module instance with memory access helpers */
58
- export interface DatabonkModule {
59
- /** WASM exports */
60
- exports: DatabonkWasm;
61
- /** Memory buffer (may be SharedArrayBuffer) */
62
- memory: WebAssembly.Memory;
63
- /** Check if using shared memory */
64
- isSharedMemory: boolean;
65
- /** Get Int32Array view into WASM memory */
66
- getInt32View(ptr: number, length: number): Int32Array;
67
- /** Get Float32Array view into WASM memory */
68
- getFloat32View(ptr: number, length: number): Float32Array;
69
- /** Get Float64Array view into WASM memory */
70
- getFloat64View(ptr: number, length: number): Float64Array;
71
- /** Get Uint8Array view into WASM memory */
72
- getUint8View(ptr: number, length: number): Uint8Array;
73
- /** Allocate string in WASM memory */
74
- allocString(str: string): number;
75
- /** Free WASM memory */
76
- freePtr(ptr: number): void;
77
- }
78
- /**
79
- * Load the Databonk WASM module
80
- */
81
- export declare function loadDatabonk(options?: LoaderOptions): Promise<DatabonkModule>;
82
- /**
83
- * Check if SharedArrayBuffer is available
84
- */
85
- export declare function isSharedArrayBufferSupported(): boolean;
86
- //# sourceMappingURL=loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,+BAA+B;AAC/B,MAAM,WAAW,YAAY;IAE3B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;IAG3B,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CA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IAC1D,6CAA6C;IAC7C,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC;IAC1D,2CAA2C;IAC3C,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAEtD,qCAAqC;IACrC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,uBAAuB;IACvB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CA8IvF;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAMtD"}
package/dist/loader.js DELETED
@@ -1,147 +0,0 @@
1
- /**
2
- * WASM Module Loader with SharedArrayBuffer support
3
- */
4
- import { fileURLToPath } from 'url';
5
- import { dirname, join } from 'path';
6
- import { readFile } from 'fs/promises';
7
- /**
8
- * Load the Databonk WASM module
9
- */
10
- export async function loadDatabonk(options = {}) {
11
- const { wasmPath, initialMemory = 256, maximumMemory = 16384, sharedMemory = true, } = options;
12
- // Create memory (shared if supported)
13
- let memory;
14
- let isSharedMemory = false;
15
- try {
16
- if (sharedMemory && typeof SharedArrayBuffer !== 'undefined') {
17
- memory = new WebAssembly.Memory({
18
- initial: initialMemory,
19
- maximum: maximumMemory,
20
- shared: true,
21
- });
22
- isSharedMemory = true;
23
- }
24
- else {
25
- memory = new WebAssembly.Memory({
26
- initial: initialMemory,
27
- maximum: maximumMemory,
28
- });
29
- }
30
- }
31
- catch {
32
- // Fall back to non-shared memory
33
- memory = new WebAssembly.Memory({
34
- initial: initialMemory,
35
- maximum: maximumMemory,
36
- });
37
- }
38
- // Load WASM binary
39
- let wasmBinary;
40
- if (wasmPath) {
41
- // Load from specified path
42
- if (typeof window !== 'undefined') {
43
- // Browser
44
- const response = await fetch(wasmPath);
45
- wasmBinary = await response.arrayBuffer();
46
- }
47
- else {
48
- // Node.js
49
- const buffer = await readFile(wasmPath);
50
- wasmBinary = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
51
- }
52
- }
53
- else {
54
- // Try default paths
55
- try {
56
- if (typeof window !== 'undefined') {
57
- const response = await fetch('./build/release.wasm');
58
- wasmBinary = await response.arrayBuffer();
59
- }
60
- else {
61
- // Node.js - try to find the wasm file relative to this module
62
- const __filename = fileURLToPath(import.meta.url);
63
- const __dirname = dirname(__filename);
64
- const defaultPath = join(__dirname, '..', 'build', 'release.wasm');
65
- const buffer = await readFile(defaultPath);
66
- wasmBinary = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
67
- }
68
- }
69
- catch {
70
- throw new Error('Could not load WASM file. Please specify wasmPath option.');
71
- }
72
- }
73
- // Imports for WASM module
74
- const imports = {
75
- env: {
76
- memory,
77
- abort(msgPtr, filePtr, line, column) {
78
- console.error(`WASM abort at ${line}:${column}`);
79
- throw new Error('WASM abort');
80
- },
81
- },
82
- };
83
- // Instantiate WASM module
84
- const { instance } = await WebAssembly.instantiate(wasmBinary, imports);
85
- const exports = instance.exports;
86
- // Create module interface
87
- const module = {
88
- exports,
89
- memory,
90
- isSharedMemory,
91
- getInt32View(ptr, length) {
92
- return new Int32Array(memory.buffer, ptr, length);
93
- },
94
- getFloat32View(ptr, length) {
95
- return new Float32Array(memory.buffer, ptr, length);
96
- },
97
- getFloat64View(ptr, length) {
98
- return new Float64Array(memory.buffer, ptr, length);
99
- },
100
- getUint8View(ptr, length) {
101
- return new Uint8Array(memory.buffer, ptr, length);
102
- },
103
- allocString(str) {
104
- // AssemblyScript string allocation using the runtime
105
- // Strings in AssemblyScript are UTF-16 encoded with a specific header format
106
- // The runtime's __new function allocates managed memory with a type header
107
- // String type ID in AssemblyScript is 2
108
- const STRING_ID = 2;
109
- const byteLength = str.length * 2; // UTF-16
110
- // Allocate string using __new (includes runtime header)
111
- const ptr = exports.__new(byteLength, STRING_ID);
112
- // Write UTF-16 data directly after the header
113
- // __new returns a pointer to the data portion (after the header)
114
- const dataView = new Uint16Array(memory.buffer, ptr, str.length);
115
- for (let i = 0; i < str.length; i++) {
116
- dataView[i] = str.charCodeAt(i);
117
- }
118
- // Pin the string so it won't be garbage collected during use
119
- exports.__pin(ptr);
120
- return ptr;
121
- },
122
- freePtr(ptr) {
123
- // For runtime-managed objects (like strings), unpin them
124
- // The GC will reclaim them when appropriate
125
- try {
126
- exports.__unpin(ptr);
127
- }
128
- catch {
129
- // If unpin fails, try freeBuffer for raw allocations
130
- exports.freeBuffer(ptr);
131
- }
132
- },
133
- };
134
- return module;
135
- }
136
- /**
137
- * Check if SharedArrayBuffer is available
138
- */
139
- export function isSharedArrayBufferSupported() {
140
- try {
141
- return typeof SharedArrayBuffer !== 'undefined';
142
- }
143
- catch {
144
- return false;
145
- }
146
- }
147
- //# sourceMappingURL=loader.js.map