@graphty/webgpu-graph-algorithms 0.6.6 → 0.6.8
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/browser.js +1 -1
- package/dist/chunks/{context-DiSr6eiz.js → context-Cezi7qpi.js} +15 -5
- package/dist/chunks/{context-DiSr6eiz.js.map → context-Cezi7qpi.js.map} +1 -1
- package/dist/node.js +19 -11
- package/dist/node.js.map +1 -1
- package/dist/src/algorithms/pagerank.d.ts.map +1 -1
- package/dist/src/algorithms/pagerank.js +19 -5
- package/dist/src/algorithms/pagerank.js.map +1 -1
- package/dist/src/algorithms/power-iteration.d.ts.map +1 -1
- package/dist/src/algorithms/power-iteration.js +8 -2
- package/dist/src/algorithms/power-iteration.js.map +1 -1
- package/dist/src/memory/residency.js +14 -4
- package/dist/src/memory/residency.js.map +1 -1
- package/dist/src/node/index.d.ts +13 -8
- package/dist/src/node/index.d.ts.map +1 -1
- package/dist/src/node/index.js +36 -17
- package/dist/src/node/index.js.map +1 -1
- package/dist/webgpu-graph-algorithms.js +22 -7
- package/dist/webgpu-graph-algorithms.js.map +1 -1
- package/package.json +5 -4
- package/src/node/index.ts +42 -18
package/dist/browser.js
CHANGED
|
@@ -2796,7 +2796,9 @@ class GraphResidency {
|
|
|
2796
2796
|
});
|
|
2797
2797
|
}
|
|
2798
2798
|
/**
|
|
2799
|
-
* One resident per array (spec 4.3: views upload in perArray mode, never into the arena).
|
|
2799
|
+
* One resident per array (spec 4.3: views upload in perArray mode, never into the arena). An empty array (the
|
|
2800
|
+
* colIdx of an edgeless directed reverse view, the src / dst of an edgeless edgeList) is skipped: spec 5.6 never
|
|
2801
|
+
* uploads a zero-length array, and Kernel.bind rejects a zero-size binding, so it is absent as in core().
|
|
2800
2802
|
* @param record - the owning record
|
|
2801
2803
|
* @param arrays - the named arrays
|
|
2802
2804
|
* @param label - the buffer label prefix
|
|
@@ -2805,6 +2807,9 @@ class GraphResidency {
|
|
|
2805
2807
|
separateArrays(record, arrays, label) {
|
|
2806
2808
|
const bindings = {};
|
|
2807
2809
|
for (const [name, array] of arrays) {
|
|
2810
|
+
if (array.byteLength === 0) {
|
|
2811
|
+
continue;
|
|
2812
|
+
}
|
|
2808
2813
|
const resident = this.upload(record, array, array, `${label}:${name}`);
|
|
2809
2814
|
bindings[name] = { buffer: resident.buffer, offset: 0, size: resident.byteLength, window: null };
|
|
2810
2815
|
}
|
|
@@ -2818,14 +2823,19 @@ class GraphResidency {
|
|
|
2818
2823
|
* lengths, so keying the packed buffer on `rev.rowPtr` would make the packed and the unpacked view of one
|
|
2819
2824
|
* snapshot collide -- whichever was built second would get the other's buffer. The record still owns the
|
|
2820
2825
|
* resident, so release(s) destroys it with the rest. Offsets are STORAGE_ALIGN-aligned because Kernel.bind
|
|
2821
|
-
* rejects any other offset synchronously (E_INVALID_ARGUMENT { argument: "offset" }).
|
|
2826
|
+
* rejects any other offset synchronously (E_INVALID_ARGUMENT { argument: "offset" }). Empty arrays are left
|
|
2827
|
+
* out as in separateArrays; when nothing is left, nothing is uploaded.
|
|
2822
2828
|
* @param record - the owning record
|
|
2823
|
-
* @param
|
|
2829
|
+
* @param all - the named arrays, in buffer order
|
|
2824
2830
|
* @param key - the marker object the resident is keyed on
|
|
2825
2831
|
* @param label - the buffer label
|
|
2826
2832
|
* @returns the bindings by name, all into the one buffer
|
|
2827
2833
|
*/
|
|
2828
|
-
packArrays(record,
|
|
2834
|
+
packArrays(record, all, key, label) {
|
|
2835
|
+
const arrays = all.filter(([, array]) => array.byteLength > 0);
|
|
2836
|
+
if (arrays.length === 0) {
|
|
2837
|
+
return Object.freeze({});
|
|
2838
|
+
}
|
|
2829
2839
|
const offsets = [];
|
|
2830
2840
|
let total = 0;
|
|
2831
2841
|
for (const [, array] of arrays) {
|
|
@@ -3542,4 +3552,4 @@ export {
|
|
|
3542
3552
|
SETTLE_FLOOR_FRACTION as y,
|
|
3543
3553
|
FR_REHEAT_FRACTION as z
|
|
3544
3554
|
};
|
|
3545
|
-
//# sourceMappingURL=context-
|
|
3555
|
+
//# sourceMappingURL=context-Cezi7qpi.js.map
|