@graphty/webgpu-graph-algorithms 0.0.0 → 0.2.0

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 (269) hide show
  1. package/README.md +344 -23
  2. package/dist/browser.d.ts +1 -0
  3. package/dist/browser.js +32 -0
  4. package/dist/browser.js.map +1 -0
  5. package/dist/chunks/context-E6iKaeuJ.js +3136 -0
  6. package/dist/chunks/context-E6iKaeuJ.js.map +1 -0
  7. package/dist/node.d.ts +1 -0
  8. package/dist/node.js +131 -0
  9. package/dist/node.js.map +1 -0
  10. package/dist/src/accelerator.d.ts +26 -0
  11. package/dist/src/accelerator.d.ts.map +1 -0
  12. package/dist/src/accelerator.js +101 -0
  13. package/dist/src/accelerator.js.map +1 -0
  14. package/dist/src/algorithms/degree.d.ts +35 -0
  15. package/dist/src/algorithms/degree.d.ts.map +1 -0
  16. package/dist/src/algorithms/degree.js +119 -0
  17. package/dist/src/algorithms/degree.js.map +1 -0
  18. package/dist/src/browser/index.d.ts +23 -0
  19. package/dist/src/browser/index.d.ts.map +1 -0
  20. package/dist/src/browser/index.js +48 -0
  21. package/dist/src/browser/index.js.map +1 -0
  22. package/dist/src/constants.d.ts +92 -0
  23. package/dist/src/constants.d.ts.map +1 -0
  24. package/dist/src/constants.js +92 -0
  25. package/dist/src/constants.js.map +1 -0
  26. package/dist/src/context.d.ts +84 -0
  27. package/dist/src/context.d.ts.map +1 -0
  28. package/dist/src/context.js +304 -0
  29. package/dist/src/context.js.map +1 -0
  30. package/dist/src/device/acquire.d.ts +57 -0
  31. package/dist/src/device/acquire.d.ts.map +1 -0
  32. package/dist/src/device/acquire.js +232 -0
  33. package/dist/src/device/acquire.js.map +1 -0
  34. package/dist/src/device/caps.d.ts +43 -0
  35. package/dist/src/device/caps.d.ts.map +1 -0
  36. package/dist/src/device/caps.js +104 -0
  37. package/dist/src/device/caps.js.map +1 -0
  38. package/dist/src/device/error-scope.d.ts +75 -0
  39. package/dist/src/device/error-scope.d.ts.map +1 -0
  40. package/dist/src/device/error-scope.js +152 -0
  41. package/dist/src/device/error-scope.js.map +1 -0
  42. package/dist/src/device/lost.d.ts +51 -0
  43. package/dist/src/device/lost.d.ts.map +1 -0
  44. package/dist/src/device/lost.js +130 -0
  45. package/dist/src/device/lost.js.map +1 -0
  46. package/dist/src/device/webgpu-constants.d.ts +31 -0
  47. package/dist/src/device/webgpu-constants.d.ts.map +1 -0
  48. package/dist/src/device/webgpu-constants.js +31 -0
  49. package/dist/src/device/webgpu-constants.js.map +1 -0
  50. package/dist/src/errors.d.ts +56 -0
  51. package/dist/src/errors.d.ts.map +1 -0
  52. package/dist/src/errors.js +57 -0
  53. package/dist/src/errors.js.map +1 -0
  54. package/dist/src/index.d.ts +29 -0
  55. package/dist/src/index.d.ts.map +1 -0
  56. package/dist/src/index.js +27 -0
  57. package/dist/src/index.js.map +1 -0
  58. package/dist/src/kernel/batch.d.ts +116 -0
  59. package/dist/src/kernel/batch.d.ts.map +1 -0
  60. package/dist/src/kernel/batch.js +335 -0
  61. package/dist/src/kernel/batch.js.map +1 -0
  62. package/dist/src/kernel/dispatch.d.ts +59 -0
  63. package/dist/src/kernel/dispatch.d.ts.map +1 -0
  64. package/dist/src/kernel/dispatch.js +139 -0
  65. package/dist/src/kernel/dispatch.js.map +1 -0
  66. package/dist/src/kernel/kernel.d.ts +84 -0
  67. package/dist/src/kernel/kernel.d.ts.map +1 -0
  68. package/dist/src/kernel/kernel.js +239 -0
  69. package/dist/src/kernel/kernel.js.map +1 -0
  70. package/dist/src/kernel/pipeline-cache.d.ts +90 -0
  71. package/dist/src/kernel/pipeline-cache.d.ts.map +1 -0
  72. package/dist/src/kernel/pipeline-cache.js +251 -0
  73. package/dist/src/kernel/pipeline-cache.js.map +1 -0
  74. package/dist/src/kernel/prelude.d.ts +35 -0
  75. package/dist/src/kernel/prelude.d.ts.map +1 -0
  76. package/dist/src/kernel/prelude.js +211 -0
  77. package/dist/src/kernel/prelude.js.map +1 -0
  78. package/dist/src/kernel/profiler.d.ts +64 -0
  79. package/dist/src/kernel/profiler.d.ts.map +1 -0
  80. package/dist/src/kernel/profiler.js +120 -0
  81. package/dist/src/kernel/profiler.js.map +1 -0
  82. package/dist/src/kernel/struct-block.d.ts +122 -0
  83. package/dist/src/kernel/struct-block.d.ts.map +1 -0
  84. package/dist/src/kernel/struct-block.js +353 -0
  85. package/dist/src/kernel/struct-block.js.map +1 -0
  86. package/dist/src/kernel/uniform-ring.d.ts +70 -0
  87. package/dist/src/kernel/uniform-ring.d.ts.map +1 -0
  88. package/dist/src/kernel/uniform-ring.js +146 -0
  89. package/dist/src/kernel/uniform-ring.js.map +1 -0
  90. package/dist/src/kernel/wgsl.d.ts +88 -0
  91. package/dist/src/kernel/wgsl.d.ts.map +1 -0
  92. package/dist/src/kernel/wgsl.js +390 -0
  93. package/dist/src/kernel/wgsl.js.map +1 -0
  94. package/dist/src/kernels.d.ts +81 -0
  95. package/dist/src/kernels.d.ts.map +1 -0
  96. package/dist/src/kernels.js +417 -0
  97. package/dist/src/kernels.js.map +1 -0
  98. package/dist/src/layouts/force-simulation.d.ts +498 -0
  99. package/dist/src/layouts/force-simulation.d.ts.map +1 -0
  100. package/dist/src/layouts/force-simulation.js +1650 -0
  101. package/dist/src/layouts/force-simulation.js.map +1 -0
  102. package/dist/src/layouts/forceatlas2.d.ts +210 -0
  103. package/dist/src/layouts/forceatlas2.d.ts.map +1 -0
  104. package/dist/src/layouts/forceatlas2.js +759 -0
  105. package/dist/src/layouts/forceatlas2.js.map +1 -0
  106. package/dist/src/layouts/inputs.d.ts +40 -0
  107. package/dist/src/layouts/inputs.d.ts.map +1 -0
  108. package/dist/src/layouts/inputs.js +185 -0
  109. package/dist/src/layouts/inputs.js.map +1 -0
  110. package/dist/src/layouts/repulsion-exact.d.ts +85 -0
  111. package/dist/src/layouts/repulsion-exact.d.ts.map +1 -0
  112. package/dist/src/layouts/repulsion-exact.js +134 -0
  113. package/dist/src/layouts/repulsion-exact.js.map +1 -0
  114. package/dist/src/layouts/seed.d.ts +56 -0
  115. package/dist/src/layouts/seed.d.ts.map +1 -0
  116. package/dist/src/layouts/seed.js +173 -0
  117. package/dist/src/layouts/seed.js.map +1 -0
  118. package/dist/src/memory/buffer-pool.d.ts +73 -0
  119. package/dist/src/memory/buffer-pool.d.ts.map +1 -0
  120. package/dist/src/memory/buffer-pool.js +170 -0
  121. package/dist/src/memory/buffer-pool.js.map +1 -0
  122. package/dist/src/memory/lease.d.ts +53 -0
  123. package/dist/src/memory/lease.d.ts.map +1 -0
  124. package/dist/src/memory/lease.js +85 -0
  125. package/dist/src/memory/lease.js.map +1 -0
  126. package/dist/src/memory/readback.d.ts +143 -0
  127. package/dist/src/memory/readback.d.ts.map +1 -0
  128. package/dist/src/memory/readback.js +375 -0
  129. package/dist/src/memory/readback.js.map +1 -0
  130. package/dist/src/memory/residency.d.ts +83 -0
  131. package/dist/src/memory/residency.d.ts.map +1 -0
  132. package/dist/src/memory/residency.js +573 -0
  133. package/dist/src/memory/residency.js.map +1 -0
  134. package/dist/src/memory/upload-plan.d.ts +101 -0
  135. package/dist/src/memory/upload-plan.d.ts.map +1 -0
  136. package/dist/src/memory/upload-plan.js +265 -0
  137. package/dist/src/memory/upload-plan.js.map +1 -0
  138. package/dist/src/node/index.d.ts +64 -0
  139. package/dist/src/node/index.d.ts.map +1 -0
  140. package/dist/src/node/index.js +183 -0
  141. package/dist/src/node/index.js.map +1 -0
  142. package/dist/src/primitives/reduce.d.ts +57 -0
  143. package/dist/src/primitives/reduce.d.ts.map +1 -0
  144. package/dist/src/primitives/reduce.js +161 -0
  145. package/dist/src/primitives/reduce.js.map +1 -0
  146. package/dist/src/primitives/segmented-reduce.d.ts +38 -0
  147. package/dist/src/primitives/segmented-reduce.d.ts.map +1 -0
  148. package/dist/src/primitives/segmented-reduce.js +211 -0
  149. package/dist/src/primitives/segmented-reduce.js.map +1 -0
  150. package/dist/src/types/accelerator.d.ts +209 -0
  151. package/dist/src/types/accelerator.d.ts.map +1 -0
  152. package/dist/src/types/accelerator.js +8 -0
  153. package/dist/src/types/accelerator.js.map +1 -0
  154. package/dist/src/types/context.d.ts +114 -0
  155. package/dist/src/types/context.d.ts.map +1 -0
  156. package/dist/src/types/context.js +7 -0
  157. package/dist/src/types/context.js.map +1 -0
  158. package/dist/src/types/layout.d.ts +95 -0
  159. package/dist/src/types/layout.d.ts.map +1 -0
  160. package/dist/src/types/layout.js +6 -0
  161. package/dist/src/types/layout.js.map +1 -0
  162. package/dist/src/types/memory.d.ts +22 -0
  163. package/dist/src/types/memory.d.ts.map +1 -0
  164. package/dist/src/types/memory.js +7 -0
  165. package/dist/src/types/memory.js.map +1 -0
  166. package/dist/src/types/options.d.ts +78 -0
  167. package/dist/src/types/options.d.ts.map +1 -0
  168. package/dist/src/types/options.js +7 -0
  169. package/dist/src/types/options.js.map +1 -0
  170. package/dist/src/types/run.d.ts +13 -0
  171. package/dist/src/types/run.d.ts.map +1 -0
  172. package/dist/src/types/run.js +6 -0
  173. package/dist/src/types/run.js.map +1 -0
  174. package/dist/src/wgsl/degree.wgsl.d.ts +10 -0
  175. package/dist/src/wgsl/degree.wgsl.d.ts.map +1 -0
  176. package/dist/src/wgsl/degree.wgsl.js +25 -0
  177. package/dist/src/wgsl/degree.wgsl.js.map +1 -0
  178. package/dist/src/wgsl/fa2-attraction.wgsl.d.ts +12 -0
  179. package/dist/src/wgsl/fa2-attraction.wgsl.d.ts.map +1 -0
  180. package/dist/src/wgsl/fa2-attraction.wgsl.js +37 -0
  181. package/dist/src/wgsl/fa2-attraction.wgsl.js.map +1 -0
  182. package/dist/src/wgsl/fa2-integrate.wgsl.d.ts +13 -0
  183. package/dist/src/wgsl/fa2-integrate.wgsl.d.ts.map +1 -0
  184. package/dist/src/wgsl/fa2-integrate.wgsl.js +69 -0
  185. package/dist/src/wgsl/fa2-integrate.wgsl.js.map +1 -0
  186. package/dist/src/wgsl/fa2-repulsion-exact.wgsl.d.ts +12 -0
  187. package/dist/src/wgsl/fa2-repulsion-exact.wgsl.d.ts.map +1 -0
  188. package/dist/src/wgsl/fa2-repulsion-exact.wgsl.js +79 -0
  189. package/dist/src/wgsl/fa2-repulsion-exact.wgsl.js.map +1 -0
  190. package/dist/src/wgsl/fa2-speed-finalize.wgsl.d.ts +15 -0
  191. package/dist/src/wgsl/fa2-speed-finalize.wgsl.d.ts.map +1 -0
  192. package/dist/src/wgsl/fa2-speed-finalize.wgsl.js +54 -0
  193. package/dist/src/wgsl/fa2-speed-finalize.wgsl.js.map +1 -0
  194. package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts +14 -0
  195. package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts.map +1 -0
  196. package/dist/src/wgsl/fa2-stats-finalize.wgsl.js +57 -0
  197. package/dist/src/wgsl/fa2-stats-finalize.wgsl.js.map +1 -0
  198. package/dist/src/wgsl/fa2-to-scene.wgsl.d.ts +11 -0
  199. package/dist/src/wgsl/fa2-to-scene.wgsl.d.ts.map +1 -0
  200. package/dist/src/wgsl/fa2-to-scene.wgsl.js +19 -0
  201. package/dist/src/wgsl/fa2-to-scene.wgsl.js.map +1 -0
  202. package/dist/src/wgsl/fill.wgsl.d.ts +7 -0
  203. package/dist/src/wgsl/fill.wgsl.d.ts.map +1 -0
  204. package/dist/src/wgsl/fill.wgsl.js +14 -0
  205. package/dist/src/wgsl/fill.wgsl.js.map +1 -0
  206. package/dist/src/wgsl/reduce.wgsl.d.ts +10 -0
  207. package/dist/src/wgsl/reduce.wgsl.d.ts.map +1 -0
  208. package/dist/src/wgsl/reduce.wgsl.js +63 -0
  209. package/dist/src/wgsl/reduce.wgsl.js.map +1 -0
  210. package/dist/src/wgsl/segmented-reduce.wgsl.d.ts +13 -0
  211. package/dist/src/wgsl/segmented-reduce.wgsl.d.ts.map +1 -0
  212. package/dist/src/wgsl/segmented-reduce.wgsl.js +35 -0
  213. package/dist/src/wgsl/segmented-reduce.wgsl.js.map +1 -0
  214. package/dist/tsconfig.build.tsbuildinfo +1 -0
  215. package/dist/webgpu-graph-algorithms.d.ts +1 -0
  216. package/dist/webgpu-graph-algorithms.js +4454 -0
  217. package/dist/webgpu-graph-algorithms.js.map +1 -0
  218. package/package.json +108 -17
  219. package/src/accelerator.ts +117 -0
  220. package/src/algorithms/degree.ts +142 -0
  221. package/src/browser/index.ts +57 -0
  222. package/src/constants.ts +116 -0
  223. package/src/context.ts +399 -0
  224. package/src/device/acquire.ts +256 -0
  225. package/src/device/caps.ts +122 -0
  226. package/src/device/error-scope.ts +171 -0
  227. package/src/device/lost.ts +142 -0
  228. package/src/device/webgpu-constants.ts +44 -0
  229. package/src/errors.ts +94 -0
  230. package/src/index.ts +102 -0
  231. package/src/kernel/batch.ts +427 -0
  232. package/src/kernel/dispatch.ts +162 -0
  233. package/src/kernel/kernel.ts +311 -0
  234. package/src/kernel/pipeline-cache.ts +288 -0
  235. package/src/kernel/prelude.ts +229 -0
  236. package/src/kernel/profiler.ts +148 -0
  237. package/src/kernel/struct-block.ts +439 -0
  238. package/src/kernel/uniform-ring.ts +184 -0
  239. package/src/kernel/wgsl.ts +490 -0
  240. package/src/kernels.ts +511 -0
  241. package/src/layouts/force-simulation.ts +2111 -0
  242. package/src/layouts/forceatlas2.ts +942 -0
  243. package/src/layouts/inputs.ts +252 -0
  244. package/src/layouts/repulsion-exact.ts +183 -0
  245. package/src/layouts/seed.ts +198 -0
  246. package/src/memory/buffer-pool.ts +204 -0
  247. package/src/memory/lease.ts +93 -0
  248. package/src/memory/readback.ts +429 -0
  249. package/src/memory/residency.ts +753 -0
  250. package/src/memory/upload-plan.ts +350 -0
  251. package/src/node/index.ts +230 -0
  252. package/src/primitives/reduce.ts +233 -0
  253. package/src/primitives/segmented-reduce.ts +270 -0
  254. package/src/types/accelerator.ts +236 -0
  255. package/src/types/context.ts +135 -0
  256. package/src/types/layout.ts +103 -0
  257. package/src/types/memory.ts +23 -0
  258. package/src/types/options.ts +84 -0
  259. package/src/types/run.ts +13 -0
  260. package/src/wgsl/degree.wgsl.ts +24 -0
  261. package/src/wgsl/fa2-attraction.wgsl.ts +37 -0
  262. package/src/wgsl/fa2-integrate.wgsl.ts +69 -0
  263. package/src/wgsl/fa2-repulsion-exact.wgsl.ts +78 -0
  264. package/src/wgsl/fa2-speed-finalize.wgsl.ts +53 -0
  265. package/src/wgsl/fa2-stats-finalize.wgsl.ts +57 -0
  266. package/src/wgsl/fa2-to-scene.wgsl.ts +19 -0
  267. package/src/wgsl/fill.wgsl.ts +13 -0
  268. package/src/wgsl/reduce.wgsl.ts +62 -0
  269. package/src/wgsl/segmented-reduce.wgsl.ts +35 -0
@@ -0,0 +1,209 @@
1
+ /**
2
+ * The structural mirrors of @graphty/layout's LayoutSimulation / LayoutAccelerator (spec 9.3) and of
3
+ * the @graphty/algorithms AlgorithmAccelerator (spec 9.2), plus the package's own accelerator surface (spec 3.3).
4
+ * Until W1 these ARE the mirrors (D27): from W1 the mirrors become `import type` of the real packages and
5
+ * test/types/conformance.test-d.ts asserts mutual assignability. Types only.
6
+ */
7
+ import type { F32, F64, GraphSnapshot, NodeMask, NumericVector, U32 } from "@graphty/graph-format";
8
+ import type { GpuContext } from "../context.js";
9
+ import type { ForceAtlas2Stats, GpuLayoutSimulation, GpuLayoutTuning } from "./layout.js";
10
+ import type { ForceAtlas2Options, FruchtermanReingoldOptions, SpringElectricalOptions } from "./options.js";
11
+ /** Design 14.3 LayoutSimulation, verbatim. */
12
+ export interface LayoutSimulation {
13
+ load(snapshot: GraphSnapshot, positions: F32): void;
14
+ step(iterations?: number): void | Promise<void>;
15
+ readonly settled: boolean;
16
+ setFixed(mask: NodeMask): void;
17
+ setPosition(index: number, x: number, y: number, z: number): void;
18
+ dispose(): void;
19
+ }
20
+ /**
21
+ * Spec 9.3 LayoutAccelerator, verbatim.
22
+ * Exported: published mirror (spec 3.3, D27); re-exported from src/index.ts at P3-T3.
23
+ * @public
24
+ */
25
+ export interface LayoutAccelerator {
26
+ readonly kind: string;
27
+ forceAtlas2?(options?: ForceAtlas2Options): LayoutSimulation;
28
+ fruchtermanReingold?(options?: FruchtermanReingoldOptions): LayoutSimulation;
29
+ springElectrical?(options?: SpringElectricalOptions): LayoutSimulation;
30
+ release?(s: GraphSnapshot): void;
31
+ dispose?(): void;
32
+ }
33
+ /**
34
+ * Placeholder for the CPU option types the AlgorithmAccelerator methods take before A2 lands (spec 9.2: "the
35
+ * accelerator methods reuse the indexed.* option types").
36
+ * Exported: published mirror (spec 9.2); re-exported from src/index.ts at P3-T3.
37
+ * @public
38
+ */
39
+ export type CpuAlgorithmOptions = Readonly<Record<string, unknown>>;
40
+ /**
41
+ * Score-shaped result of the CPU package (spec 9.7).
42
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
43
+ * @public
44
+ */
45
+ export interface ScoresResultLike {
46
+ readonly scores: NumericVector;
47
+ readonly iterations: number;
48
+ readonly converged: boolean;
49
+ }
50
+ /**
51
+ * PageRank result mirror.
52
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
53
+ * @public
54
+ */
55
+ export interface PageRankResultLike extends ScoresResultLike {
56
+ readonly danglingMass?: number | undefined;
57
+ }
58
+ /**
59
+ * HITS result mirror.
60
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
61
+ * @public
62
+ */
63
+ export interface HitsResultLike {
64
+ readonly hubs: NumericVector;
65
+ readonly authorities: NumericVector;
66
+ readonly iterations: number;
67
+ readonly converged: boolean;
68
+ }
69
+ /**
70
+ * Label result mirror (components, label propagation).
71
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
72
+ * @public
73
+ */
74
+ export interface LabelResultLike {
75
+ readonly labels: U32;
76
+ readonly count: number;
77
+ groups(): U32[];
78
+ }
79
+ /**
80
+ * BFS result mirror.
81
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
82
+ * @public
83
+ */
84
+ export interface BfsResultLike {
85
+ readonly depth: U32;
86
+ readonly parent: U32;
87
+ readonly order: U32;
88
+ readonly visitedCount: number;
89
+ }
90
+ /**
91
+ * SSSP result mirror.
92
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
93
+ * @public
94
+ */
95
+ export interface SsspResultLike {
96
+ readonly dist: NumericVector;
97
+ readonly predArc: U32;
98
+ }
99
+ /**
100
+ * Bellman-Ford result mirror.
101
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
102
+ * @public
103
+ */
104
+ export interface BellmanFordResultLike extends SsspResultLike {
105
+ readonly hasNegativeCycle: boolean;
106
+ }
107
+ /**
108
+ * Edge-score result mirror.
109
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
110
+ * @public
111
+ */
112
+ export interface EdgeScoresResultLike {
113
+ readonly scores: NumericVector;
114
+ }
115
+ /**
116
+ * APSP result mirror.
117
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
118
+ * @public
119
+ */
120
+ export interface ApspResultLike {
121
+ readonly dist: NumericVector;
122
+ readonly n: number;
123
+ }
124
+ /**
125
+ * k-core result mirror.
126
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
127
+ * @public
128
+ */
129
+ export interface CorenessResultLike {
130
+ readonly coreness: U32;
131
+ }
132
+ /**
133
+ * Minimum-spanning-tree result mirror.
134
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
135
+ * @public
136
+ */
137
+ export interface MstResultLike {
138
+ readonly edges: U32;
139
+ readonly totalWeight: number;
140
+ }
141
+ /**
142
+ * Community result mirror (Louvain).
143
+ * Exported: published mirror; re-exported from src/index.ts at P3-T3.
144
+ * @public
145
+ */
146
+ export interface CommunityResultLike extends LabelResultLike {
147
+ readonly modularity: number;
148
+ }
149
+ /**
150
+ * Spec 9.2 AlgorithmAccelerator, verbatim (every member optional; option types are CpuAlgorithmOptions until A2).
151
+ * Exported: published mirror (spec 9.2, D27); re-exported from src/index.ts at P3-T3.
152
+ * @public
153
+ */
154
+ export interface AlgorithmAccelerator {
155
+ readonly kind: string;
156
+ pageRank?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<PageRankResultLike>;
157
+ personalizedPageRank?(s: GraphSnapshot, personalization: F32 | F64, options?: CpuAlgorithmOptions): Promise<PageRankResultLike>;
158
+ hits?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<HitsResultLike>;
159
+ eigenvectorCentrality?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<ScoresResultLike>;
160
+ katzCentrality?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<ScoresResultLike>;
161
+ connectedComponents?(s: GraphSnapshot): Promise<LabelResultLike>;
162
+ weaklyConnectedComponents?(s: GraphSnapshot): Promise<LabelResultLike>;
163
+ breadthFirstSearch?(s: GraphSnapshot, source: number, options?: CpuAlgorithmOptions): Promise<BfsResultLike>;
164
+ sssp?(s: GraphSnapshot, source: number, options?: CpuAlgorithmOptions): Promise<SsspResultLike>;
165
+ bellmanFord?(s: GraphSnapshot, source: number, options?: CpuAlgorithmOptions): Promise<BellmanFordResultLike>;
166
+ closenessCentrality?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<ScoresResultLike>;
167
+ betweennessCentrality?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<ScoresResultLike>;
168
+ edgeBetweennessCentrality?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<EdgeScoresResultLike>;
169
+ allPairsShortestPath?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<ApspResultLike>;
170
+ kCoreDecomposition?(s: GraphSnapshot): Promise<CorenessResultLike>;
171
+ triangleCount?(s: GraphSnapshot): Promise<{
172
+ readonly perNode: U32;
173
+ readonly total: number;
174
+ }>;
175
+ labelPropagation?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<LabelResultLike>;
176
+ minimumSpanningTree?(s: GraphSnapshot): Promise<MstResultLike>;
177
+ louvain?(s: GraphSnapshot, options?: CpuAlgorithmOptions): Promise<CommunityResultLike>;
178
+ release?(s: GraphSnapshot): void;
179
+ dispose?(): void;
180
+ }
181
+ /**
182
+ * Spec 3.3 AcceleratorOptions, verbatim.
183
+ * Exported: consumed by src/accelerator.ts (P3-T3); re-exported from src/index.ts at P3-T3.
184
+ * @public
185
+ */
186
+ export interface AcceleratorOptions {
187
+ readonly layout?: GpuLayoutTuning | undefined;
188
+ readonly algorithms?: {
189
+ readonly betweenness?: {
190
+ readonly k?: number | undefined;
191
+ readonly sources?: readonly number[] | undefined;
192
+ } | undefined;
193
+ } | undefined;
194
+ }
195
+ /**
196
+ * The injectable object (spec 3.3); at P3 it carries forceAtlas2, release and dispose -- the algorithm members
197
+ * arrive with P7+.
198
+ * Exported: implemented by src/accelerator.ts (P3-T3); re-exported from src/index.ts at P3-T3.
199
+ * @public
200
+ */
201
+ export interface GpuAccelerator extends AlgorithmAccelerator, LayoutAccelerator {
202
+ readonly kind: "webgpu";
203
+ readonly ctx: GpuContext;
204
+ readonly options: Readonly<AcceleratorOptions>;
205
+ forceAtlas2(options?: ForceAtlas2Options): GpuLayoutSimulation<ForceAtlas2Options, ForceAtlas2Stats>;
206
+ release(s: GraphSnapshot): void;
207
+ dispose(): void;
208
+ }
209
+ //# sourceMappingURL=accelerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accelerator.d.ts","sourceRoot":"","sources":["../../../src/types/accelerator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEnG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAI5G,8CAA8C;AAC9C,MAAM,WAAW,gBAAgB;IAC7B,IAAI,CAAC,QAAQ,EA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C,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACjC,OAAO,CAAC,IAAI,IAAI,CAAC;CACpB;AAID;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EACd;QACI,QAAQ,CAAC,WAAW,CAAC,EACjB;YAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;SAAE,GAAG,SAAS,CAAC;KACzG,GACD,SAAS,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,oBAAoB,EAAE,iBAAiB;IAC3E,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAC/C,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;IACrG,OAAO,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,OAAO,IAAI,IAAI,CAAC;CACnB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The structural mirrors of @graphty/layout's LayoutSimulation / LayoutAccelerator (spec 9.3) and of
3
+ * the @graphty/algorithms AlgorithmAccelerator (spec 9.2), plus the package's own accelerator surface (spec 3.3).
4
+ * Until W1 these ARE the mirrors (D27): from W1 the mirrors become `import type` of the real packages and
5
+ * test/types/conformance.test-d.ts asserts mutual assignability. Types only.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=accelerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accelerator.js","sourceRoot":"","sources":["../../../src/types/accelerator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Context and capability types (spec 2.2, 3.3; contract 3.3). Types only: the file imports the error class
3
+ * as a type, so every layer may `import type` from it without a value edge (the src/types zone of the
4
+ * package eslint config). P0-T3 wrote AdapterInfoLike and AdapterSummary; P1-T1 completes the file.
5
+ */
6
+ import type { WebGpuGraphError } from "../errors.js";
7
+ /** The limits `"raise"` takes from the adapter (spec 2.2); maxComputeWorkgroupsPerDimension is deliberately absent. */
8
+ export type RaisableLimit = "maxBufferSize" | "maxStorageBufferBindingSize" | "maxStorageBuffersPerShaderStage" | "maxComputeWorkgroupStorageSize" | "maxComputeInvocationsPerWorkgroup" | "maxComputeWorkgroupSizeX";
9
+ /** How `create()` builds `requiredLimits` (spec 2.2 step 3). */
10
+ export type LimitPolicy = "default" | "raise" | Readonly<Partial<Record<RaisableLimit, number>>>;
11
+ /** Options of GpuContext.create (spec 2.2). */
12
+ export interface GpuContextOptions {
13
+ /** browser: navigator.gpu; Node: the handle of createNodeGpu(). */
14
+ readonly gpu?: GPU | undefined;
15
+ /** Skips requestAdapter(); the adapter must be UNUSED (spec 2.2 step 1). */
16
+ readonly adapter?: GPUAdapter | undefined;
17
+ /** Adopts a device the caller owns (ownsDevice false). */
18
+ readonly device?: GPUDevice | undefined;
19
+ /** Default "high-performance". */
20
+ readonly powerPreference?: GPUPowerPreference | undefined;
21
+ /** Default false; true -> E_SOFTWARE_ONLY instead of a device on lavapipe / SwiftShader. */
22
+ readonly rejectSoftware?: boolean | undefined;
23
+ /** Default "raise". */
24
+ readonly limits?: LimitPolicy | undefined;
25
+ /** Default ["subgroups", "timestamp-query"]; requested only when the adapter has them. */
26
+ readonly optionalFeatures?: readonly GPUFeatureName[] | undefined;
27
+ /** Default []; a missing one -> E_NO_DEVICE. */
28
+ readonly requiredFeatures?: readonly GPUFeatureName[] | undefined;
29
+ /** The device label and the context label (default "webgpu-graph-algorithms"). */
30
+ readonly label?: string | undefined;
31
+ /** The uncapturederror sink; default: keep the last error and throw it from the next public call (spec 5.7). */
32
+ readonly onError?: ((error: WebGpuGraphError) => void) | undefined;
33
+ /** Default 2: console.warn once when more snapshots than this are resident (spec 4.1). */
34
+ readonly warnUnreleasedSnapshots?: number | undefined;
35
+ /** CONTRACT DECISION: set by the ./browser and ./node entries ("browser" / "node"), never by sniffing globals (spec 2.2 step 4); consumers leave it unset ("unknown"). */
36
+ readonly runtime?: "browser" | "node" | "unknown" | undefined;
37
+ }
38
+ /** The structural subset of GPUAdapterInfo the package reads (CONTRACT DECISION: structural so tests can fake it without the __brand of @webgpu/types). */
39
+ export interface AdapterInfoLike {
40
+ readonly vendor: string;
41
+ readonly architecture: string;
42
+ readonly device: string;
43
+ readonly description: string;
44
+ readonly isFallbackAdapter?: boolean | undefined;
45
+ readonly subgroupMinSize?: number | undefined;
46
+ readonly subgroupMaxSize?: number | undefined;
47
+ }
48
+ /** What the app displays or logs about an adapter (spec 2.2). */
49
+ export interface AdapterSummary {
50
+ readonly vendor: string;
51
+ readonly architecture: string;
52
+ readonly device: string;
53
+ readonly description: string;
54
+ readonly software: boolean;
55
+ readonly subgroupMinSize: number;
56
+ readonly subgroupMaxSize: number;
57
+ readonly features: readonly string[];
58
+ readonly limits: Readonly<Record<string, number>>;
59
+ }
60
+ /** Result of GpuContext.probe (spec 2.2); `adapter` is the UNUSED adapter to pass to create({ adapter }). */
61
+ export interface ProbeResult {
62
+ readonly ok: boolean;
63
+ readonly code: "OK" | "E_NO_WEBGPU" | "E_NO_ADAPTER" | "E_SOFTWARE_ONLY";
64
+ readonly reason: string | null;
65
+ readonly adapter: GPUAdapter | null;
66
+ readonly summary: AdapterSummary | null;
67
+ }
68
+ /** Options of GpuContext.probe (spec 2.2). `gpu` may be undefined so an app can pass `navigator.gpu` without a guard: undefined -> E_NO_WEBGPU. */
69
+ export interface ProbeOptions {
70
+ readonly gpu: GPU | undefined;
71
+ readonly powerPreference?: GPUPowerPreference | undefined;
72
+ readonly rejectSoftware?: boolean | undefined;
73
+ }
74
+ /** The limits every planner reads; GPUSupportedLimits is structurally assignable to it (CONTRACT DECISION: planners take PlanCaps so faked tables need no cast). */
75
+ export interface PlanLimits {
76
+ readonly maxBufferSize: number;
77
+ readonly maxStorageBufferBindingSize: number;
78
+ readonly maxStorageBuffersPerShaderStage: number;
79
+ readonly minStorageBufferOffsetAlignment: number;
80
+ readonly minUniformBufferOffsetAlignment: number;
81
+ readonly maxComputeWorkgroupsPerDimension: number;
82
+ readonly maxComputeInvocationsPerWorkgroup: number;
83
+ readonly maxComputeWorkgroupSizeX: number;
84
+ readonly maxComputeWorkgroupStorageSize: number;
85
+ readonly maxUniformBufferBindingSize: number;
86
+ }
87
+ /** The capability record every planner and kernel reads (spec 3.3). */
88
+ export interface GpuCaps {
89
+ /** device.limits (never adapter.limits, spec 2.2 step 4). */
90
+ readonly limits: GPUSupportedLimits;
91
+ /** device.features. */
92
+ readonly features: ReadonlySet<string>;
93
+ /** navigator.gpu.wgslLanguageFeatures / the Dawn equivalent; informational only (never relied on). */
94
+ readonly wgslFeatures: ReadonlySet<string>;
95
+ /** 0 when the "subgroups" feature is absent from the device. */
96
+ readonly subgroupMinSize: number;
97
+ /** 0 when the "subgroups" feature is absent from the device. */
98
+ readonly subgroupMaxSize: number;
99
+ readonly software: boolean;
100
+ readonly runtime: "browser" | "node" | "unknown";
101
+ readonly vendor: string;
102
+ readonly architecture: string;
103
+ readonly device: string;
104
+ readonly description: string;
105
+ }
106
+ /** What the pure planners need of GpuCaps: `limits` narrowed to PlanLimits plus the four scalar facts. A GpuCaps IS a PlanCaps. */
107
+ export interface PlanCaps {
108
+ readonly limits: PlanLimits;
109
+ readonly features: ReadonlySet<string>;
110
+ readonly subgroupMinSize: number;
111
+ readonly subgroupMaxSize: number;
112
+ readonly software: boolean;
113
+ }
114
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/types/context.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AAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,gEAAgE;IAChE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAChC;AAED,mIAAmI;AACnI,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC9B"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Context and capability types (spec 2.2, 3.3; contract 3.3). Types only: the file imports the error class
3
+ * as a type, so every layer may `import type` from it without a value edge (the src/types zone of the
4
+ * package eslint config). P0-T3 wrote AdapterInfoLike and AdapterSummary; P1-T1 completes the file.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/types/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * The layout-facing public types (spec 3.3, 7.19): the stats records, the GPU simulation interface that extends the
3
+ * design-14.3 LayoutSimulation mirror, the run options and the GPU-only tuning knobs. Types only.
4
+ */
5
+ import type { F32, GraphSnapshot, NodeMask } from "@graphty/graph-format";
6
+ import type { LayoutSimulation } from "./accelerator.js";
7
+ /** Spec 3.3 LayoutStatsBase, verbatim; the three grid fields are null on the exact tier (P3 always). */
8
+ export interface LayoutStatsBase {
9
+ readonly iteration: number;
10
+ readonly meanDisplacement: number;
11
+ readonly rmsRadius: number;
12
+ readonly layoutRadius: number;
13
+ readonly centroid: readonly [number, number, number];
14
+ readonly repulsionTier: "exact" | "grid";
15
+ readonly maxCellOccupancy: number | null;
16
+ readonly outsideGrid: number | null;
17
+ readonly msPerIteration: number | null;
18
+ }
19
+ /**
20
+ * One per-iteration trace record of the last completed batch (spec 3.3 ForceAtlas2Stats.trace element).
21
+ * Exported: the element type of ForceAtlas2Stats.trace; re-exported from src/index.ts at P3-T3.
22
+ * @public
23
+ */
24
+ export interface ForceAtlas2TraceRecord {
25
+ readonly swing: number;
26
+ readonly traction: number;
27
+ readonly speed: number;
28
+ readonly speedEfficiency: number;
29
+ readonly meanDisplacement: number;
30
+ readonly settledCount: number;
31
+ }
32
+ /** Spec 3.3 ForceAtlas2Stats, verbatim. */
33
+ export interface ForceAtlas2Stats extends LayoutStatsBase {
34
+ readonly swing: number;
35
+ readonly traction: number;
36
+ readonly speed: number;
37
+ readonly speedEfficiency: number;
38
+ readonly trace: ReadonlyArray<ForceAtlas2TraceRecord>;
39
+ }
40
+ /** Options of GpuLayoutSimulation.run (spec 3.3). */
41
+ export interface RunOptions {
42
+ readonly maxIter?: number | undefined;
43
+ readonly batch?: number | undefined;
44
+ readonly signal?: AbortSignal | undefined;
45
+ }
46
+ /** Spec 3.3 GpuLayoutSimulation, verbatim (LayoutSimulation is the design-14.3 mirror of accelerator.ts). */
47
+ export interface GpuLayoutSimulation<Options, Stats extends LayoutStatsBase> extends LayoutSimulation {
48
+ load(snapshot: GraphSnapshot, positions: F32): void;
49
+ /**
50
+ * Submits k iterations; resolves when their batch has been read back into `positions`. With `maxInFlight`
51
+ * batches in flight the call COALESCES: nothing is queued and the OLDEST pending batch's promise is returned
52
+ * (spec 7.19 item 3).
53
+ * @param iterations - the number of iterations to submit (default `iterationsPerStep`)
54
+ * @returns resolves when the batch carrying them has landed in the owner's array
55
+ */
56
+ step(iterations?: number): Promise<void>;
57
+ readonly settled: boolean;
58
+ setFixed(mask: NodeMask): void;
59
+ setPosition(index: number, x: number, y: number, z: number): void;
60
+ dispose(): void;
61
+ readonly inFlight: number;
62
+ readonly iterationsDone: number;
63
+ readonly stats: Stats;
64
+ flush(): Promise<void>;
65
+ reheat(): void;
66
+ setParams(patch: Partial<Options>): void;
67
+ run(options?: RunOptions): Promise<Stats>;
68
+ inspect?(name: string): Promise<Float32Array | Uint32Array>;
69
+ }
70
+ /**
71
+ * Spec 3.3 GpuLayoutTuning, verbatim; the grid knobs are accepted and stored in P3 but only `repulsion`,
72
+ * `exactMaxNodes`, `deterministic` and `compat` have an effect (grid tier = P4).
73
+ */
74
+ export interface GpuLayoutTuning {
75
+ readonly repulsion?: "exact" | "grid" | "auto" | undefined;
76
+ readonly exactMaxNodes?: number | undefined;
77
+ readonly nearMax?: number | undefined;
78
+ readonly deterministic?: boolean | undefined;
79
+ readonly gridMax2D?: number | undefined;
80
+ readonly gridMax3D?: number | undefined;
81
+ readonly extentFactor?: number | undefined;
82
+ readonly compat?: "paper" | "networkx" | undefined;
83
+ }
84
+ /** The resolved tuning record (defaults from constants.ts LAYOUT_TUNING_DEFAULTS applied). */
85
+ export interface ResolvedLayoutTuning {
86
+ readonly repulsion: "exact" | "grid" | "auto";
87
+ readonly exactMaxNodes: number;
88
+ readonly nearMax: number;
89
+ readonly deterministic: boolean;
90
+ readonly gridMax2D: number;
91
+ readonly gridMax3D: number;
92
+ readonly extentFactor: number;
93
+ readonly compat: "paper" | "networkx";
94
+ }
95
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/types/layout.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;A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C5B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;CACtD;AAED,8FAA8F;AAC9F,MAAM,WAAW,oBAAoB;IACjC,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAAC;CACzC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The layout-facing public types (spec 3.3, 7.19): the stats records, the GPU simulation interface that extends the
3
+ * design-14.3 LayoutSimulation mirror, the run options and the GPU-only tuning knobs. Types only.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/types/layout.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The two types the memory AND the kernel layers share (spec 4.1, 4.2; contract 3.3 CONTRACT DECISION):
3
+ * they live here so src/kernel/kernel.ts never imports src/memory/** for a type and the layer graph has no
4
+ * P1 cycle (test/layers.test.ts). Types only; GPUBuffer is the ambient @webgpu/types global.
5
+ */
6
+ /** One 64-arc-aligned window of colIdx / weights (spec 4.2). P1-P3 PLAN windows; executing them is P4. */
7
+ export interface ArcWindow {
8
+ readonly start: number;
9
+ readonly end: number;
10
+ readonly rowFirst: number;
11
+ readonly rowLast: number;
12
+ readonly bufferIndex: number;
13
+ readonly offset: number;
14
+ }
15
+ /** A storage-buffer range (spec 4.1); `window` is non-null only for a binding of one arc window. */
16
+ export interface Binding {
17
+ readonly buffer: GPUBuffer;
18
+ readonly offset: number;
19
+ readonly size: number;
20
+ readonly window: ArcWindow | null;
21
+ }
22
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/types/memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0GAA0G;AAC1G,MAAM,WAAW,SAAS;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAED,oGAAoG;AACpG,MAAM,WAAW,OAAO;IACpB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;CACrC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The two types the memory AND the kernel layers share (spec 4.1, 4.2; contract 3.3 CONTRACT DECISION):
3
+ * they live here so src/kernel/kernel.ts never imports src/memory/** for a type and the layer graph has no
4
+ * P1 cycle (test/layers.test.ts). Types only; GPUBuffer is the ambient @webgpu/types global.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../src/types/memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * The option records of the layouts (spec 9.3, 7.14): structural mirrors of @graphty/layout's option types (D27),
3
+ * copied field for field so a `ForceAtlas2Options` object the element parses is accepted here without a cast. Types
4
+ * only: this file imports nothing at runtime.
5
+ */
6
+ import type { F32, NodeId, NodeMask } from "@graphty/graph-format";
7
+ /** Design 14.3 CommonLayoutOptions, mirrored verbatim. */
8
+ export interface CommonLayoutOptions {
9
+ readonly dim?: 2 | 3 | undefined;
10
+ readonly scale?: number | undefined;
11
+ readonly center?: ArrayLike<number> | undefined;
12
+ readonly seed?: number | null | undefined;
13
+ }
14
+ /** Spec 9.3 SimulationOptions, mirrored verbatim (layout-owned; the CPU simulations ignore maxInFlight). */
15
+ export interface SimulationOptions {
16
+ readonly settleThreshold?: number | undefined;
17
+ readonly settleWindow?: number | undefined;
18
+ readonly iterationsPerStep?: number | undefined;
19
+ readonly maxInFlight?: number | undefined;
20
+ }
21
+ /**
22
+ * Spec 9.3 ForceAtlas2Options, mirrored verbatim (same names and defaults as
23
+ * layout/src/layouts/force-directed/forceatlas2.ts lines 26-42).
24
+ */
25
+ export interface ForceAtlas2Options extends CommonLayoutOptions, SimulationOptions {
26
+ readonly maxIter?: number | undefined;
27
+ readonly jitterTolerance?: number | undefined;
28
+ readonly scalingRatio?: number | undefined;
29
+ readonly gravity?: number | undefined;
30
+ readonly strongGravity?: boolean | undefined;
31
+ readonly distributedAction?: boolean | undefined;
32
+ readonly linlog?: boolean | undefined;
33
+ readonly nodeMass?: F32 | string | Readonly<Record<NodeId, number>> | null | undefined;
34
+ readonly nodeSize?: F32 | string | Readonly<Record<NodeId, number>> | null | undefined;
35
+ readonly weight?: boolean | string | null | undefined;
36
+ readonly dissuadeHubs?: boolean | undefined;
37
+ }
38
+ /** Spec 9.3 FruchtermanReingoldOptions, mirrored for the LayoutAccelerator mirror's method signature (P5 implements it). */
39
+ export interface FruchtermanReingoldOptions extends CommonLayoutOptions, SimulationOptions {
40
+ readonly k?: number | null | undefined;
41
+ readonly iterations?: number | undefined;
42
+ readonly fixed?: NodeMask | string | null | undefined;
43
+ }
44
+ /** Spec 9.3 SpringElectricalOptions, mirrored for the LayoutAccelerator mirror's method signature (P5 implements it). */
45
+ export interface SpringElectricalOptions extends CommonLayoutOptions, SimulationOptions {
46
+ readonly springLength?: number | undefined;
47
+ readonly springCoefficient?: number | undefined;
48
+ readonly gravity?: number | undefined;
49
+ readonly dragCoefficient?: number | undefined;
50
+ readonly timeStep?: number | undefined;
51
+ }
52
+ /**
53
+ * The resolved (defaults applied) ForceAtlas2 option record the simulation keeps; every field present.
54
+ * Exported: consumed by src/layouts/forceatlas2.ts (P3-T2, resolveForceAtlas2Options) and the option tests.
55
+ * @public
56
+ */
57
+ export interface ResolvedForceAtlas2Options {
58
+ readonly maxIter: number;
59
+ readonly jitterTolerance: number;
60
+ readonly scalingRatio: number;
61
+ readonly gravity: number;
62
+ readonly strongGravity: boolean;
63
+ readonly distributedAction: boolean;
64
+ readonly linlog: boolean;
65
+ readonly nodeMass: F32 | string | Readonly<Record<NodeId, number>> | null;
66
+ readonly nodeSize: F32 | string | Readonly<Record<NodeId, number>> | null;
67
+ readonly weight: boolean | string | null;
68
+ readonly dissuadeHubs: boolean;
69
+ readonly dim: 2 | 3;
70
+ readonly scale: number;
71
+ readonly center: readonly [number, number, number];
72
+ readonly seed: number | null;
73
+ readonly settleThreshold: number;
74
+ readonly settleWindow: number;
75
+ readonly iterationsPerStep: number;
76
+ readonly maxInFlight: number;
77
+ }
78
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/types/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEnE,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC7C;AAED,4GAA4G;AAC5G,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB,EAAE,iBAAiB;IAC9E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,C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AAC;CAChC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The option records of the layouts (spec 9.3, 7.14): structural mirrors of @graphty/layout's option types (D27),
3
+ * copied field for field so a `ForceAtlas2Options` object the element parses is accepted here without a cast. Types
4
+ * only: this file imports nothing at runtime.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/types/options.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The run options every algorithm function accepts beside its own (spec 3.3, design 10.7; contract 3.3).
3
+ * Types only.
4
+ */
5
+ /** Options every algorithm function accepts in addition to its own (spec 3.3, design 10.7). */
6
+ export interface GpuRunOptions {
7
+ /** A preallocated destination of exact length; E_INVALID_ARGUMENT when the length does not match. */
8
+ readonly dest?: Float32Array | Uint32Array | undefined;
9
+ /** Checked between batches; E_ABORTED. */
10
+ readonly signal?: AbortSignal | undefined;
11
+ readonly onProgress?: ((done: number, total: number) => void) | undefined;
12
+ }
13
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/types/run.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC1B,qGAAqG;IACrG,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;IACvD,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC7E"}