@graphty/webgpu-graph-algorithms 0.5.0 → 0.6.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.
- package/README.md +104 -52
- package/dist/browser.js +1 -1
- package/dist/chunks/{context-CRbw2Wyo.js → context-BXqgCifx.js} +225 -33
- package/dist/chunks/context-BXqgCifx.js.map +1 -0
- package/dist/node.js +1 -1
- package/dist/src/accelerator.d.ts +12 -10
- package/dist/src/accelerator.d.ts.map +1 -1
- package/dist/src/accelerator.js +32 -10
- package/dist/src/accelerator.js.map +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 +85 -8
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +85 -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 +10 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +14 -5
- 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 +9 -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 +18 -8
- package/dist/src/kernels.d.ts.map +1 -1
- package/dist/src/kernels.js +345 -22
- 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 +42 -5
- package/dist/src/layouts/force-simulation.d.ts.map +1 -1
- package/dist/src/layouts/force-simulation.js +84 -22
- package/dist/src/layouts/force-simulation.js.map +1 -1
- package/dist/src/layouts/forceatlas2.d.ts +107 -38
- package/dist/src/layouts/forceatlas2.d.ts.map +1 -1
- package/dist/src/layouts/forceatlas2.js +297 -290
- package/dist/src/layouts/forceatlas2.js.map +1 -1
- package/dist/src/layouts/fruchterman-reingold.d.ts +241 -0
- package/dist/src/layouts/fruchterman-reingold.d.ts.map +1 -0
- package/dist/src/layouts/fruchterman-reingold.js +739 -0
- package/dist/src/layouts/fruchterman-reingold.js.map +1 -0
- package/dist/src/layouts/model-common.d.ts +140 -0
- package/dist/src/layouts/model-common.d.ts.map +1 -0
- package/dist/src/layouts/model-common.js +269 -0
- package/dist/src/layouts/model-common.js.map +1 -0
- 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 +224 -0
- package/dist/src/layouts/spring-electrical.d.ts.map +1 -0
- package/dist/src/layouts/spring-electrical.js +665 -0
- package/dist/src/layouts/spring-electrical.js.map +1 -0
- 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/accelerator.d.ts +7 -3
- package/dist/src/types/accelerator.d.ts.map +1 -1
- 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 +52 -0
- package/dist/src/types/layout.d.ts.map +1 -1
- package/dist/src/types/options.d.ts +43 -1
- package/dist/src/types/options.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 -8
- package/dist/src/wgsl/fa2-attraction.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-attraction.wgsl.js +100 -17
- package/dist/src/wgsl/fa2-attraction.wgsl.js.map +1 -1
- package/dist/src/wgsl/fa2-integrate.wgsl.d.ts +7 -2
- package/dist/src/wgsl/fa2-integrate.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-integrate.wgsl.js +28 -2
- package/dist/src/wgsl/fa2-integrate.wgsl.js.map +1 -1
- package/dist/src/wgsl/fa2-repulsion-exact.wgsl.d.ts +4 -2
- package/dist/src/wgsl/fa2-repulsion-exact.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-repulsion-exact.wgsl.js +14 -5
- package/dist/src/wgsl/fa2-repulsion-exact.wgsl.js.map +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts +12 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.js +54 -0
- 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 +5016 -1130
- package/dist/webgpu-graph-algorithms.js.map +1 -1
- package/package.json +10 -7
- package/src/accelerator.ts +46 -12
- 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 +108 -8
- package/src/errors.ts +3 -1
- package/src/index.ts +25 -5
- package/src/kernel/dispatch.ts +18 -7
- package/src/kernel/kernel.ts +59 -5
- package/src/kernel/prelude.ts +15 -0
- package/src/kernel/profiler.ts +28 -4
- package/src/kernels.ts +378 -24
- package/src/layouts/calibrate.ts +187 -0
- package/src/layouts/force-simulation.ts +111 -26
- package/src/layouts/forceatlas2.ts +346 -324
- package/src/layouts/fruchterman-reingold.ts +918 -0
- package/src/layouts/model-common.ts +323 -0
- package/src/layouts/repulsion-grid.ts +451 -0
- package/src/layouts/spring-electrical.ts +845 -0
- 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/accelerator.ts +15 -3
- package/src/types/context.ts +56 -0
- package/src/types/layout.ts +58 -0
- package/src/types/options.ts +45 -1
- package/src/wgsl/counting-scatter.wgsl.ts +16 -0
- package/src/wgsl/fa2-attraction.wgsl.ts +100 -17
- package/src/wgsl/fa2-integrate.wgsl.ts +28 -2
- package/src/wgsl/fa2-repulsion-exact.wgsl.ts +14 -5
- package/src/wgsl/fa2-stats-finalize.wgsl.ts +54 -0
- 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-CRbw2Wyo.js.map +0 -1
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
|
|
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;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,IAAc;IAChC,OAAO,IAAI,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAC1F,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,QAAgB,EAAE,KAAa;IAChD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,GAAG,QAAQ,wCAAwC,KAAK,EAAE,EAAE;YACzG,QAAQ;YACR,KAAK;YACL,QAAQ,EAA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C,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,CAAC;AACjE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,EAAU,EAAE,IAAc;IAClE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5B,IAAI,KAAK,GAAG,UAAU,EAAE,CAAC;QACrB,MAAM,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,6BAA6B,KAAK,EAAE,EAAE;YACnF,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,yBAAyB;SACtC,CAAC,CAAC;IACP,CAAC;IACD,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAkB;IACvC,OAAO,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -2,7 +2,8 @@
|
|
|
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 { 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,cAAc,EAAE,MAAM,WAAW,CAAC;AAEvF,kLAAkL;AAClL,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC/D,+FAA+F;AAC/F,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,SAAS,YAAY,EAAE,CAAC;IAC7C,kGAAkG;IAClG,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AA+Bv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O,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;AA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Y,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACxC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED,6DAA6D;IAC7D,UAAU;QACN,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prelude.d.ts","sourceRoot":"","sources":["../../../src/kernel/prelude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"prelude.d.ts","sourceRoot":"","sources":["../../../src/kernel/prelude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAsBH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUpD;AAED,iHAAiH;AACjH,eAAO,MAAM,YAAY,EAAE,MAgDzB,CAAC;AAEH,8GAA8G;AAC9G,eAAO,MAAM,aAAa,EAAE,MAAwC,CAAC;AAErE,+DAA+D;AAC/D,eAAO,MAAM,6BAA6B,EAAE,MAoCsE,CAAC;AAEnH,mFAAmF;AACnF,eAAO,MAAM,4BAA4B,EAAE,MA2EuE,CAAC;AAEnH,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,+DAAgE,CAAC;AAEjG;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAchD,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* covers this file's template, so no u32 sentinel or workgroup-size literal is ever typed here.
|
|
10
10
|
*/
|
|
11
11
|
import { INVALID_INDEX } from "@graphty/graph-format";
|
|
12
|
-
import { FA2_COINCIDENT_SQ, FA2_DISTANCE_FLOOR, FA2_DISTANCE_FLOOR_SQ, FA2_FLAG_FIRST, MAX_WORKGROUPS_PER_DIM, U32_MAX, WORKGROUP_SIZE, } from "../constants.js";
|
|
12
|
+
import { FA2_COINCIDENT_SQ, FA2_DISTANCE_FLOOR, FA2_DISTANCE_FLOOR_SQ, FA2_FLAG_ADAPTIVE, FA2_FLAG_FIRST, FR_COOLING_PATIENCE, FR_COOLING_STEP, GRID_BBOX_MARGIN, GRID_EXTENT_FLOOR, GRID_HUB_CELL, MAX_WORKGROUPS_PER_DIM, RADIX_BINS, U32_MAX, WORKGROUP_SIZE, } from "../constants.js";
|
|
13
13
|
import { WebGpuGraphError } from "../errors.js";
|
|
14
14
|
/**
|
|
15
15
|
* Formats a finite number as a WGSL f32 literal that always carries a decimal point or an exponent (`0.01`,
|
|
@@ -37,6 +37,14 @@ const FA2_DIST_FLOOR: f32 = ${wgslF32Literal(FA2_DISTANCE_FLOOR)};
|
|
|
37
37
|
const FA2_DIST_FLOOR_SQ: f32 = ${wgslF32Literal(FA2_DISTANCE_FLOOR_SQ)};
|
|
38
38
|
const FA2_COINCIDENT_SQ: f32 = ${wgslF32Literal(FA2_COINCIDENT_SQ)};
|
|
39
39
|
const FA2_FLAG_FIRST: u32 = ${FA2_FLAG_FIRST}u;
|
|
40
|
+
const FA2_FLAG_ADAPTIVE: u32 = ${FA2_FLAG_ADAPTIVE}u;
|
|
41
|
+
const FR_COOLING_STEP: f32 = ${wgslF32Literal(FR_COOLING_STEP)};
|
|
42
|
+
const FR_COOLING_PATIENCE: u32 = ${FR_COOLING_PATIENCE}u;
|
|
43
|
+
const GRID_HUB_CELL: u32 = ${GRID_HUB_CELL}u;
|
|
44
|
+
const GRID_EXTENT_FLOOR: f32 = ${wgslF32Literal(GRID_EXTENT_FLOOR)};
|
|
45
|
+
const GRID_BBOX_MARGIN: f32 = ${wgslF32Literal(GRID_BBOX_MARGIN)};
|
|
46
|
+
const RADIX_BINS: u32 = ${RADIX_BINS}u;
|
|
47
|
+
const RADIX_DIGIT_MASK: u32 = ${RADIX_BINS - 1}u;
|
|
40
48
|
const F32_MAX: f32 = 0x1.fffffep+127;
|
|
41
49
|
override WG: u32 = ${WORKGROUP_SIZE}u;
|
|
42
50
|
override USE_PERM: bool = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../../src/kernel/prelude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EACH,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,EACd,sBAAsB,EACtB,OAAO,EACP,cAAc,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IACxC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,mBAAmB,KAAK,yBAAyB,EAAE;YAChG,QAAQ,EAAE,OAAO;YACjB,KAAK;YACL,QAAQ,EAAE,iBAAiB;SAC9B,CAAC,CAAC;IACP,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC;AAClD,CAAC;AAED,iHAAiH;AACjH,MAAM,CAAC,MAAM,YAAY,GAAW,UAAU,CAAC;6BAClB,aAAa;uBACnB,OAAO;sCACQ,sBAAsB;8BAC9B,cAAc,CAAC,kBAAkB,CAAC;iCAC/B,cAAc,CAAC,qBAAqB,CAAC;iCACrC,cAAc,CAAC,iBAAiB,CAAC;8BACpC,cAAc;;
|
|
1
|
+
{"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../../src/kernel/prelude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EACH,iBAAiB,EACjB,kBAAkB,EAClB,qBAA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,IAAI,CAAC,CAAC,MAAM,CAAC;AAErE,+DAA+D;AAC/D,MAAM,CAAC,MAAM,6BAA6B,GAAW,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kHAoCkD,CAAC;AAEnH,mFAAmF;AACnF,MAAM,CAAC,MAAM,4BAA4B,GAAW,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kHA2EmD,CAAC;AAEnH,0FAA0F;AAC1F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,CAAU,CAAC;AAEjG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB,MAAM,CAAC,MAAM,CAC/D;;;;;;;;;;6CAUyC;KACpC,IAAI,EAAE;KACN,KAAK,CAAC,KAAK,CAAC,CACpB,CAAC"}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* every CommandBatch pass; `resolveInto(batch)` records the resolve plus a copy into the batch's
|
|
5
5
|
* staging slot and `timings(bytes, request)` decodes `{ label, ns }` per pass from the batch's
|
|
6
6
|
* readback bytes. Chromium quantises timestamps to 100 us (`quantised: true`); Dawn-node reports
|
|
7
|
-
* 1,024 ns ticks (spec 2.6). The profiler never throws: a full query set drops timings
|
|
8
|
-
*
|
|
7
|
+
* 1,024 ns ticks (spec 2.6). The profiler never throws: a full query set drops the timings of the
|
|
8
|
+
* passes past the budget and marks the batch's request `partial(request)` so a caller summing the
|
|
9
|
+
* rows into a duration falls back to wall time; a device without the feature disables it. Slot
|
|
10
|
+
* pairs are handed out in order and the cursor restarts at 0
|
|
9
11
|
* after every resolve: queue order guarantees the resolve of batch A reads its slots before batch B
|
|
10
12
|
* overwrites them, and one resolve buffer suffices for the same reason.
|
|
11
13
|
*/
|
|
@@ -25,8 +27,10 @@ export declare class Profiler {
|
|
|
25
27
|
private readonly querySet;
|
|
26
28
|
private readonly resolveBuffer;
|
|
27
29
|
private readonly labels;
|
|
30
|
+
private readonly partialRequests;
|
|
28
31
|
private pending;
|
|
29
32
|
private cursor;
|
|
33
|
+
private refused;
|
|
30
34
|
private destroyed;
|
|
31
35
|
/**
|
|
32
36
|
* Creates the query set and the resolve buffer when usable; `slots` defaults to PROFILER_QUERY_SLOTS = 256
|
|
@@ -39,7 +43,8 @@ export declare class Profiler {
|
|
|
39
43
|
*/
|
|
40
44
|
constructor(device: GPUDevice, enabled: boolean, quantised: boolean, slots?: number);
|
|
41
45
|
/**
|
|
42
|
-
* The timestampWrites descriptor for a new pass, or undefined when disabled / out of slots.
|
|
46
|
+
* The timestampWrites descriptor for a new pass, or undefined when disabled / out of slots. A pass refused for
|
|
47
|
+
* want of slots is counted, and the next `resolveInto()` marks its request partial.
|
|
43
48
|
* @param label - the pass name reported by `timings()`
|
|
44
49
|
* @returns the descriptor a CommandBatch puts on beginComputePass, or undefined
|
|
45
50
|
*/
|
|
@@ -51,6 +56,13 @@ export declare class Profiler {
|
|
|
51
56
|
* @returns the readback request `timings()` decodes, or null
|
|
52
57
|
*/
|
|
53
58
|
resolveInto(batch: CommandBatch): ReadbackRequest | null;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a pass of the batch was refused a slot pair, so `timings()` covers only its first slots / 2 passes
|
|
61
|
+
* and their sum is not the batch's duration.
|
|
62
|
+
* @param request - the request `resolveInto()` returned
|
|
63
|
+
* @returns true when at least one pass of that batch went untimed
|
|
64
|
+
*/
|
|
65
|
+
partial(request: ReadbackRequest): boolean;
|
|
54
66
|
/**
|
|
55
67
|
* Decodes the timings of a batch from its readback bytes.
|
|
56
68
|
* @param bytes - the resolved readback of the batch
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../../src/kernel/profiler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../../src/kern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,IAAI;CAelB"}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* every CommandBatch pass; `resolveInto(batch)` records the resolve plus a copy into the batch's
|
|
5
5
|
* staging slot and `timings(bytes, request)` decodes `{ label, ns }` per pass from the batch's
|
|
6
6
|
* readback bytes. Chromium quantises timestamps to 100 us (`quantised: true`); Dawn-node reports
|
|
7
|
-
* 1,024 ns ticks (spec 2.6). The profiler never throws: a full query set drops timings
|
|
8
|
-
*
|
|
7
|
+
* 1,024 ns ticks (spec 2.6). The profiler never throws: a full query set drops the timings of the
|
|
8
|
+
* passes past the budget and marks the batch's request `partial(request)` so a caller summing the
|
|
9
|
+
* rows into a duration falls back to wall time; a device without the feature disables it. Slot
|
|
10
|
+
* pairs are handed out in order and the cursor restarts at 0
|
|
9
11
|
* after every resolve: queue order guarantees the resolve of batch A reads its slots before batch B
|
|
10
12
|
* overwrites them, and one resolve buffer suffices for the same reason.
|
|
11
13
|
*/
|
|
@@ -24,8 +26,10 @@ export class Profiler {
|
|
|
24
26
|
*/
|
|
25
27
|
constructor(device, enabled, quantised, slots) {
|
|
26
28
|
this.labels = new WeakMap();
|
|
29
|
+
this.partialRequests = new WeakSet();
|
|
27
30
|
this.pending = [];
|
|
28
31
|
this.cursor = 0;
|
|
32
|
+
this.refused = 0;
|
|
29
33
|
this.destroyed = false;
|
|
30
34
|
const count = slots ?? PROFILER_QUERY_SLOTS;
|
|
31
35
|
this.quantised = quantised;
|
|
@@ -46,12 +50,17 @@ export class Profiler {
|
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
|
-
* The timestampWrites descriptor for a new pass, or undefined when disabled / out of slots.
|
|
53
|
+
* The timestampWrites descriptor for a new pass, or undefined when disabled / out of slots. A pass refused for
|
|
54
|
+
* want of slots is counted, and the next `resolveInto()` marks its request partial.
|
|
50
55
|
* @param label - the pass name reported by `timings()`
|
|
51
56
|
* @returns the descriptor a CommandBatch puts on beginComputePass, or undefined
|
|
52
57
|
*/
|
|
53
58
|
beginPass(label) {
|
|
54
|
-
if (this.querySet === null || this.destroyed
|
|
59
|
+
if (this.querySet === null || this.destroyed) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
if (this.cursor + 2 > this.slots) {
|
|
63
|
+
this.refused++;
|
|
55
64
|
return undefined;
|
|
56
65
|
}
|
|
57
66
|
const begin = this.cursor;
|
|
@@ -73,10 +82,23 @@ export class Profiler {
|
|
|
73
82
|
batch.resolveQuerySet(this.querySet, 0, count, this.resolveBuffer);
|
|
74
83
|
const request = batch.readback(this.resolveBuffer, 0, count * 8);
|
|
75
84
|
this.labels.set(request, this.pending.map((pass) => pass.label));
|
|
85
|
+
if (this.refused > 0) {
|
|
86
|
+
this.partialRequests.add(request);
|
|
87
|
+
}
|
|
76
88
|
this.pending = [];
|
|
77
89
|
this.cursor = 0;
|
|
90
|
+
this.refused = 0;
|
|
78
91
|
return request;
|
|
79
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether a pass of the batch was refused a slot pair, so `timings()` covers only its first slots / 2 passes
|
|
95
|
+
* and their sum is not the batch's duration.
|
|
96
|
+
* @param request - the request `resolveInto()` returned
|
|
97
|
+
* @returns true when at least one pass of that batch went untimed
|
|
98
|
+
*/
|
|
99
|
+
partial(request) {
|
|
100
|
+
return this.partialRequests.has(request);
|
|
101
|
+
}
|
|
80
102
|
/**
|
|
81
103
|
* Decodes the timings of a batch from its readback bytes.
|
|
82
104
|
* @param bytes - the resolved readback of the batch
|
|
@@ -109,6 +131,7 @@ export class Profiler {
|
|
|
109
131
|
this.destroyed = true;
|
|
110
132
|
this.pending = [];
|
|
111
133
|
this.cursor = 0;
|
|
134
|
+
this.refused = 0;
|
|
112
135
|
if (this.querySet !== null) {
|
|
113
136
|
this.querySet.destroy();
|
|
114
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiler.js","sourceRoot":"","sources":["../../../src/kernel/profiler.ts"],"names":[],"mappings":"AAAA
|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G,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YAC5C,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAED,iEAAiE;IACjE,OAAO;QACH,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,OAAO;QACX,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QAC5B,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;YAC9B,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;QACjC,CAAC;IACL,CAAC;CACJ"}
|
package/dist/src/kernels.d.ts
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
* and fa2-speed-finalize (K4) together with every generated block of contract 3.10.2; P2-T2 lands
|
|
8
8
|
* segmented-reduce; P3-T2 adds fa2-stats-finalize (K1), fa2-attraction (K2), fa2-integrate (K5) and
|
|
9
9
|
* fa2-to-scene; M8b-T3 adds the seven P7 entries: spmv-pull, pr-scale, pr-finalize, wcc-link-sample,
|
|
10
|
-
* wcc-link-edges, wcc-compress and wcc-sample.
|
|
11
|
-
* test/layers.test.ts).
|
|
10
|
+
* wcc-link-edges, wcc-compress and wcc-sample. P4-T1 adds indirect-finalize; the other P4 entries follow, one task
|
|
11
|
+
* each (the P4 plan, PD-1). This file is the only importer of src/wgsl/** (spec 3.2; test/layers.test.ts).
|
|
12
12
|
*/
|
|
13
13
|
import { UniformBlock } from "./kernel/struct-block.js";
|
|
14
14
|
import { type BindingDecl, type OverrideDecl, type WgslModuleSpec } from "./kernel/wgsl.js";
|
|
15
15
|
import { type CoreBinding } from "./memory/residency.js";
|
|
16
16
|
import { type Binding } from "./types/memory.js";
|
|
17
17
|
/** Every module id of P1-P3 and P7 (later ids are appended, never renamed). */
|
|
18
|
-
export type KernelId = "degree" | "reduce" | "fill" | "segmented-reduce" | "fa2-stats-finalize" | "fa2-attraction" | "fa2-repulsion-exact" | "fa2-speed-finalize" | "fa2-integrate" | "fa2-to-scene" | "spmv-pull" | "pr-scale" | "pr-finalize" | "wcc-link-sample" | "wcc-link-edges" | "wcc-compress" | "wcc-sample";
|
|
18
|
+
export type KernelId = "degree" | "reduce" | "fill" | "segmented-reduce" | "fa2-stats-finalize" | "fa2-attraction" | "fa2-repulsion-exact" | "fa2-speed-finalize" | "fa2-integrate" | "fa2-to-scene" | "spmv-pull" | "pr-scale" | "pr-finalize" | "wcc-link-sample" | "wcc-link-edges" | "wcc-compress" | "wcc-sample" | "indirect-finalize" | "scan-block" | "scan-add" | "histogram" | "counting-scatter" | "radix-hist" | "radix-scatter" | "grid-cell-key" | "grid-centroid" | "grid-centroid-hub" | "grid-downsample" | "grid-far-field" | "grid-near-field";
|
|
19
19
|
/** One registry entry: everything of a WgslModuleSpec except the per-variant overrides and snippets. */
|
|
20
20
|
export interface KernelEntry {
|
|
21
21
|
readonly id: KernelId;
|
|
@@ -29,7 +29,7 @@ export interface KernelEntry {
|
|
|
29
29
|
/** The snippet marker names the body carries (segmented-reduce: ["VALUE"]). */
|
|
30
30
|
readonly snippetSlots: readonly string[];
|
|
31
31
|
/** The phase the entry landed in (documentation and the compile-matrix filter). */
|
|
32
|
-
readonly phase: "P1" | "P2" | "P3" | "P7";
|
|
32
|
+
readonly phase: "P1" | "P2" | "P3" | "P4" | "P7";
|
|
33
33
|
}
|
|
34
34
|
/** `RangeParams` (uniform, 32 B): rows `[start, end)` @0 / @4 of the dispatch, the bound arc window `[arcBase, arcEnd)` @8 / @12 (0 and arcCount when not windowed), `accumulate` @16 (1 combines into `out[i]` instead of overwriting: the P4 windowed loop), `n` @20 (the node count that bounds neighbour indices), `pad0` @24, `pad1` @28. */
|
|
35
35
|
export declare const RANGE_PARAMS: UniformBlock;
|
|
@@ -37,15 +37,15 @@ export declare const RANGE_PARAMS: UniformBlock;
|
|
|
37
37
|
export declare const REDUCE_PARAMS: UniformBlock;
|
|
38
38
|
/** `FillParams` (uniform, 16 B): `count` @0 words, `value` @4, `mode` @8 (0 = the constant `value`, 1 = iota `i + value`), `pad0` @12. */
|
|
39
39
|
export declare const FILL_PARAMS: UniformBlock;
|
|
40
|
-
/** `Fa2Params` (uniform,
|
|
40
|
+
/** `Fa2Params` (uniform, 128 B; spec 7.3): the per-iteration ForceAtlas2 parameters -- `n` @0, `dim` @4, `flags` @8 (bit 0 = FA2_FLAG_FIRST), `tierStart` @12, `tierEnd` @16, `iterationIndex` @20, `seed` @24, `nearMax` @28, `scalingRatio` @32, `gravity` @36, `jitterTolerance` @40, `scale` @44, `center` @48 (xyz, w 0), `settleThreshold` @64, `extentFactor` @68, `gridMax` @72, `levels` @76, `arcBase` @80 / `arcEnd` @84 (the bound arc window of K2, 0 and arcCount in the layout), `accumulate` @88 (1 combines into `force`: the windowed pattern), `hiEnd` @92 / `midEnd` @124 (the degreeOrder tier boundaries, PD-7; both 0 without a permutation); the P5 model fields (PD-3): `frK` @96 (the FR optimal distance), `temperature` @100 (the FR temperature of this iteration), `springLength` @104, `springCoefficient` @108, `coulomb` @112 (ngraph's `gravity`, negative repels), `dragCoefficient` @116, `timeStep` @120; 128 B. */
|
|
41
41
|
export declare const FA2_PARAMS: UniformBlock;
|
|
42
|
-
/** `Fa2State` (storage, padded to STATE_HEADER_BYTES = 256; spec 7.3): the device-resident controller state the finalize kernels write and the host reads back for stats -- `speed` @0, `speedEfficiency` @4, `swing` @8, `traction` @12, `centroid` @16, `rmsRadius` @32, `radius` @36, `meanDisplacement` @40, `iteration` @44, `min` @48, `max` @64, `gridMin` @80 (P4), `eps` @96 (P4), `settledCount` @100, `outsideGrid` @104 (P4), `maxCellOccupancy` @108 (P4), `reserved0` .. `reserved8` @
|
|
42
|
+
/** `Fa2State` (storage, padded to STATE_HEADER_BYTES = 256; spec 7.3): the device-resident controller state the finalize kernels write and the host reads back for stats -- `speed` @0, `speedEfficiency` @4, `swing` @8, `traction` @12, `centroid` @16, `rmsRadius` @32, `radius` @36, `meanDisplacement` @40, `iteration` @44, `min` @48, `max` @64, `gridMin` @80 (P4), `eps` @96 (P4), `settledCount` @100, `outsideGrid` @104 (P4), `maxCellOccupancy` @108 (P4), `temperature` @112 (FR, written by K1 under STATS_MODE 1), `kineticEnergy` @116 (the preset, K1 under STATS_MODE 2), `frEnergy` @120 / `frProgress` @124 (the FR adaptive cooling), `invCellSize` @128 (P4, PD-10: `1 / cellSize`, written by K1 beside `cellSize` in `gridMin.w`; G1 multiplies by it so every key is bitwise reproducible), `reserved0` @132 (f32), `reserved1` @136 (vec2f), `reserved2` .. `reserved8` @144 .. @240. */
|
|
43
43
|
export declare const FA2_STATE: UniformBlock;
|
|
44
|
-
/** `Fa2Trace` (storage record, 32 B; spec 7.3): one per-iteration trace record -- `swing` @0, `traction` @4, `speed` @8, `speedEfficiency` @12 (written by K4), `meanDisplacement` @16, `settledCount` @20, `iteration` @24 (written by K1), `
|
|
44
|
+
/** `Fa2Trace` (storage record, 32 B; spec 7.3): one per-iteration trace record -- `swing` @0, `traction` @4, `speed` @8, `speedEfficiency` @12 (written by K4), `meanDisplacement` @16, `settledCount` @20, `iteration` @24 (written by K1), `modelScalar` @28 (K1: the temperature under STATS_MODE 1, the kinetic energy under 2, 0 under 0); the trace region is `array<Fa2Trace>` at byte offset STATE_HEADER_BYTES of the state buffer. */
|
|
45
45
|
export declare const FA2_TRACE: UniformBlock;
|
|
46
46
|
/** `Fa2Partial` (storage record, 64 B; spec 7.3): one per-workgroup partial -- `sum` @0 (xyz = sum of positions, w = sum of |p - centroid|^2), `min` @16, `max` @32 (w = max of |p - centroid|^2, the exact layoutRadius source), written by K5; `swingTraction` @48 (written by K3's epilogue); `dispFree` @56 (x = sum |dp| over free rows, y = the free count as an f32 <= 256, written by K5). */
|
|
47
47
|
export declare const FA2_PARTIAL: UniformBlock;
|
|
48
|
-
/** `SpmvParams` (uniform, 32 B; spec 8.2): `n` @0 rows of the pull, the bound arc window `[arcBase, arcEnd)` @4 / @8 (0 and arcCount when not windowed), the grid-stride step `stride` @12, `alpha` @16, `beta` @20 (the `1 - alpha` term), `uniformP` @24 (the uniform personalization mass `1 / n`, 0 for a pure SpMV), `
|
|
48
|
+
/** `SpmvParams` (uniform, 32 B; spec 8.2): `n` @0 rows of the pull, the bound arc window `[arcBase, arcEnd)` @4 / @8 (0 and arcCount when not windowed), the grid-stride step `stride` @12, `alpha` @16, `beta` @20 (the `1 - alpha` term), `uniformP` @24 (the uniform personalization mass `1 / n`, 0 for a pure SpMV), `start` @28 (the first row of the dispatch; TIER 0 strides from it, the tiers index from it). */
|
|
49
49
|
export declare const SPMV_PARAMS: UniformBlock;
|
|
50
50
|
/** `PrParams` (uniform, 32 B; spec 8.2): `n` @0, `groups` @4 (the per-workgroup partial count the finalize folds), `iteration` @8 (1-based), `trackConvergence` @12 (1 records firstConverged), `convergeThreshold` @16 (`tolerance * n`, the design's `delta < tol * n`), `pad0` @20, `pad1` @24, `pad2` @28. */
|
|
51
51
|
export declare const PR_PARAMS: UniformBlock;
|
|
@@ -59,6 +59,16 @@ export declare const PR_PARAMS: UniformBlock;
|
|
|
59
59
|
export declare const PR_PARTIAL: UniformBlock;
|
|
60
60
|
/** `WccParams` (uniform, 32 B; spec 8.3): `n` @0, `items` @4 (rows for a sample round, edges for an edge round, 1024 for the sampler), `stride` @8, `r` @12 (the neighbour index of the sampled round, and the sampler's seed), `flagIndex` @16 (the changed word inside `comp`, PD-4), `giant` @20 (`U32_MAX` before the sample), `maxSteps` @24, `pad0` @28. */
|
|
61
61
|
export declare const WCC_PARAMS: UniformBlock;
|
|
62
|
+
/** `IndirectParams` (uniform, 16 B; spec 5.4): `countIndex` @0 (the word of `counters` holding the count), `wg` @4 (the consumer's workgroup size), `slot` @8 (the 16-byte args slot to write), `pad0` @12. */
|
|
63
|
+
export declare const INDIRECT_PARAMS: UniformBlock;
|
|
64
|
+
/** `ScanParams` (uniform, 16 B; spec 6 row 2): `count` @0 (the u32 words of the level), `pad0` @4, `pad1` @8, `pad2` @12. */
|
|
65
|
+
export declare const SCAN_PARAMS: UniformBlock;
|
|
66
|
+
/** `GridLevelParams` (uniform, 32 B; spec 7.7 G5, P4-T9): `childBase` @0 and `parentBase` @4 (the first cell of the child / parent level inside the pyramid), `parentSide` @8, `parentCells` @12 (`parentSide^dim`), `depth` @16 (1 in 2D, 2 in 3D), `pad0` @20, `pad1` @24, `pad2` @28. */
|
|
67
|
+
export declare const GRID_LEVEL_PARAMS: UniformBlock;
|
|
68
|
+
/** `HistParams` (uniform, 16 B; spec 6 row 5): `count` @0 (the keys), `bins` @4 (a key >= bins is not counted), `pad0` @8, `pad1` @12. */
|
|
69
|
+
export declare const HIST_PARAMS: UniformBlock;
|
|
70
|
+
/** `RadixParams` (uniform, 16 B; spec 6 row 6): `count` @0 (the pairs), `shift` @4 (the pass's digit shift, 8 x pass), `groups` @8 (ceil(count / WG), the stride of the digit-major table), `pad0` @12. */
|
|
71
|
+
export declare const RADIX_PARAMS: UniformBlock;
|
|
62
72
|
/** THE registry (spec 3.5): every entry, keyed by id. */
|
|
63
73
|
export declare const KERNELS: Readonly<Record<KernelId, KernelEntry>>;
|
|
64
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernels.d.ts","sourceRoot":"","sources":["../../src/kernels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,0B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