@graphty/webgpu-graph-algorithms 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +459 -58
- package/dist/browser.js +1 -1
- package/dist/chunks/{context-BR7fx3vR.js → context-BXqgCifx.js} +190 -40
- package/dist/chunks/context-BXqgCifx.js.map +1 -0
- package/dist/node.js +1 -1
- package/dist/src/algorithms/components.d.ts.map +1 -1
- package/dist/src/algorithms/components.js +12 -13
- package/dist/src/algorithms/components.js.map +1 -1
- package/dist/src/algorithms/degree.d.ts +6 -8
- package/dist/src/algorithms/degree.d.ts.map +1 -1
- package/dist/src/algorithms/degree.js +58 -35
- package/dist/src/algorithms/degree.js.map +1 -1
- package/dist/src/algorithms/pagerank.d.ts.map +1 -1
- package/dist/src/algorithms/pagerank.js +16 -14
- package/dist/src/algorithms/pagerank.js.map +1 -1
- package/dist/src/algorithms/power-iteration.d.ts +2 -2
- package/dist/src/algorithms/power-iteration.d.ts.map +1 -1
- package/dist/src/algorithms/power-iteration.js +17 -14
- package/dist/src/algorithms/power-iteration.js.map +1 -1
- package/dist/src/constants.d.ts +38 -8
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +38 -8
- package/dist/src/constants.js.map +1 -1
- package/dist/src/errors.d.ts +3 -2
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +2 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +6 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/kernel/dispatch.d.ts +8 -3
- package/dist/src/kernel/dispatch.d.ts.map +1 -1
- package/dist/src/kernel/dispatch.js +18 -7
- package/dist/src/kernel/dispatch.js.map +1 -1
- package/dist/src/kernel/kernel.d.ts +30 -1
- package/dist/src/kernel/kernel.d.ts.map +1 -1
- package/dist/src/kernel/kernel.js +49 -5
- package/dist/src/kernel/kernel.js.map +1 -1
- package/dist/src/kernel/prelude.d.ts.map +1 -1
- package/dist/src/kernel/prelude.js +6 -1
- package/dist/src/kernel/prelude.js.map +1 -1
- package/dist/src/kernel/profiler.d.ts +15 -3
- package/dist/src/kernel/profiler.d.ts.map +1 -1
- package/dist/src/kernel/profiler.js +27 -4
- package/dist/src/kernel/profiler.js.map +1 -1
- package/dist/src/kernels.d.ts +17 -7
- package/dist/src/kernels.d.ts.map +1 -1
- package/dist/src/kernels.js +323 -16
- package/dist/src/kernels.js.map +1 -1
- package/dist/src/layouts/calibrate.d.ts +51 -0
- package/dist/src/layouts/calibrate.d.ts.map +1 -0
- package/dist/src/layouts/calibrate.js +172 -0
- package/dist/src/layouts/calibrate.js.map +1 -0
- package/dist/src/layouts/force-simulation.d.ts +39 -4
- package/dist/src/layouts/force-simulation.d.ts.map +1 -1
- package/dist/src/layouts/force-simulation.js +71 -19
- package/dist/src/layouts/force-simulation.js.map +1 -1
- package/dist/src/layouts/forceatlas2.d.ts +107 -36
- package/dist/src/layouts/forceatlas2.d.ts.map +1 -1
- package/dist/src/layouts/forceatlas2.js +296 -100
- package/dist/src/layouts/forceatlas2.js.map +1 -1
- package/dist/src/layouts/fruchterman-reingold.d.ts +73 -27
- package/dist/src/layouts/fruchterman-reingold.d.ts.map +1 -1
- package/dist/src/layouts/fruchterman-reingold.js +230 -70
- package/dist/src/layouts/fruchterman-reingold.js.map +1 -1
- package/dist/src/layouts/model-common.d.ts +41 -3
- package/dist/src/layouts/model-common.d.ts.map +1 -1
- package/dist/src/layouts/model-common.js +74 -3
- package/dist/src/layouts/model-common.js.map +1 -1
- package/dist/src/layouts/repulsion-grid.d.ts +152 -0
- package/dist/src/layouts/repulsion-grid.d.ts.map +1 -0
- package/dist/src/layouts/repulsion-grid.js +318 -0
- package/dist/src/layouts/repulsion-grid.js.map +1 -0
- package/dist/src/layouts/spring-electrical.d.ts +75 -30
- package/dist/src/layouts/spring-electrical.d.ts.map +1 -1
- package/dist/src/layouts/spring-electrical.js +231 -74
- package/dist/src/layouts/spring-electrical.js.map +1 -1
- package/dist/src/memory/residency.d.ts +6 -2
- package/dist/src/memory/residency.d.ts.map +1 -1
- package/dist/src/memory/residency.js +84 -14
- package/dist/src/memory/residency.js.map +1 -1
- package/dist/src/primitives/core-shape.d.ts +38 -2
- package/dist/src/primitives/core-shape.d.ts.map +1 -1
- package/dist/src/primitives/core-shape.js +71 -3
- package/dist/src/primitives/core-shape.js.map +1 -1
- package/dist/src/primitives/grid-pyramid.d.ts +71 -0
- package/dist/src/primitives/grid-pyramid.d.ts.map +1 -0
- package/dist/src/primitives/grid-pyramid.js +143 -0
- package/dist/src/primitives/grid-pyramid.js.map +1 -0
- package/dist/src/primitives/grid.d.ts +118 -0
- package/dist/src/primitives/grid.d.ts.map +1 -0
- package/dist/src/primitives/grid.js +225 -0
- package/dist/src/primitives/grid.js.map +1 -0
- package/dist/src/primitives/histogram.d.ts +67 -0
- package/dist/src/primitives/histogram.d.ts.map +1 -0
- package/dist/src/primitives/histogram.js +190 -0
- package/dist/src/primitives/histogram.js.map +1 -0
- package/dist/src/primitives/radix-sort.d.ts +75 -0
- package/dist/src/primitives/radix-sort.d.ts.map +1 -0
- package/dist/src/primitives/radix-sort.js +168 -0
- package/dist/src/primitives/radix-sort.js.map +1 -0
- package/dist/src/primitives/scan.d.ts +44 -0
- package/dist/src/primitives/scan.d.ts.map +1 -0
- package/dist/src/primitives/scan.js +151 -0
- package/dist/src/primitives/scan.js.map +1 -0
- package/dist/src/primitives/segmented-reduce.d.ts +25 -17
- package/dist/src/primitives/segmented-reduce.d.ts.map +1 -1
- package/dist/src/primitives/segmented-reduce.js +166 -47
- package/dist/src/primitives/segmented-reduce.js.map +1 -1
- package/dist/src/primitives/spmv.d.ts +18 -14
- package/dist/src/primitives/spmv.d.ts.map +1 -1
- package/dist/src/primitives/spmv.js +94 -58
- package/dist/src/primitives/spmv.js.map +1 -1
- package/dist/src/primitives/verify.d.ts +49 -0
- package/dist/src/primitives/verify.d.ts.map +1 -0
- package/dist/src/primitives/verify.js +229 -0
- package/dist/src/primitives/verify.js.map +1 -0
- package/dist/src/types/context.d.ts +53 -0
- package/dist/src/types/context.d.ts.map +1 -1
- package/dist/src/types/layout.d.ts +20 -0
- package/dist/src/types/layout.d.ts.map +1 -1
- package/dist/src/wgsl/counting-scatter.wgsl.d.ts +8 -0
- package/dist/src/wgsl/counting-scatter.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/counting-scatter.wgsl.js +17 -0
- package/dist/src/wgsl/counting-scatter.wgsl.js.map +1 -0
- package/dist/src/wgsl/fa2-attraction.wgsl.d.ts +23 -11
- package/dist/src/wgsl/fa2-attraction.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-attraction.wgsl.js +98 -20
- package/dist/src/wgsl/fa2-attraction.wgsl.js.map +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts +6 -2
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.js +22 -1
- package/dist/src/wgsl/fa2-stats-finalize.wgsl.js.map +1 -1
- package/dist/src/wgsl/grid-cell-key.wgsl.d.ts +8 -0
- package/dist/src/wgsl/grid-cell-key.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-cell-key.wgsl.js +30 -0
- package/dist/src/wgsl/grid-cell-key.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-centroid-hub.wgsl.d.ts +8 -0
- package/dist/src/wgsl/grid-centroid-hub.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-centroid-hub.wgsl.js +29 -0
- package/dist/src/wgsl/grid-centroid-hub.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-centroid.wgsl.d.ts +8 -0
- package/dist/src/wgsl/grid-centroid.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-centroid.wgsl.js +29 -0
- package/dist/src/wgsl/grid-centroid.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-downsample.wgsl.d.ts +7 -0
- package/dist/src/wgsl/grid-downsample.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-downsample.wgsl.js +28 -0
- package/dist/src/wgsl/grid-downsample.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-far-field.wgsl.d.ts +13 -0
- package/dist/src/wgsl/grid-far-field.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-far-field.wgsl.js +98 -0
- package/dist/src/wgsl/grid-far-field.wgsl.js.map +1 -0
- package/dist/src/wgsl/grid-near-field.wgsl.d.ts +19 -0
- package/dist/src/wgsl/grid-near-field.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/grid-near-field.wgsl.js +129 -0
- package/dist/src/wgsl/grid-near-field.wgsl.js.map +1 -0
- package/dist/src/wgsl/histogram.wgsl.d.ts +7 -0
- package/dist/src/wgsl/histogram.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/histogram.wgsl.js +15 -0
- package/dist/src/wgsl/histogram.wgsl.js.map +1 -0
- package/dist/src/wgsl/indirect-finalize.wgsl.d.ts +8 -0
- package/dist/src/wgsl/indirect-finalize.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/indirect-finalize.wgsl.js +26 -0
- package/dist/src/wgsl/indirect-finalize.wgsl.js.map +1 -0
- package/dist/src/wgsl/radix-hist.wgsl.d.ts +9 -0
- package/dist/src/wgsl/radix-hist.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/radix-hist.wgsl.js +31 -0
- package/dist/src/wgsl/radix-hist.wgsl.js.map +1 -0
- package/dist/src/wgsl/radix-scatter.wgsl.d.ts +9 -0
- package/dist/src/wgsl/radix-scatter.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/radix-scatter.wgsl.js +40 -0
- package/dist/src/wgsl/radix-scatter.wgsl.js.map +1 -0
- package/dist/src/wgsl/scan-add.wgsl.d.ts +6 -0
- package/dist/src/wgsl/scan-add.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/scan-add.wgsl.js +14 -0
- package/dist/src/wgsl/scan-add.wgsl.js.map +1 -0
- package/dist/src/wgsl/scan-block.wgsl.d.ts +8 -0
- package/dist/src/wgsl/scan-block.wgsl.d.ts.map +1 -0
- package/dist/src/wgsl/scan-block.wgsl.js +30 -0
- package/dist/src/wgsl/scan-block.wgsl.js.map +1 -0
- package/dist/src/wgsl/segmented-reduce.wgsl.d.ts +22 -8
- package/dist/src/wgsl/segmented-reduce.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/segmented-reduce.wgsl.js +84 -15
- package/dist/src/wgsl/segmented-reduce.wgsl.js.map +1 -1
- package/dist/src/wgsl/spmv-pull.wgsl.d.ts +22 -11
- package/dist/src/wgsl/spmv-pull.wgsl.d.ts.map +1 -1
- package/dist/src/wgsl/spmv-pull.wgsl.js +110 -36
- package/dist/src/wgsl/spmv-pull.wgsl.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/webgpu-graph-algorithms.js +3815 -1003
- package/dist/webgpu-graph-algorithms.js.map +1 -1
- package/package.json +9 -8
- package/src/algorithms/components.ts +12 -16
- package/src/algorithms/degree.ts +58 -43
- package/src/algorithms/pagerank.ts +20 -18
- package/src/algorithms/power-iteration.ts +19 -18
- package/src/constants.ts +38 -8
- package/src/errors.ts +3 -1
- package/src/index.ts +14 -4
- package/src/kernel/dispatch.ts +18 -7
- package/src/kernel/kernel.ts +59 -5
- package/src/kernel/prelude.ts +9 -0
- package/src/kernel/profiler.ts +28 -4
- package/src/kernels.ts +356 -18
- package/src/layouts/calibrate.ts +187 -0
- package/src/layouts/force-simulation.ts +91 -23
- package/src/layouts/forceatlas2.ts +331 -106
- package/src/layouts/fruchterman-reingold.ts +255 -74
- package/src/layouts/model-common.ts +98 -3
- package/src/layouts/repulsion-grid.ts +451 -0
- package/src/layouts/spring-electrical.ts +257 -78
- package/src/memory/residency.ts +126 -20
- package/src/primitives/core-shape.ts +91 -4
- package/src/primitives/grid-pyramid.ts +221 -0
- package/src/primitives/grid.ts +349 -0
- package/src/primitives/histogram.ts +273 -0
- package/src/primitives/radix-sort.ts +246 -0
- package/src/primitives/scan.ts +197 -0
- package/src/primitives/segmented-reduce.ts +214 -56
- package/src/primitives/spmv.ts +125 -65
- package/src/primitives/verify.ts +249 -0
- package/src/types/context.ts +56 -0
- package/src/types/layout.ts +22 -0
- package/src/wgsl/counting-scatter.wgsl.ts +16 -0
- package/src/wgsl/fa2-attraction.wgsl.ts +98 -20
- package/src/wgsl/fa2-stats-finalize.wgsl.ts +22 -1
- package/src/wgsl/grid-cell-key.wgsl.ts +29 -0
- package/src/wgsl/grid-centroid-hub.wgsl.ts +28 -0
- package/src/wgsl/grid-centroid.wgsl.ts +28 -0
- package/src/wgsl/grid-downsample.wgsl.ts +27 -0
- package/src/wgsl/grid-far-field.wgsl.ts +97 -0
- package/src/wgsl/grid-near-field.wgsl.ts +128 -0
- package/src/wgsl/histogram.wgsl.ts +14 -0
- package/src/wgsl/indirect-finalize.wgsl.ts +25 -0
- package/src/wgsl/radix-hist.wgsl.ts +30 -0
- package/src/wgsl/radix-scatter.wgsl.ts +39 -0
- package/src/wgsl/scan-add.wgsl.ts +13 -0
- package/src/wgsl/scan-block.wgsl.ts +29 -0
- package/src/wgsl/segmented-reduce.wgsl.ts +84 -15
- package/src/wgsl/spmv-pull.wgsl.ts +110 -36
- package/dist/chunks/context-BR7fx3vR.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repulsion-grid.js","sourceRoot":"","sources":["../../../src/layouts/repulsion-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,O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;YACzB,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC;QAC1B,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC7D,MAAM,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACK,YAAY,CAAC,MAAc;QAC/B,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACtB,MAAM,IAAI,gBAAgB,CACtB,cAAc,EACd,iBAAiB,MAAM,+CAA+C,EACtE;gBACI,KAAK,EAAE,SAAS;aACnB,CACJ,CAAC;QACN,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CACJ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The spring-electrical preset on the exact repulsion tier (spec 7.20 "the preset"; contract 3.13):
|
|
3
|
-
* physics under ngraph's option names and defaults -- Coulomb repulsion `-g m_i m_j / d^2` (K3,
|
|
2
|
+
* The spring-electrical preset on the exact or the grid repulsion tier (spec 7.20 "the preset", 7.8; contract 3.13):
|
|
3
|
+
* ngraph.forcelayout's physics under ngraph's option names and defaults -- Coulomb repulsion `-g m_i m_j / d^2` (K3,
|
|
4
|
+
* LAW 2; G6 / G7 with LAW 2 on the grid tier, P4-T13), Hooke springs
|
|
4
5
|
* `k_s (d - L)` (K2, LAW 2), drag and the semi-implicit Euler step with the unit speed clamp over a per-node velocity
|
|
5
6
|
* (K5, APPLY 2), the kinetic energy folded into the trace (K1, STATS_MODE 2; PD-4) -- as the ForceModel that
|
|
6
7
|
* ForceSimulation drives over the four FA2 kernels K1 K2 K3 K5 per iteration and toScene per batch. No K4: there is no
|
|
@@ -10,9 +11,12 @@
|
|
|
10
11
|
* `Fa2Params.coulomb` while FA2's centre gravity is 0 (PD-12). Settlement is the shared rule of spec 7.17
|
|
11
12
|
* (DEP-P5-A); `reheat()` leaves the velocities alone (ngraph has no reheat).
|
|
12
13
|
*
|
|
13
|
-
* Model decisions this file shares with forceatlas2.ts: the K1-K5 dispatches of one batch share ONE
|
|
14
|
-
* toScene runs in a second pass that ends it; the fill kernel takes its FillParams from a model-owned
|
|
15
|
-
* buffer
|
|
14
|
+
* Model decisions this file shares with forceatlas2.ts: on the exact tier the K1-K5 dispatches of one batch share ONE
|
|
15
|
+
* compute pass and toScene runs in a second pass that ends it; the fill kernel takes its FillParams from a model-owned
|
|
16
|
+
* 256-byte uniform buffer. The grid tier (P4-T13, PD-22) is FA2's: `RepulsionGrid` with `LAW` 2 when `tierFor(tuning,
|
|
17
|
+
* n)` says so (PD-18), the grid buffers from `buffers()`, K1's grid block under `gridMax > 0` (PD-14) over the model's
|
|
18
|
+
* own `hubCounters`, the three passes `se-k1` / `se-attraction` / `se-grid` before `se-to-scene` (PD-16), and the
|
|
19
|
+
* union stage list (PD-17; K4 is never recorded).
|
|
16
20
|
*/
|
|
17
21
|
import { type GraphSnapshot } from "@graphty/graph-format";
|
|
18
22
|
import { type GpuContext } from "../context.js";
|
|
@@ -23,6 +27,8 @@ import { type GpuLayoutSimulation, type GpuLayoutTuning, type ResolvedLayoutTuni
|
|
|
23
27
|
import { type ResolvedSpringElectricalOptions, type SpringElectricalOptions } from "../types/options.js";
|
|
24
28
|
import { type BufferSpec, type ForceModel, type ModelInputs, type ModelResources, type StateWriter } from "./force-simulation.js";
|
|
25
29
|
import { type Overrides } from "./model-common.js";
|
|
30
|
+
/** The stage names of both tiers in dispatch order plus the per-batch toScene (spec 7.20; P4 PD-17: the union list; the exact tier records K1 K2 K3 K5, the grid tier K1 K2 G1..G7 K5, K4 never). */
|
|
31
|
+
declare const SE_STAGES: readonly ["K1", "K2", "K3", "G1", "G2", "G3", "G4", "G5", "G6", "G7", "K4", "K5", "toScene"];
|
|
26
32
|
/**
|
|
27
33
|
* The size factor of the default force constants: 1 up to SE_SCALE_REFERENCE_NODES nodes (ngraph's constants as
|
|
28
34
|
* they are), then SE_SCALE_REFERENCE_NODES / n, so the per-node force stays at the level ngraph's constants were
|
|
@@ -42,12 +48,12 @@ export declare function springSizeFactor(n: number): number;
|
|
|
42
48
|
* @returns the frozen resolved record
|
|
43
49
|
*/
|
|
44
50
|
export declare function resolveSpringElectricalOptions(options: SpringElectricalOptions | undefined, previous?: ResolvedSpringElectricalOptions): ResolvedSpringElectricalOptions;
|
|
45
|
-
/** The spring-electrical model (spec 7.20: K1 K2 K3 K5 per iteration; toScene once per batch). Stages:
|
|
51
|
+
/** The spring-electrical model (spec 7.20: K1 K2 K3 K5 per iteration on the exact tier, K1 K2 G1..G7 K5 on the grid tier; toScene once per batch). Stages: the union list of PD-17. */
|
|
46
52
|
export declare class SpringElectricalModel implements ForceModel<SpringElectricalOptions, SpringElectricalStats> {
|
|
47
53
|
/** The model kind of spec 7.19. */
|
|
48
54
|
readonly kind = "springElectrical";
|
|
49
55
|
/** The stage names in dispatch order (the `upTo` vocabulary of recordIteration and debugRunStages). */
|
|
50
|
-
readonly stages:
|
|
56
|
+
readonly stages: typeof SE_STAGES;
|
|
51
57
|
/** Fa2Params: the per-iteration uniform block (the simulation writes the shared fields into it). */
|
|
52
58
|
readonly params: UniformBlock;
|
|
53
59
|
/** Fa2State: the state header block. */
|
|
@@ -62,6 +68,8 @@ export declare class SpringElectricalModel implements ForceModel<SpringElectrica
|
|
|
62
68
|
private resources;
|
|
63
69
|
/** The kernels and bind groups of the last bind(), or null before it (and for n === 0). */
|
|
64
70
|
private bound;
|
|
71
|
+
/** The grid of the load inputs() last resolved (null on the exact tier): onLoad() writes its frame, specs() lists its kernels. */
|
|
72
|
+
private nextGrid;
|
|
65
73
|
/** The K1-K5 compute pass of the batch being recorded, keyed by CommandBatch.id; null between batches. */
|
|
66
74
|
private openPass;
|
|
67
75
|
/**
|
|
@@ -72,22 +80,24 @@ export declare class SpringElectricalModel implements ForceModel<SpringElectrica
|
|
|
72
80
|
constructor(tuning: ResolvedLayoutTuning, resolved: ResolvedSpringElectricalOptions);
|
|
73
81
|
/**
|
|
74
82
|
* force 12n (zeroed), velocity 12n (zeroed: every load() starts at rest, `allocate()` / `clearKept()` honour
|
|
75
|
-
* `zero`)
|
|
76
|
-
*
|
|
83
|
+
* `zero`), the 256-byte FillParams uniform buffer, the 16-byte `hubCounters` K1 binds on every tier (P4 PD-14),
|
|
84
|
+
* and the grid buffers of `RepulsionGrid.buffers` exactly when `tierFor(tuning, n)` is the grid tier (PD-18).
|
|
85
|
+
* n = 0 reports one node's worth of bytes so no zero-length buffer is ever created.
|
|
77
86
|
* @param n - the node count
|
|
78
|
-
* @param
|
|
79
|
-
* @returns the
|
|
87
|
+
* @param dim - the layout dimension (the arrays are stride 3 in both; the grid's geometry differs)
|
|
88
|
+
* @returns the model-owned buffer specs
|
|
80
89
|
*/
|
|
81
|
-
buffers(n: number,
|
|
90
|
+
buffers(n: number, dim: 2 | 3): readonly BufferSpec[];
|
|
82
91
|
/**
|
|
83
92
|
* { mass: 1 + degree / 3, weights: none } (PD-11): the preset has no mass or weight option, and K2 compiles
|
|
84
|
-
* HAS_WEIGHTS = false. No `fixed` (setFixed is the live API).
|
|
85
|
-
*
|
|
93
|
+
* HAS_WEIGHTS = false. No `fixed` (setFixed is the live API). Also remembers the grid of this load
|
|
94
|
+
* (`tierFor(tuning, n)`, spec 7.8) for onLoad() and specs(): the simulation calls inputs() first, then onLoad()
|
|
95
|
+
* before bind().
|
|
86
96
|
* @param s - the snapshot being loaded
|
|
87
|
-
* @param
|
|
97
|
+
* @param options - the simulation's current option record (its dimension picks the grid's geometry)
|
|
88
98
|
* @returns the per-load inputs
|
|
89
99
|
*/
|
|
90
|
-
inputs(s: GraphSnapshot,
|
|
100
|
+
inputs(s: GraphSnapshot, options: SpringElectricalOptions): ModelInputs;
|
|
91
101
|
/**
|
|
92
102
|
* The constant SE_OVERRIDES (PD-1): no option changes a law, so setParams never recompiles.
|
|
93
103
|
* @param _options - an option record (unused)
|
|
@@ -96,16 +106,20 @@ export declare class SpringElectricalModel implements ForceModel<SpringElectrica
|
|
|
96
106
|
overrides(_options: SpringElectricalOptions): Overrides;
|
|
97
107
|
/**
|
|
98
108
|
* The six module specs of an override set in dispatch order -- K1, K2, K3, K5, toScene, fill -- each with only the
|
|
99
|
-
* override names its entry declares (K2 also USE_PERM / HAS_WEIGHTS), for warm() and the compile matrix
|
|
109
|
+
* override names its entry declares (K2 also USE_PERM / HAS_WEIGHTS), for warm() and the compile matrix,
|
|
110
|
+
* followed by the grid tier's specs (`RepulsionGrid.specs` under SE_GRID_OVERRIDES) when the load inputs() last
|
|
111
|
+
* resolved is a grid load (the pipeline key carries no geometry).
|
|
100
112
|
* @param overrides - the merged override set (the model's plus USE_PERM / HAS_WEIGHTS)
|
|
101
113
|
* @param _subgroups - accepted for the ForceModel interface and unused (the composer picks the twin from caps)
|
|
102
114
|
* @returns the specs
|
|
103
115
|
*/
|
|
104
116
|
specs(overrides: Overrides, _subgroups: boolean): readonly WgslModuleSpec[];
|
|
105
117
|
/**
|
|
106
|
-
* Compiles (through the cache) and binds every kernel against the buffers of this load(): K1, K2
|
|
107
|
-
* force when arcCount === 0), K3
|
|
108
|
-
*
|
|
118
|
+
* Compiles (through the cache) and binds every kernel against the buffers of this load(): K1, K2 over the degree
|
|
119
|
+
* tiers through bindAttraction (or the fill of force when arcCount === 0), K3 on the exact tier or G1-G7 through
|
|
120
|
+
* RepulsionGrid on the grid tier (PD-18), K5, with the velocity in the `oldForce` slot of K3 / G7 / K5 (PD-2),
|
|
121
|
+
* toScene; writes the FillParams { count: 3n, value: 0, mode: 0 } into the model's uniform buffer. With n === 0
|
|
122
|
+
* nothing is bound. The K2 TIER 1 / 2 pipelines compile on the first load whose degrees need them (P4 PD-7).
|
|
109
123
|
* @param resources - the graph, the shared and model buffers, the ring and the cache
|
|
110
124
|
* @param overrides - the merged override set
|
|
111
125
|
*/
|
|
@@ -119,17 +133,43 @@ export declare class SpringElectricalModel implements ForceModel<SpringElectrica
|
|
|
119
133
|
*/
|
|
120
134
|
paramsFor(iteration: number, options: SpringElectricalOptions): UniformValues;
|
|
121
135
|
/**
|
|
122
|
-
* Records one iteration into the batch
|
|
123
|
-
*
|
|
124
|
-
*
|
|
136
|
+
* Records one iteration into the batch, stopping after stage `upTo` when given (PD-17: `upTo` names a position
|
|
137
|
+
* in the union list and the recording stops after the last stage recorded at or before it, so "K3" on the grid
|
|
138
|
+
* tier stops after K2 and "G5" on the exact tier after K3). The exact tier: K1, K2 (or the fill of force when
|
|
139
|
+
* arcCount === 0), K3, K5 in the batch's ONE compute pass, then toScene in a second pass that ends it. The grid
|
|
140
|
+
* tier (PD-16): the passes `se-k1` (K1), `se-attraction` (K2's tiers) and `se-grid` (G1-G7, K5) per iteration,
|
|
141
|
+
* then `se-to-scene`. With n === 0 nothing is recorded; a call before bind() completed is E_NOT_LOADED.
|
|
125
142
|
* @param batch - the batch being recorded
|
|
126
143
|
* @param slot - the UniformRing slot holding this iteration's Fa2Params
|
|
127
|
-
* @param tier -
|
|
144
|
+
* @param tier - the tier the simulation resolved at load() (the same rule bind() applied, PD-18)
|
|
128
145
|
* @param upTo - a stage name to stop after; undefined records every stage including toScene
|
|
129
146
|
*/
|
|
130
147
|
recordIteration(batch: CommandBatch, slot: number, tier: "exact" | "grid", upTo?: string): void;
|
|
131
148
|
/**
|
|
132
|
-
*
|
|
149
|
+
* The grid tier's iteration (PD-16): three compute passes before toScene; no K4.
|
|
150
|
+
* @param batch - the batch being recorded
|
|
151
|
+
* @param bound - the bound model
|
|
152
|
+
* @param offset - the Fa2Params dynamic offset of the iteration
|
|
153
|
+
* @param stop - the SE_STAGES index to stop after
|
|
154
|
+
*/
|
|
155
|
+
private recordGridIteration;
|
|
156
|
+
/**
|
|
157
|
+
* K2's tier dispatches, or the fill of force when the graph has no arcs (spec 7.5).
|
|
158
|
+
* @param pass - the open compute pass
|
|
159
|
+
* @param bound - the bound model
|
|
160
|
+
* @param offset - the Fa2Params dynamic offset
|
|
161
|
+
*/
|
|
162
|
+
private recordK2;
|
|
163
|
+
/**
|
|
164
|
+
* The toScene pass that ends the iteration's pass; the batch is complete after it, so nothing reuses the pass.
|
|
165
|
+
* @param batch - the batch
|
|
166
|
+
* @param bound - the bound model
|
|
167
|
+
* @param offset - the Fa2Params dynamic offset
|
|
168
|
+
*/
|
|
169
|
+
private recordToScene;
|
|
170
|
+
/**
|
|
171
|
+
* kineticEnergy = 0 and temperature = 0 in the header (the velocities start at 0 through the buffer's `zero`);
|
|
172
|
+
* on a grid load the frame of the first build (K1 folds nothing on the first iteration).
|
|
133
173
|
* @param state - the state writer of the simulation
|
|
134
174
|
*/
|
|
135
175
|
onLoad(state: StateWriter): void;
|
|
@@ -146,9 +186,10 @@ export declare class SpringElectricalModel implements ForceModel<SpringElectrica
|
|
|
146
186
|
*/
|
|
147
187
|
onSetParams(patch: Partial<SpringElectricalOptions>, _state: StateWriter): void;
|
|
148
188
|
/**
|
|
149
|
-
* Decodes the state header and the k trace records of a completed batch into SpringElectricalStats:
|
|
150
|
-
* tier
|
|
151
|
-
*
|
|
189
|
+
* Decodes the state header and the k trace records of a completed batch into SpringElectricalStats:
|
|
190
|
+
* `repulsionTier` is the bound tier, the grid fields are the header's on the grid tier and null on the exact
|
|
191
|
+
* tier; msPerIteration null (the simulation owns the clock); `kineticEnergy` is the last folded value (one
|
|
192
|
+
* iteration behind the last integrate, PD-4).
|
|
152
193
|
* @param state - a DataView over the 256-byte state header
|
|
153
194
|
* @param trace - a DataView over the k Fa2Trace records of the batch
|
|
154
195
|
* @returns the stats
|
|
@@ -165,15 +206,19 @@ export declare class SpringElectricalModel implements ForceModel<SpringElectrica
|
|
|
165
206
|
* @returns its index
|
|
166
207
|
*/
|
|
167
208
|
private stageIndex;
|
|
168
|
-
/**
|
|
209
|
+
/** Releases the grid stage's lease and the bind groups (the simulation calls it from dispose() once every in-flight batch has settled). */
|
|
210
|
+
dispose(): void;
|
|
211
|
+
/** Drops the bind groups of the previous bind() (the buffers changed), releases the grid stage's lease and forgets the pass of a batch recorded before the rebind. */
|
|
169
212
|
private dropBound;
|
|
170
213
|
}
|
|
171
214
|
/**
|
|
172
215
|
* Spec 3.3 createSpringElectrical, verbatim: a GpuLayoutSimulation running ngraph's spring-electrical model on the
|
|
173
|
-
* exact repulsion tier with ngraph's defaults (spec 7.20) and the GPU-only tuning of
|
|
216
|
+
* exact or the grid repulsion tier (spec 7.8) with ngraph's defaults (spec 7.20) and the GPU-only tuning of
|
|
217
|
+
* GpuLayoutTuning.
|
|
174
218
|
* @param ctx - the context (E_DISPOSED / E_DEVICE_LOST through assertReady)
|
|
175
219
|
* @param options - the spring-electrical options and the GPU-only tuning knobs in one record
|
|
176
220
|
* @returns the simulation in state "created"; load() next
|
|
177
221
|
*/
|
|
178
222
|
export declare function createSpringElectrical(ctx: GpuContext, options?: SpringElectricalOptions & GpuLayoutTuning): GpuLayoutSimulation<SpringElectricalOptions, SpringElectricalStats>;
|
|
223
|
+
export {};
|
|
179
224
|
//# sourceMappingURL=spring-electrical.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spring-electrical.d.ts","sourceRoot":"","sources":["../../../src/layouts/spring-electrical.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"spring-electrical.d.ts","sourceRoot":"","sources":["../../../src/layouts/spring-electrical.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAS3D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,KAAK,cAAc,EAA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