@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,70 @@
1
+ /**
2
+ * The UniformRing of spec 5.3: one UNIFORM buffer holding UNIFORM_SLOT_BYTES-stride slots for the
3
+ * per-iteration params of a batch. A batch reserves k contiguous slots, writes their values into the
4
+ * host shadow, flushes them with ONE queue.writeBuffer and records k dispatches that select their slot
5
+ * through a dynamic offset -- no per-iteration writeBuffer and no host round trip. The stride is 256
6
+ * because minUniformBufferOffsetAlignment is 256 on every runtime the package targets (the Dawn-node
7
+ * ADAPTER advertises 64, which the package never requests; spec 2.6).
8
+ */
9
+ import type { AllocationTracker } from "../device/error-scope.js";
10
+ import type { Binding } from "../types/memory.js";
11
+ import type { UniformBlock, UniformValues } from "./struct-block.js";
12
+ /** One UNIFORM buffer with UNIFORM_SLOT_BYTES-stride slots for the per-iteration params of a batch (spec 5.3). */
13
+ export declare class UniformRing {
14
+ /** Number of slots. */
15
+ readonly slots: number;
16
+ private readonly device;
17
+ private readonly allocator;
18
+ private readonly buffer;
19
+ private readonly label;
20
+ private readonly shadow;
21
+ private readonly view;
22
+ private next;
23
+ private dirtyLo;
24
+ private dirtyHi;
25
+ private destroyed;
26
+ /**
27
+ * Creates the ring buffer (`slots x UNIFORM_SLOT_BYTES` bytes, UNIFORM | COPY_DST) through the allocator.
28
+ * @param device - the device the buffer belongs to
29
+ * @param allocator - the context's OOM-scoped allocator (the buffer is destroyed through it)
30
+ * @param slots - number of slots; E_INVALID_ARGUMENT unless a positive integer
31
+ * @param label - the buffer label
32
+ */
33
+ constructor(device: GPUDevice, allocator: AllocationTracker, slots: number, label: string);
34
+ /**
35
+ * The whole-buffer binding a kernel binds once (size = the block's byteLength; the slot is the dynamic offset).
36
+ * @param block - the params block the kernel declares for this binding
37
+ * @returns the binding at offset 0 of the ring buffer
38
+ */
39
+ binding(block: UniformBlock): Binding;
40
+ /**
41
+ * Byte offset of a slot (the dynamic offset a dispatch passes for it).
42
+ * @param slot - a slot index in [0, slots)
43
+ * @returns slot x UNIFORM_SLOT_BYTES
44
+ */
45
+ offsetOf(slot: number): number;
46
+ /**
47
+ * Reserves `count` contiguous slots for a batch, wrapping to 0 when the tail is too short; E_INVALID_ARGUMENT when count > slots.
48
+ * @param count - slots needed, in [1, slots]
49
+ * @returns the first slot of the reservation
50
+ */
51
+ reserve(count: number): number;
52
+ /**
53
+ * Writes one block's values into a slot of the host shadow; `flush()` sends the dirty range with one writeBuffer.
54
+ * @param slot - the slot to fill
55
+ * @param block - the block whose layout the bytes follow
56
+ * @param values - the field values (a missing field is written as 0 by the block)
57
+ */
58
+ write(slot: number, block: UniformBlock, values: UniformValues): void;
59
+ /**
60
+ * queue.writeBuffer of the dirty slots (called by the batch driver before submit): one call covering
61
+ * [lowest dirty slot, highest dirty slot]; nothing when no slot is dirty.
62
+ */
63
+ flush(): void;
64
+ /** Destroys the buffer (through the allocator); idempotent. */
65
+ destroy(): void;
66
+ private assertLive;
67
+ private checkSlot;
68
+ private assertFits;
69
+ }
70
+ //# sourceMappingURL=uniform-ring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uniform-ring.d.ts","sourceRoot":"","sources":["../../../src/kernel/uniform-ring.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,C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 * per-iteration params of a batch. A batch reserves k contiguous slots, writes their values into the
4
+ * host shadow, flushes them with ONE queue.writeBuffer and records k dispatches that select their slot
5
+ * through a dynamic offset -- no per-iteration writeBuffer and no host round trip. The stride is 256
6
+ * because minUniformBufferOffsetAlignment is 256 on every runtime the package targets (the Dawn-node
7
+ * ADAPTER advertises 64, which the package never requests; spec 2.6).
8
+ */
9
+ import { UNIFORM_SLOT_BYTES } from "../constants.js";
10
+ import { BufferUsage } from "../device/webgpu-constants.js";
11
+ import { WebGpuGraphError } from "../errors.js";
12
+ /** One UNIFORM buffer with UNIFORM_SLOT_BYTES-stride slots for the per-iteration params of a batch (spec 5.3). */
13
+ export class UniformRing {
14
+ /**
15
+ * Creates the ring buffer (`slots x UNIFORM_SLOT_BYTES` bytes, UNIFORM | COPY_DST) through the allocator.
16
+ * @param device - the device the buffer belongs to
17
+ * @param allocator - the context's OOM-scoped allocator (the buffer is destroyed through it)
18
+ * @param slots - number of slots; E_INVALID_ARGUMENT unless a positive integer
19
+ * @param label - the buffer label
20
+ */
21
+ constructor(device, allocator, slots, label) {
22
+ this.next = 0;
23
+ this.dirtyLo = -1;
24
+ this.dirtyHi = -1;
25
+ this.destroyed = false;
26
+ if (!Number.isInteger(slots) || slots < 1) {
27
+ throw new WebGpuGraphError("E_INVALID_ARGUMENT", `UniformRing "${label}": slots must be a positive integer, got ${slots}`, {
28
+ argument: "slots",
29
+ value: slots,
30
+ expected: "an integer >= 1",
31
+ });
32
+ }
33
+ this.device = device;
34
+ this.allocator = allocator;
35
+ this.slots = slots;
36
+ this.label = label;
37
+ this.shadow = new ArrayBuffer(slots * UNIFORM_SLOT_BYTES);
38
+ this.view = new DataView(this.shadow);
39
+ this.buffer = allocator.createBuffer({
40
+ label,
41
+ size: slots * UNIFORM_SLOT_BYTES,
42
+ usage: BufferUsage.UNIFORM | BufferUsage.COPY_DST,
43
+ });
44
+ }
45
+ /**
46
+ * The whole-buffer binding a kernel binds once (size = the block's byteLength; the slot is the dynamic offset).
47
+ * @param block - the params block the kernel declares for this binding
48
+ * @returns the binding at offset 0 of the ring buffer
49
+ */
50
+ binding(block) {
51
+ this.assertLive();
52
+ this.assertFits(block);
53
+ return { buffer: this.buffer, offset: 0, size: block.byteLength, window: null };
54
+ }
55
+ /**
56
+ * Byte offset of a slot (the dynamic offset a dispatch passes for it).
57
+ * @param slot - a slot index in [0, slots)
58
+ * @returns slot x UNIFORM_SLOT_BYTES
59
+ */
60
+ offsetOf(slot) {
61
+ this.checkSlot(slot);
62
+ return slot * UNIFORM_SLOT_BYTES;
63
+ }
64
+ /**
65
+ * Reserves `count` contiguous slots for a batch, wrapping to 0 when the tail is too short; E_INVALID_ARGUMENT when count > slots.
66
+ * @param count - slots needed, in [1, slots]
67
+ * @returns the first slot of the reservation
68
+ */
69
+ reserve(count) {
70
+ this.assertLive();
71
+ if (!Number.isInteger(count) || count < 1 || count > this.slots) {
72
+ throw new WebGpuGraphError("E_INVALID_ARGUMENT", `UniformRing "${this.label}": cannot reserve ${count} of ${this.slots} slots`, {
73
+ argument: "count",
74
+ value: count,
75
+ expected: `an integer in [1, ${this.slots}]`,
76
+ });
77
+ }
78
+ if (this.next + count > this.slots) {
79
+ this.next = 0;
80
+ }
81
+ const first = this.next;
82
+ this.next += count;
83
+ return first;
84
+ }
85
+ /**
86
+ * Writes one block's values into a slot of the host shadow; `flush()` sends the dirty range with one writeBuffer.
87
+ * @param slot - the slot to fill
88
+ * @param block - the block whose layout the bytes follow
89
+ * @param values - the field values (a missing field is written as 0 by the block)
90
+ */
91
+ write(slot, block, values) {
92
+ this.checkSlot(slot);
93
+ this.assertFits(block);
94
+ block.write(this.view, values, slot * UNIFORM_SLOT_BYTES);
95
+ if (this.dirtyLo < 0 || slot < this.dirtyLo) {
96
+ this.dirtyLo = slot;
97
+ }
98
+ if (slot > this.dirtyHi) {
99
+ this.dirtyHi = slot;
100
+ }
101
+ }
102
+ /**
103
+ * queue.writeBuffer of the dirty slots (called by the batch driver before submit): one call covering
104
+ * [lowest dirty slot, highest dirty slot]; nothing when no slot is dirty.
105
+ */
106
+ flush() {
107
+ this.assertLive();
108
+ if (this.dirtyLo < 0) {
109
+ return;
110
+ }
111
+ const begin = this.dirtyLo * UNIFORM_SLOT_BYTES;
112
+ const end = (this.dirtyHi + 1) * UNIFORM_SLOT_BYTES;
113
+ this.device.queue.writeBuffer(this.buffer, begin, this.shadow, begin, end - begin);
114
+ this.dirtyLo = -1;
115
+ this.dirtyHi = -1;
116
+ }
117
+ /** Destroys the buffer (through the allocator); idempotent. */
118
+ destroy() {
119
+ if (this.destroyed) {
120
+ return;
121
+ }
122
+ this.destroyed = true;
123
+ this.allocator.destroy(this.buffer);
124
+ }
125
+ assertLive() {
126
+ if (this.destroyed) {
127
+ throw new WebGpuGraphError("E_DISPOSED", `UniformRing "${this.label}" is destroyed`, { label: this.label });
128
+ }
129
+ }
130
+ checkSlot(slot) {
131
+ this.assertLive();
132
+ if (!Number.isInteger(slot) || slot < 0 || slot >= this.slots) {
133
+ throw new WebGpuGraphError("E_INVALID_ARGUMENT", `UniformRing "${this.label}": slot ${slot} is outside [0, ${this.slots})`, {
134
+ argument: "slot",
135
+ value: slot,
136
+ expected: `an integer in [0, ${this.slots})`,
137
+ });
138
+ }
139
+ }
140
+ assertFits(block) {
141
+ if (block.byteLength > UNIFORM_SLOT_BYTES) {
142
+ throw new WebGpuGraphError("E_INVALID_ARGUMENT", `UniformRing "${this.label}": block ${block.name} is ${block.byteLength} bytes, a slot holds ${UNIFORM_SLOT_BYTES}`, { argument: "block", value: block.name, expected: `byteLength <= ${UNIFORM_SLOT_BYTES}` });
143
+ }
144
+ }
145
+ }
146
+ //# sourceMappingURL=uniform-ring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uniform-ring.js","sourceRoot":"","sources":["../../../src/kernel/uniform-ring.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,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AAgB,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAChH,CAAC;IACL,CAAC;IAEO,SAAS,CAAC,IAAY;QAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC5D,MAAM,IAAI,gBAAgB,CACtB,oBAAoB,EACpB,gBAAgB,IAAI,CAAC,KAAK,WAAW,IAAI,mBAAmB,IAAI,CAAC,KAAK,GAAG,EACzE;gBACI,QAAQ,EAAE,MAAM;gBAChB,KAAK,EAAE,IAAI;gBACX,QAAQ,EAAE,qBAAqB,IAAI,CAAC,KAAK,GAAG;aAC/C,CACJ,CAAC;QACN,CAAC;IACL,CAAC;IAEO,UAAU,CAAC,KAAmB;QAClC,IAAI,KAAK,CAAC,UAAU,GAAG,kBAAkB,EAAE,CAAC;YACxC,MAAM,IAAI,gBAAgB,CACtB,oBAAoB,EACpB,gBAAgB,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,UAAU,wBAAwB,kBAAkB,EAAE,EACnH,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,iBAAiB,kBAAkB,EAAE,EAAE,CAC5F,CAAC;QACN,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * The WGSL composer (spec 3.5; contract 3.9, 4.2): ONE declaration per module (`WgslModuleSpec`) generates
3
+ * everything the host and the shader must agree on -- the `@group / @binding` block, the `override` lines, the
4
+ * struct texts, the explicit bind-group layouts and the bind() record keys -- by string concatenation in the fixed
5
+ * order of contract 4.2. Every disagreement that would otherwise be a GPUPipelineError on the first device that
6
+ * creates the variant is a compose-time `E_SHADER_COMPILE { stage: "compose" }` on every device.
7
+ *
8
+ * PLAN DECISION: this file imports `workgroupSizeFor` from `../device/caps.js` (one copy of the WG rule) and
9
+ * `ShaderStage` from `../device/webgpu-constants.js` (spec 2.1 rule 1: the core never reads the `GPUShaderStage`
10
+ * global at module top level); `../constants.js` is not imported because every constant the composer emits reaches
11
+ * it through `./prelude.js`. The layer rule (contract 2.4: device < context < memory < kernel) allows both edges.
12
+ */
13
+ import { type PlanCaps } from "../types/context.js";
14
+ import { type UniformBlock } from "./struct-block.js";
15
+ /** One storage or uniform binding of a module (spec 3.5). `wgslType` is the element / struct type text ("array<u32>", "array<vec4f>", "Fa2State"). */
16
+ export interface BindingDecl {
17
+ readonly group: 0 | 1 | 2 | 3;
18
+ readonly binding: number;
19
+ readonly name: string;
20
+ readonly kind: "storage" | "storage-ro" | "uniform";
21
+ readonly wgslType: string;
22
+ }
23
+ /** One module-specific override (spec 3.5); the five standard ones (WG, USE_PERM, HAS_WEIGHTS, SUBGROUP_MIN, SUBGROUP_MAX) come from the prelude and are never listed here. */
24
+ export interface OverrideDecl {
25
+ readonly name: string;
26
+ readonly type: "u32" | "bool" | "f32";
27
+ readonly default: number | boolean;
28
+ }
29
+ /** Spec 3.5 WgslModuleSpec, verbatim. `needs: ["subgroups"]` means "this body calls a wg_reduce_* helper": the composer splices the subgroup helper block when the device has the feature and the workgroup-memory twin otherwise. */
30
+ export interface WgslModuleSpec {
31
+ readonly id: string;
32
+ readonly body: string;
33
+ readonly bindings: readonly BindingDecl[];
34
+ readonly overrideDecls: readonly OverrideDecl[];
35
+ readonly overrides: Readonly<Record<string, number | boolean>>;
36
+ readonly needs: readonly "subgroups"[];
37
+ readonly uniforms: readonly UniformBlock[];
38
+ readonly snippets?: Readonly<Record<string, string>> | undefined;
39
+ }
40
+ /** The names the prelude declares as overrides; spec.overrides may set them without an OverrideDecl. */
41
+ export declare const STANDARD_OVERRIDES: readonly ["WG", "USE_PERM", "HAS_WEIGHTS", "SUBGROUP_MIN", "SUBGROUP_MAX"];
42
+ /** What composeWgsl returns: the text, the body's first line in it (for compilation-info formatting), the effective overrides (WG, SUBGROUP_MIN, SUBGROUP_MAX filled) and the features to enable. */
43
+ export interface ComposedModule {
44
+ readonly id: string;
45
+ readonly code: string;
46
+ readonly bodyLine: number;
47
+ readonly overrides: Readonly<Record<string, number | boolean>>;
48
+ /**
49
+ * The subset of `overrides` the composed code REFERENCES outside its own declaration -- what the pipeline
50
+ * descriptor's `constants` carries. WebKit (Safari) fails pipeline creation with "Compute library failed
51
+ * creation" when a constant is supplied for an override the entry point never reads (HAS_WEIGHTS in `degree`,
52
+ * TIER in the thread-per-row tiers); Dawn tolerates it. The cache key still uses `overrides` (contract 3.9).
53
+ */
54
+ readonly constants: Readonly<Record<string, number | boolean>>;
55
+ readonly entryPoint: string;
56
+ readonly subgroups: boolean;
57
+ }
58
+ /**
59
+ * The entry-point name of a body: the identifier after `fn` on the line following `@compute` (every body has exactly one entry point).
60
+ * PLAN DECISION: a body without exactly one `@compute` entry point is `E_SHADER_COMPILE { stage: "compose", slot: "entry" }`.
61
+ * @param body - the kernel body
62
+ * @returns the entry-point function name
63
+ */
64
+ export declare function entryPointOf(body: string): string;
65
+ /**
66
+ * The bind-group-layout descriptors derived from spec.bindings: one per group 0..maxGroup (empty groups get an empty entry list); uniform decls carry hasDynamicOffset true (spec 5.1).
67
+ * PLAN DECISION: a uniform decl whose struct is one of `spec.uniforms` also carries `minBindingSize = block.byteLength`,
68
+ * so a wrong-size uniform binding fails at createBindGroup (synchronously, with the bind group's label in the message)
69
+ * instead of at the first dispatch (verified on Dawn 0.4.0: without it the error names only the pipeline).
70
+ * @param spec - the module
71
+ * @returns the descriptors in group order
72
+ */
73
+ export declare function bindGroupLayoutDescriptors(spec: WgslModuleSpec): GPUBindGroupLayoutDescriptor[];
74
+ /**
75
+ * The names of the bindings of one group in binding order.
76
+ * @param spec - the module
77
+ * @param group - the group index
78
+ * @returns the names
79
+ */
80
+ export declare function bindingNames(spec: WgslModuleSpec, group: number): readonly string[];
81
+ /**
82
+ * String concatenation of spec 3.5: prelude (constants, standard overrides, helpers), module overrides, struct texts, the bind declarations, then the body with snippets substituted (4.2 gives the exact emitted format).
83
+ * @param spec - the module
84
+ * @param caps - the device capabilities (WG, the subgroup sizes and the feature set)
85
+ * @returns the composed module
86
+ */
87
+ export declare function composeWgsl(spec: WgslModuleSpec, caps: PlanCaps): ComposedModule;
88
+ //# sourceMappingURL=wgsl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wgsl.d.ts","sourceRoot":"","sources":["../../../src/kernel/wgsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,sJAAsJ;AACtJ,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B;AACD,+KAA+K;AAC/K,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CACtC;AACD,sOAAsO;AACtO,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAA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