@graphty/webgpu-graph-algorithms 0.6.20 → 0.6.22
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/README.md +1 -1
- package/dist/browser.js +1 -1
- package/dist/chunks/{context-VIvatQOo.js → context-B40Z6lV_.js} +39 -30
- package/dist/chunks/context-B40Z6lV_.js.map +1 -0
- package/dist/node.js +1 -1
- package/dist/src/accelerator.d.ts +1 -1
- package/dist/src/accelerator.d.ts.map +1 -1
- package/dist/src/accelerator.js +20 -1
- package/dist/src/accelerator.js.map +1 -1
- package/dist/src/algorithms/mst.d.ts +50 -0
- package/dist/src/algorithms/mst.d.ts.map +1 -0
- package/dist/src/algorithms/mst.js +245 -0
- package/dist/src/algorithms/mst.js.map +1 -0
- package/dist/src/constants.d.ts +6 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +6 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/kernel/prelude.d.ts.map +1 -1
- package/dist/src/kernel/prelude.js +7 -1
- package/dist/src/kernel/prelude.js.map +1 -1
- package/dist/src/kernels.d.ts +5 -2
- package/dist/src/kernels.d.ts.map +1 -1
- package/dist/src/kernels.js +58 -2
- package/dist/src/kernels.js.map +1 -1
- package/dist/src/types/accelerator.d.ts +7 -5
- package/dist/src/types/accelerator.d.ts.map +1 -1
- package/dist/src/types/structure.d.ts +17 -0
- package/dist/src/types/structure.d.ts.map +1 -1
- package/dist/src/wgsl/mst-best.wgsl.d.ts +13 -0
- package/dist/src/wgsl/mst-best.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/mst-best.wgsl.js +32 -0
- package/dist/src/wgsl/mst-best.wgsl.js.map +1 -0
- package/dist/src/wgsl/mst-link.wgsl.d.ts +14 -0
- package/dist/src/wgsl/mst-link.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/mst-link.wgsl.js +39 -0
- package/dist/src/wgsl/mst-link.wgsl.js.map +1 -0
- package/dist/webgpu-graph-algorithms.js +473 -162
- package/dist/webgpu-graph-algorithms.js.map +1 -1
- package/package.json +3 -3
- package/src/accelerator.ts +22 -2
- package/src/algorithms/mst.ts +269 -0
- package/src/constants.ts +6 -1
- package/src/index.ts +3 -1
- package/src/kernel/prelude.ts +7 -0
- package/src/kernels.ts +64 -3
- package/src/types/accelerator.ts +7 -3
- package/src/types/structure.ts +18 -0
- package/src/wgsl/mst-best.wgsl.ts +31 -0
- package/src/wgsl/mst-link.wgsl.ts +38 -0
- package/dist/chunks/context-VIvatQOo.js.map +0 -1
package/README.md
CHANGED
|
@@ -695,7 +695,7 @@ never relaxed silently.
|
|
|
695
695
|
|
|
696
696
|
<!-- targets-table:nvidia-lovelace-driver580 -->
|
|
697
697
|
|
|
698
|
-
Generated by `pnpm run bench:readme` from `benchmarks/results/targets.json`. Each figure is the best median the row has recorded, the baseline `bench:compare` pins: Node rows across the
|
|
698
|
+
Generated by `pnpm run bench:readme` from `benchmarks/results/targets.json`. Each figure is the best median the row has recorded, the baseline `bench:compare` pins: Node rows across the 11 session(s) of `benchmarks/results/nvidia-lovelace-driver580.json`, Chromium rows across the 3 of `benchmarks/results/nvidia-lovelace-driver0.json`.
|
|
699
699
|
|
|
700
700
|
| Id | What | Target | Measured | Status |
|
|
701
701
|
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ---------- | -------- |
|
package/dist/browser.js
CHANGED
|
@@ -109,6 +109,8 @@ const BC_BACKWARD_LEVELS_PER_SUBMIT = 64;
|
|
|
109
109
|
const APSP_TILE = 32;
|
|
110
110
|
const APSP_MAX_DISPATCHES_PER_SUBMIT = 4096;
|
|
111
111
|
const LABEL_PROP_PASSES_PER_SUBMIT = 8;
|
|
112
|
+
const BORUVKA_ROUNDS_PER_SUBMIT = 4;
|
|
113
|
+
const F32_SIGN_BIT = 2147483648;
|
|
112
114
|
const GROUP_ROW_THREAD_MAX = 32;
|
|
113
115
|
const GROUP_ROW_THREAD_LIMIT = 128;
|
|
114
116
|
const PARALLEL_MERGE_LIMIT = 65e3;
|
|
@@ -920,6 +922,7 @@ const PRELUDE_WGSL = (
|
|
|
920
922
|
const INVALID_INDEX: u32 = ${INVALID_INDEX}u;
|
|
921
923
|
const U32_MAX: u32 = ${U32_MAX}u;
|
|
922
924
|
const F32_INF_BITS: u32 = ${F32_INF_BITS}u;
|
|
925
|
+
const F32_SIGN_BIT: u32 = ${F32_SIGN_BIT}u;
|
|
923
926
|
const MAX_WORKGROUPS_PER_DIM: u32 = ${MAX_WORKGROUPS_PER_DIM}u;
|
|
924
927
|
const EXACT_TILES_PER_PASS: u32 = ${EXACT_TILES_PER_PASS}u;
|
|
925
928
|
const FA2_DIST_FLOOR: f32 = ${wgslF32Literal(FA2_DISTANCE_FLOOR)};
|
|
@@ -958,6 +961,11 @@ fn lowbias32(x0: u32) -> u32 {
|
|
|
958
961
|
fn mask_bit(w: u32, i: u32) -> bool { return ((w >> (i & 31u)) & 1u) == 1u; }
|
|
959
962
|
fn unpack_u8(w: u32, i: u32) -> u32 { return (w >> (8u * (i & 3u))) & 0xFFu; }
|
|
960
963
|
fn pair_hash(i: u32, j: u32) -> u32 { return lowbias32((min(i, j) * 0x9E3779B9u) ^ max(i, j)); }
|
|
964
|
+
fn order_key(w: f32) -> u32 {
|
|
965
|
+
let raw = bitcast<u32>(w);
|
|
966
|
+
let bits = select(raw, 0u, raw == F32_SIGN_BIT);
|
|
967
|
+
return select(bits | F32_SIGN_BIT, ~bits, (bits & F32_SIGN_BIT) != 0u);
|
|
968
|
+
}
|
|
961
969
|
fn hash_unit(h: u32) -> f32 { return f32(h >> 8u) * (1.0 / 16777216.0); }
|
|
962
970
|
fn hash_dir(h: u32, dim: u32) -> vec3f {
|
|
963
971
|
let phi = 6.283185307179586 * hash_unit(h);
|
|
@@ -3537,40 +3545,41 @@ class GpuContext {
|
|
|
3537
3545
|
}
|
|
3538
3546
|
}
|
|
3539
3547
|
export {
|
|
3540
|
-
|
|
3548
|
+
SETTLE_FLOOR_REFERENCE_NODES as $,
|
|
3541
3549
|
APSP_MAX_DISPATCHES_PER_SUBMIT as A,
|
|
3542
3550
|
BufferUsage as B,
|
|
3543
|
-
|
|
3544
|
-
|
|
3551
|
+
GRID_HUB_CELL as C,
|
|
3552
|
+
LAYOUT_TUNING_DEFAULTS as D,
|
|
3545
3553
|
EXACT_TILES_PER_PASS as E,
|
|
3546
3554
|
FUSED_FRONTIER_MAX as F,
|
|
3547
3555
|
GpuContext as G,
|
|
3548
|
-
|
|
3556
|
+
EXACT_MAX_NODES as H,
|
|
3549
3557
|
INDIRECT_ARGS_STRIDE as I,
|
|
3550
|
-
|
|
3551
|
-
|
|
3558
|
+
SETTLE_FLOOR_UNBOUNDED as J,
|
|
3559
|
+
GRID_BBOX_MARGIN as K,
|
|
3552
3560
|
LABEL_PROP_PASSES_PER_SUBMIT as L,
|
|
3553
3561
|
MAX_WORKGROUPS_PER_DIM as M,
|
|
3554
|
-
|
|
3555
|
-
|
|
3562
|
+
GRID_EXTENT_FLOOR as N,
|
|
3563
|
+
FR_ADAPTIVE_MAX_ITERATIONS as O,
|
|
3556
3564
|
PARALLEL_MERGE_LIMIT as P,
|
|
3557
|
-
|
|
3565
|
+
FR_START_TEMPERATURE as Q,
|
|
3558
3566
|
RADIX_BINS as R,
|
|
3559
3567
|
STATE_HEADER_BYTES as S,
|
|
3560
3568
|
TRACE_RECORD_BYTES as T,
|
|
3561
3569
|
UNIFORM_SLOT_BYTES as U,
|
|
3562
|
-
|
|
3570
|
+
FA2_FLAG_ADAPTIVE as V,
|
|
3563
3571
|
WebGpuGraphError as W,
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3572
|
+
SETTLE_FLOOR_FRACTION as X,
|
|
3573
|
+
FR_REHEAT_FRACTION as Y,
|
|
3574
|
+
FR_DEFAULTS as Z,
|
|
3575
|
+
SE_DEFAULTS as _,
|
|
3568
3576
|
WGSL_RESERVED_WORDS as a,
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3577
|
+
SE_SCALE_REFERENCE_NODES as a0,
|
|
3578
|
+
ARC_WINDOW_ALIGN as a1,
|
|
3579
|
+
PASSTHROUGH_FORMAT_CODES as a2,
|
|
3580
|
+
STORAGE_ALIGN as a3,
|
|
3581
|
+
WORKGROUP_SIZE as a4,
|
|
3582
|
+
isSoftwareAdapter as a5,
|
|
3574
3583
|
U32_MAX as b,
|
|
3575
3584
|
MAX_LEVELS_PER_SUBMIT as c,
|
|
3576
3585
|
deviceLostError as d,
|
|
@@ -3586,15 +3595,15 @@ export {
|
|
|
3586
3595
|
GROUP_ROW_THREAD_MAX as n,
|
|
3587
3596
|
GROUP_ROW_THREAD_LIMIT as o,
|
|
3588
3597
|
GROUP_HASH_LOAD_FACTOR as p,
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3598
|
+
BORUVKA_ROUNDS_PER_SUBMIT as q,
|
|
3599
|
+
GRID_COARSEST_SIDE as r,
|
|
3600
|
+
GRID_MIN_SIDE as s,
|
|
3601
|
+
GRID_SORT_BITS as t,
|
|
3602
|
+
FA2_DEFAULTS as u,
|
|
3603
|
+
MAX_ITERATIONS_PER_STEP as v,
|
|
3604
|
+
MAX_1D_ITEMS as w,
|
|
3605
|
+
hasErrorCode as x,
|
|
3606
|
+
FA2_FLAG_FIRST as y,
|
|
3607
|
+
PARTIAL_BYTES as z
|
|
3599
3608
|
};
|
|
3600
|
-
//# sourceMappingURL=context-
|
|
3609
|
+
//# sourceMappingURL=context-B40Z6lV_.js.map
|