@graphty/webgpu-graph-algorithms 0.6.14 → 0.6.16

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 (197) hide show
  1. package/README.md +52 -52
  2. package/dist/browser.js +1 -1
  3. package/dist/chunks/{context-Bi6AhScG.js → context-VIvatQOo.js} +69 -34
  4. package/dist/chunks/context-VIvatQOo.js.map +1 -0
  5. package/dist/node.js +1 -1
  6. package/dist/src/accelerator.d.ts +5 -3
  7. package/dist/src/accelerator.d.ts.map +1 -1
  8. package/dist/src/accelerator.js +101 -5
  9. package/dist/src/accelerator.js.map +1 -1
  10. package/dist/src/algorithms/all-pairs.d.ts +41 -0
  11. package/dist/src/algorithms/all-pairs.d.ts.map +1 -0
  12. package/dist/src/algorithms/all-pairs.js +181 -0
  13. package/dist/src/algorithms/all-pairs.js.map +1 -0
  14. package/dist/src/algorithms/betweenness.d.ts +70 -0
  15. package/dist/src/algorithms/betweenness.d.ts.map +1 -0
  16. package/dist/src/algorithms/betweenness.js +538 -0
  17. package/dist/src/algorithms/betweenness.js.map +1 -0
  18. package/dist/src/algorithms/closeness.d.ts +15 -5
  19. package/dist/src/algorithms/closeness.d.ts.map +1 -1
  20. package/dist/src/algorithms/closeness.js +112 -26
  21. package/dist/src/algorithms/closeness.js.map +1 -1
  22. package/dist/src/algorithms/components.d.ts +9 -1
  23. package/dist/src/algorithms/components.d.ts.map +1 -1
  24. package/dist/src/algorithms/components.js +2 -2
  25. package/dist/src/algorithms/components.js.map +1 -1
  26. package/dist/src/algorithms/label-propagation.d.ts +31 -0
  27. package/dist/src/algorithms/label-propagation.d.ts.map +1 -0
  28. package/dist/src/algorithms/label-propagation.js +254 -0
  29. package/dist/src/algorithms/label-propagation.js.map +1 -0
  30. package/dist/src/algorithms/simple-symmetric.d.ts +88 -0
  31. package/dist/src/algorithms/simple-symmetric.d.ts.map +1 -0
  32. package/dist/src/algorithms/simple-symmetric.js +347 -0
  33. package/dist/src/algorithms/simple-symmetric.js.map +1 -0
  34. package/dist/src/algorithms/triangles.d.ts +34 -0
  35. package/dist/src/algorithms/triangles.d.ts.map +1 -0
  36. package/dist/src/algorithms/triangles.js +203 -0
  37. package/dist/src/algorithms/triangles.js.map +1 -0
  38. package/dist/src/constants.d.ts +53 -0
  39. package/dist/src/constants.d.ts.map +1 -1
  40. package/dist/src/constants.js +53 -0
  41. package/dist/src/constants.js.map +1 -1
  42. package/dist/src/index.d.ts +12 -3
  43. package/dist/src/index.d.ts.map +1 -1
  44. package/dist/src/index.js +8 -1
  45. package/dist/src/index.js.map +1 -1
  46. package/dist/src/kernel/prelude.d.ts.map +1 -1
  47. package/dist/src/kernel/prelude.js +4 -1
  48. package/dist/src/kernel/prelude.js.map +1 -1
  49. package/dist/src/kernels.d.ts +24 -6
  50. package/dist/src/kernels.d.ts.map +1 -1
  51. package/dist/src/kernels.js +373 -7
  52. package/dist/src/kernels.js.map +1 -1
  53. package/dist/src/memory/residency.js +15 -4
  54. package/dist/src/memory/residency.js.map +1 -1
  55. package/dist/src/primitives/coo-to-csr.d.ts +73 -0
  56. package/dist/src/primitives/coo-to-csr.d.ts.map +1 -0
  57. package/dist/src/primitives/coo-to-csr.js +183 -0
  58. package/dist/src/primitives/coo-to-csr.js.map +1 -0
  59. package/dist/src/primitives/frontier.d.ts +2 -0
  60. package/dist/src/primitives/frontier.d.ts.map +1 -1
  61. package/dist/src/primitives/frontier.js +2 -0
  62. package/dist/src/primitives/frontier.js.map +1 -1
  63. package/dist/src/primitives/group-by-key.d.ts +82 -0
  64. package/dist/src/primitives/group-by-key.d.ts.map +1 -0
  65. package/dist/src/primitives/group-by-key.js +147 -0
  66. package/dist/src/primitives/group-by-key.js.map +1 -0
  67. package/dist/src/types/accelerator.d.ts +19 -7
  68. package/dist/src/types/accelerator.d.ts.map +1 -1
  69. package/dist/src/types/algorithms.d.ts +4 -0
  70. package/dist/src/types/algorithms.d.ts.map +1 -1
  71. package/dist/src/types/all-pairs.d.ts +35 -0
  72. package/dist/src/types/all-pairs.d.ts.map +1 -0
  73. package/dist/src/types/all-pairs.js +8 -0
  74. package/dist/src/types/all-pairs.js.map +1 -0
  75. package/dist/src/types/betweenness.d.ts +35 -0
  76. package/dist/src/types/betweenness.d.ts.map +1 -0
  77. package/dist/src/types/betweenness.js +7 -0
  78. package/dist/src/types/betweenness.js.map +1 -0
  79. package/dist/src/types/community.d.ts +18 -0
  80. package/dist/src/types/community.d.ts.map +1 -0
  81. package/dist/src/types/community.js +5 -0
  82. package/dist/src/types/community.js.map +1 -0
  83. package/dist/src/types/structure.d.ts +27 -0
  84. package/dist/src/types/structure.d.ts.map +1 -0
  85. package/dist/src/types/structure.js +8 -0
  86. package/dist/src/types/structure.js.map +1 -0
  87. package/dist/src/wgsl/apsp-fw.wgsl.d.ts +25 -0
  88. package/dist/src/wgsl/apsp-fw.wgsl.d.ts.map +1 -0
  89. package/dist/src/wgsl/apsp-fw.wgsl.js +113 -0
  90. package/dist/src/wgsl/apsp-fw.wgsl.js.map +1 -0
  91. package/dist/src/wgsl/apsp-init.wgsl.d.ts +12 -0
  92. package/dist/src/wgsl/apsp-init.wgsl.d.ts.map +1 -0
  93. package/dist/src/wgsl/apsp-init.wgsl.js +26 -0
  94. package/dist/src/wgsl/apsp-init.wgsl.js.map +1 -0
  95. package/dist/src/wgsl/bc-backward.wgsl.d.ts +15 -0
  96. package/dist/src/wgsl/bc-backward.wgsl.d.ts.map +1 -0
  97. package/dist/src/wgsl/bc-backward.wgsl.js +34 -0
  98. package/dist/src/wgsl/bc-backward.wgsl.js.map +1 -0
  99. package/dist/src/wgsl/bc-edge-gather.wgsl.d.ts +12 -0
  100. package/dist/src/wgsl/bc-edge-gather.wgsl.d.ts.map +1 -0
  101. package/dist/src/wgsl/bc-edge-gather.wgsl.js +36 -0
  102. package/dist/src/wgsl/bc-edge-gather.wgsl.js.map +1 -0
  103. package/dist/src/wgsl/bc-finalize.wgsl.d.ts +21 -0
  104. package/dist/src/wgsl/bc-finalize.wgsl.d.ts.map +1 -0
  105. package/dist/src/wgsl/bc-finalize.wgsl.js +47 -0
  106. package/dist/src/wgsl/bc-finalize.wgsl.js.map +1 -0
  107. package/dist/src/wgsl/bc-forward-edge.wgsl.d.ts +15 -0
  108. package/dist/src/wgsl/bc-forward-edge.wgsl.d.ts.map +1 -0
  109. package/dist/src/wgsl/bc-forward-edge.wgsl.js +76 -0
  110. package/dist/src/wgsl/bc-forward-edge.wgsl.js.map +1 -0
  111. package/dist/src/wgsl/bc-forward.wgsl.d.ts +23 -0
  112. package/dist/src/wgsl/bc-forward.wgsl.d.ts.map +1 -0
  113. package/dist/src/wgsl/bc-forward.wgsl.js +106 -0
  114. package/dist/src/wgsl/bc-forward.wgsl.js.map +1 -0
  115. package/dist/src/wgsl/bc-gather.wgsl.d.ts +9 -0
  116. package/dist/src/wgsl/bc-gather.wgsl.d.ts.map +1 -0
  117. package/dist/src/wgsl/bc-gather.wgsl.js +20 -0
  118. package/dist/src/wgsl/bc-gather.wgsl.js.map +1 -0
  119. package/dist/src/wgsl/closeness-reduce.wgsl.d.ts +4 -1
  120. package/dist/src/wgsl/closeness-reduce.wgsl.d.ts.map +1 -1
  121. package/dist/src/wgsl/closeness-reduce.wgsl.js +8 -4
  122. package/dist/src/wgsl/closeness-reduce.wgsl.js.map +1 -1
  123. package/dist/src/wgsl/closeness-sweep.wgsl.d.ts +4 -2
  124. package/dist/src/wgsl/closeness-sweep.wgsl.d.ts.map +1 -1
  125. package/dist/src/wgsl/closeness-sweep.wgsl.js +12 -2
  126. package/dist/src/wgsl/closeness-sweep.wgsl.js.map +1 -1
  127. package/dist/src/wgsl/coo-emit.wgsl.d.ts +10 -0
  128. package/dist/src/wgsl/coo-emit.wgsl.d.ts.map +1 -0
  129. package/dist/src/wgsl/coo-emit.wgsl.js +33 -0
  130. package/dist/src/wgsl/coo-emit.wgsl.js.map +1 -0
  131. package/dist/src/wgsl/coo-scatter.wgsl.d.ts +15 -0
  132. package/dist/src/wgsl/coo-scatter.wgsl.d.ts.map +1 -0
  133. package/dist/src/wgsl/coo-scatter.wgsl.js +32 -0
  134. package/dist/src/wgsl/coo-scatter.wgsl.js.map +1 -0
  135. package/dist/src/wgsl/group-by-key-row.wgsl.d.ts +26 -0
  136. package/dist/src/wgsl/group-by-key-row.wgsl.d.ts.map +1 -0
  137. package/dist/src/wgsl/group-by-key-row.wgsl.js +146 -0
  138. package/dist/src/wgsl/group-by-key-row.wgsl.js.map +1 -0
  139. package/dist/src/wgsl/lpa-step.wgsl.d.ts +10 -0
  140. package/dist/src/wgsl/lpa-step.wgsl.d.ts.map +1 -0
  141. package/dist/src/wgsl/lpa-step.wgsl.js +35 -0
  142. package/dist/src/wgsl/lpa-step.wgsl.js.map +1 -0
  143. package/dist/src/wgsl/orient-flags.wgsl.d.ts +9 -0
  144. package/dist/src/wgsl/orient-flags.wgsl.d.ts.map +1 -0
  145. package/dist/src/wgsl/orient-flags.wgsl.js +21 -0
  146. package/dist/src/wgsl/orient-flags.wgsl.js.map +1 -0
  147. package/dist/src/wgsl/run-flags.wgsl.d.ts +8 -0
  148. package/dist/src/wgsl/run-flags.wgsl.d.ts.map +1 -0
  149. package/dist/src/wgsl/run-flags.wgsl.js +18 -0
  150. package/dist/src/wgsl/run-flags.wgsl.js.map +1 -0
  151. package/dist/src/wgsl/tri-intersect.wgsl.d.ts +11 -0
  152. package/dist/src/wgsl/tri-intersect.wgsl.d.ts.map +1 -0
  153. package/dist/src/wgsl/tri-intersect.wgsl.js +64 -0
  154. package/dist/src/wgsl/tri-intersect.wgsl.js.map +1 -0
  155. package/dist/webgpu-graph-algorithms.js +2828 -321
  156. package/dist/webgpu-graph-algorithms.js.map +1 -1
  157. package/package.json +5 -5
  158. package/src/accelerator.ts +130 -7
  159. package/src/algorithms/all-pairs.ts +228 -0
  160. package/src/algorithms/betweenness.ts +739 -0
  161. package/src/algorithms/closeness.ts +124 -32
  162. package/src/algorithms/components.ts +2 -2
  163. package/src/algorithms/label-propagation.ts +280 -0
  164. package/src/algorithms/simple-symmetric.ts +409 -0
  165. package/src/algorithms/triangles.ts +240 -0
  166. package/src/constants.ts +53 -0
  167. package/src/index.ts +20 -1
  168. package/src/kernel/prelude.ts +6 -0
  169. package/src/kernels.ts +411 -10
  170. package/src/memory/residency.ts +15 -4
  171. package/src/primitives/coo-to-csr.ts +251 -0
  172. package/src/primitives/frontier.ts +4 -0
  173. package/src/primitives/group-by-key.ts +209 -0
  174. package/src/types/accelerator.ts +26 -6
  175. package/src/types/algorithms.ts +5 -0
  176. package/src/types/all-pairs.ts +37 -0
  177. package/src/types/betweenness.ts +38 -0
  178. package/src/types/community.ts +18 -0
  179. package/src/types/structure.ts +28 -0
  180. package/src/wgsl/apsp-fw.wgsl.ts +112 -0
  181. package/src/wgsl/apsp-init.wgsl.ts +25 -0
  182. package/src/wgsl/bc-backward.wgsl.ts +33 -0
  183. package/src/wgsl/bc-edge-gather.wgsl.ts +35 -0
  184. package/src/wgsl/bc-finalize.wgsl.ts +46 -0
  185. package/src/wgsl/bc-forward-edge.wgsl.ts +75 -0
  186. package/src/wgsl/bc-forward.wgsl.ts +105 -0
  187. package/src/wgsl/bc-gather.wgsl.ts +19 -0
  188. package/src/wgsl/closeness-reduce.wgsl.ts +8 -4
  189. package/src/wgsl/closeness-sweep.wgsl.ts +12 -2
  190. package/src/wgsl/coo-emit.wgsl.ts +32 -0
  191. package/src/wgsl/coo-scatter.wgsl.ts +31 -0
  192. package/src/wgsl/group-by-key-row.wgsl.ts +145 -0
  193. package/src/wgsl/lpa-step.wgsl.ts +34 -0
  194. package/src/wgsl/orient-flags.wgsl.ts +20 -0
  195. package/src/wgsl/run-flags.wgsl.ts +17 -0
  196. package/src/wgsl/tri-intersect.wgsl.ts +63 -0
  197. package/dist/chunks/context-Bi6AhScG.js.map +0 -1
package/README.md CHANGED
@@ -127,25 +127,25 @@ caller re-issues its pins with a mask over the new index space), and the simulat
127
127
  `createForceAtlas2(ctx, options)` and `accelerator.forceAtlas2(options)` take `ForceAtlas2Options` (the same
128
128
  names and defaults as the CPU port in `@graphty/layout`) plus the GPU tuning:
129
129
 
130
- | Option | Default | Meaning |
131
- | --------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
132
- | `dim` | `2` | `2` or `3`; in 2D every readback writes `z = center[2]` whatever was uploaded |
133
- | `scale`, `center` | `1`, `[0, 0, 0]` | scene units = layout units x `scale` + `center` |
134
- | `seed` | `null` | the LCG seed of the NaN rows (the CPU port's generator, bit for bit); `0` / `null` draws a random seed |
135
- | `maxIter` | `100` | `run()` stops and `settled` turns true after this many iterations since `load()` / `reheat()` |
136
- | `jitterTolerance` | `1` | the speed controller's tolerance |
137
- | `scalingRatio` | `2` | the repulsion constant |
138
- | `gravity` | `1` | toward the centroid (`compat: "paper"`) or the origin (`compat: "networkx"`) |
139
- | `strongGravity` | `false` | gravity proportional to the distance |
140
- | `distributedAction` | `false` | attraction divided by the source's mass |
141
- | `linlog` | `false` | logarithmic attraction |
142
- | `nodeMass` | `null` | `null`: the node column with the role `mass` when present, else `outDegree + 1`; a `Float32Array` of length n; a numeric node column name (a `Record` is `E_UNSUPPORTED`) |
143
- | `nodeSize` | `null` | `E_UNSUPPORTED` when non-null (no overlap prevention) |
144
- | `weight` | unset | `true`: the snapshot's arc weights; an edge column name: that numeric column; unset / `false` / `null`: every edge weighs 1 |
145
- | `dissuadeHubs` | `false` | accepted and ignored |
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
- | `iterationsPerStep` | `1` | iterations per `step()` (the Node `run()` uses its own `batch`) |
148
- | `maxInFlight` | `2` | batches in flight before `step()` coalesces; `1` for the strictest freshness |
130
+ | Option | Default | Meaning |
131
+ | --------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
132
+ | `dim` | `2` | `2` or `3`; in 2D every readback writes `z = center[2]` whatever was uploaded |
133
+ | `scale`, `center` | `1`, `[0, 0, 0]` | scene units = layout units x `scale` + `center` |
134
+ | `seed` | `null` | the LCG seed of the NaN rows (the CPU port's generator, bit for bit); `0` / `null` draws a random seed |
135
+ | `maxIter` | `100` | `run()` stops and `settled` turns true after this many iterations since `load()` / `reheat()` |
136
+ | `jitterTolerance` | `1` | the speed controller's tolerance |
137
+ | `scalingRatio` | `2` | the repulsion constant |
138
+ | `gravity` | `1` | toward the centroid (`compat: "paper"`) or the origin (`compat: "networkx"`) |
139
+ | `strongGravity` | `false` | gravity proportional to the distance |
140
+ | `distributedAction` | `false` | attraction divided by the source's mass |
141
+ | `linlog` | `false` | logarithmic attraction |
142
+ | `nodeMass` | `null` | `null`: the node column with the role `mass` when present, else `outDegree + 1`; a `Float32Array` of length n; a numeric node column name (a `Record` is `E_UNSUPPORTED`) |
143
+ | `nodeSize` | `null` | `E_UNSUPPORTED` when non-null (no overlap prevention) |
144
+ | `weight` | unset | `true`: the snapshot's arc weights; an edge column name: that numeric column; unset / `false` / `null`: every edge weighs 1 |
145
+ | `dissuadeHubs` | `false` | accepted and ignored |
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
+ | `iterationsPerStep` | `1` | iterations per `step()` (the Node `run()` uses its own `batch`) |
148
+ | `maxInFlight` | `2` | batches in flight before `step()` coalesces; `1` for the strictest freshness |
149
149
 
150
150
  GPU tuning (`GpuLayoutTuning`; also the `layout` field of `createAccelerator`'s options, inherited by every
151
151
  simulation the accelerator creates):
@@ -695,39 +695,39 @@ 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 7 session(s) of `benchmarks/results/nvidia-lovelace-driver580.json`, Chromium rows across the 3 of `benchmarks/results/nvidia-lovelace-driver0.json`.
699
-
700
- | Id | What | Target | Measured | Status |
701
- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ----------- | -------------- |
702
- | T-1 | Upload of the 100k / 1M weighted hot prefix (16.4 MB), Node | <= 10 ms | 5.734 ms | met |
703
- | T-1 | Upload of the 1M / 10M weighted hot prefix (164 MB), Node | <= 100 ms | 122.254 ms | missed (noisy) |
704
- | T-2 | `degree` + 400 KB readback at 100k (core resident), Node | <= 2 ms | 0.838 ms | met |
705
- | T-3 | Empty submit + 4-byte `readU32` round trip, Dawn in Node | <= 0.1 ms | 0.062 ms | met |
706
- | T-3 | Empty submit + 4-byte `readU32` round trip, Chromium (the <= 0.1 ms target is Dawn's) | recorded | 0.170 ms | recorded |
707
- | T-4 | ForceAtlas2 exact tier, GPU time per iteration (profiler) at 10k | <= 1 ms | 0.586 ms | met |
708
- | T-4 | ForceAtlas2 exact tier, GPU time per iteration (profiler) at 16k | <= 2 ms | 1.052 ms | met |
709
- | T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 10k, Chromium | <= 6 ms | 2.400 ms | met |
710
- | T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 10k, Node | recorded | 0.713 ms | recorded |
711
- | T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 100k on the grid tier, Chromium | <= 12 ms | 3.700 ms | met |
712
- | T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 100k on the grid tier, Node | recorded | 1.769 ms | recorded |
713
- | T-6 | ForceAtlas2 grid tier, GPU time per iteration (profiler) at 100k 2D | <= 10 ms | 0.574 ms | met |
714
- | T-6 | ForceAtlas2 grid tier, GPU time per iteration (profiler) at 1M 2D | <= 100 ms | 5.303 ms | met |
715
- | T-6 | ForceAtlas2 grid tier, GPU time per iteration (profiler) at 100k 3D | <= 20 ms | 1.279 ms | met |
716
- | T-7 | Attraction gather (the `fa2-attraction` pass of the grid tier), GPU time per iteration (profiler) at 1M / 10M | <= 15 ms | 1.475 ms | met |
717
- | T-8 | PageRank, 100 iterations, wall end to end including the upload, at 100k / 1M | <= 150 ms | 17.204 ms | met |
718
- | T-8 | PageRank, 100 iterations, wall end to end including the upload, at 1M / 10M | <= 1500 ms | 197.154 ms | met |
719
- | T-9 | Weakly connected components (Afforest), wall end to end including the upload and the label readback, at 1M / 10M | <= 100 ms | 140.984 ms | missed |
720
- | T-9 | Weakly connected components (Afforest), wall end to end including the upload and the label readback, at 100k / 1M | recorded | 12.613 ms | recorded |
721
- | T-14 | Fruchterman-Reingold exact tier, GPU time per iteration (profiler) at 10k | recorded | 0.566 ms | recorded |
722
- | T-14 | Fruchterman-Reingold exact tier, GPU time per iteration (profiler) at 100k (`repulsion: "exact"`) | recorded | 16.322 ms | recorded |
723
- | T-14 | Spring-electrical preset, GPU time per iteration (profiler) at 10k | recorded | 0.648 ms | recorded |
724
- | T-14 | Spring-electrical preset, GPU time per iteration (profiler) at 100k (`repulsion: "exact"`) | recorded | 18.154 ms | recorded |
725
- | T-10 | BFS direction-optimizing (`breadthFirstSearch`), wall end to end including the upload, from node 0 of the undirected RMAT at 1M / 10M (a contract on the dev box only) | <= 100 ms | 237.388 ms | missed |
726
- | T-10 | BFS top-down, the same traversal at 1M / 10M | recorded | 233.064 ms | recorded |
727
- | T-10 | BFS direction-optimizing, the same traversal at 100k / 1M | recorded | 101.183 ms | recorded |
728
- | T-10 | BFS on the 1000 x 1000 grid from a corner (1,999 levels), wall including the upload (a contract on the dev box only) | <= 1500 ms | 5680.192 ms | missed |
729
- | T-10 | `sssp` (the near-far queue), wall end to end including the upload, random f32 weights in [0.1, 10), at 1M / 10M | recorded | 310.351 ms | recorded |
730
- | T-10 | `sssp`, the same run at 100k / 1M | recorded | 118.064 ms | recorded |
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 10 session(s) of `benchmarks/results/nvidia-lovelace-driver580.json`, Chromium rows across the 3 of `benchmarks/results/nvidia-lovelace-driver0.json`.
699
+
700
+ | Id | What | Target | Measured | Status |
701
+ | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ---------- | -------- |
702
+ | T-1 | Upload of the 100k / 1M weighted hot prefix (16.4 MB), Node | <= 10 ms | 5.734 ms | met |
703
+ | T-1 | Upload of the 1M / 10M weighted hot prefix (164 MB), Node | <= 100 ms | 74.110 ms | met |
704
+ | T-2 | `degree` + 400 KB readback at 100k (core resident), Node | <= 2 ms | 0.256 ms | met |
705
+ | T-3 | Empty submit + 4-byte `readU32` round trip, Dawn in Node | <= 0.1 ms | 0.037 ms | met |
706
+ | T-3 | Empty submit + 4-byte `readU32` round trip, Chromium (the <= 0.1 ms target is Dawn's) | recorded | 0.170 ms | recorded |
707
+ | T-4 | ForceAtlas2 exact tier, GPU time per iteration (profiler) at 10k | <= 1 ms | 0.586 ms | met |
708
+ | T-4 | ForceAtlas2 exact tier, GPU time per iteration (profiler) at 16k | <= 2 ms | 1.052 ms | met |
709
+ | T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 10k, Chromium | <= 6 ms | 2.400 ms | met |
710
+ | T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 10k, Node | recorded | 0.713 ms | recorded |
711
+ | T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 100k on the grid tier, Chromium | <= 12 ms | 3.700 ms | met |
712
+ | T-5 | ForceAtlas2 per-frame cost, `step(1)` + the 12n readback at 100k on the grid tier, Node | recorded | 1.769 ms | recorded |
713
+ | T-6 | ForceAtlas2 grid tier, GPU time per iteration (profiler) at 100k 2D | <= 10 ms | 0.553 ms | met |
714
+ | T-6 | ForceAtlas2 grid tier, GPU time per iteration (profiler) at 1M 2D | <= 100 ms | 5.303 ms | met |
715
+ | T-6 | ForceAtlas2 grid tier, GPU time per iteration (profiler) at 100k 3D | <= 20 ms | 1.279 ms | met |
716
+ | T-7 | Attraction gather (the `fa2-attraction` pass of the grid tier), GPU time per iteration (profiler) at 1M / 10M | <= 15 ms | 1.475 ms | met |
717
+ | T-8 | PageRank, 100 iterations, wall end to end including the upload, at 100k / 1M | <= 150 ms | 17.204 ms | met |
718
+ | T-8 | PageRank, 100 iterations, wall end to end including the upload, at 1M / 10M | <= 1500 ms | 197.154 ms | met |
719
+ | T-9 | Weakly connected components (Afforest), wall end to end including the upload and the label readback, at 1M / 10M | <= 100 ms | 138.425 ms | missed |
720
+ | T-9 | Weakly connected components (Afforest), wall end to end including the upload and the label readback, at 100k / 1M | recorded | 12.613 ms | recorded |
721
+ | T-14 | Fruchterman-Reingold exact tier, GPU time per iteration (profiler) at 10k | recorded | 0.566 ms | recorded |
722
+ | T-14 | Fruchterman-Reingold exact tier, GPU time per iteration (profiler) at 100k (`repulsion: "exact"`) | recorded | 16.322 ms | recorded |
723
+ | T-14 | Spring-electrical preset, GPU time per iteration (profiler) at 10k | recorded | 0.648 ms | recorded |
724
+ | T-14 | Spring-electrical preset, GPU time per iteration (profiler) at 100k (`repulsion: "exact"`) | recorded | 18.154 ms | recorded |
725
+ | T-10 | BFS direction-optimizing (`breadthFirstSearch`), wall end to end including the upload, from node 0 of the undirected RMAT at 1M / 10M (a contract on the dev box only) | <= 100 ms | 84.989 ms | met |
726
+ | T-10 | BFS top-down, the same traversal at 1M / 10M | recorded | 81.261 ms | recorded |
727
+ | T-10 | BFS direction-optimizing, the same traversal at 100k / 1M | recorded | 12.837 ms | recorded |
728
+ | T-10 | BFS on the 1000 x 1000 grid from a corner (1,999 levels), wall including the upload (a contract on the dev box only) | <= 1500 ms | 369.673 ms | met |
729
+ | T-10 | `sssp` (the near-far queue), wall end to end including the upload, random f32 weights in [0.1, 10), at 1M / 10M | recorded | 256.320 ms | recorded |
730
+ | T-10 | `sssp`, the same run at 100k / 1M | recorded | 47.421 ms | recorded |
731
731
 
732
732
  <!-- /targets-table:nvidia-lovelace-driver580 -->
733
733
 
package/dist/browser.js CHANGED
@@ -1,4 +1,4 @@
1
- import { G as GpuContext, W as WebGpuGraphError } from "./chunks/context-Bi6AhScG.js";
1
+ import { G as GpuContext, W as WebGpuGraphError } from "./chunks/context-VIvatQOo.js";
2
2
  function navigatorGpu() {
3
3
  if (typeof navigator === "undefined") {
4
4
  return void 0;
@@ -102,6 +102,18 @@ const FUSED_FRONTIER_MAX = 4096;
102
102
  const BEAMER_BETA = 24;
103
103
  const SSSP_DELTA_FACTOR = 32;
104
104
  const F32_INF_BITS = 2139095040;
105
+ const BC_BATCH_BUDGET_FRACTION = 0.25;
106
+ const BC_MAX_BATCH = 64;
107
+ const BC_EDGE_PARALLEL_GAMMA = 2;
108
+ const BC_BACKWARD_LEVELS_PER_SUBMIT = 64;
109
+ const APSP_TILE = 32;
110
+ const APSP_MAX_DISPATCHES_PER_SUBMIT = 4096;
111
+ const LABEL_PROP_PASSES_PER_SUBMIT = 8;
112
+ const GROUP_ROW_THREAD_MAX = 32;
113
+ const GROUP_ROW_THREAD_LIMIT = 128;
114
+ const PARALLEL_MERGE_LIMIT = 65e3;
115
+ const GROUP_HASH_LOAD_FACTOR = 2;
116
+ const TRIANGLE_BINARY_SEARCH_RATIO = 32;
105
117
  const PASSTHROUGH_FORMAT_CODES = Object.freeze(["E_GPU_INELIGIBLE", "E_UNKNOWN_NODE", "E_UNKNOWN_COLUMN", "E_COLUMN_LENGTH"]);
106
118
  const EMPTY_DETAILS = Object.freeze({});
107
119
  class WebGpuGraphError extends Error {
@@ -922,6 +934,9 @@ const GRID_EXTENT_FLOOR: f32 = ${wgslF32Literal(GRID_EXTENT_FLOOR)};
922
934
  const GRID_BBOX_MARGIN: f32 = ${wgslF32Literal(GRID_BBOX_MARGIN)};
923
935
  const RADIX_BINS: u32 = ${RADIX_BINS}u;
924
936
  const RADIX_DIGIT_MASK: u32 = ${RADIX_BINS - 1}u;
937
+ const APSP_TILE: u32 = ${APSP_TILE}u;
938
+ const GROUP_HASH_LOAD_FACTOR: u32 = ${GROUP_HASH_LOAD_FACTOR}u;
939
+ const TRIANGLE_BINARY_SEARCH_RATIO: u32 = ${TRIANGLE_BINARY_SEARCH_RATIO}u;
925
940
  const F32_MAX: f32 = 0x1.fffffep+127;
926
941
  override WG: u32 = ${WORKGROUP_SIZE}u;
927
942
  override USE_PERM: bool = false;
@@ -2633,7 +2648,8 @@ class GraphResidency {
2633
2648
  /**
2634
2649
  * Uploads (or finds) a view: outDegree / inDegree / degreeOrder / reverseDegreeOrder upload one array each;
2635
2650
  * reverse and edgeList (P7) upload their arrays perArray, never into the arena, and are memoised per record so
2636
- * a second call uploads nothing (spec 4.3). coo and mate -> E_UNSUPPORTED until P11. packViews concatenates a
2651
+ * a second call uploads nothing (spec 4.3). coo uploads its per-arc `src` (P11; the rest aliases the core); mate ->
2652
+ * E_UNSUPPORTED. packViews concatenates a
2637
2653
  * reverse or edgeList view into ONE buffer at STORAGE_ALIGN offsets; on any other view `true` is E_UNSUPPORTED
2638
2654
  * { option: "packViews" }.
2639
2655
  * @param s - the snapshot
@@ -2700,10 +2716,18 @@ class GraphResidency {
2700
2716
  break;
2701
2717
  }
2702
2718
  case "coo":
2719
+ this.assertNotReleased(s);
2720
+ this.assertNonEmpty(s);
2721
+ if (s.arcCount === 0) {
2722
+ return Object.freeze({ view: name, bindings: Object.freeze({}), scalars: Object.freeze({}) });
2723
+ }
2724
+ array = s.coo().src;
2725
+ bindingName = "src";
2726
+ break;
2703
2727
  case "mate":
2704
- throw new WebGpuGraphError("E_UNSUPPORTED", `the ${name} view is not uploaded before P11`, {
2705
- feature: `view:${name}`,
2706
- hint: "outDegree, inDegree, degreeOrder, reverseDegreeOrder, reverse and edgeList are uploaded"
2728
+ throw new WebGpuGraphError("E_UNSUPPORTED", "the mate view is not uploaded: no kernel reads it", {
2729
+ feature: "view:mate",
2730
+ hint: "outDegree, inDegree, degreeOrder, reverseDegreeOrder, coo, reverse and edgeList are uploaded"
2707
2731
  });
2708
2732
  default:
2709
2733
  throw invalid("name", name, "a view name");
@@ -3513,53 +3537,64 @@ class GpuContext {
3513
3537
  }
3514
3538
  }
3515
3539
  export {
3516
- FR_DEFAULTS as A,
3540
+ SE_SCALE_REFERENCE_NODES as $,
3541
+ APSP_MAX_DISPATCHES_PER_SUBMIT as A,
3517
3542
  BufferUsage as B,
3518
- SE_DEFAULTS as C,
3519
- SETTLE_FLOOR_REFERENCE_NODES as D,
3543
+ LAYOUT_TUNING_DEFAULTS as C,
3544
+ EXACT_MAX_NODES as D,
3520
3545
  EXACT_TILES_PER_PASS as E,
3521
3546
  FUSED_FRONTIER_MAX as F,
3522
3547
  GpuContext as G,
3523
- SE_SCALE_REFERENCE_NODES as H,
3548
+ SETTLE_FLOOR_UNBOUNDED as H,
3524
3549
  INDIRECT_ARGS_STRIDE as I,
3525
- ARC_WINDOW_ALIGN as J,
3526
- PASSTHROUGH_FORMAT_CODES as K,
3527
- LAYOUT_TUNING_DEFAULTS as L,
3550
+ GRID_BBOX_MARGIN as J,
3551
+ GRID_EXTENT_FLOOR as K,
3552
+ LABEL_PROP_PASSES_PER_SUBMIT as L,
3528
3553
  MAX_WORKGROUPS_PER_DIM as M,
3529
- STORAGE_ALIGN as N,
3530
- WORKGROUP_SIZE as O,
3531
- PARTIAL_BYTES as P,
3532
- isSoftwareAdapter as Q,
3554
+ FR_ADAPTIVE_MAX_ITERATIONS as N,
3555
+ FR_START_TEMPERATURE as O,
3556
+ PARALLEL_MERGE_LIMIT as P,
3557
+ FA2_FLAG_ADAPTIVE as Q,
3533
3558
  RADIX_BINS as R,
3534
3559
  STATE_HEADER_BYTES as S,
3535
3560
  TRACE_RECORD_BYTES as T,
3536
3561
  UNIFORM_SLOT_BYTES as U,
3562
+ SETTLE_FLOOR_FRACTION as V,
3537
3563
  WebGpuGraphError as W,
3564
+ FR_REHEAT_FRACTION as X,
3565
+ FR_DEFAULTS as Y,
3566
+ SE_DEFAULTS as Z,
3567
+ SETTLE_FLOOR_REFERENCE_NODES as _,
3538
3568
  WGSL_RESERVED_WORDS as a,
3569
+ ARC_WINDOW_ALIGN as a0,
3570
+ PASSTHROUGH_FORMAT_CODES as a1,
3571
+ STORAGE_ALIGN as a2,
3572
+ WORKGROUP_SIZE as a3,
3573
+ isSoftwareAdapter as a4,
3539
3574
  U32_MAX as b,
3540
3575
  MAX_LEVELS_PER_SUBMIT as c,
3541
3576
  deviceLostError as d,
3542
3577
  BEAMER_BETA as e,
3543
3578
  SSSP_DELTA_FACTOR as f,
3544
3579
  F32_INF_BITS as g,
3545
- GRID_COARSEST_SIDE as h,
3580
+ BC_EDGE_PARALLEL_GAMMA as h,
3546
3581
  isWebGpuGraphError as i,
3547
- GRID_MIN_SIDE as j,
3548
- GRID_SORT_BITS as k,
3549
- FA2_DEFAULTS as l,
3550
- MAX_ITERATIONS_PER_STEP as m,
3551
- MAX_1D_ITEMS as n,
3552
- hasErrorCode as o,
3553
- FA2_FLAG_FIRST as p,
3554
- GRID_HUB_CELL as q,
3555
- EXACT_MAX_NODES as r,
3556
- SETTLE_FLOOR_UNBOUNDED as s,
3557
- GRID_BBOX_MARGIN as t,
3558
- GRID_EXTENT_FLOOR as u,
3559
- FR_ADAPTIVE_MAX_ITERATIONS as v,
3560
- FR_START_TEMPERATURE as w,
3561
- FA2_FLAG_ADAPTIVE as x,
3562
- SETTLE_FLOOR_FRACTION as y,
3563
- FR_REHEAT_FRACTION as z
3582
+ BC_BATCH_BUDGET_FRACTION as j,
3583
+ BC_MAX_BATCH as k,
3584
+ BC_BACKWARD_LEVELS_PER_SUBMIT as l,
3585
+ APSP_TILE as m,
3586
+ GROUP_ROW_THREAD_MAX as n,
3587
+ GROUP_ROW_THREAD_LIMIT as o,
3588
+ GROUP_HASH_LOAD_FACTOR as p,
3589
+ GRID_COARSEST_SIDE as q,
3590
+ GRID_MIN_SIDE as r,
3591
+ GRID_SORT_BITS as s,
3592
+ FA2_DEFAULTS as t,
3593
+ MAX_ITERATIONS_PER_STEP as u,
3594
+ MAX_1D_ITEMS as v,
3595
+ hasErrorCode as w,
3596
+ FA2_FLAG_FIRST as x,
3597
+ PARTIAL_BYTES as y,
3598
+ GRID_HUB_CELL as z
3564
3599
  };
3565
- //# sourceMappingURL=context-Bi6AhScG.js.map
3600
+ //# sourceMappingURL=context-VIvatQOo.js.map