@graphty/webgpu-graph-algorithms 0.6.3 → 0.6.4
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 +62 -32
- package/dist/browser.js +1 -1
- package/dist/chunks/{context-BXqgCifx.js → context-Dvq-Cc6v.js} +71 -25
- package/dist/chunks/context-Dvq-Cc6v.js.map +1 -0
- package/dist/node.js +1 -1
- package/dist/src/accelerator.d.ts +8 -6
- package/dist/src/accelerator.d.ts.map +1 -1
- package/dist/src/accelerator.js +57 -6
- package/dist/src/accelerator.js.map +1 -1
- package/dist/src/algorithms/bellman-ford.d.ts +60 -0
- package/dist/src/algorithms/bellman-ford.d.ts.map +1 -0
- package/dist/src/algorithms/bellman-ford.js +301 -0
- package/dist/src/algorithms/bellman-ford.js.map +1 -0
- package/dist/src/algorithms/bfs.d.ts +67 -0
- package/dist/src/algorithms/bfs.d.ts.map +1 -0
- package/dist/src/algorithms/bfs.js +534 -0
- package/dist/src/algorithms/bfs.js.map +1 -0
- package/dist/src/algorithms/closeness.d.ts +53 -0
- package/dist/src/algorithms/closeness.d.ts.map +1 -0
- package/dist/src/algorithms/closeness.js +323 -0
- package/dist/src/algorithms/closeness.js.map +1 -0
- package/dist/src/algorithms/scope.d.ts +5 -3
- package/dist/src/algorithms/scope.d.ts.map +1 -1
- package/dist/src/algorithms/scope.js +3 -0
- package/dist/src/algorithms/scope.js.map +1 -1
- package/dist/src/algorithms/sssp.d.ts +71 -0
- package/dist/src/algorithms/sssp.d.ts.map +1 -0
- package/dist/src/algorithms/sssp.js +585 -0
- package/dist/src/algorithms/sssp.js.map +1 -0
- package/dist/src/constants.d.ts +12 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +12 -0
- package/dist/src/constants.js.map +1 -1
- package/dist/src/index.d.ts +8 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/kernel/prelude.d.ts +4 -4
- package/dist/src/kernel/prelude.d.ts.map +1 -1
- package/dist/src/kernel/prelude.js +39 -5
- package/dist/src/kernel/prelude.js.map +1 -1
- package/dist/src/kernel/uniform-ring.d.ts +8 -0
- package/dist/src/kernel/uniform-ring.d.ts.map +1 -1
- package/dist/src/kernel/uniform-ring.js +13 -0
- package/dist/src/kernel/uniform-ring.js.map +1 -1
- package/dist/src/kernels.d.ts +44 -4
- package/dist/src/kernels.d.ts.map +1 -1
- package/dist/src/kernels.js +371 -3
- package/dist/src/kernels.js.map +1 -1
- package/dist/src/primitives/advance.d.ts +62 -0
- package/dist/src/primitives/advance.d.ts.map +1 -0
- package/dist/src/primitives/advance.js +95 -0
- package/dist/src/primitives/advance.js.map +1 -0
- package/dist/src/primitives/compact.d.ts +89 -0
- package/dist/src/primitives/compact.d.ts.map +1 -0
- package/dist/src/primitives/compact.js +233 -0
- package/dist/src/primitives/compact.js.map +1 -0
- package/dist/src/primitives/core-shape.d.ts +22 -1
- package/dist/src/primitives/core-shape.d.ts.map +1 -1
- package/dist/src/primitives/core-shape.js +33 -3
- package/dist/src/primitives/core-shape.js.map +1 -1
- package/dist/src/primitives/frontier.d.ts +156 -0
- package/dist/src/primitives/frontier.d.ts.map +1 -0
- package/dist/src/primitives/frontier.js +259 -0
- package/dist/src/primitives/frontier.js.map +1 -0
- package/dist/src/types/accelerator.d.ts +16 -7
- package/dist/src/types/accelerator.d.ts.map +1 -1
- package/dist/src/types/traversal.d.ts +53 -0
- package/dist/src/types/traversal.d.ts.map +1 -0
- package/dist/src/types/traversal.js +10 -0
- package/dist/src/types/traversal.js.map +1 -0
- package/dist/src/wgsl/advance-expand.wgsl.d.ts +19 -0
- package/dist/src/wgsl/advance-expand.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/advance-expand.wgsl.js +69 -0
- package/dist/src/wgsl/advance-expand.wgsl.js.map +1 -0
- package/dist/src/wgsl/bf-relax.wgsl.d.ts +22 -0
- package/dist/src/wgsl/bf-relax.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/bf-relax.wgsl.js +58 -0
- package/dist/src/wgsl/bf-relax.wgsl.js.map +1 -0
- package/dist/src/wgsl/bfs-bitset-build.wgsl.d.ts +15 -0
- package/dist/src/wgsl/bfs-bitset-build.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/bfs-bitset-build.wgsl.js +24 -0
- package/dist/src/wgsl/bfs-bitset-build.wgsl.js.map +1 -0
- package/dist/src/wgsl/bfs-bottom-up.wgsl.d.ts +20 -0
- package/dist/src/wgsl/bfs-bottom-up.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/bfs-bottom-up.wgsl.js +67 -0
- package/dist/src/wgsl/bfs-bottom-up.wgsl.js.map +1 -0
- package/dist/src/wgsl/bfs-contract.wgsl.d.ts +20 -0
- package/dist/src/wgsl/bfs-contract.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/bfs-contract.wgsl.js +55 -0
- package/dist/src/wgsl/bfs-contract.wgsl.js.map +1 -0
- package/dist/src/wgsl/bfs-fused.wgsl.d.ts +25 -0
- package/dist/src/wgsl/bfs-fused.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/bfs-fused.wgsl.js +78 -0
- package/dist/src/wgsl/bfs-fused.wgsl.js.map +1 -0
- package/dist/src/wgsl/bfs-unvisited-flags.wgsl.d.ts +18 -0
- package/dist/src/wgsl/bfs-unvisited-flags.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/bfs-unvisited-flags.wgsl.js +42 -0
- package/dist/src/wgsl/bfs-unvisited-flags.wgsl.js.map +1 -0
- package/dist/src/wgsl/closeness-reduce.wgsl.d.ts +17 -0
- package/dist/src/wgsl/closeness-reduce.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/closeness-reduce.wgsl.js +65 -0
- package/dist/src/wgsl/closeness-reduce.wgsl.js.map +1 -0
- package/dist/src/wgsl/closeness-sweep.wgsl.d.ts +20 -0
- package/dist/src/wgsl/closeness-sweep.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/closeness-sweep.wgsl.js +96 -0
- package/dist/src/wgsl/closeness-sweep.wgsl.js.map +1 -0
- package/dist/src/wgsl/compact-scatter.wgsl.d.ts +9 -0
- package/dist/src/wgsl/compact-scatter.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/compact-scatter.wgsl.js +17 -0
- package/dist/src/wgsl/compact-scatter.wgsl.js.map +1 -0
- package/dist/src/wgsl/dedupe-claim.wgsl.d.ts +10 -0
- package/dist/src/wgsl/dedupe-claim.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/dedupe-claim.wgsl.js +19 -0
- package/dist/src/wgsl/dedupe-claim.wgsl.js.map +1 -0
- package/dist/src/wgsl/dedupe-filter.wgsl.d.ts +12 -0
- package/dist/src/wgsl/dedupe-filter.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/dedupe-filter.wgsl.js +46 -0
- package/dist/src/wgsl/dedupe-filter.wgsl.js.map +1 -0
- package/dist/src/wgsl/frontier-finalize.wgsl.d.ts +59 -0
- package/dist/src/wgsl/frontier-finalize.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/frontier-finalize.wgsl.js +210 -0
- package/dist/src/wgsl/frontier-finalize.wgsl.js.map +1 -0
- package/dist/src/wgsl/sssp-pred.wgsl.d.ts +28 -0
- package/dist/src/wgsl/sssp-pred.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/sssp-pred.wgsl.js +80 -0
- package/dist/src/wgsl/sssp-pred.wgsl.js.map +1 -0
- package/dist/src/wgsl/sssp-relax.wgsl.d.ts +30 -0
- package/dist/src/wgsl/sssp-relax.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/sssp-relax.wgsl.js +72 -0
- package/dist/src/wgsl/sssp-relax.wgsl.js.map +1 -0
- package/dist/webgpu-graph-algorithms.js +3207 -377
- package/dist/webgpu-graph-algorithms.js.map +1 -1
- package/package.json +5 -4
- package/src/accelerator.ts +65 -7
- package/src/algorithms/bellman-ford.ts +387 -0
- package/src/algorithms/bfs.ts +626 -0
- package/src/algorithms/closeness.ts +395 -0
- package/src/algorithms/scope.ts +13 -3
- package/src/algorithms/sssp.ts +767 -0
- package/src/constants.ts +12 -0
- package/src/index.ts +14 -1
- package/src/kernel/prelude.ts +39 -4
- package/src/kernel/uniform-ring.ts +14 -0
- package/src/kernels.ts +450 -6
- package/src/primitives/advance.ts +130 -0
- package/src/primitives/compact.ts +323 -0
- package/src/primitives/core-shape.ts +41 -3
- package/src/primitives/frontier.ts +388 -0
- package/src/types/accelerator.ts +18 -5
- package/src/types/traversal.ts +56 -0
- package/src/wgsl/advance-expand.wgsl.ts +68 -0
- package/src/wgsl/bf-relax.wgsl.ts +57 -0
- package/src/wgsl/bfs-bitset-build.wgsl.ts +23 -0
- package/src/wgsl/bfs-bottom-up.wgsl.ts +66 -0
- package/src/wgsl/bfs-contract.wgsl.ts +54 -0
- package/src/wgsl/bfs-fused.wgsl.ts +77 -0
- package/src/wgsl/bfs-unvisited-flags.wgsl.ts +41 -0
- package/src/wgsl/closeness-reduce.wgsl.ts +64 -0
- package/src/wgsl/closeness-sweep.wgsl.ts +95 -0
- package/src/wgsl/compact-scatter.wgsl.ts +16 -0
- package/src/wgsl/dedupe-claim.wgsl.ts +18 -0
- package/src/wgsl/dedupe-filter.wgsl.ts +45 -0
- package/src/wgsl/frontier-finalize.wgsl.ts +209 -0
- package/src/wgsl/sssp-pred.wgsl.ts +79 -0
- package/src/wgsl/sssp-relax.wgsl.ts +71 -0
- package/dist/chunks/context-BXqgCifx.js.map +0 -1
|
@@ -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;AACp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NAAiN;AACjN,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,+JAA+J;AAC/J,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,8JAA8J;AAC9J,eAAO,MAAM,YAAY,aAAa,CAAC"}
|
package/dist/src/constants.js
CHANGED
|
@@ -166,4 +166,16 @@ export const GRID_EXTENT_FLOOR = 1e-6;
|
|
|
166
166
|
export const GRID_BBOX_MARGIN = 1.01;
|
|
167
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
168
|
export const GRID_SORT_BITS = 24;
|
|
169
|
+
/** Design 8.4 (P8 PD-7): traversal levels recorded per submit -- one four-byte readback per 32 BFS levels, SSSP rounds or closeness levels. */
|
|
170
|
+
export const MAX_LEVELS_PER_SUBMIT = 32;
|
|
171
|
+
/** Design 8.4 and 6 row 8 (P8): a frontier at most this long runs the fused expand-contract kernel (Merrill's "fleeting iterations"); the default of the `fusedMax` uniform, which a test may set to 0 or `U32_MAX`. */
|
|
172
|
+
export const FUSED_FRONTIER_MAX = 4096;
|
|
173
|
+
/** P8-T4: the indirect dispatch slots `frontier-finalize` writes per level (expand, contract, fused, fill-bits, bitset-build, bottom-up, fused-retry); the args buffer is `MAX_LEVELS_PER_SUBMIT x FRONTIER_CANDIDATES x 16` bytes. */
|
|
174
|
+
export const FRONTIER_CANDIDATES = 7;
|
|
175
|
+
/** Design 8.4 (P8 PD-21): Beamer's beta -- switch back to top-down when `frontierCount * BEAMER_BETA < unvisitedCount` and the frontier is shrinking; alpha is derived from the graph, so it has no constant. */
|
|
176
|
+
export const BEAMER_BETA = 24;
|
|
177
|
+
/** Design 8.4 (P8 PD-22): the near-far split `delta = SSSP_DELTA_FACTOR * avgWeight / avgDegree`, computed on the host from the weight vector the run uses. */
|
|
178
|
+
export const SSSP_DELTA_FACTOR = 32;
|
|
179
|
+
/** The bit pattern of +Infinity, the unreached sentinel of `dist` (P8 PD-9); interpolated into the prelude as `F32_INF_BITS` so no body types the literal. */
|
|
180
|
+
export const F32_INF_BITS = 0x7f800000;
|
|
169
181
|
//# 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,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,kBAAkB,GAAG,GAAG,CAAC;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AACrC,kFAAkF;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AACvC,yGAAyG;AACzG,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACxC,gGAAgG;AAChG,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AACzC,mDAAmD;AACnD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,IAAI,CA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MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,8JAA8J;AAC9J,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -7,7 +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. P4 adds calibrateLayout and its two records.
|
|
10
|
+
* two stats records. P4 adds calibrateLayout and its two records. P8 adds the four traversals and their three result
|
|
11
|
+
* records. test/index.test.ts pins the value list and
|
|
11
12
|
* test/types/public-api.test-d.ts the type list. This comment must never spell the internal
|
|
12
13
|
* JSDoc tag: it is the leading comment of the first export statement, and stripInternal would drop that statement
|
|
13
14
|
* from the emitted declarations.
|
|
@@ -23,13 +24,18 @@ export { degree } from "./algorithms/degree.js";
|
|
|
23
24
|
export { connectedComponents } from "./algorithms/components.js";
|
|
24
25
|
export { pageRank, personalizedPageRank } from "./algorithms/pagerank.js";
|
|
25
26
|
export { eigenvectorCentrality, hits, katzCentrality } from "./algorithms/spectral.js";
|
|
27
|
+
export { bellmanFord } from "./algorithms/bellman-ford.js";
|
|
28
|
+
export { breadthFirstSearch } from "./algorithms/bfs.js";
|
|
29
|
+
export { closenessCentrality } from "./algorithms/closeness.js";
|
|
30
|
+
export { sssp } from "./algorithms/sssp.js";
|
|
26
31
|
export { createAccelerator } from "./accelerator.js";
|
|
27
32
|
export { calibrateLayout } from "./layouts/calibrate.js";
|
|
28
33
|
export { createForceAtlas2 } from "./layouts/forceatlas2.js";
|
|
29
34
|
export { createFruchtermanReingold } from "./layouts/fruchterman-reingold.js";
|
|
30
35
|
export { seedPositions } from "./layouts/seed.js";
|
|
31
36
|
export { createSpringElectrical } from "./layouts/spring-electrical.js";
|
|
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";
|
|
37
|
+
export type { AcceleratorOptions, AlgorithmAccelerator, ApspResultLike, BellmanFordResultLike, BetweennessAcceleratorOptions, BfsOptions, BfsResultLike, CommunityResultLike, CorenessResultLike, EdgeScoresResultLike, GpuAccelerator, HitsOptionsLike, HitsResultLike, LabelResultLike, LayoutAccelerator, LayoutSimulation, MstResultLike, PageRankResultLike, ScoresResultLike, SsspOptions, SsspResultLike, } from "./types/accelerator.js";
|
|
38
|
+
export type { GpuBellmanFordResult, GpuBfsResult, GpuSsspResult } from "./types/traversal.js";
|
|
33
39
|
export type { ComponentsOptions, EigenvectorOptions, GpuHitsResult, GpuLabelResult, GpuPageRankResult, GpuScoresResult, HitsOptions, KatzOptions, PageRankOptions, } from "./types/algorithms.js";
|
|
34
40
|
export type { AdapterInfoLike, AdapterSummary, DeviceCheck, DeviceCheckMismatch, GpuCaps, GpuContextOptions, LimitPolicy, PlanCaps, PlanLimits, ProbeOptions, ProbeResult, RaisableLimit, } from "./types/context.js";
|
|
35
41
|
export type { CalibrateOptions, ForceAtlas2Stats, ForceAtlas2TraceRecord, FruchtermanReingoldStats, FruchtermanReingoldTraceRecord, GpuCalibration, GpuLayoutSimulation, GpuLayoutTuning, LayoutStatsBase, RunOptions, SpringElectricalStats, SpringElectricalTraceRecord, } from "./types/layout.js";
|
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
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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ftwareAdapter. 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. P4 adds calibrateLayout and its two records.
|
|
11
|
+
* two stats records. P4 adds calibrateLayout and its two records. P8 adds the four traversals and their three result
|
|
12
|
+
* records. test/index.test.ts pins the value list and
|
|
12
13
|
* test/types/public-api.test-d.ts the type list. This comment must never spell the internal
|
|
13
14
|
* JSDoc tag: it is the leading comment of the first export statement, and stripInternal would drop that statement
|
|
14
15
|
* from the emitted declarations.
|
|
@@ -30,6 +31,11 @@ export { degree } from "./algorithms/degree.js";
|
|
|
30
31
|
export { connectedComponents } from "./algorithms/components.js";
|
|
31
32
|
export { pageRank, personalizedPageRank } from "./algorithms/pagerank.js";
|
|
32
33
|
export { eigenvectorCentrality, hits, katzCentrality } from "./algorithms/spectral.js";
|
|
34
|
+
// ==================== algorithms (P8: the frontier family, spec 3.3 lines 807-810, 8.4; the seam's option types in)
|
|
35
|
+
export { bellmanFord } from "./algorithms/bellman-ford.js";
|
|
36
|
+
export { breadthFirstSearch } from "./algorithms/bfs.js";
|
|
37
|
+
export { closenessCentrality } from "./algorithms/closeness.js";
|
|
38
|
+
export { sssp } from "./algorithms/sssp.js";
|
|
33
39
|
// ==================== layouts and the accelerator (P3; the two P5 factories; P4's calibrateLayout, spec 2.2)
|
|
34
40
|
export { createAccelerator } from "./accelerator.js";
|
|
35
41
|
export { calibrateLayout } from "./layouts/calibrate.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
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;A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MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -19,12 +19,12 @@ export declare function wgslF32Literal(value: number): string;
|
|
|
19
19
|
export declare const PRELUDE_WGSL: string;
|
|
20
20
|
/** Line count of PRELUDE_WGSL (the compilation-info formatter subtracts it plus the emitted declarations). */
|
|
21
21
|
export declare const PRELUDE_LINES: number;
|
|
22
|
-
/** The workgroup-memory reduction helpers (the twin) (4.3). */
|
|
22
|
+
/** The workgroup-memory reduction helpers (the twin) (4.3), plus the workgroup-memory form of the P8 scan helper. */
|
|
23
23
|
export declare const REDUCE_HELPERS_WORKGROUP_WGSL: string;
|
|
24
|
-
/** The subgroup reduction helpers, spliced only with `enable subgroups;` (4.3). */
|
|
24
|
+
/** The subgroup reduction helpers, spliced only with `enable subgroups;` (4.3), plus the subgroup form of the P8 scan helper. */
|
|
25
25
|
export declare const REDUCE_HELPERS_SUBGROUP_WGSL: string;
|
|
26
|
-
/** The helper function names a body may call when its spec lists needs: ["subgroups"]. */
|
|
27
|
-
export declare const REDUCE_HELPER_NAMES: readonly ["wg_reduce_f32", "wg_reduce_u32", "wg_reduce_vec4"];
|
|
26
|
+
/** The helper function names a body may call when its spec lists needs: ["subgroups"]; `wg_scan_u32(v, lid)` is an INCLUSIVE prefix sum over the workgroup in lane order (P8-T1), bitwise the same in both forms. */
|
|
27
|
+
export declare const REDUCE_HELPER_NAMES: readonly ["wg_reduce_f32", "wg_reduce_u32", "wg_reduce_vec4", "wg_scan_u32"];
|
|
28
28
|
/**
|
|
29
29
|
* The WGSL reserved words of spec section 16.2 (the `_reserved` production), frozen; composeWgsl rejects a body or
|
|
30
30
|
* snippet that uses one (3.9). PLAN DECISION: the list is the 146 words of the W3C Candidate Recommendation Draft
|
|
@@ -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;AAuBH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUpD;AAED,iHAAiH;AACjH,eAAO,MAAM,YAAY,EAAE,MAiDzB,CAAC;AAEH,8GAA8G;AAC9G,eAAO,MAAM,aAAa,EAAE,MAAwC,CAAC;AAErE,qHAAqH;AACrH,eAAO,MAAM,6BAA6B,EAAE,MAmDsE,CAAC;AAEnH,iIAAiI;AACjI,eAAO,MAAM,4BAA4B,EAAE,MA6FuE,CAAC;AAEnH,qNAAqN;AACrN,eAAO,MAAM,mBAAmB,8EAA+E,CAAC;AAEhH;;;;;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_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";
|
|
12
|
+
import { F32_INF_BITS, 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`,
|
|
@@ -32,6 +32,7 @@ export function wgslF32Literal(value) {
|
|
|
32
32
|
export const PRELUDE_WGSL = /* wgsl */ `// ---- prelude: constants, standard overrides, helpers (every module receives this text first)
|
|
33
33
|
const INVALID_INDEX: u32 = ${INVALID_INDEX}u;
|
|
34
34
|
const U32_MAX: u32 = ${U32_MAX}u;
|
|
35
|
+
const F32_INF_BITS: u32 = ${F32_INF_BITS}u;
|
|
35
36
|
const MAX_WORKGROUPS_PER_DIM: u32 = ${MAX_WORKGROUPS_PER_DIM}u;
|
|
36
37
|
const FA2_DIST_FLOOR: f32 = ${wgslF32Literal(FA2_DISTANCE_FLOOR)};
|
|
37
38
|
const FA2_DIST_FLOOR_SQ: f32 = ${wgslF32Literal(FA2_DISTANCE_FLOOR_SQ)};
|
|
@@ -80,7 +81,7 @@ fn kick_dir(i: u32, j: u32, dim: u32) -> vec3f {
|
|
|
80
81
|
}`;
|
|
81
82
|
/** Line count of PRELUDE_WGSL (the compilation-info formatter subtracts it plus the emitted declarations). */
|
|
82
83
|
export const PRELUDE_LINES = PRELUDE_WGSL.split("\n").length;
|
|
83
|
-
/** The workgroup-memory reduction helpers (the twin) (4.3). */
|
|
84
|
+
/** The workgroup-memory reduction helpers (the twin) (4.3), plus the workgroup-memory form of the P8 scan helper. */
|
|
84
85
|
export const REDUCE_HELPERS_WORKGROUP_WGSL = /* wgsl */ `var<workgroup> wg_scratch_v: array<vec4f, WG>;
|
|
85
86
|
var<workgroup> wg_scratch_u: array<u32, WG>;
|
|
86
87
|
fn combine_v(a: vec4f, b: vec4f, op: u32) -> vec4f {
|
|
@@ -117,8 +118,23 @@ fn wg_reduce_u32(v: u32, lid: u32, op: u32) -> u32 {
|
|
|
117
118
|
workgroupBarrier();
|
|
118
119
|
return total;
|
|
119
120
|
}
|
|
121
|
+
fn wg_scan_u32(v: u32, lid: u32) -> u32 {
|
|
122
|
+
workgroupBarrier();
|
|
123
|
+
wg_scratch_u[lid] = v;
|
|
124
|
+
workgroupBarrier();
|
|
125
|
+
for (var s = 1u; s < WG; s = s * 2u) { // Hillis-Steele inclusive scan (scan-block's body); uniform: every lane runs every round
|
|
126
|
+
var t = 0u;
|
|
127
|
+
if (lid >= s) { t = wg_scratch_u[lid - s]; }
|
|
128
|
+
workgroupBarrier();
|
|
129
|
+
wg_scratch_u[lid] = wg_scratch_u[lid] + t;
|
|
130
|
+
workgroupBarrier();
|
|
131
|
+
}
|
|
132
|
+
let inclusive = wg_scratch_u[lid];
|
|
133
|
+
workgroupBarrier(); // the scratch is free for the next call
|
|
134
|
+
return inclusive;
|
|
135
|
+
}
|
|
120
136
|
fn wg_reduce_f32(v: f32, lid: u32, op: u32) -> f32 { return wg_reduce_vec4(vec4f(v, 0.0, 0.0, 0.0), lid, op).x; }`;
|
|
121
|
-
/** The subgroup reduction helpers, spliced only with `enable subgroups;` (4.3). */
|
|
137
|
+
/** The subgroup reduction helpers, spliced only with `enable subgroups;` (4.3), plus the subgroup form of the P8 scan helper. */
|
|
122
138
|
export const REDUCE_HELPERS_SUBGROUP_WGSL = /* wgsl */ `override SG_SLOTS: u32 = (WG + SUBGROUP_MIN - 1u) / SUBGROUP_MIN; // one slot per subgroup; the count is largest when the compiler picks the SMALLEST size
|
|
123
139
|
var<workgroup> sg_counter: atomic<u32>;
|
|
124
140
|
var<workgroup> sg_val_v: array<vec4f, SG_SLOTS>;
|
|
@@ -194,9 +210,27 @@ fn wg_reduce_u32(v: u32, lid: u32, op: u32) -> u32 {
|
|
|
194
210
|
workgroupBarrier();
|
|
195
211
|
return total;
|
|
196
212
|
}
|
|
213
|
+
fn wg_scan_u32(v: u32, lid: u32) -> u32 {
|
|
214
|
+
workgroupBarrier();
|
|
215
|
+
if (lid == 0u) { atomicStore(&sg_counter, 0u); }
|
|
216
|
+
workgroupBarrier();
|
|
217
|
+
let inSub = subgroupExclusiveAdd(v) + v; // the lane's inclusive sum within its subgroup
|
|
218
|
+
let total = subgroupAdd(v);
|
|
219
|
+
let key = subgroupMin(lid); // the subgroup's identity: its smallest local id (D16)
|
|
220
|
+
var slot = 0u;
|
|
221
|
+
if (subgroupElect()) { slot = atomicAdd(&sg_counter, 1u); }
|
|
222
|
+
slot = subgroupBroadcast(slot, 0u);
|
|
223
|
+
if (subgroupElect()) { sg_val_u[slot] = total; sg_key[slot] = key; }
|
|
224
|
+
workgroupBarrier();
|
|
225
|
+
let count = atomicLoad(&sg_counter);
|
|
226
|
+
var carry = 0u; // the totals of every subgroup whose key is below this lane's: LANE order, whatever order the slots were taken in
|
|
227
|
+
for (var k = 0u; k < count; k = k + 1u) { if (sg_key[k] < key) { carry = carry + sg_val_u[k]; } }
|
|
228
|
+
workgroupBarrier(); // the slots are free for the next call
|
|
229
|
+
return inSub + carry;
|
|
230
|
+
}
|
|
197
231
|
fn wg_reduce_f32(v: f32, lid: u32, op: u32) -> f32 { return wg_reduce_vec4(vec4f(v, 0.0, 0.0, 0.0), lid, op).x; }`;
|
|
198
|
-
/** The helper function names a body may call when its spec lists needs: ["subgroups"]. */
|
|
199
|
-
export const REDUCE_HELPER_NAMES = ["wg_reduce_f32", "wg_reduce_u32", "wg_reduce_vec4"];
|
|
232
|
+
/** The helper function names a body may call when its spec lists needs: ["subgroups"]; `wg_scan_u32(v, lid)` is an INCLUSIVE prefix sum over the workgroup in lane order (P8-T1), bitwise the same in both forms. */
|
|
233
|
+
export const REDUCE_HELPER_NAMES = ["wg_reduce_f32", "wg_reduce_u32", "wg_reduce_vec4", "wg_scan_u32"];
|
|
200
234
|
/**
|
|
201
235
|
* The WGSL reserved words of spec section 16.2 (the `_reserved` production), frozen; composeWgsl rejects a body or
|
|
202
236
|
* snippet that uses one (3.9). PLAN DECISION: the list is the 146 words of the W3C Candidate Recommendation Draft
|
|
@@ -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,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,UAAU,EACV,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;
|
|
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,YAAY,EACZ,iBAAiB,EACjB,kBAAkB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YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AAErE,qHAAqH;AACrH,MAAM,CAAC,MAAM,6BAA6B,GAAW,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kHAmDkD,CAAC;AAEnH,iIAAiI;AACjI,MAAM,CAAC,MAAM,4BAA4B,GAAW,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kHA6FmD,CAAC;AAEnH,qNAAqN;AACrN,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,CAAU,CAAC;AAEhH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB,MAAM,CAAC,MAAM,CAC/D;;;;;;;;;;6CAUyC;KACpC,IAAI,EAAE;KACN,KAAK,CAAC,KAAK,CAAC,CACpB,CAAC"}
|
|
@@ -13,6 +13,14 @@ import type { UniformBlock, UniformValues } from "./struct-block.js";
|
|
|
13
13
|
export declare class UniformRing {
|
|
14
14
|
/** Number of slots. */
|
|
15
15
|
readonly slots: number;
|
|
16
|
+
/**
|
|
17
|
+
* How many reservations covered a DIRTY slot (written since the last `flush()`): the one reuse that corrupts,
|
|
18
|
+
* because the batch being recorded still reads that record and the shadow overwrites it before the flush sends
|
|
19
|
+
* either. A wrap onto slots an earlier, flushed batch wrote is harmless: its `writeBuffer` is ordered before that
|
|
20
|
+
* batch's submit and the next flush after it. A driver sizes its ring so this stays 0 (P8-T12: `bfsRingSlots`).
|
|
21
|
+
*/
|
|
22
|
+
overruns: number;
|
|
23
|
+
private readonly dirty;
|
|
16
24
|
private readonly device;
|
|
17
25
|
private readonly allocator;
|
|
18
26
|
private readonly buffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniform-ring.d.ts","sourceRoot":"","sources":["../../../src/kernel/uniform-ring.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAErE,kHAAkH;AAClH,qBAAa,WAAW;IACpB,uBAAuB;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,SAAS,CAAS;IAE1B;;;;;;OAMG;gBACS,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"uniform-ring.d.ts","sourceRoot":"","sources":["../../../src/kernel/uniform-ring.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAErE,kHAAkH;AAClH,qBAAa,WAAW;IACpB,uBAAuB;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,SAAK;IACb,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,SAAS,CAAS;IAE1B;;;;;;OAMG;gBACS,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IA0BzF;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAMrC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAK9B;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAwB9B;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAarE;;;OAGG;IACH,KAAK,IAAI,IAAI;IAab,+DAA+D;IAC/D,OAAO,IAAI,IAAI;IAQf,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,UAAU;CASrB"}
|
|
@@ -19,6 +19,13 @@ export class UniformRing {
|
|
|
19
19
|
* @param label - the buffer label
|
|
20
20
|
*/
|
|
21
21
|
constructor(device, allocator, slots, label) {
|
|
22
|
+
/**
|
|
23
|
+
* How many reservations covered a DIRTY slot (written since the last `flush()`): the one reuse that corrupts,
|
|
24
|
+
* because the batch being recorded still reads that record and the shadow overwrites it before the flush sends
|
|
25
|
+
* either. A wrap onto slots an earlier, flushed batch wrote is harmless: its `writeBuffer` is ordered before that
|
|
26
|
+
* batch's submit and the next flush after it. A driver sizes its ring so this stays 0 (P8-T12: `bfsRingSlots`).
|
|
27
|
+
*/
|
|
28
|
+
this.overruns = 0;
|
|
22
29
|
this.next = 0;
|
|
23
30
|
this.dirtyLo = -1;
|
|
24
31
|
this.dirtyHi = -1;
|
|
@@ -36,6 +43,7 @@ export class UniformRing {
|
|
|
36
43
|
this.label = label;
|
|
37
44
|
this.shadow = new ArrayBuffer(slots * UNIFORM_SLOT_BYTES);
|
|
38
45
|
this.view = new DataView(this.shadow);
|
|
46
|
+
this.dirty = new Uint8Array(slots);
|
|
39
47
|
this.buffer = allocator.createBuffer({
|
|
40
48
|
label,
|
|
41
49
|
size: slots * UNIFORM_SLOT_BYTES,
|
|
@@ -80,6 +88,9 @@ export class UniformRing {
|
|
|
80
88
|
}
|
|
81
89
|
const first = this.next;
|
|
82
90
|
this.next += count;
|
|
91
|
+
if (this.dirty.subarray(first, first + count).includes(1)) {
|
|
92
|
+
this.overruns += 1;
|
|
93
|
+
}
|
|
83
94
|
return first;
|
|
84
95
|
}
|
|
85
96
|
/**
|
|
@@ -92,6 +103,7 @@ export class UniformRing {
|
|
|
92
103
|
this.checkSlot(slot);
|
|
93
104
|
this.assertFits(block);
|
|
94
105
|
block.write(this.view, values, slot * UNIFORM_SLOT_BYTES);
|
|
106
|
+
this.dirty[slot] = 1;
|
|
95
107
|
if (this.dirtyLo < 0 || slot < this.dirtyLo) {
|
|
96
108
|
this.dirtyLo = slot;
|
|
97
109
|
}
|
|
@@ -111,6 +123,7 @@ export class UniformRing {
|
|
|
111
123
|
const begin = this.dirtyLo * UNIFORM_SLOT_BYTES;
|
|
112
124
|
const end = (this.dirtyHi + 1) * UNIFORM_SLOT_BYTES;
|
|
113
125
|
this.device.queue.writeBuffer(this.buffer, begin, this.shadow, begin, end - begin);
|
|
126
|
+
this.dirty.fill(0);
|
|
114
127
|
this.dirtyLo = -1;
|
|
115
128
|
this.dirtyHi = -1;
|
|
116
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniform-ring.js","sourceRoot":"","sources":["../../../src/kernel/uniform-ring.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,kHAAkH;AAClH,MAAM,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"uniform-ring.js","sourceRoot":"","sources":["../../../src/kernel/uniform-ring.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,kHAAkH;AAClH,MAAM,OAAO,WAAW;IAsBpB;;;;;;OAMG;IACH,YAAY,MAAiB,EAAE,SAA4B,EAAE,KAAa,EAAE,KAAa;QA1BzF;;;;;WAKG;QACH,aAAQ,GAAG,CAAC,CAAC;QAQL,SAAI,GAAG,CAAC,CAAC;QACT,YAAO,GAAG,CAAC,CAAC,CAAC;QACb,YAAO,GAAG,CAAC,CAAC,CAAC;QACb,cAAS,GAAG,KAAK,CAAC;QAUtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,gBAAgB,CACtB,oBAAoB,EACpB,gBAAgB,KAAK,4CAA4C,KAAK,EAAE,EACxE;gBACI,QAAQ,EAAE,OAAO;gBACjB,KAAK,EAAE,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AC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC5D,MAAM,IAAI,gBAAgB,CACtB,oBAAoB,EACpB,gBAAgB,IAAI,CAAC,KAAK,WAAW,IAAI,mBAAmB,IAAI,CAAC,KAAK,GAAG,EACzE;gBACI,QAAQ,EAAE,MAAM;gBAChB,KAAK,EAAE,IAAI;gBACX,QAAQ,EAAE,qBAAqB,IAAI,CAAC,KAAK,GAAG;aAC/C,CACJ,CAAC;QACN,CAAC;IACL,CAAC;IAEO,UAAU,CAAC,KAAmB;QAClC,IAAI,KAAK,CAAC,UAAU,GAAG,kBAAkB,EAAE,CAAC;YACxC,MAAM,IAAI,gBAAgB,CACtB,oBAAoB,EACpB,gBAAgB,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,UAAU,wBAAwB,kBAAkB,EAAE,EACnH,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,iBAAiB,kBAAkB,EAAE,EAAE,CAC5F,CAAC;QACN,CAAC;IACL,CAAC;CACJ"}
|
package/dist/src/kernels.d.ts
CHANGED
|
@@ -8,14 +8,19 @@
|
|
|
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
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).
|
|
11
|
+
* each (the P4 plan, PD-1). P8-T3 opens the P8 run of nine appends (the P8 plan, PD-2) with compact-scatter,
|
|
12
|
+
* dedupe-claim and dedupe-filter; P8-T4 adds frontier-finalize with the FrontierCounters and FrontierParams blocks;
|
|
13
|
+
* P8-T5 adds advance-expand; P8-T6 adds bfs-contract and sssp-pred; P8-T7 adds bfs-fused; P8-T8 adds bfs-bottom-up,
|
|
14
|
+
* bfs-bitset-build and bfs-unvisited-flags; P8-T9 adds sssp-relax; P8-T10 adds bf-relax with the BfParams and BfFlags
|
|
15
|
+
* blocks; P8-T11 adds closeness-sweep and closeness-reduce. This file is the only importer of src/wgsl/** (spec 3.2;
|
|
16
|
+
* test/layers.test.ts).
|
|
12
17
|
*/
|
|
13
18
|
import { UniformBlock } from "./kernel/struct-block.js";
|
|
14
19
|
import { type BindingDecl, type OverrideDecl, type WgslModuleSpec } from "./kernel/wgsl.js";
|
|
15
20
|
import { type CoreBinding } from "./memory/residency.js";
|
|
16
21
|
import { type Binding } from "./types/memory.js";
|
|
17
|
-
/** Every module id of P1-
|
|
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";
|
|
22
|
+
/** Every module id of P1-P4, P7 and P8 (later ids are appended, never renamed). */
|
|
23
|
+
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" | "compact-scatter" | "dedupe-claim" | "dedupe-filter" | "frontier-finalize" | "advance-expand" | "bfs-contract" | "sssp-pred" | "bfs-fused" | "bfs-bottom-up" | "bfs-bitset-build" | "bfs-unvisited-flags" | "sssp-relax" | "bf-relax" | "closeness-sweep" | "closeness-reduce";
|
|
19
24
|
/** One registry entry: everything of a WgslModuleSpec except the per-variant overrides and snippets. */
|
|
20
25
|
export interface KernelEntry {
|
|
21
26
|
readonly id: KernelId;
|
|
@@ -29,7 +34,7 @@ export interface KernelEntry {
|
|
|
29
34
|
/** The snippet marker names the body carries (segmented-reduce: ["VALUE"]). */
|
|
30
35
|
readonly snippetSlots: readonly string[];
|
|
31
36
|
/** The phase the entry landed in (documentation and the compile-matrix filter). */
|
|
32
|
-
readonly phase: "P1" | "P2" | "P3" | "P4" | "P7";
|
|
37
|
+
readonly phase: "P1" | "P2" | "P3" | "P4" | "P7" | "P8";
|
|
33
38
|
}
|
|
34
39
|
/** `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
40
|
export declare const RANGE_PARAMS: UniformBlock;
|
|
@@ -69,6 +74,41 @@ export declare const GRID_LEVEL_PARAMS: UniformBlock;
|
|
|
69
74
|
export declare const HIST_PARAMS: UniformBlock;
|
|
70
75
|
/** `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
76
|
export declare const RADIX_PARAMS: UniformBlock;
|
|
77
|
+
/** `CompactParams` (uniform, 16 B; spec 6 row 4, P8-T3): `count` @0 (the entries, or the capacity a device count is clamped to), `outIndex` @4 (the word of `outCount` that receives the output count: the block is bound whole because a four-byte word is never 256-aligned), `countIndex` @8 (the word of the counters block holding the entry count, or `U32_MAX` for a host-known count; `compact-scatter` ignores it), `pad0` @12. */
|
|
78
|
+
export declare const COMPACT_PARAMS: UniformBlock;
|
|
79
|
+
/**
|
|
80
|
+
* `FrontierCounters` (storage, 112 B; design 6 row 7, P8-T4, PD-8): EVERY counter of the frontier family is a word of
|
|
81
|
+
* this one block, byte offset 4 x index, because a four-byte word is never a legal storage-binding offset and the
|
|
82
|
+
* device-side selector must reach every count it acts on through one binding; every kernel binds it as
|
|
83
|
+
* `array<atomic<u32>>` and indexes by the `W` record of src/primitives/frontier.ts, and the host decodes the result
|
|
84
|
+
* copy with `FRONTIER_COUNTERS.read`. `frontierCount` @0 (role 0 rotates it in from word 1; never seeded),
|
|
85
|
+
* `nextFrontierCount` @4 (the claim kernels' append span; the BFS seed is 1), `frontierDegreeSum` @8,
|
|
86
|
+
* `prevFrontierCount` @12, `prevDegreeSum` @16, `unvisitedCount` @20, `unvisitedDegreeSum` @24,
|
|
87
|
+
* `unvisitedListLen` @28 (P8-T8), `edgeCount` @32 (clamped by role 1), `edgeCountUnclamped` @36 (the overflow
|
|
88
|
+
* detector, PD-23), `overflowLevels` @40, `level` @44 (the current level; the seed is U32_MAX so the first boundary
|
|
89
|
+
* lands on 0), `visitedCount` @48, `switches` @52, `direction` @56, `done` @60 (the four bytes the host reads per
|
|
90
|
+
* submit), `arcsScanned` @64, `fusedLevels` @68, `twoPhaseLevels` @72, `bottomUpLevels` @76, `farCount` @80,
|
|
91
|
+
* `nextFarCount` @84, `thresholdBits` @88, `deltaBits` @92 (P8-T9), `path` @96 (what the level's kernels run, written
|
|
92
|
+
* by the selector: 0 nothing, 1 two-phase, 2 fused, 3 bottom-up, 4 the fused retry, 5 a near SSSP round, 6 a far
|
|
93
|
+
* one; every level kernel is a direct dispatch that reads it first -- G8-F5). The words nothing writes before
|
|
94
|
+
* P8-T8 / P8-T9 are declared now because the byte layout is what the single result copy decodes.
|
|
95
|
+
*/
|
|
96
|
+
export declare const FRONTIER_COUNTERS: UniformBlock;
|
|
97
|
+
/**
|
|
98
|
+
* `FrontierParams` (uniform, 80 B; P8-T4): the params block every P8 kernel except the three compact / dedupe
|
|
99
|
+
* primitives and `bf-relax` binds -- `role` @0 (the finalize role), `slotBase` @4 (`level x FRONTIER_CANDIDATES`),
|
|
100
|
+
* `wg` @8 (the consumers' workgroup size), `alpha` @12, `beta` @16 (Beamer's thresholds, P8-T8), `fusedMax` @20,
|
|
101
|
+
* `edgeCapacity` @24, `maxDepth` @28, `n` @32, `mode` @36 (BFS: 0 auto, 1 top-down only; `sssp-pred`: the PD-27 key
|
|
102
|
+
* rule), `cutoffBits` @40, `arcBase` @44, `arcEnd` @48 (the bound arc window), `predKind` @52 (0 arc, 1 node),
|
|
103
|
+
* `bitsBase` @56, `source` @60, `stride` @64 (a grid-stride plan's stride), `firstOfSubmit` @68 (the boundary's index
|
|
104
|
+
* inside its submit, clamped to 2: the unvisited-count subtraction runs at >= 1, the degree-sum one at >= 2),
|
|
105
|
+
* `iteration` @72 (an `sssp-pred` hop pass, P8-T9), `pad1` @76.
|
|
106
|
+
*/
|
|
107
|
+
export declare const FRONTIER_PARAMS: UniformBlock;
|
|
108
|
+
/** `BfParams` (uniform, 16 B; P8-T10): `edgeCount` @0 (the logical edges of the `edgeList` view), `stride` @4 (the grid-stride plan's stride), `maxRetries` @8 (PD-12's compare-exchange bound), `cutoffBits` @12 (the f32 bit pattern of the CPU port's `cutoff`, `+Inf` when absent). */
|
|
109
|
+
export declare const BF_PARAMS: UniformBlock;
|
|
110
|
+
/** `BfFlags` (storage, 16 B; P8-T10): the two words `bf-relax` raises and the host reads back after every batch of rounds -- `changed` @0 (some exchange succeeded), `retryExhausted` @4 (some lane hit `maxRetries`, PD-12), `pad0` @8, `pad1` @12. Bound by the kernel as `array<atomic<u32>>`; the block is the host's decoder. */
|
|
111
|
+
export declare const BF_FLAGS: UniformBlock;
|
|
72
112
|
/** THE registry (spec 3.5): every entry, keyed by id. */
|
|
73
113
|
export declare const KERNELS: Readonly<Record<KernelId, KernelEntry>>;
|
|
74
114
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernels.d.ts","sourceRoot":"","sources":["../../src/kernels.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kernels.d.ts","sourceRoot":"","sources":["../../src/kernels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA+CjD,mFAAmF;AACnF,MAAM,MAAM,QAAQ,GACd,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,kBAAkB,GAClB,oBAAoB,GACpB,gBAAgB,GAChB,qBAAqB,GACrB,oBAAoB,GACpB,eAAe,GACf,cAAc,GACd,WAAW,GACX,UAAU,GACV,aAAa,GACb,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,mBAAmB,GACnB,YAAY,GACZ,UAAU,GACV,WAAW,GACX,kBAAkB,GAClB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,gBAAgB,GAChB,cAAc,GACd,WAAW,GACX,WAAW,GACX,eAAe,GACf,kBAAkB,GAClB,qBAAqB,GACrB,YAAY,GACZ,UAAU,GACV,iBAAiB,GACjB,kBAAkB,CAAC;AAEzB,wGAAwG;AACxG,MAAM,WAAW,WAAW;IACxB,QAAQ,CAA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