@graphty/webgpu-graph-algorithms 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +459 -58
- package/dist/browser.js +1 -1
- package/dist/chunks/{context-BR7fx3vR.js → context-BXqgCifx.js} +190 -40
- package/dist/chunks/context-BXqgCifx.js.map +1 -0
- package/dist/node.js +1 -1
- package/dist/src/algorithms/components.d.ts.map +1 -1
- package/dist/src/algorithms/components.js +12 -13
- package/dist/src/algorithms/components.js.map +1 -1
- package/dist/src/algorithms/degree.d.ts +6 -8
- package/dist/src/algorithms/degree.d.ts.map +1 -1
- package/dist/src/algorithms/degree.js +58 -35
- package/dist/src/algorithms/degree.js.map +1 -1
- package/dist/src/algorithms/pagerank.d.ts.map +1 -1
- package/dist/src/algorithms/pagerank.js +16 -14
- package/dist/src/algorithms/pagerank.js.map +1 -1
- package/dist/src/algorithms/power-iteration.d.ts +2 -2
- package/dist/src/algorithms/power-iteration.d.ts.map +1 -1
- package/dist/src/algorithms/power-iteration.js +17 -14
- package/dist/src/algorithms/power-iteration.js.map +1 -1
- package/dist/src/constants.d.ts +38 -8
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +38 -8
- package/dist/src/constants.js.map +1 -1
- package/dist/src/errors.d.ts +3 -2
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +2 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +6 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/kernel/dispatch.d.ts +8 -3
- package/dist/src/kernel/dispatch.d.ts.map +1 -1
- package/dist/src/kernel/dispatch.js +18 -7
- package/dist/src/kernel/dispatch.js.map +1 -1
- package/dist/src/kernel/kernel.d.ts +30 -1
- package/dist/src/kernel/kernel.d.ts.map +1 -1
- package/dist/src/kernel/kernel.js +49 -5
- package/dist/src/kernel/kernel.js.map +1 -1
- package/dist/src/kernel/prelude.d.ts.map +1 -1
- package/dist/src/kernel/prelude.js +6 -1
- package/dist/src/kernel/prelude.js.map +1 -1
- package/dist/src/kernel/profiler.d.ts +15 -3
- package/dist/src/kernel/profiler.d.ts.map +1 -1
- package/dist/src/kernel/profiler.js +27 -4
- package/dist/src/kernel/profiler.js.map +1 -1
- package/dist/src/kernels.d.ts +17 -7
- package/dist/src/kernels.d.ts.map +1 -1
- package/dist/src/kernels.js +323 -16
- package/dist/src/kernels.js.map +1 -1
- package/dist/src/layouts/calibrate.d.ts +51 -0
- package/dist/src/layouts/calibrate.d.ts.map +1 -0
- package/dist/src/layouts/calibrate.js +172 -0
- package/dist/src/layouts/calibrate.js.map +1 -0
- package/dist/src/layouts/force-simulation.d.ts +39 -4
- package/dist/src/layouts/force-simulation.d.ts.map +1 -1
- package/dist/src/layouts/force-simulation.js +71 -19
- package/dist/src/layouts/force-simulation.js.map +1 -1
- package/dist/src/layouts/forceatlas2.d.ts +107 -36
- package/dist/src/layouts/forceatlas2.d.ts.map +1 -1
- package/dist/src/layouts/forceatlas2.js +296 -100
- package/dist/src/layouts/forceatlas2.js.map +1 -1
- package/dist/src/layouts/fruchterman-reingold.d.ts +73 -27
- package/dist/src/layouts/fruchterman-reingold.d.ts.map +1 -1
- package/dist/src/layouts/fruchterman-reingold.js +230 -70
- package/dist/src/layouts/fruchterman-reingold.js.map +1 -1
- package/dist/src/layouts/model-common.d.ts +41 -3
- package/dist/src/layouts/model-common.d.ts.map +1 -1
- package/dist/src/layouts/model-common.js +74 -3
- package/dist/src/layouts/model-common.js.map +1 -1
- package/dist/src/layouts/repulsion-grid.d.ts +152 -0
- package/dist/src/layouts/repulsion-grid.d.ts.map +1 -0
- package/dist/src/layouts/repulsion-grid.js +318 -0
- package/dist/src/layouts/repulsion-grid.js.map +1 -0
- package/dist/src/layouts/spring-electrical.d.ts +75 -30
- package/dist/src/layouts/spring-electrical.d.ts.map +1 -1
- package/dist/src/layouts/spring-electrical.js +231 -74
- package/dist/src/layouts/spring-electrical.js.map +1 -1
- package/dist/src/memory/residency.d.ts +6 -2
- package/dist/src/memory/residency.d.ts.map +1 -1
- package/dist/src/memory/residency.js +84 -14
- package/dist/src/memory/residency.js.map +1 -1
- package/dist/src/primitives/core-shape.d.ts +38 -2
- package/dist/src/primitives/core-shape.d.ts.map +1 -1
- package/dist/src/primitives/core-shape.js +71 -3
- package/dist/src/primitives/core-shape.js.map +1 -1
- package/dist/src/primitives/grid-pyramid.d.ts +71 -0
- package/dist/src/primitives/grid-pyramid.d.ts.map +1 -0
- package/dist/src/primitives/grid-pyramid.js +143 -0
- package/dist/src/primitives/grid-pyramid.js.map +1 -0
- package/dist/src/primitives/grid.d.ts +118 -0
- package/dist/src/primitives/grid.d.ts.map +1 -0
- package/dist/src/primitives/grid.js +225 -0
- package/dist/src/primitives/grid.js.map +1 -0
- package/dist/src/primitives/histogram.d.ts +67 -0
- package/dist/src/primitives/histogram.d.ts.map +1 -0
- package/dist/src/primitives/histogram.js +190 -0
- package/dist/src/primitives/histogram.js.map +1 -0
- package/dist/src/primitives/radix-sort.d.ts +75 -0
- package/dist/src/primitives/radix-sort.d.ts.map +1 -0
- package/dist/src/primitives/radix-sort.js +168 -0
- package/dist/src/primitives/radix-sort.js.map +1 -0
- package/dist/src/primitives/scan.d.ts +44 -0
- package/dist/src/primitives/scan.d.ts.map +1 -0
- package/dist/src/primitives/scan.js +151 -0
- package/dist/src/primitives/scan.js.map +1 -0
- package/dist/src/primitives/segmented-reduce.d.ts +25 -17
- package/dist/src/primitives/segmented-reduce.d.ts.map +1 -1
- package/dist/src/primitives/segmented-reduce.js +166 -47
- package/dist/src/primitives/segmented-reduce.js.map +1 -1
- package/dist/src/primitives/spmv.d.ts +18 -14
- package/dist/src/primitives/spmv.d.ts.map +1 -1
- package/dist/src/primitives/spmv.js +94 -58
- package/dist/src/primitives/spmv.js.map +1 -1
- package/dist/src/primitives/verify.d.ts +49 -0
- package/dist/src/primitives/verify.d.ts.map +1 -0
- package/dist/src/primitives/verify.js +229 -0
- package/dist/src/primitives/verify.js.map +1 -0
- package/dist/src/types/context.d.ts +53 -0
- package/dist/src/types/context.d.ts.map +1 -1
- package/dist/src/types/layout.d.ts +20 -0
- package/dist/src/types/layout.d.ts.map +1 -1
- package/dist/src/wgsl/counting-scatter.wgsl.d.ts +8 -0
- package/dist/src/wgsl/counting-scatter.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/counting-scatter.wgsl.js +17 -0
- package/dist/src/wgsl/counting-scatter.wgsl.js.map +1 -0
- package/dist/src/wgsl/fa2-attraction.wgsl.d.ts +23 -11
- package/dist/src/wgsl/fa2-attraction.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-attraction.wgsl.js +98 -20
- package/dist/src/wgsl/fa2-attraction.wgsl.js.map +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts +6 -2
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.js +22 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.js.map +1 -1
- package/dist/src/wgsl/grid-cell-key.wgsl.d.ts +8 -0
- package/dist/src/wgsl/grid-cell-key.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-cell-key.wgsl.js +30 -0
- package/dist/src/wgsl/grid-cell-key.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-centroid-hub.wgsl.d.ts +8 -0
- package/dist/src/wgsl/grid-centroid-hub.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-centroid-hub.wgsl.js +29 -0
- package/dist/src/wgsl/grid-centroid-hub.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-centroid.wgsl.d.ts +8 -0
- package/dist/src/wgsl/grid-centroid.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-centroid.wgsl.js +29 -0
- package/dist/src/wgsl/grid-centroid.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-downsample.wgsl.d.ts +7 -0
- package/dist/src/wgsl/grid-downsample.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-downsample.wgsl.js +28 -0
- package/dist/src/wgsl/grid-downsample.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-far-field.wgsl.d.ts +13 -0
- package/dist/src/wgsl/grid-far-field.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-far-field.wgsl.js +98 -0
- package/dist/src/wgsl/grid-far-field.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-near-field.wgsl.d.ts +19 -0
- package/dist/src/wgsl/grid-near-field.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-near-field.wgsl.js +129 -0
- package/dist/src/wgsl/grid-near-field.wgsl.js.map +1 -0
- package/dist/src/wgsl/histogram.wgsl.d.ts +7 -0
- package/dist/src/wgsl/histogram.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/histogram.wgsl.js +15 -0
- package/dist/src/wgsl/histogram.wgsl.js.map +1 -0
- package/dist/src/wgsl/indirect-finalize.wgsl.d.ts +8 -0
- package/dist/src/wgsl/indirect-finalize.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/indirect-finalize.wgsl.js +26 -0
- package/dist/src/wgsl/indirect-finalize.wgsl.js.map +1 -0
- package/dist/src/wgsl/radix-hist.wgsl.d.ts +9 -0
- package/dist/src/wgsl/radix-hist.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/radix-hist.wgsl.js +31 -0
- package/dist/src/wgsl/radix-hist.wgsl.js.map +1 -0
- package/dist/src/wgsl/radix-scatter.wgsl.d.ts +9 -0
- package/dist/src/wgsl/radix-scatter.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/radix-scatter.wgsl.js +40 -0
- package/dist/src/wgsl/radix-scatter.wgsl.js.map +1 -0
- package/dist/src/wgsl/scan-add.wgsl.d.ts +6 -0
- package/dist/src/wgsl/scan-add.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/scan-add.wgsl.js +14 -0
- package/dist/src/wgsl/scan-add.wgsl.js.map +1 -0
- package/dist/src/wgsl/scan-block.wgsl.d.ts +8 -0
- package/dist/src/wgsl/scan-block.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/scan-block.wgsl.js +30 -0
- package/dist/src/wgsl/scan-block.wgsl.js.map +1 -0
- package/dist/src/wgsl/segmented-reduce.wgsl.d.ts +22 -8
- package/dist/src/wgsl/segmented-reduce.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/segmented-reduce.wgsl.js +84 -15
- package/dist/src/wgsl/segmented-reduce.wgsl.js.map +1 -1
- package/dist/src/wgsl/spmv-pull.wgsl.d.ts +22 -11
- package/dist/src/wgsl/spmv-pull.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/spmv-pull.wgsl.js +110 -36
- package/dist/src/wgsl/spmv-pull.wgsl.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/webgpu-graph-algorithms.js +3815 -1003
- package/dist/webgpu-graph-algorithms.js.map +1 -1
- package/package.json +9 -8
- package/src/algorithms/components.ts +12 -16
- package/src/algorithms/degree.ts +58 -43
- package/src/algorithms/pagerank.ts +20 -18
- package/src/algorithms/power-iteration.ts +19 -18
- package/src/constants.ts +38 -8
- package/src/errors.ts +3 -1
- package/src/index.ts +14 -4
- package/src/kernel/dispatch.ts +18 -7
- package/src/kernel/kernel.ts +59 -5
- package/src/kernel/prelude.ts +9 -0
- package/src/kernel/profiler.ts +28 -4
- package/src/kernels.ts +356 -18
- package/src/layouts/calibrate.ts +187 -0
- package/src/layouts/force-simulation.ts +91 -23
- package/src/layouts/forceatlas2.ts +331 -106
- package/src/layouts/fruchterman-reingold.ts +255 -74
- package/src/layouts/model-common.ts +98 -3
- package/src/layouts/repulsion-grid.ts +451 -0
- package/src/layouts/spring-electrical.ts +257 -78
- package/src/memory/residency.ts +126 -20
- package/src/primitives/core-shape.ts +91 -4
- package/src/primitives/grid-pyramid.ts +221 -0
- package/src/primitives/grid.ts +349 -0
- package/src/primitives/histogram.ts +273 -0
- package/src/primitives/radix-sort.ts +246 -0
- package/src/primitives/scan.ts +197 -0
- package/src/primitives/segmented-reduce.ts +214 -56
- package/src/primitives/spmv.ts +125 -65
- package/src/primitives/verify.ts +249 -0
- package/src/types/context.ts +56 -0
- package/src/types/layout.ts +22 -0
- package/src/wgsl/counting-scatter.wgsl.ts +16 -0
- package/src/wgsl/fa2-attraction.wgsl.ts +98 -20
- package/src/wgsl/fa2-stats-finalize.wgsl.ts +22 -1
- package/src/wgsl/grid-cell-key.wgsl.ts +29 -0
- package/src/wgsl/grid-centroid-hub.wgsl.ts +28 -0
- package/src/wgsl/grid-centroid.wgsl.ts +28 -0
- package/src/wgsl/grid-downsample.wgsl.ts +27 -0
- package/src/wgsl/grid-far-field.wgsl.ts +97 -0
- package/src/wgsl/grid-near-field.wgsl.ts +128 -0
- package/src/wgsl/histogram.wgsl.ts +14 -0
- package/src/wgsl/indirect-finalize.wgsl.ts +25 -0
- package/src/wgsl/radix-hist.wgsl.ts +30 -0
- package/src/wgsl/radix-scatter.wgsl.ts +39 -0
- package/src/wgsl/scan-add.wgsl.ts +13 -0
- package/src/wgsl/scan-block.wgsl.ts +29 -0
- package/src/wgsl/segmented-reduce.wgsl.ts +84 -15
- package/src/wgsl/spmv-pull.wgsl.ts +110 -36
- package/dist/chunks/context-BR7fx3vR.js.map +0 -1
package/dist/src/constants.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare const MAX_WORKGROUPS_PER_DIM = 65535;
|
|
|
12
12
|
export declare const MAX_1D_ITEMS: number;
|
|
13
13
|
/** The largest u32 (the `min` identity of the u32 reduce); interpolated into the prelude as `U32_MAX` so no body types the literal (contract 4.1). */
|
|
14
14
|
export declare const U32_MAX = 4294967295;
|
|
15
|
+
/** The bins of one radix-sort pass, 2^8 (spec 6 row 6; P4 PD-5: 8 bits per pass); interpolated into the prelude as `RADIX_BINS` and `RADIX_DIGIT_MASK` (= bins - 1) so no body types the literal. */
|
|
16
|
+
export declare const RADIX_BINS = 256;
|
|
15
17
|
/** Arc-window boundaries are multiples of 64 arcs = 256 bytes (design 10.6). */
|
|
16
18
|
export declare const ARC_WINDOW_ALIGN = 64;
|
|
17
19
|
/** Storage-binding offset alignment the package always honours (spec 2.6): the graph-format arena is 256-aligned. */
|
|
@@ -19,14 +21,30 @@ export declare const STORAGE_ALIGN = 256;
|
|
|
19
21
|
/** Stride of one UniformRing slot: minUniformBufferOffsetAlignment is 256 on every runtime the package targets (spec 5.3). */
|
|
20
22
|
export declare const UNIFORM_SLOT_BYTES = 256;
|
|
21
23
|
/**
|
|
22
|
-
* Exact-tier crossover default, re-fixed at
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* Exact-tier crossover default, re-fixed at G4 by the spec 7.8 rule in full (spec Q-6; docs/decisions/G3.md section 3
|
|
25
|
+
* for the budget clause, docs/decisions/G4.md section 7 for the re-check): the largest rung of the T-4 ladder (1k / 4k /
|
|
26
|
+
* 8k / 16k / 32k / 65k, E = 10n, 2D) with <= 4 ms per iteration AND not slower than the grid tier at the same n (the
|
|
27
|
+
* `layout-grid` 2D rows: the shared rungs 32k / 65k and the re-check rungs 1k / 4k / 8k / 16k the group runs so every
|
|
28
|
+
* exact rung has a grid row), rounded down to a power of two. Measured on the RTX 4070 SUPER under Dawn-node:
|
|
29
|
+
* benchmarks/results/nvidia-lovelace-driver580.json, session 2026-09-21T06:15:17.027Z, the "ms/iteration (profiler)"
|
|
30
|
+
* rows of layout-exact and the "grid ms/iteration (profiler) ... 2D" rows of layout-grid (the GPU time of the
|
|
31
|
+
* iteration's passes at the card's working clock), exact / grid ms per iteration: 1k 0.102 / 0.290, 4k 0.262 / 0.188,
|
|
32
|
+
* 8k 0.484 / 0.211, 16k 1.064 / 0.225, 32k 2.579 / 0.298, 65k 8.450 / 0.409. The grid tier's cost is a near-constant
|
|
33
|
+
* ~0.19-0.3 ms floor (its sort, scan and pyramid passes) up to 32k, so the exact tier wins only at 1k and the rule's
|
|
34
|
+
* answer is 1024 (32768 under the budget clause alone, the G3 value; 16384 was the P4-T14 draft's value, which only
|
|
35
|
+
* evaluated the grid clause at 32k / 65k and was not a measurement). calibrateLayout's finer probe on the same card
|
|
36
|
+
* (tmp/p4/t14-review/calibrate-defaults.log: exact 0.150 vs grid 0.190 ms at 2048) puts the true crossover between
|
|
37
|
+
* 2k and 4k; the ladder has no 2k rung, and the design's basis (cosmos switches at 4,096) is within 0.07 ms per
|
|
38
|
+
* iteration of the rule's value, so the choice among 1k / 2k / 4k is an accuracy preference (the exact tier is the
|
|
39
|
+
* oracle), not a speed one. OWNER DECISION G4-D1 (docs/decisions/G4.md section 7, rows G4-D1 / G4-F9): the constant
|
|
40
|
+
* KEEPS the G3 value 32768 while the accuracy work G4-F1 leaves is open -- G4-F1 (the grid tier's exact-vs-grid RMS
|
|
41
|
+
* on the clumpy and degenerate fixtures) closed on 2026-09-21 by the owner's asserted / printed split, G4-F2 (the
|
|
42
|
+
* unbiasedness item) the same day by its re-scope to the whole-field ratio, and the far field's accuracy on those
|
|
43
|
+
* fixtures is the follow-up -- because "auto" is the default every consumer sees and the exact tier is the accurate
|
|
44
|
+
* one; the rule's answer on the dev box (1024) is recorded, not shipped, until that work closes and the value is
|
|
45
|
+
* re-fixed. A
|
|
46
|
+
* consumer whose GPU differs (integrated, Apple, T4) passes its own value through
|
|
47
|
+
* createAccelerator(ctx, { layout: { exactMaxNodes } }); calibrateLayout(ctx) measures it.
|
|
30
48
|
*/
|
|
31
49
|
export declare const EXACT_MAX_NODES = 32768;
|
|
32
50
|
/** Default number of MAP_READ staging buffers in the Readback ring (spec 4.4). */
|
|
@@ -136,4 +154,16 @@ export declare const SE_DEFAULTS: Readonly<{
|
|
|
136
154
|
iterationsPerStep: 1;
|
|
137
155
|
maxInFlight: 2;
|
|
138
156
|
}>;
|
|
157
|
+
/** The smallest finest grid side `G` (spec 7.7 geometry table: `clamp(nextPow2(2 n^(1/dim)), 8, gridMax)`; P4 PD-9). */
|
|
158
|
+
export declare const GRID_MIN_SIDE = 8;
|
|
159
|
+
/** The coarsest pyramid level's side (spec 7.7: "levels (coarsest 4 per axis)", `levels = log2(G / 4) + 1`). */
|
|
160
|
+
export declare const GRID_COARSEST_SIDE = 4;
|
|
161
|
+
/** A cell with more than this many entries is summed by a workgroup (G4b) instead of the thread-per-cell loop of G4 (spec 7.7 G4: `count > 1024`). */
|
|
162
|
+
export declare const GRID_HUB_CELL = 1024;
|
|
163
|
+
/** The extent floor of spec 7.7: `cellSize = max(extent, 1e-6) / G`, so an all-coincident load never divides by zero. */
|
|
164
|
+
export declare const GRID_EXTENT_FLOOR = 0.000001;
|
|
165
|
+
/** The bbox margin of spec 7.7: `bboxExtent` is the largest axis of `state.min / max` "with a 1% margin". */
|
|
166
|
+
export declare const GRID_BBOX_MARGIN = 1.01;
|
|
167
|
+
/** The key width the grid always sorts with (P4 PD-5): three 8-bit passes cover the 19-bit 2D keys at G = 512 and the 22-bit 3D keys at G = 128, and an odd pass count leaves `sortedIdx` in the scratch pair. */
|
|
168
|
+
export declare const GRID_SORT_BITS = 24;
|
|
139
169
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0IAA0I;AAC1I,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,4HAA4H;AAC5H,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAC5C,sGAAsG;AACtG,eAAO,MAAM,YAAY,QAA0C,CAAC;AACpE,sJAAsJ;AACtJ,eAAO,MAAM,OAAO,aAAa,CAAC;AAClC,gFAAgF;AAChF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,qHAAqH;AACrH,eAAO,MAAM,aAA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,WAAO,CAAC;AACtC,6GAA6G;AAC7G,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,kNAAkN;AAClN,eAAO,MAAM,cAAc,KAAK,CAAC"}
|
package/dist/src/constants.js
CHANGED
|
@@ -12,6 +12,8 @@ export const MAX_WORKGROUPS_PER_DIM = 65535;
|
|
|
12
12
|
export const MAX_1D_ITEMS = MAX_WORKGROUPS_PER_DIM * WORKGROUP_SIZE;
|
|
13
13
|
/** The largest u32 (the `min` identity of the u32 reduce); interpolated into the prelude as `U32_MAX` so no body types the literal (contract 4.1). */
|
|
14
14
|
export const U32_MAX = 0xffffffff;
|
|
15
|
+
/** The bins of one radix-sort pass, 2^8 (spec 6 row 6; P4 PD-5: 8 bits per pass); interpolated into the prelude as `RADIX_BINS` and `RADIX_DIGIT_MASK` (= bins - 1) so no body types the literal. */
|
|
16
|
+
export const RADIX_BINS = 256;
|
|
15
17
|
/** Arc-window boundaries are multiples of 64 arcs = 256 bytes (design 10.6). */
|
|
16
18
|
export const ARC_WINDOW_ALIGN = 64;
|
|
17
19
|
/** Storage-binding offset alignment the package always honours (spec 2.6): the graph-format arena is 256-aligned. */
|
|
@@ -19,14 +21,30 @@ export const STORAGE_ALIGN = 256;
|
|
|
19
21
|
/** Stride of one UniformRing slot: minUniformBufferOffsetAlignment is 256 on every runtime the package targets (spec 5.3). */
|
|
20
22
|
export const UNIFORM_SLOT_BYTES = 256;
|
|
21
23
|
/**
|
|
22
|
-
* Exact-tier crossover default, re-fixed at
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
24
|
+
* Exact-tier crossover default, re-fixed at G4 by the spec 7.8 rule in full (spec Q-6; docs/decisions/G3.md section 3
|
|
25
|
+
* for the budget clause, docs/decisions/G4.md section 7 for the re-check): the largest rung of the T-4 ladder (1k / 4k /
|
|
26
|
+
* 8k / 16k / 32k / 65k, E = 10n, 2D) with <= 4 ms per iteration AND not slower than the grid tier at the same n (the
|
|
27
|
+
* `layout-grid` 2D rows: the shared rungs 32k / 65k and the re-check rungs 1k / 4k / 8k / 16k the group runs so every
|
|
28
|
+
* exact rung has a grid row), rounded down to a power of two. Measured on the RTX 4070 SUPER under Dawn-node:
|
|
29
|
+
* benchmarks/results/nvidia-lovelace-driver580.json, session 2026-09-21T06:15:17.027Z, the "ms/iteration (profiler)"
|
|
30
|
+
* rows of layout-exact and the "grid ms/iteration (profiler) ... 2D" rows of layout-grid (the GPU time of the
|
|
31
|
+
* iteration's passes at the card's working clock), exact / grid ms per iteration: 1k 0.102 / 0.290, 4k 0.262 / 0.188,
|
|
32
|
+
* 8k 0.484 / 0.211, 16k 1.064 / 0.225, 32k 2.579 / 0.298, 65k 8.450 / 0.409. The grid tier's cost is a near-constant
|
|
33
|
+
* ~0.19-0.3 ms floor (its sort, scan and pyramid passes) up to 32k, so the exact tier wins only at 1k and the rule's
|
|
34
|
+
* answer is 1024 (32768 under the budget clause alone, the G3 value; 16384 was the P4-T14 draft's value, which only
|
|
35
|
+
* evaluated the grid clause at 32k / 65k and was not a measurement). calibrateLayout's finer probe on the same card
|
|
36
|
+
* (tmp/p4/t14-review/calibrate-defaults.log: exact 0.150 vs grid 0.190 ms at 2048) puts the true crossover between
|
|
37
|
+
* 2k and 4k; the ladder has no 2k rung, and the design's basis (cosmos switches at 4,096) is within 0.07 ms per
|
|
38
|
+
* iteration of the rule's value, so the choice among 1k / 2k / 4k is an accuracy preference (the exact tier is the
|
|
39
|
+
* oracle), not a speed one. OWNER DECISION G4-D1 (docs/decisions/G4.md section 7, rows G4-D1 / G4-F9): the constant
|
|
40
|
+
* KEEPS the G3 value 32768 while the accuracy work G4-F1 leaves is open -- G4-F1 (the grid tier's exact-vs-grid RMS
|
|
41
|
+
* on the clumpy and degenerate fixtures) closed on 2026-09-21 by the owner's asserted / printed split, G4-F2 (the
|
|
42
|
+
* unbiasedness item) the same day by its re-scope to the whole-field ratio, and the far field's accuracy on those
|
|
43
|
+
* fixtures is the follow-up -- because "auto" is the default every consumer sees and the exact tier is the accurate
|
|
44
|
+
* one; the rule's answer on the dev box (1024) is recorded, not shipped, until that work closes and the value is
|
|
45
|
+
* re-fixed. A
|
|
46
|
+
* consumer whose GPU differs (integrated, Apple, T4) passes its own value through
|
|
47
|
+
* createAccelerator(ctx, { layout: { exactMaxNodes } }); calibrateLayout(ctx) measures it.
|
|
30
48
|
*/
|
|
31
49
|
export const EXACT_MAX_NODES = 32768;
|
|
32
50
|
/** Default number of MAP_READ staging buffers in the Readback ring (spec 4.4). */
|
|
@@ -136,4 +154,16 @@ export const SE_DEFAULTS = Object.freeze({
|
|
|
136
154
|
iterationsPerStep: 1,
|
|
137
155
|
maxInFlight: 2,
|
|
138
156
|
});
|
|
157
|
+
/** The smallest finest grid side `G` (spec 7.7 geometry table: `clamp(nextPow2(2 n^(1/dim)), 8, gridMax)`; P4 PD-9). */
|
|
158
|
+
export const GRID_MIN_SIDE = 8;
|
|
159
|
+
/** The coarsest pyramid level's side (spec 7.7: "levels (coarsest 4 per axis)", `levels = log2(G / 4) + 1`). */
|
|
160
|
+
export const GRID_COARSEST_SIDE = 4;
|
|
161
|
+
/** A cell with more than this many entries is summed by a workgroup (G4b) instead of the thread-per-cell loop of G4 (spec 7.7 G4: `count > 1024`). */
|
|
162
|
+
export const GRID_HUB_CELL = 1024;
|
|
163
|
+
/** The extent floor of spec 7.7: `cellSize = max(extent, 1e-6) / G`, so an all-coincident load never divides by zero. */
|
|
164
|
+
export const GRID_EXTENT_FLOOR = 1e-6;
|
|
165
|
+
/** The bbox margin of spec 7.7: `bboxExtent` is the largest axis of `state.min / max` "with a 1% margin". */
|
|
166
|
+
export const GRID_BBOX_MARGIN = 1.01;
|
|
167
|
+
/** The key width the grid always sorts with (P4 PD-5): three 8-bit passes cover the 19-bit 2D keys at G = 512 and the 22-bit 3D keys at G = 128, and an odd pass count leaves `sortedIdx` in the scratch pair. */
|
|
168
|
+
export const GRID_SORT_BITS = 24;
|
|
139
169
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0IAA0I;AAC1I,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,4HAA4H;AAC5H,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAC5C,sGAAsG;AACtG,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,GAAG,cAAc,CAAC;AACpE,sJAAsJ;AACtJ,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,qHAAqH;AACrH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AACjC,8HAA8H;AAC9H,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0IAA0I;AAC1I,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,4HAA4H;AAC5H,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC;AAC5C,sGAAsG;AACtG,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,GAAG,cAAc,CAAC;AACpE,sJAAsJ;AACtJ,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,qMAAqM;AACrM,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC;AAC9B,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,qHAAqH;AACrH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AACjC,8HAA8H;AAC9H,MAAM,CAAC,MAAM,kBAAk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d,KAAK,EAAE,IAAI;IACX,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,eAAe,EAAE,KAAK;IACtB,YAAY,EAAE,EAAE;IAChB,iBAAiB,EAAE,CAAC;IACpB,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,QAAQ;CACpB,CAAC,CAAC;AACH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,wNAAwN;AACxN,MAAM,CAAC,MAAM,WAAW,GAYnB,MAAM,CAAC,MAAM,CAAC;IACf,YAAY,EAAE,EAAE;IAChB,iBAAiB,EAAE,GAAG;IACtB,OAAO,EAAE,CAAC,EAAE;IACZ,eAAe,EAAE,GAAG;IACpB,QAAQ,EAAE,GAAG;IACb,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,eAAe,EAAE,KAAK;IACtB,YAAY,EAAE,EAAE;IAChB,iBAAiB,EAAE,CAAC;IACpB,WAAW,EAAE,CAAC;CACjB,CAAC,CAAC;AACH,wHAAwH;AACxH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAC/B,gHAAgH;AAChH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AACpC,sJAAsJ;AACtJ,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAClC,yHAAyH;AACzH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AACtC,6GAA6G;AAC7G,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AACrC,kNAAkN;AAClN,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC"}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
* `details` keys per code (contract 3.1, so tests can assert them): E_NO_WEBGPU { reason, hint };
|
|
10
10
|
* E_NO_ADAPTER { reason }; E_NO_DEVICE { reason, adapter, limit?, requested?, available? } (reason "consumed" |
|
|
11
11
|
* "requestDevice" | "limit" | "feature" | "maxComputeWorkgroupsPerDimension"); E_SOFTWARE_ONLY { adapter };
|
|
12
|
-
* E_DEVICE_LOST { reason, message };
|
|
12
|
+
* E_DEVICE_LOST { reason, message }; E_DEVICE_INCORRECT { check, where, expected, actual, poison, count, blocks,
|
|
13
|
+
* workgroupSize, adapter, hint? }; E_DISPOSED { label }; E_VALIDATION { label, message, batchId? };
|
|
13
14
|
* E_SHADER_COMPILE { id, stage: "compose" | "compile", slot?, messages? }; E_OUT_OF_MEMORY { requested, resident,
|
|
14
15
|
* label }; E_TOO_LARGE { needed, limit, path, algorithm }; E_UNSUPPORTED { feature? | option?, hint? } (exactly
|
|
15
16
|
* one of feature / option); E_INVALID_ARGUMENT { argument, value, expected? }; E_SNAPSHOT { reason, serial };
|
|
16
17
|
* E_RELEASED { serial }; E_NOT_LOADED { state }; E_ABORTED { batchId? }.
|
|
17
18
|
*/
|
|
18
19
|
/** Every condition the package detects itself carries one of these codes (spec 3.3). */
|
|
19
|
-
export type WebGpuGraphErrorCode = "E_NO_WEBGPU" | "E_NO_ADAPTER" | "E_NO_DEVICE" | "E_SOFTWARE_ONLY" | "E_DEVICE_LOST" | "E_DISPOSED" | "E_VALIDATION" | "E_SHADER_COMPILE" | "E_OUT_OF_MEMORY" | "E_TOO_LARGE" | "E_UNSUPPORTED" | "E_INVALID_ARGUMENT" | "E_SNAPSHOT" | "E_RELEASED" | "E_NOT_LOADED" | "E_ABORTED";
|
|
20
|
+
export type WebGpuGraphErrorCode = "E_NO_WEBGPU" | "E_NO_ADAPTER" | "E_NO_DEVICE" | "E_SOFTWARE_ONLY" | "E_DEVICE_LOST" | "E_DEVICE_INCORRECT" | "E_DISPOSED" | "E_VALIDATION" | "E_SHADER_COMPILE" | "E_OUT_OF_MEMORY" | "E_TOO_LARGE" | "E_UNSUPPORTED" | "E_INVALID_ARGUMENT" | "E_SNAPSHOT" | "E_RELEASED" | "E_NOT_LOADED" | "E_ABORTED";
|
|
20
21
|
/** The graph-format error codes a public call lets propagate unchanged (D12, spec 5.7): raised by accessors the package calls on the caller's behalf. */
|
|
21
22
|
export declare const PASSTHROUGH_FORMAT_CODES: readonly [
|
|
22
23
|
"E_GPU_INELIGIBLE",
|
package/dist/src/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,wFAAwF;AACxF,MAAM,MAAM,oBAAoB,GAC1B,aAAa,GACb,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,oBAAoB,GACpB,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,WAAW,CAAC;AAElB,yJAAyJ;AACzJ,eAAO,MAAM,wBAAwB,EAAE,SAAS;IAC5C,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;CACoF,CAAC;AAI1G,gIAAgI;AAChI,qBAAa,gBAAiB,SAAQ,KAAK;IACvC,uBAAuB;IACvB,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAEpC,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpD,2CAA2C;IAC3C,SAAkB,IAAI,EAAE,kBAAkB,CAAC;IAE3C;;;;;OAKG;gBACS,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAM7F;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,gBAAgB,CAMpE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAE5E"}
|
package/dist/src/errors.js
CHANGED
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* `details` keys per code (contract 3.1, so tests can assert them): E_NO_WEBGPU { reason, hint };
|
|
10
10
|
* E_NO_ADAPTER { reason }; E_NO_DEVICE { reason, adapter, limit?, requested?, available? } (reason "consumed" |
|
|
11
11
|
* "requestDevice" | "limit" | "feature" | "maxComputeWorkgroupsPerDimension"); E_SOFTWARE_ONLY { adapter };
|
|
12
|
-
* E_DEVICE_LOST { reason, message };
|
|
12
|
+
* E_DEVICE_LOST { reason, message }; E_DEVICE_INCORRECT { check, where, expected, actual, poison, count, blocks,
|
|
13
|
+
* workgroupSize, adapter, hint? }; E_DISPOSED { label }; E_VALIDATION { label, message, batchId? };
|
|
13
14
|
* E_SHADER_COMPILE { id, stage: "compose" | "compile", slot?, messages? }; E_OUT_OF_MEMORY { requested, resident,
|
|
14
15
|
* label }; E_TOO_LARGE { needed, limit, path, algorithm }; E_UNSUPPORTED { feature? | option?, hint? } (exactly
|
|
15
16
|
* one of feature / option); E_INVALID_ARGUMENT { argument, value, expected? }; E_SNAPSHOT { reason, serial };
|
package/dist/src/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAsBH,yJAAyJ;AACzJ,MAAM,CAAC,MAAM,wBAAwB,GAKjC,MAAM,CAAC,MAAM,CAAC,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,CAAU,CAAC,CAAC;AAE1G,MAAM,aAAa,GAAsC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE3E,gIAAgI;AAChI,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAUvC;;;;;OAKG;IACH,YAAY,IAA0B,EAAE,OAAe,EAAE,OAAiC;QACtF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,CAAU;IACzC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,SAAS,GAAG,CAAyD,CAAC;IAC5E,OAAO,SAAS,CAAC,IAAI,KAAK,kBAAkB,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC;AACvF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,CAAU,EAAE,IAA0B;IAC/D,OAAO,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC;AACpD,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* isSoftwareAdapter. P1 adds GpuContext and degree (values) and the context / run / profiler types. P2 adds nothing
|
|
8
8
|
* (Lease, CommandBatch, UniformRing are internal). P3 adds the layout factory, the accelerator, the two default
|
|
9
9
|
* tables, the seeder and the layout / accelerator types. P5 adds the two factories, the two default tables and the
|
|
10
|
-
* two stats records.
|
|
11
|
-
*
|
|
10
|
+
* two stats records. P4 adds calibrateLayout and its two records. test/index.test.ts pins the value list and
|
|
11
|
+
* test/types/public-api.test-d.ts the type list. This comment must never spell the internal
|
|
12
12
|
* JSDoc tag: it is the leading comment of the first export statement, and stripInternal would drop that statement
|
|
13
13
|
* from the emitted declarations.
|
|
14
14
|
*/
|
|
@@ -18,19 +18,21 @@ export { hasErrorCode, isWebGpuGraphError, PASSTHROUGH_FORMAT_CODES, WebGpuGraph
|
|
|
18
18
|
export { GpuContext } from "./context.js";
|
|
19
19
|
export { isSoftwareAdapter } from "./device/acquire.js";
|
|
20
20
|
export type { PassTiming, Profiler } from "./kernel/profiler.js";
|
|
21
|
+
export { verifyDevice } from "./primitives/verify.js";
|
|
21
22
|
export { degree } from "./algorithms/degree.js";
|
|
22
23
|
export { connectedComponents } from "./algorithms/components.js";
|
|
23
24
|
export { pageRank, personalizedPageRank } from "./algorithms/pagerank.js";
|
|
24
25
|
export { eigenvectorCentrality, hits, katzCentrality } from "./algorithms/spectral.js";
|
|
25
26
|
export { createAccelerator } from "./accelerator.js";
|
|
27
|
+
export { calibrateLayout } from "./layouts/calibrate.js";
|
|
26
28
|
export { createForceAtlas2 } from "./layouts/forceatlas2.js";
|
|
27
29
|
export { createFruchtermanReingold } from "./layouts/fruchterman-reingold.js";
|
|
28
30
|
export { seedPositions } from "./layouts/seed.js";
|
|
29
31
|
export { createSpringElectrical } from "./layouts/spring-electrical.js";
|
|
30
32
|
export type { AcceleratorOptions, AlgorithmAccelerator, ApspResultLike, BellmanFordResultLike, BetweennessAcceleratorOptions, BfsResultLike, CommunityResultLike, CorenessResultLike, EdgeScoresResultLike, GpuAccelerator, HitsOptionsLike, HitsResultLike, LabelResultLike, LayoutAccelerator, LayoutSimulation, MstResultLike, PageRankResultLike, ScoresResultLike, SsspResultLike, } from "./types/accelerator.js";
|
|
31
33
|
export type { ComponentsOptions, EigenvectorOptions, GpuHitsResult, GpuLabelResult, GpuPageRankResult, GpuScoresResult, HitsOptions, KatzOptions, PageRankOptions, } from "./types/algorithms.js";
|
|
32
|
-
export type { AdapterInfoLike, AdapterSummary, GpuCaps, GpuContextOptions, LimitPolicy, PlanCaps, PlanLimits, ProbeOptions, ProbeResult, RaisableLimit, } from "./types/context.js";
|
|
33
|
-
export type { ForceAtlas2Stats, ForceAtlas2TraceRecord, FruchtermanReingoldStats, FruchtermanReingoldTraceRecord, GpuLayoutSimulation, GpuLayoutTuning, LayoutStatsBase, RunOptions, SpringElectricalStats, SpringElectricalTraceRecord, } from "./types/layout.js";
|
|
34
|
+
export type { AdapterInfoLike, AdapterSummary, DeviceCheck, DeviceCheckMismatch, GpuCaps, GpuContextOptions, LimitPolicy, PlanCaps, PlanLimits, ProbeOptions, ProbeResult, RaisableLimit, } from "./types/context.js";
|
|
35
|
+
export type { CalibrateOptions, ForceAtlas2Stats, ForceAtlas2TraceRecord, FruchtermanReingoldStats, FruchtermanReingoldTraceRecord, GpuCalibration, GpuLayoutSimulation, GpuLayoutTuning, LayoutStatsBase, RunOptions, SpringElectricalStats, SpringElectricalTraceRecord, } from "./types/layout.js";
|
|
34
36
|
export type { CommonLayoutOptions, ForceAtlas2Options, FruchtermanReingoldOptions, SimulationOptions, SpringElectricalOptions, } from "./types/options.js";
|
|
35
37
|
export type { GpuRunOptions } from "./types/run.js";
|
|
36
38
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;;AAIH,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,cAAc,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,KAAK,oBAAoB,GAC5B,MAAM,aAA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C9E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAIxE,YAAY,EACR,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,6BAA6B,EAC7B,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,GACjB,MAAM,wBAAwB,CAAC;AAGhC,YAAY,EACR,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,GAClB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACR,eAAe,EACf,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,WAAW,EACX,aAAa,GAChB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACR,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,8BAA8B,EAC9B,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,2BAA2B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACR,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,GAC1B,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* isSoftwareAdapter. P1 adds GpuContext and degree (values) and the context / run / profiler types. P2 adds nothing
|
|
9
9
|
* (Lease, CommandBatch, UniformRing are internal). P3 adds the layout factory, the accelerator, the two default
|
|
10
10
|
* tables, the seeder and the layout / accelerator types. P5 adds the two factories, the two default tables and the
|
|
11
|
-
* two stats records.
|
|
12
|
-
*
|
|
11
|
+
* two stats records. P4 adds calibrateLayout and its two records. test/index.test.ts pins the value list and
|
|
12
|
+
* test/types/public-api.test-d.ts the type list. This comment must never spell the internal
|
|
13
13
|
* JSDoc tag: it is the leading comment of the first export statement, and stripInternal would drop that statement
|
|
14
14
|
* from the emitted declarations.
|
|
15
15
|
*/
|
|
@@ -20,14 +20,19 @@ export { hasErrorCode, isWebGpuGraphError, PASSTHROUGH_FORMAT_CODES, WebGpuGraph
|
|
|
20
20
|
// ==================== context, adapter classifier, profiler (P0 / P1)
|
|
21
21
|
export { GpuContext } from "./context.js";
|
|
22
22
|
export { isSoftwareAdapter } from "./device/acquire.js";
|
|
23
|
+
// ==================== the device self-check: what this device computed when it was asked an answer we already
|
|
24
|
+
// know. Every compute entry point awaits it and refuses a device that got it wrong (E_DEVICE_INCORRECT); a
|
|
25
|
+
// caller may await it first to ask before committing.
|
|
26
|
+
export { verifyDevice } from "./primitives/verify.js";
|
|
23
27
|
// ==================== algorithms (P1: the walking-skeleton diagnostic, spec 3.3)
|
|
24
28
|
export { degree } from "./algorithms/degree.js";
|
|
25
29
|
// ==================== algorithms (P7: the SpMV family and WCC, spec 8.2, 8.3)
|
|
26
30
|
export { connectedComponents } from "./algorithms/components.js";
|
|
27
31
|
export { pageRank, personalizedPageRank } from "./algorithms/pagerank.js";
|
|
28
32
|
export { eigenvectorCentrality, hits, katzCentrality } from "./algorithms/spectral.js";
|
|
29
|
-
// ==================== layouts and the accelerator (P3; the two P5 factories)
|
|
33
|
+
// ==================== layouts and the accelerator (P3; the two P5 factories; P4's calibrateLayout, spec 2.2)
|
|
30
34
|
export { createAccelerator } from "./accelerator.js";
|
|
35
|
+
export { calibrateLayout } from "./layouts/calibrate.js";
|
|
31
36
|
export { createForceAtlas2 } from "./layouts/forceatlas2.js";
|
|
32
37
|
export { createFruchtermanReingold } from "./layouts/fruchterman-reingold.js";
|
|
33
38
|
export { seedPositions } from "./layouts/seed.js";
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD;;;;;;;;;;;;;GAaG;AAEH,qHAAqH;AACrH,uBAAuB;AACvB,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,cAAc,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,GAEnB,MAAM,aAAa,CAAC;AAErB,uEAAuE;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,kFAAkF;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,+EAA+E;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEvF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD;;;;;;;;;;;;;GAaG;AAEH,qHAAqH;AACrH,uBAAuB;AACvB,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,cAAc,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,GAEnB,MAAM,aAAa,CAAC;AAErB,uEAAuE;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,+GAA+G;AAC/G,2GAA2G;AAC3G,sDAAsD;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,kFAAkF;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,+EAA+E;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEvF,8GAA8G;AAC9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -47,10 +47,15 @@ export declare function plan2d(groups: number, caps: PlanCaps): DispatchPlan;
|
|
|
47
47
|
*/
|
|
48
48
|
export declare function planGridStride(items: number, wg: number, caps: PlanCaps, maxGroups?: number): DispatchPlan;
|
|
49
49
|
/**
|
|
50
|
-
* P4 (spec 5.4): the (x, y, 1) args
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* P4 (spec 5.4): the (x, y, 1) args the device-side finalize kernel writes for a count -- plan1d's rule applied to a
|
|
51
|
+
* u32 count through the same grid() as plan1d and plan2d, so the host twin and the kernel cannot drift; the kernel
|
|
52
|
+
* (src/wgsl/indirect-finalize.wgsl.ts) mirrors exactly this arithmetic. `items` of the plan is the count. A count
|
|
53
|
+
* outside [0, 2^32) is E_INVALID_ARGUMENT (the device holds it as a u32); for any u32 count y <= 1,025, so
|
|
54
|
+
* E_TOO_LARGE is unreachable here.
|
|
55
|
+
* @param count - the device-side count (a u32)
|
|
56
|
+
* @param wg - the workgroup size (a power of two)
|
|
53
57
|
* @param caps - the capability table
|
|
58
|
+
* @returns the plan
|
|
54
59
|
*/
|
|
55
60
|
export declare function planIndirect(count: number, wg: number, caps: PlanCaps): DispatchPlan;
|
|
56
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/kernel/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,oGAAoG;AACpG,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AA8ED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAI9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAGnE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,CAS1G;AAED
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/kernel/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,oGAAoG;AACpG,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AA8ED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAI9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAGnE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,CAS1G;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAWpF;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAEnD"}
|
|
@@ -124,16 +124,27 @@ export function planGridStride(items, wg, caps, maxGroups) {
|
|
|
124
124
|
return { x: groups, y: 1, z: 1, items, stride: groups * wg };
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
* P4 (spec 5.4): the (x, y, 1) args
|
|
128
|
-
*
|
|
129
|
-
*
|
|
127
|
+
* P4 (spec 5.4): the (x, y, 1) args the device-side finalize kernel writes for a count -- plan1d's rule applied to a
|
|
128
|
+
* u32 count through the same grid() as plan1d and plan2d, so the host twin and the kernel cannot drift; the kernel
|
|
129
|
+
* (src/wgsl/indirect-finalize.wgsl.ts) mirrors exactly this arithmetic. `items` of the plan is the count. A count
|
|
130
|
+
* outside [0, 2^32) is E_INVALID_ARGUMENT (the device holds it as a u32); for any u32 count y <= 1,025, so
|
|
131
|
+
* E_TOO_LARGE is unreachable here.
|
|
132
|
+
* @param count - the device-side count (a u32)
|
|
133
|
+
* @param wg - the workgroup size (a power of two)
|
|
130
134
|
* @param caps - the capability table
|
|
135
|
+
* @returns the plan
|
|
131
136
|
*/
|
|
132
137
|
export function planIndirect(count, wg, caps) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
assertCount("count", count);
|
|
139
|
+
if (count > 0xffffffff) {
|
|
140
|
+
throw new WebGpuGraphError("E_INVALID_ARGUMENT", `count must fit a u32, got ${count}`, {
|
|
141
|
+
argument: "count",
|
|
142
|
+
value: count,
|
|
143
|
+
expected: "an integer in [0, 2^32)",
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
assertWorkgroupSize(wg);
|
|
147
|
+
return grid(Math.ceil(count / wg), count, caps);
|
|
137
148
|
}
|
|
138
149
|
/**
|
|
139
150
|
* The workgroup count of a plan (x * y).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../../src/kernel/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAYhD;;;;;;GAM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ec. `bind()` creates the
|
|
3
3
|
* bind groups from a `Record<name, Binding>` keyed by the declared names and caches them by the identity of the
|
|
4
4
|
* buffers, offsets and sizes (a layout's bind groups are created once per load(), not per iteration); `dispatch()`
|
|
5
|
-
* records setPipeline / setBindGroup / dispatchWorkgroups and skips an empty plan (spec 5.6)
|
|
5
|
+
* records setPipeline / setBindGroup / dispatchWorkgroups and skips an empty plan (spec 5.6); `dispatchIndirect()`
|
|
6
|
+
* (P4, spec 5.4) records the same prefix and a dispatchWorkgroupsIndirect over one 16-byte slot of an args buffer.
|
|
6
7
|
*/
|
|
7
8
|
import { type Binding } from "../types/memory.js";
|
|
8
9
|
import { type DispatchPlan } from "./dispatch.js";
|
|
@@ -16,6 +17,8 @@ export interface BoundKernel {
|
|
|
16
17
|
/** Group indices whose bind group takes a dynamic offset (the uniform groups), in group order. */
|
|
17
18
|
readonly dynamicGroups: readonly number[];
|
|
18
19
|
}
|
|
20
|
+
/** Bytes of one indirect args slot: (x, y, 1, count) as four u32 (spec 5.4; P4 PD-2). */
|
|
21
|
+
export declare const INDIRECT_ARGS_STRIDE = 16;
|
|
19
22
|
/** A compiled pipeline plus the binding list of its spec (spec 5.1). */
|
|
20
23
|
export declare class Kernel {
|
|
21
24
|
/** The module spec the pipeline was compiled from (its bindings drive bind()). */
|
|
@@ -78,6 +81,32 @@ export declare class Kernel {
|
|
|
78
81
|
* @param dynamicOffsets - one byte offset per entry of bound.dynamicGroups
|
|
79
82
|
*/
|
|
80
83
|
dispatch(pass: GPUComputePassEncoder, bound: BoundKernel, plan: DispatchPlan, dynamicOffsets?: readonly number[]): void;
|
|
84
|
+
/**
|
|
85
|
+
* setPipeline + the bind groups exactly as dispatch(), then dispatchWorkgroupsIndirect(args.buffer, args.offset +
|
|
86
|
+
* INDIRECT_ARGS_STRIDE * slot) (spec 5.4): the (x, y, 1) of the slot were written by the indirect-finalize kernel
|
|
87
|
+
* earlier in the same pass. A slot beyond the binding is E_INVALID_ARGUMENT.
|
|
88
|
+
* @param pass - the open compute pass
|
|
89
|
+
* @param bound - a BoundKernel of THIS kernel
|
|
90
|
+
* @param args - the args buffer range (usage INDIRECT | STORAGE)
|
|
91
|
+
* @param slot - the 16-byte slot index inside the range
|
|
92
|
+
* @param dynamicOffsets - one byte offset per entry of bound.dynamicGroups
|
|
93
|
+
*/
|
|
94
|
+
dispatchIndirect(pass: GPUComputePassEncoder, bound: BoundKernel, args: Binding, slot: number, dynamicOffsets?: readonly number[]): void;
|
|
95
|
+
/**
|
|
96
|
+
* The argument checks dispatch() and dispatchIndirect() share: a BoundKernel of another kernel or an offset list
|
|
97
|
+
* of the wrong length is E_INVALID_ARGUMENT.
|
|
98
|
+
* @param bound - the bound kernel
|
|
99
|
+
* @param dynamicOffsets - the offsets, if any
|
|
100
|
+
*/
|
|
101
|
+
private check;
|
|
102
|
+
/**
|
|
103
|
+
* setPipeline + setBindGroup for every group (the dynamic offsets replicated over the uniform bindings of each
|
|
104
|
+
* dynamic group), the prefix dispatch() and dispatchIndirect() share.
|
|
105
|
+
* @param pass - the open compute pass
|
|
106
|
+
* @param bound - a BoundKernel of this kernel
|
|
107
|
+
* @param dynamicOffsets - one byte offset per entry of bound.dynamicGroups (absent = 0)
|
|
108
|
+
*/
|
|
109
|
+
private setUp;
|
|
81
110
|
/** Drops cached bind groups (a layout's buffers changed). */
|
|
82
111
|
invalidate(): void;
|
|
83
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../src/kernel/kernel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../src/kernel/kernel.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAoB,KAAK,cAAc,EAAE,KAAK,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;;;;;;;;;OAYG;IACH,QAAQ,CACJ,IAAI,EAAE,qBAAqB,EAC3B,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,YAAY,EAClB,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,GACnC,IAAI;IASP;;;;;;;;;OASG;IACH,gBAAgB,CACZ,IAAI,EAAE,qBAAqB,EAC3B,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,GACnC,IAAI;IAaP;;;;;OAKG;IACH,OAAO,CAAC,KAAK;IA0Bb;;;;;;OAMG;IACH,OAAO,CAAC,KAAK;IAmBb,6DAA6D;IAC7D,UAAU,IAAI,IAAI;CAGrB"}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
* Kernel (spec 5.1; contract 3.9): a compiled pipeline bound to the binding list of its spec. `bind()` creates the
|
|
3
3
|
* bind groups from a `Record<name, Binding>` keyed by the declared names and caches them by the identity of the
|
|
4
4
|
* buffers, offsets and sizes (a layout's bind groups are created once per load(), not per iteration); `dispatch()`
|
|
5
|
-
* records setPipeline / setBindGroup / dispatchWorkgroups and skips an empty plan (spec 5.6)
|
|
5
|
+
* records setPipeline / setBindGroup / dispatchWorkgroups and skips an empty plan (spec 5.6); `dispatchIndirect()`
|
|
6
|
+
* (P4, spec 5.4) records the same prefix and a dispatchWorkgroupsIndirect over one 16-byte slot of an args buffer.
|
|
6
7
|
*/
|
|
7
8
|
import { STORAGE_ALIGN } from "../constants.js";
|
|
8
9
|
import { WebGpuGraphError } from "../errors.js";
|
|
10
|
+
/** Bytes of one indirect args slot: (x, y, 1, count) as four u32 (spec 5.4; P4 PD-2). */
|
|
11
|
+
export const INDIRECT_ARGS_STRIDE = 16;
|
|
9
12
|
/** Buffer identities for the bind-group cache key: every GPUBuffer seen by any Kernel gets one number, once. */
|
|
10
13
|
const bufferIds = new WeakMap();
|
|
11
14
|
let nextBufferId = 1;
|
|
@@ -194,6 +197,42 @@ export class Kernel {
|
|
|
194
197
|
* @param dynamicOffsets - one byte offset per entry of bound.dynamicGroups
|
|
195
198
|
*/
|
|
196
199
|
dispatch(pass, bound, plan, dynamicOffsets) {
|
|
200
|
+
this.check(bound, dynamicOffsets);
|
|
201
|
+
if (plan.x === 0) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
this.setUp(pass, bound, dynamicOffsets);
|
|
205
|
+
pass.dispatchWorkgroups(plan.x, plan.y, 1);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* setPipeline + the bind groups exactly as dispatch(), then dispatchWorkgroupsIndirect(args.buffer, args.offset +
|
|
209
|
+
* INDIRECT_ARGS_STRIDE * slot) (spec 5.4): the (x, y, 1) of the slot were written by the indirect-finalize kernel
|
|
210
|
+
* earlier in the same pass. A slot beyond the binding is E_INVALID_ARGUMENT.
|
|
211
|
+
* @param pass - the open compute pass
|
|
212
|
+
* @param bound - a BoundKernel of THIS kernel
|
|
213
|
+
* @param args - the args buffer range (usage INDIRECT | STORAGE)
|
|
214
|
+
* @param slot - the 16-byte slot index inside the range
|
|
215
|
+
* @param dynamicOffsets - one byte offset per entry of bound.dynamicGroups
|
|
216
|
+
*/
|
|
217
|
+
dispatchIndirect(pass, bound, args, slot, dynamicOffsets) {
|
|
218
|
+
this.check(bound, dynamicOffsets);
|
|
219
|
+
if (!Number.isInteger(slot) || slot < 0 || (slot + 1) * INDIRECT_ARGS_STRIDE > args.size) {
|
|
220
|
+
throw new WebGpuGraphError("E_INVALID_ARGUMENT", `${this.spec.id}: args slot ${slot} is outside the binding`, {
|
|
221
|
+
argument: "slot",
|
|
222
|
+
value: slot,
|
|
223
|
+
expected: `0 <= slot < ${Math.floor(args.size / INDIRECT_ARGS_STRIDE)}`,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
this.setUp(pass, bound, dynamicOffsets);
|
|
227
|
+
pass.dispatchWorkgroupsIndirect(args.buffer, args.offset + INDIRECT_ARGS_STRIDE * slot);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The argument checks dispatch() and dispatchIndirect() share: a BoundKernel of another kernel or an offset list
|
|
231
|
+
* of the wrong length is E_INVALID_ARGUMENT.
|
|
232
|
+
* @param bound - the bound kernel
|
|
233
|
+
* @param dynamicOffsets - the offsets, if any
|
|
234
|
+
*/
|
|
235
|
+
check(bound, dynamicOffsets) {
|
|
197
236
|
const { id } = this.spec;
|
|
198
237
|
if (bound.kernel !== this) {
|
|
199
238
|
throw new WebGpuGraphError("E_INVALID_ARGUMENT", `${id}: the bound kernel belongs to "${bound.kernel.spec.id}"`, {
|
|
@@ -209,9 +248,15 @@ export class Kernel {
|
|
|
209
248
|
expected: bound.dynamicGroups.length,
|
|
210
249
|
});
|
|
211
250
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* setPipeline + setBindGroup for every group (the dynamic offsets replicated over the uniform bindings of each
|
|
254
|
+
* dynamic group), the prefix dispatch() and dispatchIndirect() share.
|
|
255
|
+
* @param pass - the open compute pass
|
|
256
|
+
* @param bound - a BoundKernel of this kernel
|
|
257
|
+
* @param dynamicOffsets - one byte offset per entry of bound.dynamicGroups (absent = 0)
|
|
258
|
+
*/
|
|
259
|
+
setUp(pass, bound, dynamicOffsets) {
|
|
215
260
|
pass.setPipeline(this.pipeline);
|
|
216
261
|
let next = 0;
|
|
217
262
|
bound.bindGroups.forEach((bindGroup, group) => {
|
|
@@ -229,7 +274,6 @@ export class Kernel {
|
|
|
229
274
|
pass.setBindGroup(group, bindGroup);
|
|
230
275
|
}
|
|
231
276
|
});
|
|
232
|
-
pass.dispatchWorkgroups(plan.x, plan.y, 1);
|
|
233
277
|
}
|
|
234
278
|
/** Drops cached bind groups (a layout's buffers changed). */
|
|
235
279
|
invalidate() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../src/kernel/kernel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../src/kernel/kernel.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAehD,yFAAyF;AACzF,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,gHAAgH;AAChH,MAAM,SAAS,GAAG,IAAI,OAAO,EAAqB,CAAC;AACnD,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;GAIG;AACH,SAAS,QAAQ,CAAC,MAAiB;IAC/B,IAAI,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACnB,EAAE,GAAG,YAAY,CAAC;QAClB,YAAY,IAAI,CAAC,CAAC;QAClB,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,CAAU,EAAE,CAAU;IAC3C,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC;AACxE,CAAC;AAED,wEAAwE;AACxE,MAAM,OAAO,MAAM;IAmBf;;;;;;;OAOG;IACH,YACI,MAAiB,EACjB,IAAoB,EACpB,QAAwB,EACxB,QAA4B,EAC5B,OAAsC;QAhB1C,6DAA6D;QAC5C,UAAK,GAAG,IAAI,GAAG,EAAuB,CAAC;QAiBpD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,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