@graphty/webgpu-graph-algorithms 0.6.4 → 0.6.6
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 +38 -17
- package/dist/browser.js +1 -1
- package/dist/chunks/{context-Dvq-Cc6v.js → context-DiSr6eiz.js} +45 -33
- package/dist/chunks/context-DiSr6eiz.js.map +1 -0
- package/dist/node.js +1 -1
- package/dist/src/algorithms/bfs.d.ts +11 -7
- package/dist/src/algorithms/bfs.d.ts.map +1 -1
- package/dist/src/algorithms/bfs.js +33 -10
- package/dist/src/algorithms/bfs.js.map +1 -1
- package/dist/src/algorithms/scope.d.ts +3 -3
- package/dist/src/algorithms/scope.d.ts.map +1 -1
- package/dist/src/algorithms/scope.js +0 -2
- package/dist/src/algorithms/scope.js.map +1 -1
- package/dist/src/algorithms/sssp.d.ts +4 -3
- package/dist/src/algorithms/sssp.d.ts.map +1 -1
- package/dist/src/algorithms/sssp.js +4 -3
- package/dist/src/algorithms/sssp.js.map +1 -1
- package/dist/src/constants.d.ts +33 -2
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +33 -2
- package/dist/src/constants.js.map +1 -1
- package/dist/src/kernel/dispatch.d.ts +2 -2
- package/dist/src/kernel/dispatch.d.ts.map +1 -1
- package/dist/src/kernel/kernel.d.ts +1 -1
- package/dist/src/kernel/kernel.js +2 -2
- package/dist/src/kernel/kernel.js.map +1 -1
- package/dist/src/kernel/prelude.d.ts.map +1 -1
- package/dist/src/kernel/prelude.js +2 -1
- package/dist/src/kernel/prelude.js.map +1 -1
- package/dist/src/kernels.d.ts +15 -11
- package/dist/src/kernels.d.ts.map +1 -1
- package/dist/src/kernels.js +42 -21
- package/dist/src/kernels.js.map +1 -1
- package/dist/src/layouts/forceatlas2.d.ts.map +1 -1
- package/dist/src/layouts/forceatlas2.js +2 -1
- package/dist/src/layouts/forceatlas2.js.map +1 -1
- package/dist/src/layouts/fruchterman-reingold.d.ts.map +1 -1
- package/dist/src/layouts/fruchterman-reingold.js +4 -2
- package/dist/src/layouts/fruchterman-reingold.js.map +1 -1
- package/dist/src/layouts/repulsion-exact.d.ts +16 -0
- package/dist/src/layouts/repulsion-exact.d.ts.map +1 -1
- package/dist/src/layouts/repulsion-exact.js +21 -1
- package/dist/src/layouts/repulsion-exact.js.map +1 -1
- package/dist/src/layouts/repulsion-grid.d.ts +1 -1
- package/dist/src/layouts/repulsion-grid.js +1 -1
- package/dist/src/layouts/spring-electrical.d.ts.map +1 -1
- package/dist/src/layouts/spring-electrical.js +6 -2
- package/dist/src/layouts/spring-electrical.js.map +1 -1
- package/dist/src/primitives/advance.d.ts +3 -2
- package/dist/src/primitives/advance.d.ts.map +1 -1
- package/dist/src/primitives/advance.js.map +1 -1
- package/dist/src/primitives/frontier.d.ts +34 -38
- package/dist/src/primitives/frontier.d.ts.map +1 -1
- package/dist/src/primitives/frontier.js +24 -32
- package/dist/src/primitives/frontier.js.map +1 -1
- package/dist/src/primitives/grid-pyramid.d.ts +4 -4
- package/dist/src/primitives/grid-pyramid.d.ts.map +1 -1
- package/dist/src/primitives/grid-pyramid.js +4 -3
- package/dist/src/primitives/grid-pyramid.js.map +1 -1
- package/dist/src/primitives/grid.d.ts +13 -10
- package/dist/src/primitives/grid.d.ts.map +1 -1
- package/dist/src/primitives/grid.js +10 -7
- package/dist/src/primitives/grid.js.map +1 -1
- package/dist/src/wgsl/advance-expand.wgsl.d.ts +4 -3
- package/dist/src/wgsl/advance-expand.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/advance-expand.wgsl.js +4 -3
- package/dist/src/wgsl/advance-expand.wgsl.js.map +1 -1
- package/dist/src/wgsl/bfs-bottom-up.wgsl.d.ts +4 -3
- package/dist/src/wgsl/bfs-bottom-up.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/bfs-bottom-up.wgsl.js +4 -3
- package/dist/src/wgsl/bfs-bottom-up.wgsl.js.map +1 -1
- package/dist/src/wgsl/bfs-fused.wgsl.d.ts +6 -6
- package/dist/src/wgsl/bfs-fused.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/bfs-fused.wgsl.js +6 -6
- package/dist/src/wgsl/bfs-next-degree.wgsl.d.ts +23 -0
- package/dist/src/wgsl/bfs-next-degree.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/bfs-next-degree.wgsl.js +34 -0
- package/dist/src/wgsl/bfs-next-degree.wgsl.js.map +1 -0
- package/dist/src/wgsl/fa2-repulsion-exact.wgsl.d.ts +4 -1
- package/dist/src/wgsl/fa2-repulsion-exact.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-repulsion-exact.wgsl.js +18 -2
- package/dist/src/wgsl/fa2-repulsion-exact.wgsl.js.map +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.js +4 -2
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.js.map +1 -1
- package/dist/src/wgsl/frontier-finalize.wgsl.d.ts +44 -49
- package/dist/src/wgsl/frontier-finalize.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/frontier-finalize.wgsl.js +62 -107
- package/dist/src/wgsl/frontier-finalize.wgsl.js.map +1 -1
- package/dist/src/wgsl/grid-cell-key.wgsl.d.ts +3 -2
- package/dist/src/wgsl/grid-cell-key.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/grid-cell-key.wgsl.js +4 -2
- package/dist/src/wgsl/grid-cell-key.wgsl.js.map +1 -1
- package/dist/src/wgsl/grid-centroid.wgsl.d.ts +3 -2
- package/dist/src/wgsl/grid-centroid.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/grid-centroid.wgsl.js +3 -2
- package/dist/src/wgsl/grid-centroid.wgsl.js.map +1 -1
- package/dist/src/wgsl/grid-downsample.wgsl.d.ts +1 -1
- package/dist/src/wgsl/grid-downsample.wgsl.js +1 -1
- package/dist/src/wgsl/grid-far-field.wgsl.d.ts +6 -4
- package/dist/src/wgsl/grid-far-field.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/grid-far-field.wgsl.js +15 -8
- package/dist/src/wgsl/grid-far-field.wgsl.js.map +1 -1
- package/dist/src/wgsl/grid-near-field.wgsl.d.ts +2 -2
- package/dist/src/wgsl/grid-near-field.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/grid-near-field.wgsl.js +6 -2
- package/dist/src/wgsl/grid-near-field.wgsl.js.map +1 -1
- package/dist/src/wgsl/histogram.wgsl.d.ts +1 -1
- package/dist/src/wgsl/histogram.wgsl.js +1 -1
- package/dist/webgpu-graph-algorithms.js +144 -119
- package/dist/webgpu-graph-algorithms.js.map +1 -1
- package/package.json +3 -3
- package/src/algorithms/bfs.ts +34 -10
- package/src/algorithms/pagerank.ts +19 -5
- package/src/algorithms/power-iteration.ts +8 -2
- package/src/algorithms/scope.ts +3 -10
- package/src/algorithms/sssp.ts +4 -3
- package/src/constants.ts +35 -2
- package/src/kernel/dispatch.ts +2 -2
- package/src/kernel/kernel.ts +2 -2
- package/src/kernel/prelude.ts +2 -0
- package/src/kernels.ts +44 -21
- package/src/layouts/forceatlas2.ts +2 -0
- package/src/layouts/fruchterman-reingold.ts +4 -1
- package/src/layouts/repulsion-exact.ts +29 -1
- package/src/layouts/repulsion-grid.ts +1 -1
- package/src/layouts/spring-electrical.ts +8 -1
- package/src/memory/residency.ts +14 -4
- package/src/primitives/advance.ts +5 -4
- package/src/primitives/frontier.ts +42 -56
- package/src/primitives/grid-pyramid.ts +6 -5
- package/src/primitives/grid.ts +17 -12
- package/src/wgsl/advance-expand.wgsl.ts +4 -3
- package/src/wgsl/bfs-bottom-up.wgsl.ts +4 -3
- package/src/wgsl/bfs-fused.wgsl.ts +6 -6
- package/src/wgsl/bfs-next-degree.wgsl.ts +33 -0
- package/src/wgsl/fa2-repulsion-exact.wgsl.ts +18 -2
- package/src/wgsl/fa2-stats-finalize.wgsl.ts +4 -2
- package/src/wgsl/frontier-finalize.wgsl.ts +62 -107
- package/src/wgsl/grid-cell-key.wgsl.ts +4 -2
- package/src/wgsl/grid-centroid.wgsl.ts +3 -2
- package/src/wgsl/grid-downsample.wgsl.ts +1 -1
- package/src/wgsl/grid-far-field.wgsl.ts +15 -8
- package/src/wgsl/grid-near-field.wgsl.ts +6 -2
- package/src/wgsl/histogram.wgsl.ts +1 -1
- package/dist/chunks/context-Dvq-Cc6v.js.map +0 -1
package/README.md
CHANGED
|
@@ -143,7 +143,7 @@ names and defaults as the CPU port in `@graphty/layout`) plus the GPU tuning:
|
|
|
143
143
|
| `nodeSize` | `null` | `E_UNSUPPORTED` when non-null (no overlap prevention) |
|
|
144
144
|
| `weight` | unset | `true`: the snapshot's arc weights; an edge column name: that numeric column; unset / `false` / `null`: every edge weighs 1 |
|
|
145
145
|
| `dissuadeHubs` | `false` | accepted and ignored |
|
|
146
|
-
| `settleThreshold`, `settleWindow` | `0.001`, `10` | settled when the mean displacement stayed below the
|
|
146
|
+
| `settleThreshold`, `settleWindow` | `0.001`, `10` | settled when the mean displacement stayed below `settleThreshold x rmsRadius` AND below an absolute floor (a fraction of the model's length unit: 0.003 `springLength` x (2000 / n)^(1/4) for spring-electrical, 0.002 `k` for Fruchterman-Reingold; ForceAtlas2 has none) for `settleWindow` iterations |
|
|
147
147
|
| `iterationsPerStep` | `1` | iterations per `step()` (the Node `run()` uses its own `batch`) |
|
|
148
148
|
| `maxInFlight` | `2` | batches in flight before `step()` coalesces; `1` for the strictest freshness |
|
|
149
149
|
|
|
@@ -692,22 +692,22 @@ are the T-table of plan section 10.4. A missed target is re-fixed by a recorded
|
|
|
692
692
|
|
|
693
693
|
Measured on nvidia-lovelace-driver580 (NVIDIA: 580.173.02 580.173.2.0), session 2026-09-20T01:06:48.656Z, medians of 5 runs; Chromium: nvidia / lovelace (nvidia-lovelace-driver0, the description is redacted by Chromium), session 2026-09-16T02:18:11.896Z. The T-5 (100k), T-6 and T-7 rows are from the later session 2026-09-21T06:15:17.027Z (the file's last session, the current baseline, the one the crossover re-check reads; its Chromium session 2026-09-21T05:48:14.190Z), whose other rows are within 1.25x of this table's.
|
|
694
694
|
|
|
695
|
-
| Id | What | Target | Measured
|
|
696
|
-
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
|
697
|
-
| T-1 | Upload of the 100k / 1M weighted hot prefix (16.4 MB); 1M / 10M (164 MB) | <= 10 ms; <= 100 ms | 5.980 ms; 125.738 ms
|
|
698
|
-
| T-2 | `degree` + 400 KB readback at 100k (core resident), Node | <= 2 ms | 0.870 ms
|
|
699
|
-
| T-3 | Empty submit + 4-byte `readU32` round trip, Dawn | <= 0.1 ms | 0.181 ms
|
|
700
|
-
| T-4 | ForceAtlas2 exact tier, GPU time per iteration (profiler) at 10k; at 16k | <= 1 ms; <= 2 ms | 0.586 ms; 1.053 ms
|
|
701
|
-
| T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 10k, Chromium (Node in brackets) | <= 6 ms | 2.400 ms (0.726 ms)
|
|
702
|
-
| T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 100k on the grid tier, Chromium (Node in brackets) | <= 12 ms | 3.700 ms (2.087 ms)
|
|
703
|
-
| T-6 | ForceAtlas2 grid tier, GPU time per iteration (profiler) at 100k 2D; at 1M 2D; at 100k 3D | <= 10 ms; <= 100 ms; <= 20 ms | 0.634 ms; 5.414 ms; 1.306 ms
|
|
704
|
-
| T-7 | Attraction gather (the `fa2-attraction` pass of the grid tier), GPU time per iteration (profiler) at 1M / 10M | <= 15 ms | 1.493 ms
|
|
705
|
-
| T-8 | PageRank, 100 iterations, wall end to end including the upload, at 100k / 1M; at 1M / 10M | <= 150 ms; <= 1.5 s | 17.204 ms; 198.645 ms
|
|
706
|
-
| T-9 | Weakly connected components (Afforest), wall end to end including the upload and the label readback, at 1M / 10M (100k / 1M in brackets) | <= 100 ms | 145.970 ms (12.613 ms)
|
|
707
|
-
| T-14 | Fruchterman-Reingold exact tier, GPU time per iteration (profiler) at 10k; at 100k (`repulsion: "exact"`) | recorded | 0.617 ms; 16.367 ms
|
|
708
|
-
| T-10 | BFS direction-optimizing (`breadthFirstSearch`), wall end to end including the upload, from node 0 of the undirected RMAT at 1M / 10M (577,681 nodes reached, 6 levels; 100k / 1M in brackets; top-down 233.064 ms / 97.259 ms) | <= 100 ms | 237.388 ms (101.183 ms) in the baseline session;
|
|
709
|
-
| T-10 | BFS on the 1000 x 1000 grid from a corner (1,999 levels; 64 `mapAsync` calls = ceil(levels / 32) + 1), wall including the upload | <= 1.5 s | 5680.192 ms in the baseline session; 427.235 ms re-measured 2026-09-25 under load after the direct-dispatch change, MET -- see below and G8-F5 of `docs/decisions/G8.md`
|
|
710
|
-
| T-10 | `sssp` (the near-far queue), wall end to end including the upload, random f32 weights in [0.1, 10), at 1M / 10M (100k / 1M in brackets) | recorded | 310.351 ms (118.064 ms); 271.040 ms (50.871 ms) re-measured 2026-09-25 under load
|
|
695
|
+
| Id | What | Target | Measured |
|
|
696
|
+
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
697
|
+
| T-1 | Upload of the 100k / 1M weighted hot prefix (16.4 MB); 1M / 10M (164 MB) | <= 10 ms; <= 100 ms | 5.980 ms; 125.738 ms |
|
|
698
|
+
| T-2 | `degree` + 400 KB readback at 100k (core resident), Node | <= 2 ms | 0.870 ms |
|
|
699
|
+
| T-3 | Empty submit + 4-byte `readU32` round trip, Dawn | <= 0.1 ms | 0.181 ms |
|
|
700
|
+
| T-4 | ForceAtlas2 exact tier, GPU time per iteration (profiler) at 10k; at 16k | <= 1 ms; <= 2 ms | 0.586 ms; 1.053 ms |
|
|
701
|
+
| T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 10k, Chromium (Node in brackets) | <= 6 ms | 2.400 ms (0.726 ms) |
|
|
702
|
+
| T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 100k on the grid tier, Chromium (Node in brackets) | <= 12 ms | 3.700 ms (2.087 ms) |
|
|
703
|
+
| T-6 | ForceAtlas2 grid tier, GPU time per iteration (profiler) at 100k 2D; at 1M 2D; at 100k 3D | <= 10 ms; <= 100 ms; <= 20 ms | 0.634 ms; 5.414 ms; 1.306 ms |
|
|
704
|
+
| T-7 | Attraction gather (the `fa2-attraction` pass of the grid tier), GPU time per iteration (profiler) at 1M / 10M | <= 15 ms | 1.493 ms |
|
|
705
|
+
| T-8 | PageRank, 100 iterations, wall end to end including the upload, at 100k / 1M; at 1M / 10M | <= 150 ms; <= 1.5 s | 17.204 ms; 198.645 ms |
|
|
706
|
+
| T-9 | Weakly connected components (Afforest), wall end to end including the upload and the label readback, at 1M / 10M (100k / 1M in brackets) | <= 100 ms | 145.970 ms (12.613 ms) |
|
|
707
|
+
| T-14 | Fruchterman-Reingold exact tier, GPU time per iteration (profiler) at 10k; at 100k (`repulsion: "exact"`) | recorded | 0.617 ms; 16.367 ms |
|
|
708
|
+
| T-10 | BFS direction-optimizing (`breadthFirstSearch`), wall end to end including the upload, from node 0 of the undirected RMAT at 1M / 10M (577,681 nodes reached, 6 levels; 100k / 1M in brackets; top-down 233.064 ms / 97.259 ms) | <= 100 ms | 237.388 ms (101.183 ms) in the baseline session; 89.212 ms (14.925 ms) re-measured 2026-09-25 at load average 7.3 after the direct-dispatch change and the m_f fix of issue #391, top-down 95.014 ms (14.744 ms); a sample one minute earlier at load average 10.5 read 134.674 ms (15.183 ms) auto and 99.002 ms (14.630 ms) top-down -- see below and G8-F5 / G8-F21 of `docs/decisions/G8.md` |
|
|
709
|
+
| T-10 | BFS on the 1000 x 1000 grid from a corner (1,999 levels; 64 `mapAsync` calls = ceil(levels / 32) + 1), wall including the upload | <= 1.5 s | 5680.192 ms in the baseline session; 427.235 ms re-measured 2026-09-25 under load after the direct-dispatch change, 542.370 ms (536.980 ms one minute earlier) after the m_f fix at load average 7.3-10.5, 382.680 ms at load average 2.5 once `bfs-next-degree` took a capped grid, MET -- see below and G8-F5 of `docs/decisions/G8.md` |
|
|
710
|
+
| T-10 | `sssp` (the near-far queue), wall end to end including the upload, random f32 weights in [0.1, 10), at 1M / 10M (100k / 1M in brackets) | recorded | 310.351 ms (118.064 ms); 271.040 ms (50.871 ms) re-measured 2026-09-25 under load; 275.474 ms (48.326 ms) after the m_f fix at load average 7.3 |
|
|
711
711
|
|
|
712
712
|
Three rows miss their target in this session: the 1M / 10M upload (125.7 ms against 100 ms, the open owner decision of
|
|
713
713
|
`docs/decisions/G1.md` section 7), the empty-submit round trip (0.181 ms against 0.1 ms: the row is measured after the
|
|
@@ -741,6 +741,27 @@ to the baseline): a 34-node BFS 7.2 ms (from 89.3 with the core resident), the g
|
|
|
741
741
|
auto row 156.6 ms and the top-down row 88.6 ms. The auto row now misses only because the direction-optimizing
|
|
742
742
|
choice itself is slower than top-down on that graph, which the validation cost had hidden (G8-F21).
|
|
743
743
|
|
|
744
|
+
That miss was not the direction choice either (G8-F21, closed by issue #391). The 156.6 against 88.6 ms gap was the
|
|
745
|
+
card clocking down to P5 and then ramping back up: the benchmark runs the auto row first, so whichever row runs
|
|
746
|
+
first carries the ramp, and alternating the two directions end to end reads the same 75 ms from the third iteration
|
|
747
|
+
on. The upload cannot explain it, being paid by both rows alike. The real defect the issue uncovered was Beamer's m_f
|
|
748
|
+
measured one level stale -- `frontierDegreeSum` is the degree of the frontier the PREVIOUS level expanded, which is
|
|
749
|
+
0 after a bottom-up level -- so the switch into bottom-up was missed at the level holding 13.6M of the 21M arcs. The
|
|
750
|
+
`bfs-next-degree` kernel now sums the out-degree of the frontier about to be expanded (counters word 25) and the
|
|
751
|
+
boundary compares that. With the core resident on the card the 1M / 10M auto traversal went from 37.8 to 31.4 ms
|
|
752
|
+
and 100k / 1M from 10.3 to 8.8 ms; the three bottom-up levels of the 1M / 10M run read 649,743 arcs in total. At
|
|
753
|
+
100k / 1M the direction-optimizing traversal still loses to plain top-down on this card, 9.55 against 9.34 ms
|
|
754
|
+
resident, which is a smaller loss than the 10.87 against 9.91 ms it read before the fix, and still a loss. The
|
|
755
|
+
new kernel is dispatched on every level, so a high-diameter traversal pays its fixed cost per level: the grid
|
|
756
|
+
traversal resident on the card went 339 -> 421 ms with the full-width grid `planGridStride(n, wg)` gives it and
|
|
757
|
+
back to 356 ms with the grid capped at 128 workgroups (`NEXT_DEGREE_MAX_GROUPS`), which is still enough to sum n
|
|
758
|
+
out-degrees by grid stride; neither R-MAT row moved. The
|
|
759
|
+
rows in the table (`--no-save --runs 3`, not appended to the baseline; both samples on 2026-09-25, one minute
|
|
760
|
+
apart): at load average 7.3 the 1M / 10M auto row is 89.2 ms against 95.0 ms top-down, the 100k / 1M row 14.9
|
|
761
|
+
against 14.7 ms, the grid row 542 ms and `sssp` 275.5 ms (48.3 ms); at load average 10.5 the same auto row read
|
|
762
|
+
134.7 ms and top-down 99.0 ms. The two samples ran the same code on the same card, so the 100 ms target is met or
|
|
763
|
+
missed by the upload and the clock state the row starts in, not by the traversal.
|
|
764
|
+
|
|
744
765
|
The exact curve (the `layout-exact` group: 2D, E = 10n, seeded G(n, m), one simulation per rung; ms / iteration from the profiler):
|
|
745
766
|
|
|
746
767
|
| n | ms / iteration | step(1) wall (ms) | pairs / s |
|
package/dist/browser.js
CHANGED
|
@@ -49,6 +49,7 @@ const LAYOUT_TUNING_DEFAULTS = Object.freeze({
|
|
|
49
49
|
const FA2_DISTANCE_FLOOR = 0.01;
|
|
50
50
|
const FA2_DISTANCE_FLOOR_SQ = 1e-4;
|
|
51
51
|
const FA2_COINCIDENT_SQ = 1e-8;
|
|
52
|
+
const EXACT_TILES_PER_PASS = 128;
|
|
52
53
|
const FA2_FLAG_FIRST = 1;
|
|
53
54
|
const FA2_FLAG_ADAPTIVE = 2;
|
|
54
55
|
const FR_START_TEMPERATURE = 0.1;
|
|
@@ -82,6 +83,14 @@ const SE_DEFAULTS = Object.freeze({
|
|
|
82
83
|
iterationsPerStep: 1,
|
|
83
84
|
maxInFlight: 2
|
|
84
85
|
});
|
|
86
|
+
const SETTLE_FLOOR_FRACTION = Object.freeze(
|
|
87
|
+
{
|
|
88
|
+
springElectrical: 3e-3,
|
|
89
|
+
fruchtermanReingold: 2e-3
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
const SETTLE_FLOOR_REFERENCE_NODES = 2e3;
|
|
93
|
+
const SETTLE_FLOOR_UNBOUNDED = 2 ** 128 - 2 ** 104;
|
|
85
94
|
const GRID_MIN_SIDE = 8;
|
|
86
95
|
const GRID_COARSEST_SIDE = 4;
|
|
87
96
|
const GRID_HUB_CELL = 1024;
|
|
@@ -90,7 +99,6 @@ const GRID_BBOX_MARGIN = 1.01;
|
|
|
90
99
|
const GRID_SORT_BITS = 24;
|
|
91
100
|
const MAX_LEVELS_PER_SUBMIT = 32;
|
|
92
101
|
const FUSED_FRONTIER_MAX = 4096;
|
|
93
|
-
const FRONTIER_CANDIDATES = 7;
|
|
94
102
|
const BEAMER_BETA = 24;
|
|
95
103
|
const SSSP_DELTA_FACTOR = 32;
|
|
96
104
|
const F32_INF_BITS = 2139095040;
|
|
@@ -734,7 +742,7 @@ class Kernel {
|
|
|
734
742
|
return bound;
|
|
735
743
|
}
|
|
736
744
|
/**
|
|
737
|
-
* setPipeline + setBindGroup for every group (dynamic offsets in dynamicGroups order) + dispatchWorkgroups(plan.x, plan.y,
|
|
745
|
+
* setPipeline + setBindGroup for every group (dynamic offsets in dynamicGroups order) + dispatchWorkgroups(plan.x, plan.y, plan.z); a plan with x === 0 records nothing (spec 5.6).
|
|
738
746
|
* PLAN DECISION: one dynamic offset per dynamic GROUP, replicated over every uniform binding of that group (every
|
|
739
747
|
* P1-P3 kernel has exactly one params uniform per group); absent offsets mean 0; a BoundKernel of another kernel
|
|
740
748
|
* or an offset list of the wrong length is E_INVALID_ARGUMENT.
|
|
@@ -752,7 +760,7 @@ class Kernel {
|
|
|
752
760
|
return;
|
|
753
761
|
}
|
|
754
762
|
this.setUp(pass, bound, dynamicOffsets);
|
|
755
|
-
pass.dispatchWorkgroups(plan.x, plan.y,
|
|
763
|
+
pass.dispatchWorkgroups(plan.x, plan.y, plan.z);
|
|
756
764
|
}
|
|
757
765
|
/**
|
|
758
766
|
* setPipeline + the bind groups exactly as dispatch(), then dispatchWorkgroupsIndirect(args.buffer, args.offset +
|
|
@@ -891,6 +899,7 @@ const INVALID_INDEX: u32 = ${INVALID_INDEX}u;
|
|
|
891
899
|
const U32_MAX: u32 = ${U32_MAX}u;
|
|
892
900
|
const F32_INF_BITS: u32 = ${F32_INF_BITS}u;
|
|
893
901
|
const MAX_WORKGROUPS_PER_DIM: u32 = ${MAX_WORKGROUPS_PER_DIM}u;
|
|
902
|
+
const EXACT_TILES_PER_PASS: u32 = ${EXACT_TILES_PER_PASS}u;
|
|
894
903
|
const FA2_DIST_FLOOR: f32 = ${wgslF32Literal(FA2_DISTANCE_FLOOR)};
|
|
895
904
|
const FA2_DIST_FLOOR_SQ: f32 = ${wgslF32Literal(FA2_DISTANCE_FLOOR_SQ)};
|
|
896
905
|
const FA2_COINCIDENT_SQ: f32 = ${wgslF32Literal(FA2_COINCIDENT_SQ)};
|
|
@@ -3484,20 +3493,23 @@ class GpuContext {
|
|
|
3484
3493
|
}
|
|
3485
3494
|
}
|
|
3486
3495
|
export {
|
|
3487
|
-
|
|
3496
|
+
FR_DEFAULTS as A,
|
|
3488
3497
|
BufferUsage as B,
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3498
|
+
SE_DEFAULTS as C,
|
|
3499
|
+
SETTLE_FLOOR_REFERENCE_NODES as D,
|
|
3500
|
+
EXACT_TILES_PER_PASS as E,
|
|
3501
|
+
FUSED_FRONTIER_MAX as F,
|
|
3493
3502
|
GpuContext as G,
|
|
3494
|
-
|
|
3503
|
+
SE_SCALE_REFERENCE_NODES as H,
|
|
3495
3504
|
INDIRECT_ARGS_STRIDE as I,
|
|
3496
|
-
|
|
3497
|
-
|
|
3505
|
+
ARC_WINDOW_ALIGN as J,
|
|
3506
|
+
PASSTHROUGH_FORMAT_CODES as K,
|
|
3498
3507
|
LAYOUT_TUNING_DEFAULTS as L,
|
|
3499
3508
|
MAX_WORKGROUPS_PER_DIM as M,
|
|
3509
|
+
STORAGE_ALIGN as N,
|
|
3510
|
+
WORKGROUP_SIZE as O,
|
|
3500
3511
|
PARTIAL_BYTES as P,
|
|
3512
|
+
isSoftwareAdapter as Q,
|
|
3501
3513
|
RADIX_BINS as R,
|
|
3502
3514
|
STATE_HEADER_BYTES as S,
|
|
3503
3515
|
TRACE_RECORD_BYTES as T,
|
|
@@ -3507,27 +3519,27 @@ export {
|
|
|
3507
3519
|
U32_MAX as b,
|
|
3508
3520
|
MAX_LEVELS_PER_SUBMIT as c,
|
|
3509
3521
|
deviceLostError as d,
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3522
|
+
BEAMER_BETA as e,
|
|
3523
|
+
SSSP_DELTA_FACTOR as f,
|
|
3524
|
+
F32_INF_BITS as g,
|
|
3525
|
+
GRID_COARSEST_SIDE as h,
|
|
3514
3526
|
isWebGpuGraphError as i,
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3527
|
+
GRID_MIN_SIDE as j,
|
|
3528
|
+
GRID_SORT_BITS as k,
|
|
3529
|
+
FA2_DEFAULTS as l,
|
|
3530
|
+
MAX_ITERATIONS_PER_STEP as m,
|
|
3531
|
+
MAX_1D_ITEMS as n,
|
|
3532
|
+
hasErrorCode as o,
|
|
3533
|
+
FA2_FLAG_FIRST as p,
|
|
3534
|
+
GRID_HUB_CELL as q,
|
|
3535
|
+
EXACT_MAX_NODES as r,
|
|
3536
|
+
SETTLE_FLOOR_UNBOUNDED as s,
|
|
3537
|
+
GRID_BBOX_MARGIN as t,
|
|
3538
|
+
GRID_EXTENT_FLOOR as u,
|
|
3539
|
+
FR_ADAPTIVE_MAX_ITERATIONS as v,
|
|
3540
|
+
FR_START_TEMPERATURE as w,
|
|
3541
|
+
FA2_FLAG_ADAPTIVE as x,
|
|
3542
|
+
SETTLE_FLOOR_FRACTION as y,
|
|
3543
|
+
FR_REHEAT_FRACTION as z
|
|
3532
3544
|
};
|
|
3533
|
-
//# sourceMappingURL=context-
|
|
3545
|
+
//# sourceMappingURL=context-DiSr6eiz.js.map
|