@reicek/neataptic-ts 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/.github/copilot-instructions.md +11 -0
  2. package/.github/skills/trace-analyzer-extension/SKILL.md +3 -3
  3. package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +1 -1
  4. package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +1 -1
  5. package/.github/skills/trace-audit-reporting/SKILL.md +3 -3
  6. package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +1 -1
  7. package/package.json +19 -13
  8. package/plans/Flappy_Bird_Folder_Documentation_Pass.md +4 -4
  9. package/plans/README.md +24 -0
  10. package/plans/Roadmap.md +62 -40
  11. package/plans/analyze-trace-solid-split.plans.md +66 -0
  12. package/plans/architecture-solid-split.plans.md +9 -15
  13. package/plans/asciiMaze-typescript-repair.plans.md +1 -1
  14. package/plans/generate-docs-solid-split.plans.md +87 -0
  15. package/plans/methods-docs.plans.md +25 -1
  16. package/plans/methods-solid-split.plans.md +14 -14
  17. package/plans/neat-docs.plans.md +9 -1
  18. package/plans/neat-test-surface-repair.plans.md +1 -1
  19. package/plans/render-docs-html-solid-split.plans.md +68 -0
  20. package/plans/src-no-explicit-any-cleanup.plans.md +1 -1
  21. package/plans/utils-docs.plans.md +6 -1
  22. package/scripts/analyze-trace/analyze-trace.analysis.ts +479 -0
  23. package/scripts/analyze-trace/analyze-trace.constants.ts +35 -0
  24. package/scripts/analyze-trace/analyze-trace.io.ts +69 -0
  25. package/scripts/analyze-trace/analyze-trace.report.ts +100 -0
  26. package/scripts/analyze-trace/analyze-trace.shared.ts +116 -0
  27. package/scripts/analyze-trace/analyze-trace.ts +45 -0
  28. package/scripts/analyze-trace/analyze-trace.types.ts +72 -0
  29. package/scripts/assets/theme.css +80 -23
  30. package/scripts/copy-examples.ts +239 -0
  31. package/scripts/export-onnx.ts +223 -0
  32. package/scripts/generate-bench-tables.ts +378 -37
  33. package/scripts/generate-docs/generate-docs.constants.ts +107 -0
  34. package/scripts/generate-docs/generate-docs.order.ts +355 -0
  35. package/scripts/generate-docs/generate-docs.state.ts +31 -0
  36. package/scripts/generate-docs/generate-docs.targets.ts +165 -0
  37. package/scripts/generate-docs/generate-docs.ts +63 -0
  38. package/scripts/generate-docs/generate-docs.types.ts +112 -0
  39. package/scripts/generate-docs/output/generate-docs.output.folder-index.utils.ts +167 -0
  40. package/scripts/generate-docs/output/generate-docs.output.ordering.utils.ts +353 -0
  41. package/scripts/generate-docs/output/generate-docs.output.readme.utils.ts +420 -0
  42. package/scripts/generate-docs/output/generate-docs.output.ts +123 -0
  43. package/scripts/generate-docs/output/generate-docs.output.warnings.utils.ts +219 -0
  44. package/scripts/generate-docs/symbols/generate-docs.symbols.collection.utils.ts +365 -0
  45. package/scripts/generate-docs/symbols/generate-docs.symbols.jsdoc.utils.ts +373 -0
  46. package/scripts/generate-docs/symbols/generate-docs.symbols.normalize.utils.ts +155 -0
  47. package/scripts/generate-docs/symbols/generate-docs.symbols.render.utils.ts +149 -0
  48. package/scripts/generate-docs/symbols/generate-docs.symbols.signature.utils.ts +289 -0
  49. package/scripts/generate-docs/symbols/generate-docs.symbols.ts +11 -0
  50. package/scripts/mermaid-cli.mjs +102 -22
  51. package/scripts/mermaid-cli.ts +736 -0
  52. package/scripts/render-docs-html/render-docs-html.assets.ts +54 -0
  53. package/scripts/render-docs-html/render-docs-html.mermaid.ts +245 -0
  54. package/scripts/{render-docs-html.sidebar.ts → render-docs-html/render-docs-html.navigation.ts} +141 -144
  55. package/scripts/render-docs-html/render-docs-html.pages.ts +333 -0
  56. package/scripts/render-docs-html/render-docs-html.shared.ts +333 -0
  57. package/scripts/render-docs-html/render-docs-html.types.ts +42 -0
  58. package/scripts/render-docs-html.ts +23 -587
  59. package/scripts/run-docs.ts +238 -0
  60. package/scripts/write-dist-docs-pkg.ts +40 -0
  61. package/src/README.md +75 -75
  62. package/src/architecture/connection/README.md +5 -5
  63. package/src/architecture/layer/README.md +508 -508
  64. package/src/architecture/network/README.md +1458 -1458
  65. package/src/architecture/network/activate/README.md +694 -694
  66. package/src/architecture/network/bootstrap/README.md +77 -77
  67. package/src/architecture/network/connect/README.md +74 -74
  68. package/src/architecture/network/deterministic/README.md +135 -135
  69. package/src/architecture/network/evolve/README.md +364 -364
  70. package/src/architecture/network/gating/README.md +130 -130
  71. package/src/architecture/network/genetic/README.md +399 -399
  72. package/src/architecture/network/mutate/README.md +897 -897
  73. package/src/architecture/network/onnx/README.md +720 -720
  74. package/src/architecture/network/onnx/export/README.md +728 -728
  75. package/src/architecture/network/onnx/export/layers/README.md +450 -450
  76. package/src/architecture/network/onnx/import/README.md +618 -618
  77. package/src/architecture/network/onnx/schema/README.md +32 -32
  78. package/src/architecture/network/prune/README.md +245 -245
  79. package/src/architecture/network/remove/README.md +135 -135
  80. package/src/architecture/network/runtime/README.md +106 -106
  81. package/src/architecture/network/serialize/README.md +542 -542
  82. package/src/architecture/network/slab/README.md +608 -608
  83. package/src/architecture/network/standalone/README.md +212 -212
  84. package/src/architecture/network/stats/README.md +84 -84
  85. package/src/architecture/network/topology/README.md +465 -465
  86. package/src/architecture/network/training/README.md +200 -200
  87. package/src/architecture/node/README.md +5 -5
  88. package/src/architecture/nodePool/README.md +14 -14
  89. package/src/methods/README.md +99 -99
  90. package/src/methods/activation/README.md +189 -189
  91. package/src/methods/cost/README.md +131 -131
  92. package/src/methods/rate/README.md +86 -86
  93. package/src/multithreading/README.md +77 -77
  94. package/src/multithreading/workers/browser/README.md +8 -8
  95. package/src/multithreading/workers/node/README.md +8 -8
  96. package/src/neat/README.md +148 -148
  97. package/src/neat/adaptive/README.md +120 -120
  98. package/src/neat/adaptive/acceptance/README.md +40 -40
  99. package/src/neat/adaptive/complexity/README.md +137 -137
  100. package/src/neat/adaptive/core/README.md +197 -197
  101. package/src/neat/adaptive/lineage/README.md +90 -90
  102. package/src/neat/adaptive/mutation/README.md +284 -284
  103. package/src/neat/compat/README.md +43 -43
  104. package/src/neat/compat/core/README.md +90 -90
  105. package/src/neat/diversity/README.md +35 -35
  106. package/src/neat/diversity/core/README.md +88 -88
  107. package/src/neat/evaluate/README.md +85 -85
  108. package/src/neat/evaluate/auto-distance/README.md +75 -75
  109. package/src/neat/evaluate/entropy-compat/README.md +37 -37
  110. package/src/neat/evaluate/entropy-sharing/README.md +43 -43
  111. package/src/neat/evaluate/fitness/README.md +23 -23
  112. package/src/neat/evaluate/novelty/README.md +120 -120
  113. package/src/neat/evaluate/objectives/README.md +17 -17
  114. package/src/neat/evaluate/shared/README.md +94 -94
  115. package/src/neat/evolve/README.md +96 -96
  116. package/src/neat/evolve/adaptive/README.md +60 -60
  117. package/src/neat/evolve/objectives/README.md +63 -63
  118. package/src/neat/evolve/offspring/README.md +56 -56
  119. package/src/neat/evolve/population/README.md +171 -171
  120. package/src/neat/evolve/runtime/README.md +79 -79
  121. package/src/neat/evolve/speciation/README.md +74 -74
  122. package/src/neat/evolve/warnings/README.md +10 -10
  123. package/src/neat/export/README.md +114 -114
  124. package/src/neat/helpers/README.md +50 -50
  125. package/src/neat/init/README.md +9 -9
  126. package/src/neat/lineage/core/README.md +101 -101
  127. package/src/neat/multiobjective/category/README.md +74 -74
  128. package/src/neat/multiobjective/crowding/README.md +272 -272
  129. package/src/neat/multiobjective/dominance/README.md +171 -171
  130. package/src/neat/multiobjective/fronts/README.md +68 -68
  131. package/src/neat/multiobjective/metrics/README.md +43 -43
  132. package/src/neat/multiobjective/objectives/README.md +31 -31
  133. package/src/neat/multiobjective/shared/README.md +27 -27
  134. package/src/neat/mutation/README.md +97 -97
  135. package/src/neat/mutation/add-conn/README.md +115 -115
  136. package/src/neat/mutation/add-node/README.md +126 -126
  137. package/src/neat/mutation/flow/README.md +149 -149
  138. package/src/neat/mutation/repair/README.md +185 -185
  139. package/src/neat/mutation/select/README.md +117 -117
  140. package/src/neat/mutation/shared/README.md +32 -32
  141. package/src/neat/objectives/README.md +25 -25
  142. package/src/neat/objectives/core/README.md +67 -67
  143. package/src/neat/pruning/README.md +40 -40
  144. package/src/neat/pruning/core/README.md +171 -171
  145. package/src/neat/pruning/facade/README.md +32 -32
  146. package/src/neat/rng/README.md +104 -104
  147. package/src/neat/rng/core/README.md +137 -137
  148. package/src/neat/rng/facade/README.md +50 -50
  149. package/src/neat/selection/README.md +111 -111
  150. package/src/neat/selection/core/README.md +227 -227
  151. package/src/neat/selection/facade/README.md +61 -61
  152. package/src/neat/shared/README.md +163 -163
  153. package/src/neat/speciation/README.md +31 -31
  154. package/src/neat/speciation/threshold/README.md +35 -35
  155. package/src/neat/species/README.md +25 -25
  156. package/src/neat/species/core/README.md +20 -20
  157. package/src/neat/species/core/shared/README.md +18 -18
  158. package/src/neat/species/history/context/README.md +22 -22
  159. package/src/neat/telemetry/accessors/README.md +58 -58
  160. package/src/neat/telemetry/exports/README.md +233 -233
  161. package/src/neat/telemetry/facade/README.md +252 -252
  162. package/src/neat/telemetry/facade/archive/README.md +57 -57
  163. package/src/neat/telemetry/facade/buffer/README.md +43 -43
  164. package/src/neat/telemetry/facade/lineage/README.md +12 -12
  165. package/src/neat/telemetry/facade/objectives/README.md +44 -44
  166. package/src/neat/telemetry/facade/runtime/README.md +26 -26
  167. package/src/neat/telemetry/facade/species/README.md +27 -27
  168. package/src/neat/telemetry/metrics/README.md +696 -696
  169. package/src/neat/telemetry/recorder/README.md +57 -57
  170. package/src/neat/telemetry/types/README.md +32 -32
  171. package/src/neat/topology-intent/README.md +75 -75
  172. package/src/utils/README.md +193 -193
  173. package/test/examples/asciiMaze/browser-entry/README.md +92 -92
  174. package/test/examples/asciiMaze/dashboardManager/README.md +109 -109
  175. package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +28 -28
  176. package/test/examples/asciiMaze/evolutionEngine/README.md +1527 -1527
  177. package/test/examples/asciiMaze/mazeMovement/README.md +105 -105
  178. package/test/examples/asciiMaze/mazeMovement/finalization/README.md +16 -16
  179. package/test/examples/asciiMaze/mazeMovement/policy/README.md +57 -57
  180. package/test/examples/asciiMaze/mazeMovement/runtime/README.md +52 -52
  181. package/test/examples/asciiMaze/mazeMovement/shaping/README.md +46 -46
  182. package/test/examples/flappy_bird/browser-entry/README.md +508 -508
  183. package/test/examples/flappy_bird/browser-entry/host/README.md +101 -101
  184. package/test/examples/flappy_bird/browser-entry/host/resize/README.md +144 -144
  185. package/test/examples/flappy_bird/browser-entry/network-view/README.md +194 -194
  186. package/test/examples/flappy_bird/browser-entry/playback/README.md +278 -278
  187. package/test/examples/flappy_bird/browser-entry/playback/background/README.md +129 -129
  188. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +502 -502
  189. package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +139 -139
  190. package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +10 -10
  191. package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +43 -43
  192. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +30 -30
  193. package/test/examples/flappy_bird/browser-entry/runtime/README.md +59 -59
  194. package/test/examples/flappy_bird/browser-entry/visualization/README.md +276 -276
  195. package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +16 -16
  196. package/test/examples/flappy_bird/constants/README.md +1070 -1070
  197. package/test/examples/flappy_bird/environment/README.md +22 -22
  198. package/test/examples/flappy_bird/evaluation/README.md +32 -32
  199. package/test/examples/flappy_bird/evaluation/rollout/README.md +141 -141
  200. package/test/examples/flappy_bird/flappy-evolution-worker/README.md +425 -425
  201. package/test/examples/flappy_bird/simulation-shared/README.md +170 -170
  202. package/test/examples/flappy_bird/simulation-shared/observation/README.md +109 -109
  203. package/test/examples/flappy_bird/trainer/README.md +325 -325
  204. package/test/examples/flappy_bird/trainer/evaluation/README.md +74 -74
  205. package/scripts/analyze-trace.ts +0 -590
  206. package/scripts/copy-examples.mjs +0 -114
  207. package/scripts/export-onnx.mjs +0 -86
  208. package/scripts/generate-bench-tables.mjs +0 -182
  209. package/scripts/generate-docs.ts +0 -2900
  210. package/scripts/write-dist-docs-pkg.mjs +0 -16
@@ -32,57 +32,69 @@ console.log('First weight from->to', slab.weights[0], slab.from[0], slab.to[0]);
32
32
 
33
33
  ## architecture/network/slab/network.slab.utils.types.ts
34
34
 
35
- ### SLAB_ZERO
35
+ ### BuildAdjacencyContext
36
36
 
37
- Numeric zero sentinel used across slab orchestration and helper pipelines.
37
+ Shared immutable inputs used across the adjacency build pipeline.
38
38
 
39
- ### SLAB_ONE
39
+ ### ConnectionInternals
40
40
 
41
- Numeric one sentinel used for neutral gain defaults and index math.
41
+ Internal Connection properties accessed during slab operations.
42
42
 
43
- ### SLAB_GROWTH_FACTOR_NODE
43
+ ### ConnectionSlabView
44
44
 
45
- Capacity growth factor for Node.js slab allocations.
45
+ Shape returned by getConnectionSlab describing the packed SoA view.
46
46
 
47
- ### SLAB_GROWTH_FACTOR_BROWSER
47
+ ### FanOutCollectionContext
48
48
 
49
- Capacity growth factor for browser slab allocations.
49
+ Context for fan-out collection: build inputs plus the output count buffer.
50
50
 
51
- ### SLAB_DEFAULT_ASYNC_CHUNK_SIZE
51
+ ### FastSlabNodeRuntime
52
52
 
53
- Default async slab rebuild chunk size when no override is provided.
53
+ Node shape required by fast slab activation kernels.
54
54
 
55
- ### ConnectionInternals
55
+ ### NetworkActivationRuntime
56
56
 
57
- Internal Connection properties accessed during slab operations.
57
+ Runtime activation contract used by slab-based execution paths.
58
58
 
59
59
  ### NetworkSlabProps
60
60
 
61
61
  Internal Network properties for slab operations.
62
62
 
63
+ ### NetworkTopoRuntime
64
+
65
+ Runtime topology contract used to lazily rebuild topological order.
66
+
67
+ ### OutgoingOrderBuildContext
68
+
69
+ Context for constructing source-grouped outgoing connection order.
70
+
63
71
  ### PoolKeyMetrics
64
72
 
65
73
  Per-pool-key allocation & reuse counters (educational / diagnostics).
66
74
 
67
- ### TypedArray
75
+ ### PublishAdjacencyContext
68
76
 
69
- Union of slab typed array element container types.
77
+ Context for publishing fully built adjacency slabs to internal network state.
70
78
 
71
- ### TypedArrayConstructor
79
+ ### SLAB_DEFAULT_ASYNC_CHUNK_SIZE
72
80
 
73
- Constructor type for typed arrays used in slabs.
81
+ Default async slab rebuild chunk size when no override is provided.
74
82
 
75
- ### NetworkActivationRuntime
83
+ ### SLAB_GROWTH_FACTOR_BROWSER
76
84
 
77
- Runtime activation contract used by slab-based execution paths.
85
+ Capacity growth factor for browser slab allocations.
78
86
 
79
- ### NetworkTopoRuntime
87
+ ### SLAB_GROWTH_FACTOR_NODE
80
88
 
81
- Runtime topology contract used to lazily rebuild topological order.
89
+ Capacity growth factor for Node.js slab allocations.
82
90
 
83
- ### FastSlabNodeRuntime
91
+ ### SLAB_ONE
84
92
 
85
- Node shape required by fast slab activation kernels.
93
+ Numeric one sentinel used for neutral gain defaults and index math.
94
+
95
+ ### SLAB_ZERO
96
+
97
+ Numeric zero sentinel used across slab orchestration and helper pipelines.
86
98
 
87
99
  ### SlabBuildContext
88
100
 
@@ -96,31 +108,78 @@ Result of scanning and populating optional gain/plastic slab arrays.
96
108
 
97
109
  Writable slab arrays targeted during connection serialization.
98
110
 
111
+ ### StartIndicesBuildContext
112
+
113
+ Context for constructing CSR start offsets from precomputed fan-out counts.
114
+
115
+ ### TypedArray
116
+
117
+ Union of slab typed array element container types.
118
+
119
+ ### TypedArrayConstructor
120
+
121
+ Constructor type for typed arrays used in slabs.
122
+
123
+ ## architecture/network/slab/network.slab.utils.ts
124
+
125
+ ### canUseFastSlab
126
+
127
+ ```ts
128
+ canUseFastSlab(
129
+ training: boolean,
130
+ ): boolean
131
+ ```
132
+
133
+ Public convenience wrapper exposing fast path eligibility.
134
+ Mirrors `_canUseFastSlab` internal predicate.
135
+
136
+ Parameters:
137
+ - `training` - Whether caller is performing training (disables fast path if true).
138
+
139
+ Returns: True when slab fast path predicates hold.
140
+
99
141
  ### ConnectionSlabView
100
142
 
101
143
  Shape returned by getConnectionSlab describing the packed SoA view.
102
144
 
103
- ### BuildAdjacencyContext
145
+ ### fastSlabActivate
104
146
 
105
- Shared immutable inputs used across the adjacency build pipeline.
147
+ ```ts
148
+ fastSlabActivate(
149
+ input: number[],
150
+ ): number[]
151
+ ```
106
152
 
107
- ### FanOutCollectionContext
153
+ High‑performance forward pass using packed slabs + CSR adjacency.
108
154
 
109
- Context for fan-out collection: build inputs plus the output count buffer.
155
+ Fallback Conditions (auto‑detected):
156
+ - Missing slabs / adjacency structures.
157
+ - Topology/gating/stochastic predicates fail (see `_canUseFastSlab`).
158
+ - Gating present, when applicable (explicit guard).
110
159
 
111
- ### StartIndicesBuildContext
160
+ Implementation Notes:
161
+ - Reuses internal activation/state buffers to reduce per‑step allocation churn.
162
+ - Applies gain multiplication if optional gain slab exists.
163
+ - Assumes acyclic graph; topological order recomputed on demand if marked dirty.
112
164
 
113
- Context for constructing CSR start offsets from precomputed fan-out counts.
165
+ Parameters:
166
+ - `input` - Input vector (length must equal `network.input`).
114
167
 
115
- ### OutgoingOrderBuildContext
168
+ Returns: Output activations (detached plain array) of length `network.output`.
116
169
 
117
- Context for constructing source-grouped outgoing connection order.
170
+ ### getConnectionSlab
118
171
 
119
- ### PublishAdjacencyContext
172
+ ```ts
173
+ getConnectionSlab(): ConnectionSlabView
174
+ ```
120
175
 
121
- Context for publishing fully built adjacency slabs to internal network state.
176
+ Obtain (and lazily rebuild if dirty) the current packed SoA view of connections.
122
177
 
123
- ## architecture/network/slab/network.slab.utils.ts
178
+ Gain Omission: If the internal gain slab is absent (all gains neutral) a synthetic
179
+ neutral array is created and returned (NOT retained) to keep external educational
180
+ tooling branch‑free while preserving omission memory savings internally.
181
+
182
+ Returns: Read‑only style view (do not mutate) containing typed arrays + metadata.
124
183
 
125
184
  ### getSlabAllocationStats
126
185
 
@@ -139,6 +198,16 @@ NOTE: Stats are cumulative (not auto‑reset); callers may diff successive snaps
139
198
 
140
199
  Returns: Plain object copy (safe to serialize) of current allocator counters.
141
200
 
201
+ ### getSlabVersion
202
+
203
+ ```ts
204
+ getSlabVersion(): number
205
+ ```
206
+
207
+ Retrieve current monotonic slab version (increments on each successful rebuild).
208
+
209
+ Returns: Non‑negative integer (0 if slab never built yet).
210
+
142
211
  ### rebuildConnectionSlab
143
212
 
144
213
  ```ts
@@ -188,75 +257,6 @@ Parameters:
188
257
 
189
258
  Returns: Promise resolving once rebuild completes.
190
259
 
191
- ### getConnectionSlab
192
-
193
- ```ts
194
- getConnectionSlab(): ConnectionSlabView
195
- ```
196
-
197
- Obtain (and lazily rebuild if dirty) the current packed SoA view of connections.
198
-
199
- Gain Omission: If the internal gain slab is absent (all gains neutral) a synthetic
200
- neutral array is created and returned (NOT retained) to keep external educational
201
- tooling branch‑free while preserving omission memory savings internally.
202
-
203
- Returns: Read‑only style view (do not mutate) containing typed arrays + metadata.
204
-
205
- ### fastSlabActivate
206
-
207
- ```ts
208
- fastSlabActivate(
209
- input: number[],
210
- ): number[]
211
- ```
212
-
213
- High‑performance forward pass using packed slabs + CSR adjacency.
214
-
215
- Fallback Conditions (auto‑detected):
216
- - Missing slabs / adjacency structures.
217
- - Topology/gating/stochastic predicates fail (see `_canUseFastSlab`).
218
- - Gating present, when applicable (explicit guard).
219
-
220
- Implementation Notes:
221
- - Reuses internal activation/state buffers to reduce per‑step allocation churn.
222
- - Applies gain multiplication if optional gain slab exists.
223
- - Assumes acyclic graph; topological order recomputed on demand if marked dirty.
224
-
225
- Parameters:
226
- - `input` - Input vector (length must equal `network.input`).
227
-
228
- Returns: Output activations (detached plain array) of length `network.output`.
229
-
230
- ### canUseFastSlab
231
-
232
- ```ts
233
- canUseFastSlab(
234
- training: boolean,
235
- ): boolean
236
- ```
237
-
238
- Public convenience wrapper exposing fast path eligibility.
239
- Mirrors `_canUseFastSlab` internal predicate.
240
-
241
- Parameters:
242
- - `training` - Whether caller is performing training (disables fast path if true).
243
-
244
- Returns: True when slab fast path predicates hold.
245
-
246
- ### getSlabVersion
247
-
248
- ```ts
249
- getSlabVersion(): number
250
- ```
251
-
252
- Retrieve current monotonic slab version (increments on each successful rebuild).
253
-
254
- Returns: Non‑negative integer (0 if slab never built yet).
255
-
256
- ### ConnectionSlabView
257
-
258
- Shape returned by getConnectionSlab describing the packed SoA view.
259
-
260
260
  ## architecture/network/slab/network.slab.pool.utils.ts
261
261
 
262
262
  Internal slab pool/stat helpers extracted from network.slab.utils.ts.
@@ -282,25 +282,6 @@ Parameters:
282
282
 
283
283
  Returns: Acquired typed array.
284
284
 
285
- ### _releaseTA
286
-
287
- ```ts
288
- _releaseTA(
289
- kind: string,
290
- bytesPerElement: number,
291
- arr: TypedArray,
292
- ): void
293
- ```
294
-
295
- Releases a typed array back to bounded per-key pool.
296
-
297
- Parameters:
298
- - `kind` - - Pool kind discriminator.
299
- - `bytesPerElement` - - Element byte width for keying.
300
- - `arr` - - Typed array instance to retain when room exists.
301
-
302
- Returns: Nothing.
303
-
304
285
  ### _getSlabAllocationStatsSnapshot
305
286
 
306
287
  ```ts
@@ -311,16 +292,6 @@ Returns allocation stats snapshot for slab typed arrays.
311
292
 
312
293
  Returns: Serializable snapshot of fresh, pooled, and per-key metrics.
313
294
 
314
- ### _slabPoolCap
315
-
316
- ```ts
317
- _slabPoolCap(): number
318
- ```
319
-
320
- Computes retention cap per key.
321
-
322
- Returns: Non-negative max retained arrays per key.
323
-
324
295
  ### _poolKey
325
296
 
326
297
  ```ts
@@ -340,52 +311,66 @@ Parameters:
340
311
 
341
312
  Returns: Stable pool key.
342
313
 
343
- ## architecture/network/slab/network.slab.view.utils.ts
344
-
345
- ### _createConnectionSlabView
314
+ ### _releaseTA
346
315
 
347
316
  ```ts
348
- _createConnectionSlabView(
349
- network: default,
350
- ): ConnectionSlabView
317
+ _releaseTA(
318
+ kind: string,
319
+ bytesPerElement: number,
320
+ arr: TypedArray,
321
+ ): void
351
322
  ```
352
323
 
353
- Creates a read-oriented packed slab view from current network internals.
324
+ Releases a typed array back to bounded per-key pool.
354
325
 
355
326
  Parameters:
356
- - `network` - - Target network.
327
+ - `kind` - - Pool kind discriminator.
328
+ - `bytesPerElement` - - Element byte width for keying.
329
+ - `arr` - - Typed array instance to retain when room exists.
357
330
 
358
- Returns: Packed connection slab view.
331
+ Returns: Nothing.
359
332
 
360
- ### _readSlabVersion
333
+ ### _slabPoolCap
361
334
 
362
335
  ```ts
363
- _readSlabVersion(
336
+ _slabPoolCap(): number
337
+ ```
338
+
339
+ Computes retention cap per key.
340
+
341
+ Returns: Non-negative max retained arrays per key.
342
+
343
+ ## architecture/network/slab/network.slab.view.utils.ts
344
+
345
+ ### _createConnectionSlabView
346
+
347
+ ```ts
348
+ _createConnectionSlabView(
364
349
  network: default,
365
- ): number
350
+ ): ConnectionSlabView
366
351
  ```
367
352
 
368
- Reads the current monotonic slab version from network internals.
353
+ Creates a read-oriented packed slab view from current network internals.
369
354
 
370
355
  Parameters:
371
356
  - `network` - - Target network.
372
357
 
373
- Returns: Non-negative slab version counter.
358
+ Returns: Packed connection slab view.
374
359
 
375
- ### _resolveConnectionSlabCapacity
360
+ ### _readSlabVersion
376
361
 
377
362
  ```ts
378
- _resolveConnectionSlabCapacity(
379
- internalNet: NetworkSlabProps,
363
+ _readSlabVersion(
364
+ network: default,
380
365
  ): number
381
366
  ```
382
367
 
383
- Resolves effective slab capacity using explicit capacity first.
368
+ Reads the current monotonic slab version from network internals.
384
369
 
385
370
  Parameters:
386
- - `internalNet` - - Internal slab runtime shape.
371
+ - `network` - - Target network.
387
372
 
388
- Returns: Effective capacity value.
373
+ Returns: Non-negative slab version counter.
389
374
 
390
375
  ### _resolveConnectionGainView
391
376
 
@@ -404,6 +389,21 @@ Parameters:
404
389
 
405
390
  Returns: Gain array view.
406
391
 
392
+ ### _resolveConnectionSlabCapacity
393
+
394
+ ```ts
395
+ _resolveConnectionSlabCapacity(
396
+ internalNet: NetworkSlabProps,
397
+ ): number
398
+ ```
399
+
400
+ Resolves effective slab capacity using explicit capacity first.
401
+
402
+ Parameters:
403
+ - `internalNet` - - Internal slab runtime shape.
404
+
405
+ Returns: Effective capacity value.
406
+
407
407
  ## architecture/network/slab/network.slab.setup.utils.ts
408
408
 
409
409
  ### _prepareSlabBuildPreconditions
@@ -461,112 +461,63 @@ Returns: Nothing.
461
461
 
462
462
  Internal slab rebuild helper functions extracted from network.slab.utils.ts.
463
463
 
464
- ### _createSlabBuildContext
465
-
466
- ```ts
467
- _createSlabBuildContext(
468
- network: default,
469
- growthFactor: number,
470
- ): SlabBuildContext
471
- ```
472
-
473
- Creates immutable slab build context for one rebuild pass.
474
-
475
- Parameters:
476
- - `network` - - Target network.
477
- - `growthFactor` - - Capacity growth multiplier.
478
-
479
- Returns: Build context.
480
-
481
- ### _shouldSkipSlabRebuild
482
-
483
- ```ts
484
- _shouldSkipSlabRebuild(
485
- internalNet: NetworkSlabProps,
486
- force: boolean,
487
- ): boolean
488
- ```
489
-
490
- Determines whether slab rebuild can be skipped.
491
-
492
- Parameters:
493
- - `internalNet` - - Internal slab runtime shape.
494
- - `force` - - True when rebuild must run regardless of dirty state.
495
-
496
- Returns: True when rebuild can be skipped.
497
-
498
- ### _ensureSlabCapacitySync
464
+ ### _allocateCoreSlabArrays
499
465
 
500
466
  ```ts
501
- _ensureSlabCapacitySync(
467
+ _allocateCoreSlabArrays(
502
468
  buildContext: SlabBuildContext,
503
469
  ): void
504
470
  ```
505
471
 
506
- Ensures sync rebuild has enough slab capacity.
472
+ Allocates core slab arrays (weights/from/to/flags).
507
473
 
508
474
  Parameters:
509
475
  - `buildContext` - - Slab build context.
510
476
 
511
477
  Returns: Nothing.
512
478
 
513
- ### _ensureSlabCapacityAsync
479
+ ### _allocateGainSlabForAsync
514
480
 
515
481
  ```ts
516
- _ensureSlabCapacityAsync(
482
+ _allocateGainSlabForAsync(
517
483
  buildContext: SlabBuildContext,
518
484
  ): void
519
485
  ```
520
486
 
521
- Ensures async rebuild has enough slab capacity.
487
+ Allocates gain slab for async pass prefill strategy.
522
488
 
523
489
  Parameters:
524
490
  - `buildContext` - - Slab build context.
525
491
 
526
492
  Returns: Nothing.
527
493
 
528
- ### _populateSlabConnectionsSync
529
-
530
- ```ts
531
- _populateSlabConnectionsSync(
532
- buildContext: SlabBuildContext,
533
- ): SlabPopulateResult
534
- ```
535
-
536
- Populates core slab arrays in synchronous single pass.
537
-
538
- Parameters:
539
- - `buildContext` - - Slab build context.
540
-
541
- Returns: Population result flags and optional slabs.
542
-
543
- ### _populateSlabConnectionsAsync
494
+ ### _applyGainOmissionPolicy
544
495
 
545
496
  ```ts
546
- _populateSlabConnectionsAsync(
497
+ _applyGainOmissionPolicy(
547
498
  buildContext: SlabBuildContext,
548
- chunkSize: number,
549
- ): Promise<SlabPopulateResult>
499
+ populateResult: SlabPopulateResult,
500
+ ): void
550
501
  ```
551
502
 
552
- Populates core slab arrays in cooperative async chunks.
503
+ Applies gain omission rule by releasing neutral gain slab.
553
504
 
554
505
  Parameters:
555
506
  - `buildContext` - - Slab build context.
556
- - `chunkSize` - - Maximum items per chunk.
507
+ - `populateResult` - - Populate result.
557
508
 
558
- Returns: Population result flags and optional slabs.
509
+ Returns: Nothing.
559
510
 
560
- ### _applyGainOmissionPolicy
511
+ ### _applyPlasticPolicyAsync
561
512
 
562
513
  ```ts
563
- _applyGainOmissionPolicy(
514
+ _applyPlasticPolicyAsync(
564
515
  buildContext: SlabBuildContext,
565
516
  populateResult: SlabPopulateResult,
566
517
  ): void
567
518
  ```
568
519
 
569
- Applies gain omission rule by releasing neutral gain slab.
520
+ Applies async plastic slab allocation/release policy.
570
521
 
571
522
  Parameters:
572
523
  - `buildContext` - - Slab build context.
@@ -591,99 +542,101 @@ Parameters:
591
542
 
592
543
  Returns: Nothing.
593
544
 
594
- ### _applyPlasticPolicyAsync
545
+ ### _createInitialSlabPopulateResult
595
546
 
596
547
  ```ts
597
- _applyPlasticPolicyAsync(
598
- buildContext: SlabBuildContext,
599
- populateResult: SlabPopulateResult,
600
- ): void
548
+ _createInitialSlabPopulateResult(
549
+ internalNet: NetworkSlabProps,
550
+ ): SlabPopulateResult
601
551
  ```
602
552
 
603
- Applies async plastic slab allocation/release policy.
553
+ Creates initial populate result from current optional slab state.
604
554
 
605
555
  Parameters:
606
- - `buildContext` - - Slab build context.
607
- - `populateResult` - - Populate result.
556
+ - `internalNet` - - Internal slab runtime shape.
608
557
 
609
- Returns: Nothing.
558
+ Returns: Initial populate result.
610
559
 
611
- ### _resolveAsyncChunkSize
560
+ ### _createSlabBuildContext
612
561
 
613
562
  ```ts
614
- _resolveAsyncChunkSize(
615
- totalConnections: number,
616
- requestedChunkSize: number,
617
- ): number
563
+ _createSlabBuildContext(
564
+ network: default,
565
+ growthFactor: number,
566
+ ): SlabBuildContext
618
567
  ```
619
568
 
620
- Resolves effective async chunk size using adaptive heuristics.
569
+ Creates immutable slab build context for one rebuild pass.
621
570
 
622
571
  Parameters:
623
- - `totalConnections` - - Number of active connections.
624
- - `requestedChunkSize` - - Requested chunk size.
572
+ - `network` - - Target network.
573
+ - `growthFactor` - - Capacity growth multiplier.
625
574
 
626
- Returns: Effective chunk size.
575
+ Returns: Build context.
627
576
 
628
- ### _finalizeSyncSlabRebuild
577
+ ### _createSlabWriteArrays
629
578
 
630
579
  ```ts
631
- _finalizeSyncSlabRebuild(
580
+ _createSlabWriteArrays(
632
581
  buildContext: SlabBuildContext,
633
- ): void
582
+ ): SlabWriteArrays
634
583
  ```
635
584
 
636
- Finalizes sync rebuild bookkeeping fields.
585
+ Creates strongly typed write-array bundle for connection population.
637
586
 
638
587
  Parameters:
639
588
  - `buildContext` - - Slab build context.
640
589
 
641
- Returns: Nothing.
590
+ Returns: Write-array bundle.
642
591
 
643
- ### _finalizeAsyncSlabRebuild
592
+ ### _ensureGainArrayExistsForIndex
644
593
 
645
594
  ```ts
646
- _finalizeAsyncSlabRebuild(
595
+ _ensureGainArrayExistsForIndex(
647
596
  buildContext: SlabBuildContext,
597
+ populateResult: SlabPopulateResult,
598
+ connectionIndex: number,
648
599
  ): void
649
600
  ```
650
601
 
651
- Finalizes async rebuild bookkeeping fields.
602
+ Ensures gain slab exists before writing non-neutral value.
652
603
 
653
604
  Parameters:
654
605
  - `buildContext` - - Slab build context.
606
+ - `populateResult` - - Mutable populate result.
607
+ - `connectionIndex` - - Current connection index.
655
608
 
656
609
  Returns: Nothing.
657
610
 
658
- ### _weightByteWidth
611
+ ### _ensureSlabCapacityAsync
659
612
 
660
613
  ```ts
661
- _weightByteWidth(
662
- useFloat32Weights: boolean | undefined,
663
- ): number
614
+ _ensureSlabCapacityAsync(
615
+ buildContext: SlabBuildContext,
616
+ ): void
664
617
  ```
665
618
 
666
- Resolves byte width for weight slab arrays.
619
+ Ensures async rebuild has enough slab capacity.
667
620
 
668
621
  Parameters:
669
- - `useFloat32Weights` - - True when 32-bit weights are enabled.
622
+ - `buildContext` - - Slab build context.
670
623
 
671
- Returns: Byte width for weight elements.
624
+ Returns: Nothing.
672
625
 
673
- ### _weightArrayCtor
626
+ ### _ensureSlabCapacitySync
674
627
 
675
628
  ```ts
676
- _weightArrayCtor(
677
- useFloat32Weights: boolean | undefined,
678
- ): Float32ArrayConstructor | Float64ArrayConstructor
629
+ _ensureSlabCapacitySync(
630
+ buildContext: SlabBuildContext,
631
+ ): void
679
632
  ```
680
633
 
681
- Resolves typed-array constructor for weight slabs.
634
+ Ensures sync rebuild has enough slab capacity.
682
635
 
683
636
  Parameters:
684
- - `useFloat32Weights` - - True when 32-bit weights are enabled.
637
+ - `buildContext` - - Slab build context.
685
638
 
686
- Returns: Matching typed-array constructor.
639
+ Returns: Nothing.
687
640
 
688
641
  ### _expandSlabCapacity
689
642
 
@@ -704,177 +657,190 @@ Parameters:
704
657
 
705
658
  Returns: Expanded capacity.
706
659
 
707
- ### _releaseExistingSlabArrays
660
+ ### _fillPlasticityRates
708
661
 
709
662
  ```ts
710
- _releaseExistingSlabArrays(
711
- buildContext: SlabBuildContext,
663
+ _fillPlasticityRates(
664
+ network: default,
665
+ plasticArray: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
666
+ connectionCount: number,
712
667
  ): void
713
668
  ```
714
669
 
715
- Releases all currently allocated slab arrays back to pool.
670
+ Fills plastic slab values from connection plasticity rates.
716
671
 
717
672
  Parameters:
718
- - `buildContext` - - Slab build context.
673
+ - `network` - - Target network.
674
+ - `plasticArray` - - Plastic slab array.
675
+ - `connectionCount` - - Number of active connections.
719
676
 
720
677
  Returns: Nothing.
721
678
 
722
- ### _allocateCoreSlabArrays
679
+ ### _finalizeAsyncSlabRebuild
723
680
 
724
681
  ```ts
725
- _allocateCoreSlabArrays(
682
+ _finalizeAsyncSlabRebuild(
726
683
  buildContext: SlabBuildContext,
727
684
  ): void
728
685
  ```
729
686
 
730
- Allocates core slab arrays (weights/from/to/flags).
687
+ Finalizes async rebuild bookkeeping fields.
731
688
 
732
689
  Parameters:
733
690
  - `buildContext` - - Slab build context.
734
691
 
735
692
  Returns: Nothing.
736
693
 
737
- ### _allocateGainSlabForAsync
694
+ ### _finalizeSharedSlabState
738
695
 
739
696
  ```ts
740
- _allocateGainSlabForAsync(
741
- buildContext: SlabBuildContext,
697
+ _finalizeSharedSlabState(
698
+ internalNet: NetworkSlabProps,
699
+ connectionCount: number,
742
700
  ): void
743
701
  ```
744
702
 
745
- Allocates gain slab for async pass prefill strategy.
703
+ Finalizes shared rebuild bookkeeping fields.
746
704
 
747
705
  Parameters:
748
- - `buildContext` - - Slab build context.
706
+ - `internalNet` - - Internal slab runtime shape.
707
+ - `connectionCount` - - Number of active connections.
749
708
 
750
709
  Returns: Nothing.
751
710
 
752
- ### _resetOptionalSlabArraysAfterSyncAllocate
711
+ ### _finalizeSyncSlabRebuild
753
712
 
754
713
  ```ts
755
- _resetOptionalSlabArraysAfterSyncAllocate(
756
- internalNet: NetworkSlabProps,
714
+ _finalizeSyncSlabRebuild(
715
+ buildContext: SlabBuildContext,
757
716
  ): void
758
717
  ```
759
718
 
760
- Resets optional slabs after sync allocation to keep omission semantics.
719
+ Finalizes sync rebuild bookkeeping fields.
761
720
 
762
721
  Parameters:
763
- - `internalNet` - - Internal slab runtime shape.
722
+ - `buildContext` - - Slab build context.
764
723
 
765
724
  Returns: Nothing.
766
725
 
767
- ### _createSlabWriteArrays
726
+ ### _populateAsyncChunkRange
768
727
 
769
728
  ```ts
770
- _createSlabWriteArrays(
729
+ _populateAsyncChunkRange(
771
730
  buildContext: SlabBuildContext,
772
- ): SlabWriteArrays
731
+ writeArrays: SlabWriteArrays,
732
+ populateResult: SlabPopulateResult,
733
+ startIndex: number,
734
+ endIndex: number,
735
+ ): void
773
736
  ```
774
737
 
775
- Creates strongly typed write-array bundle for connection population.
738
+ Populates one inclusive-exclusive chunk range for async rebuild.
776
739
 
777
740
  Parameters:
778
741
  - `buildContext` - - Slab build context.
742
+ - `writeArrays` - - Core write arrays.
743
+ - `populateResult` - - Mutable populate result.
744
+ - `startIndex` - - Chunk start index.
745
+ - `endIndex` - - Chunk end index.
779
746
 
780
- Returns: Write-array bundle.
747
+ Returns: Nothing.
781
748
 
782
- ### _createInitialSlabPopulateResult
749
+ ### _populateSlabConnectionsAsync
783
750
 
784
751
  ```ts
785
- _createInitialSlabPopulateResult(
786
- internalNet: NetworkSlabProps,
752
+ _populateSlabConnectionsAsync(
753
+ buildContext: SlabBuildContext,
754
+ chunkSize: number,
755
+ ): Promise<SlabPopulateResult>
756
+ ```
757
+
758
+ Populates core slab arrays in cooperative async chunks.
759
+
760
+ Parameters:
761
+ - `buildContext` - - Slab build context.
762
+ - `chunkSize` - - Maximum items per chunk.
763
+
764
+ Returns: Population result flags and optional slabs.
765
+
766
+ ### _populateSlabConnectionsSync
767
+
768
+ ```ts
769
+ _populateSlabConnectionsSync(
770
+ buildContext: SlabBuildContext,
787
771
  ): SlabPopulateResult
788
772
  ```
789
773
 
790
- Creates initial populate result from current optional slab state.
774
+ Populates core slab arrays in synchronous single pass.
791
775
 
792
776
  Parameters:
793
- - `internalNet` - - Internal slab runtime shape.
777
+ - `buildContext` - - Slab build context.
794
778
 
795
- Returns: Initial populate result.
779
+ Returns: Population result flags and optional slabs.
796
780
 
797
- ### _populateAsyncChunkRange
781
+ ### _releaseExistingSlabArrays
798
782
 
799
783
  ```ts
800
- _populateAsyncChunkRange(
784
+ _releaseExistingSlabArrays(
801
785
  buildContext: SlabBuildContext,
802
- writeArrays: SlabWriteArrays,
803
- populateResult: SlabPopulateResult,
804
- startIndex: number,
805
- endIndex: number,
806
786
  ): void
807
787
  ```
808
788
 
809
- Populates one inclusive-exclusive chunk range for async rebuild.
789
+ Releases all currently allocated slab arrays back to pool.
810
790
 
811
791
  Parameters:
812
792
  - `buildContext` - - Slab build context.
813
- - `writeArrays` - - Core write arrays.
814
- - `populateResult` - - Mutable populate result.
815
- - `startIndex` - - Chunk start index.
816
- - `endIndex` - - Chunk end index.
817
793
 
818
794
  Returns: Nothing.
819
795
 
820
- ### _writeConnectionCoreFields
796
+ ### _resetOptionalSlabArraysAfterSyncAllocate
821
797
 
822
798
  ```ts
823
- _writeConnectionCoreFields(
824
- writeArrays: SlabWriteArrays,
825
- connection: ConnectionInternals,
826
- connectionIndex: number,
799
+ _resetOptionalSlabArraysAfterSyncAllocate(
800
+ internalNet: NetworkSlabProps,
827
801
  ): void
828
802
  ```
829
803
 
830
- Writes core fields for one connection into slab arrays.
804
+ Resets optional slabs after sync allocation to keep omission semantics.
831
805
 
832
806
  Parameters:
833
- - `writeArrays` - - Core write arrays.
834
- - `connection` - - Connection internals.
835
- - `connectionIndex` - - Connection index.
807
+ - `internalNet` - - Internal slab runtime shape.
836
808
 
837
809
  Returns: Nothing.
838
810
 
839
- ### _writeConnectionGainField
811
+ ### _resolveAsyncChunkSize
840
812
 
841
813
  ```ts
842
- _writeConnectionGainField(
843
- buildContext: SlabBuildContext,
844
- populateResult: SlabPopulateResult,
845
- connection: ConnectionInternals,
846
- connectionIndex: number,
847
- ): void
814
+ _resolveAsyncChunkSize(
815
+ totalConnections: number,
816
+ requestedChunkSize: number,
817
+ ): number
848
818
  ```
849
819
 
850
- Writes gain field for one connection and updates gain flags.
820
+ Resolves effective async chunk size using adaptive heuristics.
851
821
 
852
822
  Parameters:
853
- - `buildContext` - - Slab build context.
854
- - `populateResult` - - Mutable populate result.
855
- - `connection` - - Connection internals.
856
- - `connectionIndex` - - Connection index.
823
+ - `totalConnections` - - Number of active connections.
824
+ - `requestedChunkSize` - - Requested chunk size.
857
825
 
858
- Returns: Nothing.
826
+ Returns: Effective chunk size.
859
827
 
860
- ### _ensureGainArrayExistsForIndex
828
+ ### _shouldSkipSlabRebuild
861
829
 
862
830
  ```ts
863
- _ensureGainArrayExistsForIndex(
864
- buildContext: SlabBuildContext,
865
- populateResult: SlabPopulateResult,
866
- connectionIndex: number,
867
- ): void
831
+ _shouldSkipSlabRebuild(
832
+ internalNet: NetworkSlabProps,
833
+ force: boolean,
834
+ ): boolean
868
835
  ```
869
836
 
870
- Ensures gain slab exists before writing non-neutral value.
837
+ Determines whether slab rebuild can be skipped.
871
838
 
872
839
  Parameters:
873
- - `buildContext` - - Slab build context.
874
- - `populateResult` - - Mutable populate result.
875
- - `connectionIndex` - - Current connection index.
840
+ - `internalNet` - - Internal slab runtime shape.
841
+ - `force` - - True when rebuild must run regardless of dirty state.
876
842
 
877
- Returns: Nothing.
843
+ Returns: True when rebuild can be skipped.
878
844
 
879
845
  ### _updatePlasticPresence
880
846
 
@@ -893,39 +859,73 @@ Parameters:
893
859
 
894
860
  Returns: Nothing.
895
861
 
896
- ### _fillPlasticityRates
862
+ ### _weightArrayCtor
897
863
 
898
864
  ```ts
899
- _fillPlasticityRates(
900
- network: default,
901
- plasticArray: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
902
- connectionCount: number,
865
+ _weightArrayCtor(
866
+ useFloat32Weights: boolean | undefined,
867
+ ): Float32ArrayConstructor | Float64ArrayConstructor
868
+ ```
869
+
870
+ Resolves typed-array constructor for weight slabs.
871
+
872
+ Parameters:
873
+ - `useFloat32Weights` - - True when 32-bit weights are enabled.
874
+
875
+ Returns: Matching typed-array constructor.
876
+
877
+ ### _weightByteWidth
878
+
879
+ ```ts
880
+ _weightByteWidth(
881
+ useFloat32Weights: boolean | undefined,
882
+ ): number
883
+ ```
884
+
885
+ Resolves byte width for weight slab arrays.
886
+
887
+ Parameters:
888
+ - `useFloat32Weights` - - True when 32-bit weights are enabled.
889
+
890
+ Returns: Byte width for weight elements.
891
+
892
+ ### _writeConnectionCoreFields
893
+
894
+ ```ts
895
+ _writeConnectionCoreFields(
896
+ writeArrays: SlabWriteArrays,
897
+ connection: ConnectionInternals,
898
+ connectionIndex: number,
903
899
  ): void
904
900
  ```
905
901
 
906
- Fills plastic slab values from connection plasticity rates.
902
+ Writes core fields for one connection into slab arrays.
907
903
 
908
904
  Parameters:
909
- - `network` - - Target network.
910
- - `plasticArray` - - Plastic slab array.
911
- - `connectionCount` - - Number of active connections.
905
+ - `writeArrays` - - Core write arrays.
906
+ - `connection` - - Connection internals.
907
+ - `connectionIndex` - - Connection index.
912
908
 
913
909
  Returns: Nothing.
914
910
 
915
- ### _finalizeSharedSlabState
911
+ ### _writeConnectionGainField
916
912
 
917
913
  ```ts
918
- _finalizeSharedSlabState(
919
- internalNet: NetworkSlabProps,
920
- connectionCount: number,
914
+ _writeConnectionGainField(
915
+ buildContext: SlabBuildContext,
916
+ populateResult: SlabPopulateResult,
917
+ connection: ConnectionInternals,
918
+ connectionIndex: number,
921
919
  ): void
922
920
  ```
923
921
 
924
- Finalizes shared rebuild bookkeeping fields.
922
+ Writes gain field for one connection and updates gain flags.
925
923
 
926
924
  Parameters:
927
- - `internalNet` - - Internal slab runtime shape.
928
- - `connectionCount` - - Number of active connections.
925
+ - `buildContext` - - Slab build context.
926
+ - `populateResult` - - Mutable populate result.
927
+ - `connection` - - Connection internals.
928
+ - `connectionIndex` - - Connection index.
929
929
 
930
930
  Returns: Nothing.
931
931
 
@@ -948,35 +948,35 @@ Parameters:
948
948
 
949
949
  Returns: Nothing.
950
950
 
951
- ### createBuildAdjacencyContext
951
+ ### asNetworkSlabProps
952
952
 
953
953
  ```ts
954
- createBuildAdjacencyContext(
954
+ asNetworkSlabProps(
955
955
  network: default,
956
- ): BuildAdjacencyContext | null
956
+ ): NetworkSlabProps
957
957
  ```
958
958
 
959
- Build adjacency context when required slabs are available.
959
+ Cast network instance into internal slab-backed shape.
960
960
 
961
961
  Parameters:
962
962
  - `network` - - Target network.
963
963
 
964
- Returns: Build context or null when adjacency cannot be built yet.
964
+ Returns: Internal slab-backed network representation.
965
965
 
966
- ### collectFanOutCounts
966
+ ### buildOutgoingOrder
967
967
 
968
968
  ```ts
969
- collectFanOutCounts(
970
- buildContext: BuildAdjacencyContext,
969
+ buildOutgoingOrder(
970
+ outgoingOrderBuildContext: OutgoingOrderBuildContext,
971
971
  ): Uint32Array<ArrayBufferLike>
972
972
  ```
973
973
 
974
- Collect fan-out counts for each source node.
974
+ Build source-grouped outgoing order using CSR start offsets.
975
975
 
976
976
  Parameters:
977
- - `buildContext` - - Shared adjacency build context.
977
+ - `outgoingOrderBuildContext` - - Context holding build data and start offsets.
978
978
 
979
- Returns: Fan-out counts per node.
979
+ Returns: Ordered outgoing connection indices.
980
980
 
981
981
  ### buildOutgoingStartIndices
982
982
 
@@ -993,35 +993,35 @@ Parameters:
993
993
 
994
994
  Returns: Outgoing start indices slab.
995
995
 
996
- ### buildOutgoingOrder
996
+ ### collectFanOutCounts
997
997
 
998
998
  ```ts
999
- buildOutgoingOrder(
1000
- outgoingOrderBuildContext: OutgoingOrderBuildContext,
999
+ collectFanOutCounts(
1000
+ buildContext: BuildAdjacencyContext,
1001
1001
  ): Uint32Array<ArrayBufferLike>
1002
1002
  ```
1003
1003
 
1004
- Build source-grouped outgoing order using CSR start offsets.
1004
+ Collect fan-out counts for each source node.
1005
1005
 
1006
1006
  Parameters:
1007
- - `outgoingOrderBuildContext` - - Context holding build data and start offsets.
1007
+ - `buildContext` - - Shared adjacency build context.
1008
1008
 
1009
- Returns: Ordered outgoing connection indices.
1009
+ Returns: Fan-out counts per node.
1010
1010
 
1011
- ### publishAdjacency
1011
+ ### createBuildAdjacencyContext
1012
1012
 
1013
1013
  ```ts
1014
- publishAdjacency(
1015
- publishAdjacencyContext: PublishAdjacencyContext,
1016
- ): void
1014
+ createBuildAdjacencyContext(
1015
+ network: default,
1016
+ ): BuildAdjacencyContext | null
1017
1017
  ```
1018
1018
 
1019
- Publish adjacency slabs and clear dirty flag.
1019
+ Build adjacency context when required slabs are available.
1020
1020
 
1021
1021
  Parameters:
1022
- - `publishAdjacencyContext` - - Values to publish on the internal network slab state.
1022
+ - `network` - - Target network.
1023
1023
 
1024
- Returns: Nothing.
1024
+ Returns: Build context or null when adjacency cannot be built yet.
1025
1025
 
1026
1026
  ### createFanOutCollectionContext
1027
1027
 
@@ -1038,50 +1038,50 @@ Parameters:
1038
1038
 
1039
1039
  Returns: Fan-out collection context.
1040
1040
 
1041
- ### populateFanOutCounts
1041
+ ### createFanOutCountsBuffer
1042
1042
 
1043
1043
  ```ts
1044
- populateFanOutCounts(
1045
- fanOutCollectionContext: FanOutCollectionContext,
1046
- ): void
1044
+ createFanOutCountsBuffer(
1045
+ nodeCount: number,
1046
+ ): Uint32Array<ArrayBufferLike>
1047
1047
  ```
1048
1048
 
1049
- Populate fan-out counts from the connection source slab.
1049
+ Allocate fan-out counts buffer.
1050
1050
 
1051
1051
  Parameters:
1052
- - `fanOutCollectionContext` - - Fan-out collection context.
1052
+ - `nodeCount` - - Number of nodes.
1053
1053
 
1054
- Returns: Nothing.
1054
+ Returns: Zero-initialized fan-out counts.
1055
1055
 
1056
- ### incrementFanOutCountAtSource
1056
+ ### createInsertionCursor
1057
1057
 
1058
1058
  ```ts
1059
- incrementFanOutCountAtSource(
1060
- context: { fanOutCounts: Uint32Array<ArrayBufferLike>; connectionFromSlab: Uint32Array<ArrayBufferLike>; connectionIndex: number; },
1061
- ): void
1059
+ createInsertionCursor(
1060
+ outgoingStartIndices: Uint32Array<ArrayBufferLike>,
1061
+ ): Uint32Array<ArrayBufferLike>
1062
1062
  ```
1063
1063
 
1064
- Increment fan-out count for one connection source index.
1064
+ Create insertion cursor copy from outgoing start indices.
1065
1065
 
1066
1066
  Parameters:
1067
- - `context` - - Increment context.
1067
+ - `outgoingStartIndices` - - Outgoing start indices slab.
1068
1068
 
1069
- Returns: Nothing.
1069
+ Returns: Mutable insertion cursor.
1070
1070
 
1071
- ### createFanOutCountsBuffer
1071
+ ### createOutgoingOrderBuffer
1072
1072
 
1073
1073
  ```ts
1074
- createFanOutCountsBuffer(
1075
- nodeCount: number,
1074
+ createOutgoingOrderBuffer(
1075
+ connectionCount: number,
1076
1076
  ): Uint32Array<ArrayBufferLike>
1077
1077
  ```
1078
1078
 
1079
- Allocate fan-out counts buffer.
1079
+ Allocate outgoing order buffer.
1080
1080
 
1081
1081
  Parameters:
1082
- - `nodeCount` - - Number of nodes.
1082
+ - `connectionCount` - - Number of active connections.
1083
1083
 
1084
- Returns: Zero-initialized fan-out counts.
1084
+ Returns: Outgoing order buffer.
1085
1085
 
1086
1086
  ### createOutgoingStartIndicesBuffer
1087
1087
 
@@ -1098,78 +1098,33 @@ Parameters:
1098
1098
 
1099
1099
  Returns: Outgoing start indices buffer.
1100
1100
 
1101
- ### populateOutgoingStartIndices
1102
-
1103
- ```ts
1104
- populateOutgoingStartIndices(
1105
- context: { fanOutCounts: Uint32Array<ArrayBufferLike>; outgoingStartIndices: Uint32Array<ArrayBufferLike>; },
1106
- ): number
1107
- ```
1108
-
1109
- Populate outgoing start indices and return terminal offset.
1110
-
1111
- Parameters:
1112
- - `context` - - Population context.
1113
-
1114
- Returns: Terminal running offset after the last node.
1115
-
1116
- ### setTerminalOutgoingStartOffset
1117
-
1118
- ```ts
1119
- setTerminalOutgoingStartOffset(
1120
- context: { nodeCount: number; outgoingStartIndices: Uint32Array<ArrayBufferLike>; terminalRunningOffset: number; },
1121
- ): void
1122
- ```
1123
-
1124
- Set terminal outgoing start offset at the tail slot.
1125
-
1126
- Parameters:
1127
- - `context` - - Terminal offset context.
1128
-
1129
- Returns: Nothing.
1130
-
1131
- ### createOutgoingOrderBuffer
1132
-
1133
- ```ts
1134
- createOutgoingOrderBuffer(
1135
- connectionCount: number,
1136
- ): Uint32Array<ArrayBufferLike>
1137
- ```
1138
-
1139
- Allocate outgoing order buffer.
1140
-
1141
- Parameters:
1142
- - `connectionCount` - - Number of active connections.
1143
-
1144
- Returns: Outgoing order buffer.
1145
-
1146
- ### createInsertionCursor
1101
+ ### hasRequiredConnectionSlabs
1147
1102
 
1148
1103
  ```ts
1149
- createInsertionCursor(
1150
- outgoingStartIndices: Uint32Array<ArrayBufferLike>,
1151
- ): Uint32Array<ArrayBufferLike>
1104
+ hasRequiredConnectionSlabs(
1105
+ internalNet: NetworkSlabProps,
1106
+ ): boolean
1152
1107
  ```
1153
1108
 
1154
- Create insertion cursor copy from outgoing start indices.
1109
+ Check whether required connection slabs exist.
1155
1110
 
1156
1111
  Parameters:
1157
- - `outgoingStartIndices` - - Outgoing start indices slab.
1112
+ - `internalNet` - - Internal slab-backed network representation.
1158
1113
 
1159
- Returns: Mutable insertion cursor.
1114
+ Returns: True when adjacency build prerequisites are present.
1160
1115
 
1161
- ### populateOutgoingOrder
1116
+ ### incrementFanOutCountAtSource
1162
1117
 
1163
1118
  ```ts
1164
- populateOutgoingOrder(
1165
- context: { connectionCount: number; connectionFromSlab: Uint32Array<ArrayBufferLike>; outgoingOrder: Uint32Array<ArrayBufferLike>; insertionCursor: Uint32Array<ArrayBufferLike>; },
1119
+ incrementFanOutCountAtSource(
1120
+ context: { fanOutCounts: Uint32Array<ArrayBufferLike>; connectionFromSlab: Uint32Array<ArrayBufferLike>; connectionIndex: number; },
1166
1121
  ): void
1167
1122
  ```
1168
1123
 
1169
- Populate outgoing order by source-grouped insertion.
1124
+ Increment fan-out count for one connection source index.
1170
1125
 
1171
1126
  Parameters:
1172
- - `context` - - Outgoing order population context.
1127
+ - `context` - - Increment context.
1173
1128
 
1174
1129
  Returns: Nothing.
1175
1130
 
@@ -1222,204 +1177,169 @@ Parameters:
1222
1177
 
1223
1178
  Returns: Nothing.
1224
1179
 
1225
- ### hasRequiredConnectionSlabs
1226
-
1227
- ```ts
1228
- hasRequiredConnectionSlabs(
1229
- internalNet: NetworkSlabProps,
1230
- ): boolean
1231
- ```
1232
-
1233
- Check whether required connection slabs exist.
1234
-
1235
- Parameters:
1236
- - `internalNet` - - Internal slab-backed network representation.
1237
-
1238
- Returns: True when adjacency build prerequisites are present.
1239
-
1240
- ### asNetworkSlabProps
1180
+ ### populateFanOutCounts
1241
1181
 
1242
1182
  ```ts
1243
- asNetworkSlabProps(
1244
- network: default,
1245
- ): NetworkSlabProps
1183
+ populateFanOutCounts(
1184
+ fanOutCollectionContext: FanOutCollectionContext,
1185
+ ): void
1246
1186
  ```
1247
1187
 
1248
- Cast network instance into internal slab-backed shape.
1188
+ Populate fan-out counts from the connection source slab.
1249
1189
 
1250
1190
  Parameters:
1251
- - `network` - - Target network.
1252
-
1253
- Returns: Internal slab-backed network representation.
1254
-
1255
- ## architecture/network/slab/network.slab.fast-path.helpers.utils.ts
1191
+ - `fanOutCollectionContext` - - Fan-out collection context.
1256
1192
 
1257
- Internal fast slab activation helpers extracted from network.slab.utils.ts.
1193
+ Returns: Nothing.
1258
1194
 
1259
- ### _canUseFastSlab
1195
+ ### populateOutgoingOrder
1260
1196
 
1261
1197
  ```ts
1262
- _canUseFastSlab(
1263
- training: boolean,
1264
- ): boolean
1198
+ populateOutgoingOrder(
1199
+ context: { connectionCount: number; connectionFromSlab: Uint32Array<ArrayBufferLike>; outgoingOrder: Uint32Array<ArrayBufferLike>; insertionCursor: Uint32Array<ArrayBufferLike>; },
1200
+ ): void
1265
1201
  ```
1266
1202
 
1267
- Predicate gating usage of high-performance slab forward pass.
1203
+ Populate outgoing order by source-grouped insertion.
1268
1204
 
1269
1205
  Parameters:
1270
- - `training` - - Whether caller is in training mode.
1206
+ - `context` - - Outgoing order population context.
1271
1207
 
1272
- Returns: True if fast path can be safely used.
1208
+ Returns: Nothing.
1273
1209
 
1274
- ### _tryFastSlabFallbackForGating
1210
+ ### populateOutgoingStartIndices
1275
1211
 
1276
1212
  ```ts
1277
- _tryFastSlabFallbackForGating(
1278
- network: default,
1279
- input: number[],
1280
- ): number[] | null
1213
+ populateOutgoingStartIndices(
1214
+ context: { fanOutCounts: Uint32Array<ArrayBufferLike>; outgoingStartIndices: Uint32Array<ArrayBufferLike>; },
1215
+ ): number
1281
1216
  ```
1282
1217
 
1283
- Falls back to legacy activation when gating is present.
1218
+ Populate outgoing start indices and return terminal offset.
1284
1219
 
1285
1220
  Parameters:
1286
- - `network` - - Target network.
1287
- - `input` - - Activation input.
1221
+ - `context` - - Population context.
1288
1222
 
1289
- Returns: Legacy output or null when fast path may continue.
1223
+ Returns: Terminal running offset after the last node.
1290
1224
 
1291
- ### _tryFastSlabFallbackForMissingPrerequisites
1225
+ ### publishAdjacency
1292
1226
 
1293
1227
  ```ts
1294
- _tryFastSlabFallbackForMissingPrerequisites(
1295
- network: default,
1296
- internalNet: NetworkSlabProps,
1297
- input: number[],
1298
- ): number[] | null
1228
+ publishAdjacency(
1229
+ publishAdjacencyContext: PublishAdjacencyContext,
1230
+ ): void
1299
1231
  ```
1300
1232
 
1301
- Falls back to legacy activation when slab prerequisites are missing.
1233
+ Publish adjacency slabs and clear dirty flag.
1302
1234
 
1303
1235
  Parameters:
1304
- - `network` - - Target network.
1305
- - `internalNet` - - Internal slab runtime shape.
1306
- - `input` - - Activation input.
1236
+ - `publishAdjacencyContext` - - Values to publish on the internal network slab state.
1307
1237
 
1308
- Returns: Legacy output or null when fast path may continue.
1238
+ Returns: Nothing.
1309
1239
 
1310
- ### _prepareFastSlabRuntime
1240
+ ### setTerminalOutgoingStartOffset
1311
1241
 
1312
1242
  ```ts
1313
- _prepareFastSlabRuntime(
1314
- network: default,
1315
- internalNet: NetworkSlabProps,
1316
- reindexNodes: (network: default) => void,
1243
+ setTerminalOutgoingStartOffset(
1244
+ context: { nodeCount: number; outgoingStartIndices: Uint32Array<ArrayBufferLike>; terminalRunningOffset: number; },
1317
1245
  ): void
1318
1246
  ```
1319
1247
 
1320
- Prepares topology and indices for fast slab pass.
1248
+ Set terminal outgoing start offset at the tail slot.
1321
1249
 
1322
1250
  Parameters:
1323
- - `network` - - Target network.
1324
- - `internalNet` - - Internal slab runtime shape.
1325
- - `reindexNodes` - - Callback used to reindex nodes when needed.
1251
+ - `context` - - Terminal offset context.
1326
1252
 
1327
1253
  Returns: Nothing.
1328
1254
 
1329
- ### _resolveFastTopoOrder
1255
+ ## architecture/network/slab/network.slab.fast-path.helpers.utils.ts
1256
+
1257
+ Internal fast slab activation helpers extracted from network.slab.utils.ts.
1258
+
1259
+ ### _activateThroughLegacyPath
1330
1260
 
1331
1261
  ```ts
1332
- _resolveFastTopoOrder(
1262
+ _activateThroughLegacyPath(
1333
1263
  network: default,
1334
- internalNet: NetworkSlabProps,
1335
- ): FastSlabNodeRuntime[]
1264
+ input: number[],
1265
+ ): number[]
1336
1266
  ```
1337
1267
 
1338
- Resolves topological iteration order for fast slab pass.
1268
+ Executes legacy network activation fallback.
1339
1269
 
1340
1270
  Parameters:
1341
1271
  - `network` - - Target network.
1342
- - `internalNet` - - Internal slab runtime shape.
1272
+ - `input` - - Activation input.
1343
1273
 
1344
- Returns: Topological node order.
1274
+ Returns: Legacy activation output.
1345
1275
 
1346
- ### _ensureFastSlabBuffers
1276
+ ### _canUseFastSlab
1347
1277
 
1348
1278
  ```ts
1349
- _ensureFastSlabBuffers(
1350
- internalNet: NetworkSlabProps,
1351
- nodeCount: number,
1352
- ): void
1279
+ _canUseFastSlab(
1280
+ training: boolean,
1281
+ ): boolean
1353
1282
  ```
1354
1283
 
1355
- Ensures fast activation/state buffers are allocated and shape-compatible.
1284
+ Predicate gating usage of high-performance slab forward pass.
1356
1285
 
1357
1286
  Parameters:
1358
- - `internalNet` - - Internal slab runtime shape.
1359
- - `nodeCount` - - Node count.
1287
+ - `training` - - Whether caller is in training mode.
1360
1288
 
1361
- Returns: Nothing.
1289
+ Returns: True if fast path can be safely used.
1362
1290
 
1363
- ### _seedFastInputLayer
1291
+ ### _collectFastSlabOutput
1364
1292
 
1365
1293
  ```ts
1366
- _seedFastInputLayer(
1294
+ _collectFastSlabOutput(
1367
1295
  network: default,
1368
- input: number[],
1369
1296
  activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1370
- ): void
1297
+ nodeCount: number,
1298
+ ): number[]
1371
1299
  ```
1372
1300
 
1373
- Seeds input-layer activations for fast slab pass.
1301
+ Collects output activations into detached number array.
1374
1302
 
1375
1303
  Parameters:
1376
1304
  - `network` - - Target network.
1377
- - `input` - - Activation input.
1378
1305
  - `activationBuffer` - - Activation buffer.
1306
+ - `nodeCount` - - Node count.
1379
1307
 
1380
- Returns: Nothing.
1308
+ Returns: Output activation array.
1381
1309
 
1382
- ### _propagateFastSlabActivations
1310
+ ### _createFastActivationBuffer
1383
1311
 
1384
1312
  ```ts
1385
- _propagateFastSlabActivations(
1386
- network: default,
1387
- internalNet: NetworkSlabProps,
1388
- topoOrder: FastSlabNodeRuntime[],
1389
- activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1390
- stateBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1391
- ): void
1313
+ _createFastActivationBuffer(
1314
+ useFloat32Activation: boolean,
1315
+ nodeCount: number,
1316
+ ): Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>
1392
1317
  ```
1393
1318
 
1394
- Propagates activations through topology using slab arrays.
1319
+ Creates typed fast activation/state buffer.
1395
1320
 
1396
1321
  Parameters:
1397
- - `network` - - Target network.
1398
- - `internalNet` - - Internal slab runtime shape.
1399
- - `topoOrder` - - Topological node order.
1400
- - `activationBuffer` - - Activation buffer.
1401
- - `stateBuffer` - - State buffer.
1322
+ - `useFloat32Activation` - - True when 32-bit buffer is required.
1323
+ - `nodeCount` - - Node count.
1402
1324
 
1403
- Returns: Nothing.
1325
+ Returns: New typed buffer.
1404
1326
 
1405
- ### _collectFastSlabOutput
1327
+ ### _ensureFastSlabBuffers
1406
1328
 
1407
1329
  ```ts
1408
- _collectFastSlabOutput(
1409
- network: default,
1410
- activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1330
+ _ensureFastSlabBuffers(
1331
+ internalNet: NetworkSlabProps,
1411
1332
  nodeCount: number,
1412
- ): number[]
1333
+ ): void
1413
1334
  ```
1414
1335
 
1415
- Collects output activations into detached number array.
1336
+ Ensures fast activation/state buffers are allocated and shape-compatible.
1416
1337
 
1417
1338
  Parameters:
1418
- - `network` - - Target network.
1419
- - `activationBuffer` - - Activation buffer.
1339
+ - `internalNet` - - Internal slab runtime shape.
1420
1340
  - `nodeCount` - - Node count.
1421
1341
 
1422
- Returns: Output activation array.
1342
+ Returns: Nothing.
1423
1343
 
1424
1344
  ### _hasFastSlabPrerequisites
1425
1345
 
@@ -1436,35 +1356,26 @@ Parameters:
1436
1356
 
1437
1357
  Returns: True when all required slabs/adjacency arrays exist.
1438
1358
 
1439
- ### _activateThroughLegacyPath
1440
-
1441
- ```ts
1442
- _activateThroughLegacyPath(
1443
- network: default,
1444
- input: number[],
1445
- ): number[]
1446
- ```
1447
-
1448
- Executes legacy network activation fallback.
1449
-
1450
- Parameters:
1451
- - `network` - - Target network.
1452
- - `input` - - Activation input.
1453
-
1454
- Returns: Legacy activation output.
1455
-
1456
- ### _recomputeTopologyOrder
1359
+ ### _maybeActivateNonInputNode
1457
1360
 
1458
1361
  ```ts
1459
- _recomputeTopologyOrder(
1362
+ _maybeActivateNonInputNode(
1460
1363
  network: default,
1364
+ node: FastSlabNodeRuntime,
1365
+ nodeIndex: number,
1366
+ stateBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1367
+ activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1461
1368
  ): void
1462
1369
  ```
1463
1370
 
1464
- Recomputes topological order on demand.
1371
+ Activates one non-input node when required.
1465
1372
 
1466
1373
  Parameters:
1467
1374
  - `network` - - Target network.
1375
+ - `node` - - Current node.
1376
+ - `nodeIndex` - - Node index.
1377
+ - `stateBuffer` - - State buffer.
1378
+ - `activationBuffer` - - Activation buffer.
1468
1379
 
1469
1380
  Returns: Nothing.
1470
1381
 
@@ -1487,60 +1398,45 @@ Parameters:
1487
1398
 
1488
1399
  Returns: True when replacement is needed.
1489
1400
 
1490
- ### _createFastActivationBuffer
1491
-
1492
- ```ts
1493
- _createFastActivationBuffer(
1494
- useFloat32Activation: boolean,
1495
- nodeCount: number,
1496
- ): Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>
1497
- ```
1498
-
1499
- Creates typed fast activation/state buffer.
1500
-
1501
- Parameters:
1502
- - `useFloat32Activation` - - True when 32-bit buffer is required.
1503
- - `nodeCount` - - Node count.
1504
-
1505
- Returns: New typed buffer.
1506
-
1507
- ### _writeInputNodeRuntime
1401
+ ### _prepareFastSlabRuntime
1508
1402
 
1509
1403
  ```ts
1510
- _writeInputNodeRuntime(
1511
- node: default,
1512
- inputValue: number,
1404
+ _prepareFastSlabRuntime(
1405
+ network: default,
1406
+ internalNet: NetworkSlabProps,
1407
+ reindexNodes: (network: default) => void,
1513
1408
  ): void
1514
1409
  ```
1515
1410
 
1516
- Writes runtime activation/state for one input node.
1411
+ Prepares topology and indices for fast slab pass.
1517
1412
 
1518
1413
  Parameters:
1519
- - `node` - - Input node.
1520
- - `inputValue` - - Input activation value.
1414
+ - `network` - - Target network.
1415
+ - `internalNet` - - Internal slab runtime shape.
1416
+ - `reindexNodes` - - Callback used to reindex nodes when needed.
1521
1417
 
1522
1418
  Returns: Nothing.
1523
1419
 
1524
- ### _maybeActivateNonInputNode
1420
+ ### _propagateFastSlabActivations
1525
1421
 
1526
1422
  ```ts
1527
- _maybeActivateNonInputNode(
1423
+ _propagateFastSlabActivations(
1528
1424
  network: default,
1529
- node: FastSlabNodeRuntime,
1530
- nodeIndex: number,
1531
- stateBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1425
+ internalNet: NetworkSlabProps,
1426
+ topoOrder: FastSlabNodeRuntime[],
1532
1427
  activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1428
+ stateBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1533
1429
  ): void
1534
1430
  ```
1535
1431
 
1536
- Activates one non-input node when required.
1432
+ Propagates activations through topology using slab arrays.
1537
1433
 
1538
1434
  Parameters:
1539
1435
  - `network` - - Target network.
1540
- - `node` - - Current node.
1541
- - `nodeIndex` - - Node index.
1542
- - `stateBuffer` - - State buffer.
1436
+ - `internalNet` - - Internal slab runtime shape.
1437
+ - `topoOrder` - - Topological node order.
1543
1438
  - `activationBuffer` - - Activation buffer.
1439
+ - `stateBuffer` - - State buffer.
1544
1440
 
1545
1441
  Returns: Nothing.
1546
1442
 
@@ -1573,6 +1469,38 @@ Parameters:
1573
1469
 
1574
1470
  Returns: Nothing.
1575
1471
 
1472
+ ### _recomputeTopologyOrder
1473
+
1474
+ ```ts
1475
+ _recomputeTopologyOrder(
1476
+ network: default,
1477
+ ): void
1478
+ ```
1479
+
1480
+ Recomputes topological order on demand.
1481
+
1482
+ Parameters:
1483
+ - `network` - - Target network.
1484
+
1485
+ Returns: Nothing.
1486
+
1487
+ ### _resolveFastTopoOrder
1488
+
1489
+ ```ts
1490
+ _resolveFastTopoOrder(
1491
+ network: default,
1492
+ internalNet: NetworkSlabProps,
1493
+ ): FastSlabNodeRuntime[]
1494
+ ```
1495
+
1496
+ Resolves topological iteration order for fast slab pass.
1497
+
1498
+ Parameters:
1499
+ - `network` - - Target network.
1500
+ - `internalNet` - - Internal slab runtime shape.
1501
+
1502
+ Returns: Topological node order.
1503
+
1576
1504
  ### _resolveWeightedConnectionValue
1577
1505
 
1578
1506
  ```ts
@@ -1591,3 +1519,75 @@ Parameters:
1591
1519
  - `connectionIndex` - - Connection index.
1592
1520
 
1593
1521
  Returns: Effective weighted value.
1522
+
1523
+ ### _seedFastInputLayer
1524
+
1525
+ ```ts
1526
+ _seedFastInputLayer(
1527
+ network: default,
1528
+ input: number[],
1529
+ activationBuffer: Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>,
1530
+ ): void
1531
+ ```
1532
+
1533
+ Seeds input-layer activations for fast slab pass.
1534
+
1535
+ Parameters:
1536
+ - `network` - - Target network.
1537
+ - `input` - - Activation input.
1538
+ - `activationBuffer` - - Activation buffer.
1539
+
1540
+ Returns: Nothing.
1541
+
1542
+ ### _tryFastSlabFallbackForGating
1543
+
1544
+ ```ts
1545
+ _tryFastSlabFallbackForGating(
1546
+ network: default,
1547
+ input: number[],
1548
+ ): number[] | null
1549
+ ```
1550
+
1551
+ Falls back to legacy activation when gating is present.
1552
+
1553
+ Parameters:
1554
+ - `network` - - Target network.
1555
+ - `input` - - Activation input.
1556
+
1557
+ Returns: Legacy output or null when fast path may continue.
1558
+
1559
+ ### _tryFastSlabFallbackForMissingPrerequisites
1560
+
1561
+ ```ts
1562
+ _tryFastSlabFallbackForMissingPrerequisites(
1563
+ network: default,
1564
+ internalNet: NetworkSlabProps,
1565
+ input: number[],
1566
+ ): number[] | null
1567
+ ```
1568
+
1569
+ Falls back to legacy activation when slab prerequisites are missing.
1570
+
1571
+ Parameters:
1572
+ - `network` - - Target network.
1573
+ - `internalNet` - - Internal slab runtime shape.
1574
+ - `input` - - Activation input.
1575
+
1576
+ Returns: Legacy output or null when fast path may continue.
1577
+
1578
+ ### _writeInputNodeRuntime
1579
+
1580
+ ```ts
1581
+ _writeInputNodeRuntime(
1582
+ node: default,
1583
+ inputValue: number,
1584
+ ): void
1585
+ ```
1586
+
1587
+ Writes runtime activation/state for one input node.
1588
+
1589
+ Parameters:
1590
+ - `node` - - Input node.
1591
+ - `inputValue` - - Input activation value.
1592
+
1593
+ Returns: Nothing.