@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.
- package/.github/copilot-instructions.md +11 -0
- package/.github/skills/trace-analyzer-extension/SKILL.md +3 -3
- package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +1 -1
- package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +1 -1
- package/.github/skills/trace-audit-reporting/SKILL.md +3 -3
- package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +1 -1
- package/package.json +19 -13
- package/plans/Flappy_Bird_Folder_Documentation_Pass.md +4 -4
- package/plans/README.md +24 -0
- package/plans/Roadmap.md +62 -40
- package/plans/analyze-trace-solid-split.plans.md +66 -0
- package/plans/architecture-solid-split.plans.md +9 -15
- package/plans/asciiMaze-typescript-repair.plans.md +1 -1
- package/plans/generate-docs-solid-split.plans.md +87 -0
- package/plans/methods-docs.plans.md +25 -1
- package/plans/methods-solid-split.plans.md +14 -14
- package/plans/neat-docs.plans.md +9 -1
- package/plans/neat-test-surface-repair.plans.md +1 -1
- package/plans/render-docs-html-solid-split.plans.md +68 -0
- package/plans/src-no-explicit-any-cleanup.plans.md +1 -1
- package/plans/utils-docs.plans.md +6 -1
- package/scripts/analyze-trace/analyze-trace.analysis.ts +479 -0
- package/scripts/analyze-trace/analyze-trace.constants.ts +35 -0
- package/scripts/analyze-trace/analyze-trace.io.ts +69 -0
- package/scripts/analyze-trace/analyze-trace.report.ts +100 -0
- package/scripts/analyze-trace/analyze-trace.shared.ts +116 -0
- package/scripts/analyze-trace/analyze-trace.ts +45 -0
- package/scripts/analyze-trace/analyze-trace.types.ts +72 -0
- package/scripts/assets/theme.css +80 -23
- package/scripts/copy-examples.ts +239 -0
- package/scripts/export-onnx.ts +223 -0
- package/scripts/generate-bench-tables.ts +378 -37
- package/scripts/generate-docs/generate-docs.constants.ts +107 -0
- package/scripts/generate-docs/generate-docs.order.ts +355 -0
- package/scripts/generate-docs/generate-docs.state.ts +31 -0
- package/scripts/generate-docs/generate-docs.targets.ts +165 -0
- package/scripts/generate-docs/generate-docs.ts +63 -0
- package/scripts/generate-docs/generate-docs.types.ts +112 -0
- package/scripts/generate-docs/output/generate-docs.output.folder-index.utils.ts +167 -0
- package/scripts/generate-docs/output/generate-docs.output.ordering.utils.ts +353 -0
- package/scripts/generate-docs/output/generate-docs.output.readme.utils.ts +420 -0
- package/scripts/generate-docs/output/generate-docs.output.ts +123 -0
- package/scripts/generate-docs/output/generate-docs.output.warnings.utils.ts +219 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.collection.utils.ts +365 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.jsdoc.utils.ts +373 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.normalize.utils.ts +155 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.render.utils.ts +149 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.signature.utils.ts +289 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.ts +11 -0
- package/scripts/mermaid-cli.mjs +102 -22
- package/scripts/mermaid-cli.ts +736 -0
- package/scripts/render-docs-html/render-docs-html.assets.ts +54 -0
- package/scripts/render-docs-html/render-docs-html.mermaid.ts +245 -0
- package/scripts/{render-docs-html.sidebar.ts → render-docs-html/render-docs-html.navigation.ts} +141 -144
- package/scripts/render-docs-html/render-docs-html.pages.ts +333 -0
- package/scripts/render-docs-html/render-docs-html.shared.ts +333 -0
- package/scripts/render-docs-html/render-docs-html.types.ts +42 -0
- package/scripts/render-docs-html.ts +23 -587
- package/scripts/run-docs.ts +238 -0
- package/scripts/write-dist-docs-pkg.ts +40 -0
- package/src/README.md +75 -75
- package/src/architecture/connection/README.md +5 -5
- package/src/architecture/layer/README.md +508 -508
- package/src/architecture/network/README.md +1458 -1458
- package/src/architecture/network/activate/README.md +694 -694
- package/src/architecture/network/bootstrap/README.md +77 -77
- package/src/architecture/network/connect/README.md +74 -74
- package/src/architecture/network/deterministic/README.md +135 -135
- package/src/architecture/network/evolve/README.md +364 -364
- package/src/architecture/network/gating/README.md +130 -130
- package/src/architecture/network/genetic/README.md +399 -399
- package/src/architecture/network/mutate/README.md +897 -897
- package/src/architecture/network/onnx/README.md +720 -720
- package/src/architecture/network/onnx/export/README.md +728 -728
- package/src/architecture/network/onnx/export/layers/README.md +450 -450
- package/src/architecture/network/onnx/import/README.md +618 -618
- package/src/architecture/network/onnx/schema/README.md +32 -32
- package/src/architecture/network/prune/README.md +245 -245
- package/src/architecture/network/remove/README.md +135 -135
- package/src/architecture/network/runtime/README.md +106 -106
- package/src/architecture/network/serialize/README.md +542 -542
- package/src/architecture/network/slab/README.md +608 -608
- package/src/architecture/network/standalone/README.md +212 -212
- package/src/architecture/network/stats/README.md +84 -84
- package/src/architecture/network/topology/README.md +465 -465
- package/src/architecture/network/training/README.md +200 -200
- package/src/architecture/node/README.md +5 -5
- package/src/architecture/nodePool/README.md +14 -14
- package/src/methods/README.md +99 -99
- package/src/methods/activation/README.md +189 -189
- package/src/methods/cost/README.md +131 -131
- package/src/methods/rate/README.md +86 -86
- package/src/multithreading/README.md +77 -77
- package/src/multithreading/workers/browser/README.md +8 -8
- package/src/multithreading/workers/node/README.md +8 -8
- package/src/neat/README.md +148 -148
- package/src/neat/adaptive/README.md +120 -120
- package/src/neat/adaptive/acceptance/README.md +40 -40
- package/src/neat/adaptive/complexity/README.md +137 -137
- package/src/neat/adaptive/core/README.md +197 -197
- package/src/neat/adaptive/lineage/README.md +90 -90
- package/src/neat/adaptive/mutation/README.md +284 -284
- package/src/neat/compat/README.md +43 -43
- package/src/neat/compat/core/README.md +90 -90
- package/src/neat/diversity/README.md +35 -35
- package/src/neat/diversity/core/README.md +88 -88
- package/src/neat/evaluate/README.md +85 -85
- package/src/neat/evaluate/auto-distance/README.md +75 -75
- package/src/neat/evaluate/entropy-compat/README.md +37 -37
- package/src/neat/evaluate/entropy-sharing/README.md +43 -43
- package/src/neat/evaluate/fitness/README.md +23 -23
- package/src/neat/evaluate/novelty/README.md +120 -120
- package/src/neat/evaluate/objectives/README.md +17 -17
- package/src/neat/evaluate/shared/README.md +94 -94
- package/src/neat/evolve/README.md +96 -96
- package/src/neat/evolve/adaptive/README.md +60 -60
- package/src/neat/evolve/objectives/README.md +63 -63
- package/src/neat/evolve/offspring/README.md +56 -56
- package/src/neat/evolve/population/README.md +171 -171
- package/src/neat/evolve/runtime/README.md +79 -79
- package/src/neat/evolve/speciation/README.md +74 -74
- package/src/neat/evolve/warnings/README.md +10 -10
- package/src/neat/export/README.md +114 -114
- package/src/neat/helpers/README.md +50 -50
- package/src/neat/init/README.md +9 -9
- package/src/neat/lineage/core/README.md +101 -101
- package/src/neat/multiobjective/category/README.md +74 -74
- package/src/neat/multiobjective/crowding/README.md +272 -272
- package/src/neat/multiobjective/dominance/README.md +171 -171
- package/src/neat/multiobjective/fronts/README.md +68 -68
- package/src/neat/multiobjective/metrics/README.md +43 -43
- package/src/neat/multiobjective/objectives/README.md +31 -31
- package/src/neat/multiobjective/shared/README.md +27 -27
- package/src/neat/mutation/README.md +97 -97
- package/src/neat/mutation/add-conn/README.md +115 -115
- package/src/neat/mutation/add-node/README.md +126 -126
- package/src/neat/mutation/flow/README.md +149 -149
- package/src/neat/mutation/repair/README.md +185 -185
- package/src/neat/mutation/select/README.md +117 -117
- package/src/neat/mutation/shared/README.md +32 -32
- package/src/neat/objectives/README.md +25 -25
- package/src/neat/objectives/core/README.md +67 -67
- package/src/neat/pruning/README.md +40 -40
- package/src/neat/pruning/core/README.md +171 -171
- package/src/neat/pruning/facade/README.md +32 -32
- package/src/neat/rng/README.md +104 -104
- package/src/neat/rng/core/README.md +137 -137
- package/src/neat/rng/facade/README.md +50 -50
- package/src/neat/selection/README.md +111 -111
- package/src/neat/selection/core/README.md +227 -227
- package/src/neat/selection/facade/README.md +61 -61
- package/src/neat/shared/README.md +163 -163
- package/src/neat/speciation/README.md +31 -31
- package/src/neat/speciation/threshold/README.md +35 -35
- package/src/neat/species/README.md +25 -25
- package/src/neat/species/core/README.md +20 -20
- package/src/neat/species/core/shared/README.md +18 -18
- package/src/neat/species/history/context/README.md +22 -22
- package/src/neat/telemetry/accessors/README.md +58 -58
- package/src/neat/telemetry/exports/README.md +233 -233
- package/src/neat/telemetry/facade/README.md +252 -252
- package/src/neat/telemetry/facade/archive/README.md +57 -57
- package/src/neat/telemetry/facade/buffer/README.md +43 -43
- package/src/neat/telemetry/facade/lineage/README.md +12 -12
- package/src/neat/telemetry/facade/objectives/README.md +44 -44
- package/src/neat/telemetry/facade/runtime/README.md +26 -26
- package/src/neat/telemetry/facade/species/README.md +27 -27
- package/src/neat/telemetry/metrics/README.md +696 -696
- package/src/neat/telemetry/recorder/README.md +57 -57
- package/src/neat/telemetry/types/README.md +32 -32
- package/src/neat/topology-intent/README.md +75 -75
- package/src/utils/README.md +193 -193
- package/test/examples/asciiMaze/browser-entry/README.md +92 -92
- package/test/examples/asciiMaze/dashboardManager/README.md +109 -109
- package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +28 -28
- package/test/examples/asciiMaze/evolutionEngine/README.md +1527 -1527
- package/test/examples/asciiMaze/mazeMovement/README.md +105 -105
- package/test/examples/asciiMaze/mazeMovement/finalization/README.md +16 -16
- package/test/examples/asciiMaze/mazeMovement/policy/README.md +57 -57
- package/test/examples/asciiMaze/mazeMovement/runtime/README.md +52 -52
- package/test/examples/asciiMaze/mazeMovement/shaping/README.md +46 -46
- package/test/examples/flappy_bird/browser-entry/README.md +508 -508
- package/test/examples/flappy_bird/browser-entry/host/README.md +101 -101
- package/test/examples/flappy_bird/browser-entry/host/resize/README.md +144 -144
- package/test/examples/flappy_bird/browser-entry/network-view/README.md +194 -194
- package/test/examples/flappy_bird/browser-entry/playback/README.md +278 -278
- package/test/examples/flappy_bird/browser-entry/playback/background/README.md +129 -129
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +502 -502
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +139 -139
- package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +10 -10
- package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +43 -43
- package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +30 -30
- package/test/examples/flappy_bird/browser-entry/runtime/README.md +59 -59
- package/test/examples/flappy_bird/browser-entry/visualization/README.md +276 -276
- package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +16 -16
- package/test/examples/flappy_bird/constants/README.md +1070 -1070
- package/test/examples/flappy_bird/environment/README.md +22 -22
- package/test/examples/flappy_bird/evaluation/README.md +32 -32
- package/test/examples/flappy_bird/evaluation/rollout/README.md +141 -141
- package/test/examples/flappy_bird/flappy-evolution-worker/README.md +425 -425
- package/test/examples/flappy_bird/simulation-shared/README.md +170 -170
- package/test/examples/flappy_bird/simulation-shared/observation/README.md +109 -109
- package/test/examples/flappy_bird/trainer/README.md +325 -325
- package/test/examples/flappy_bird/trainer/evaluation/README.md +74 -74
- package/scripts/analyze-trace.ts +0 -590
- package/scripts/copy-examples.mjs +0 -114
- package/scripts/export-onnx.mjs +0 -86
- package/scripts/generate-bench-tables.mjs +0 -182
- package/scripts/generate-docs.ts +0 -2900
- package/scripts/write-dist-docs-pkg.mjs +0 -16
|
@@ -30,60 +30,76 @@ flowchart TD
|
|
|
30
30
|
|
|
31
31
|
## neat/telemetry/facade/archive/telemetry.facade.archive.ts
|
|
32
32
|
|
|
33
|
-
###
|
|
33
|
+
### clearParetoArchive
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
|
-
|
|
36
|
+
clearParetoArchive(
|
|
37
37
|
host: TelemetryFacadeArchiveHost,
|
|
38
|
-
):
|
|
38
|
+
): void
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Clear the Pareto archive metadata stored on the host.
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
archived vectors without leaving the same conceptual boundary.
|
|
43
|
+
Reach for this when a caller wants a fresh archive observation window
|
|
44
|
+
without resetting the rest of the telemetry system.
|
|
46
45
|
|
|
47
46
|
Parameters:
|
|
48
|
-
- `host` - - `Neat` instance whose
|
|
47
|
+
- `host` - - `Neat` instance whose Pareto archive should be emptied.
|
|
49
48
|
|
|
50
|
-
Returns:
|
|
49
|
+
Returns: Nothing. The archive buffer is reset in place.
|
|
50
|
+
|
|
51
|
+
### exportParetoFrontJSONL
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
exportParetoFrontJSONL(
|
|
55
|
+
host: TelemetryFacadeArchiveHost,
|
|
56
|
+
maxEntries: number,
|
|
57
|
+
): string
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Export recent Pareto archive entries as JSON Lines.
|
|
61
|
+
|
|
62
|
+
Prefer this when archive inspection is leaving the process boundary. JSONL is
|
|
63
|
+
easy to append to files, load into notebooks, or post-process with simple
|
|
64
|
+
scripts while preserving one archived snapshot per line.
|
|
65
|
+
|
|
66
|
+
Parameters:
|
|
67
|
+
- `host` - - `Neat` instance storing Pareto objective snapshots.
|
|
68
|
+
- `maxEntries` - - Maximum number of entries to serialize.
|
|
69
|
+
|
|
70
|
+
Returns: JSONL payload for recent Pareto archive entries.
|
|
51
71
|
|
|
52
72
|
Example:
|
|
53
73
|
|
|
54
74
|
```ts
|
|
55
|
-
const
|
|
56
|
-
console.
|
|
75
|
+
const archiveJsonl = exportParetoFrontJSONL(neat, 100);
|
|
76
|
+
console.log(archiveJsonl.split('\n').at(0));
|
|
57
77
|
```
|
|
58
78
|
|
|
59
|
-
###
|
|
79
|
+
### getMultiObjectiveMetrics
|
|
60
80
|
|
|
61
81
|
```ts
|
|
62
|
-
|
|
82
|
+
getMultiObjectiveMetrics(
|
|
63
83
|
host: TelemetryFacadeArchiveHost,
|
|
64
|
-
|
|
65
|
-
): default[][]
|
|
84
|
+
): { rank: number; crowding: number; score: number; nodes: number; connections: number; }[]
|
|
66
85
|
```
|
|
67
86
|
|
|
68
|
-
|
|
87
|
+
Build compact multi-objective metrics for the current population snapshot.
|
|
69
88
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
tests, or teaching material that needs to show how genomes separate into
|
|
74
|
-
dominance layers.
|
|
89
|
+
This chapter keeps the highest-level Pareto inspection helpers together so a
|
|
90
|
+
caller can move from per-genome rank summaries to reconstructed fronts and
|
|
91
|
+
archived vectors without leaving the same conceptual boundary.
|
|
75
92
|
|
|
76
93
|
Parameters:
|
|
77
|
-
- `host` - - `Neat` instance whose population should be
|
|
78
|
-
- `maxFronts` - - Maximum number of fronts to reconstruct.
|
|
94
|
+
- `host` - - `Neat` instance whose population should be summarized.
|
|
79
95
|
|
|
80
|
-
Returns:
|
|
96
|
+
Returns: Rank, crowding, score, and size metrics per genome.
|
|
81
97
|
|
|
82
98
|
Example:
|
|
83
99
|
|
|
84
100
|
```ts
|
|
85
|
-
const
|
|
86
|
-
console.
|
|
101
|
+
const metrics = getMultiObjectiveMetrics(neat);
|
|
102
|
+
console.table(metrics.slice(0, 5));
|
|
87
103
|
```
|
|
88
104
|
|
|
89
105
|
### getParetoArchive
|
|
@@ -114,52 +130,36 @@ const recentArchive = getParetoArchive(neat, 25);
|
|
|
114
130
|
console.log(recentArchive.length);
|
|
115
131
|
```
|
|
116
132
|
|
|
117
|
-
###
|
|
133
|
+
### getParetoFronts
|
|
118
134
|
|
|
119
135
|
```ts
|
|
120
|
-
|
|
136
|
+
getParetoFronts(
|
|
121
137
|
host: TelemetryFacadeArchiveHost,
|
|
122
|
-
|
|
123
|
-
):
|
|
138
|
+
maxFronts: number,
|
|
139
|
+
): default[][]
|
|
124
140
|
```
|
|
125
141
|
|
|
126
|
-
|
|
142
|
+
Reconstruct Pareto fronts from current rank annotations.
|
|
127
143
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
144
|
+
Use this when you want the live frontier grouping itself rather than a flat
|
|
145
|
+
metrics table. The helper rebuilds the front structure from the population's
|
|
146
|
+
current multi-objective annotations, which makes it useful for dashboards,
|
|
147
|
+
tests, or teaching material that needs to show how genomes separate into
|
|
148
|
+
dominance layers.
|
|
131
149
|
|
|
132
150
|
Parameters:
|
|
133
|
-
- `host` - - `Neat` instance
|
|
134
|
-
- `
|
|
151
|
+
- `host` - - `Neat` instance whose population should be partitioned.
|
|
152
|
+
- `maxFronts` - - Maximum number of fronts to reconstruct.
|
|
135
153
|
|
|
136
|
-
Returns:
|
|
154
|
+
Returns: Pareto fronts ordered from best to worst.
|
|
137
155
|
|
|
138
156
|
Example:
|
|
139
157
|
|
|
140
158
|
```ts
|
|
141
|
-
const
|
|
142
|
-
console.log(
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### clearParetoArchive
|
|
146
|
-
|
|
147
|
-
```ts
|
|
148
|
-
clearParetoArchive(
|
|
149
|
-
host: TelemetryFacadeArchiveHost,
|
|
150
|
-
): void
|
|
159
|
+
const fronts = getParetoFronts(neat, 3);
|
|
160
|
+
console.log(fronts.map((front) => front.length));
|
|
151
161
|
```
|
|
152
162
|
|
|
153
|
-
Clear the Pareto archive metadata stored on the host.
|
|
154
|
-
|
|
155
|
-
Reach for this when a caller wants a fresh archive observation window
|
|
156
|
-
without resetting the rest of the telemetry system.
|
|
157
|
-
|
|
158
|
-
Parameters:
|
|
159
|
-
- `host` - - `Neat` instance whose Pareto archive should be emptied.
|
|
160
|
-
|
|
161
|
-
Returns: Nothing. The archive buffer is reset in place.
|
|
162
|
-
|
|
163
163
|
### TelemetryFacadeArchiveHost
|
|
164
164
|
|
|
165
165
|
Narrow telemetry-facade host surface required by the archive chapter.
|
|
@@ -29,31 +29,50 @@ flowchart TD
|
|
|
29
29
|
|
|
30
30
|
## neat/telemetry/facade/buffer/telemetry.facade.buffer.ts
|
|
31
31
|
|
|
32
|
-
###
|
|
32
|
+
### clearTelemetry
|
|
33
33
|
|
|
34
34
|
```ts
|
|
35
|
-
|
|
35
|
+
clearTelemetry(
|
|
36
36
|
host: TelemetryFacadeBufferHost,
|
|
37
|
-
):
|
|
37
|
+
): void
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
Clear cached telemetry entries.
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
concept cluster inside the broader telemetry facade.
|
|
42
|
+
Reach for this when you want a fresh telemetry observation window between
|
|
43
|
+
experiment phases without rebuilding the rest of the controller.
|
|
45
44
|
|
|
46
45
|
Parameters:
|
|
47
|
-
- `host` - - `Neat` instance
|
|
46
|
+
- `host` - - `Neat` instance whose telemetry buffer should be reset.
|
|
48
47
|
|
|
49
|
-
Returns:
|
|
50
|
-
|
|
48
|
+
Returns: Nothing. The helper mutates the host buffer in place.
|
|
49
|
+
|
|
50
|
+
### exportTelemetryCSV
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
exportTelemetryCSV(
|
|
54
|
+
host: TelemetryFacadeBufferHost,
|
|
55
|
+
maxEntries: number,
|
|
56
|
+
): string
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Export recent telemetry entries as CSV for quick spreadsheet inspection.
|
|
60
|
+
|
|
61
|
+
Use this when the consumer is a person first. CSV makes it easy to open a
|
|
62
|
+
recent telemetry window in a spreadsheet or quick table view without having
|
|
63
|
+
to parse nested JSON structures.
|
|
64
|
+
|
|
65
|
+
Parameters:
|
|
66
|
+
- `host` - - `Neat` instance whose telemetry buffer should be exported.
|
|
67
|
+
- `maxEntries` - - Maximum number of recent entries to include.
|
|
68
|
+
|
|
69
|
+
Returns: CSV string containing the requested telemetry window.
|
|
51
70
|
|
|
52
71
|
Example:
|
|
53
72
|
|
|
54
73
|
```ts
|
|
55
|
-
const
|
|
56
|
-
console.log(
|
|
74
|
+
const csv = exportTelemetryCSV(neat, 100);
|
|
75
|
+
console.log(csv.split('\n').slice(0, 3).join('\n'));
|
|
57
76
|
```
|
|
58
77
|
|
|
59
78
|
### exportTelemetryJSONL
|
|
@@ -82,52 +101,33 @@ const jsonl = exportTelemetryJSONL(neat);
|
|
|
82
101
|
console.log(jsonl.split('\n').at(0));
|
|
83
102
|
```
|
|
84
103
|
|
|
85
|
-
###
|
|
104
|
+
### getTelemetry
|
|
86
105
|
|
|
87
106
|
```ts
|
|
88
|
-
|
|
107
|
+
getTelemetry(
|
|
89
108
|
host: TelemetryFacadeBufferHost,
|
|
90
|
-
|
|
91
|
-
): string
|
|
109
|
+
): TelemetryEntry[]
|
|
92
110
|
```
|
|
93
111
|
|
|
94
|
-
|
|
112
|
+
Return the in-memory telemetry buffer.
|
|
95
113
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
114
|
+
This chapter groups the lowest-level telemetry reads with the export helpers
|
|
115
|
+
so callers can treat "inspect the buffer" and "serialize the buffer" as one
|
|
116
|
+
concept cluster inside the broader telemetry facade.
|
|
99
117
|
|
|
100
118
|
Parameters:
|
|
101
|
-
- `host` - - `Neat` instance
|
|
102
|
-
- `maxEntries` - - Maximum number of recent entries to include.
|
|
119
|
+
- `host` - - `Neat` instance storing generation telemetry snapshots.
|
|
103
120
|
|
|
104
|
-
Returns:
|
|
121
|
+
Returns: Telemetry entries captured so far, or an empty array when telemetry
|
|
122
|
+
is not initialized.
|
|
105
123
|
|
|
106
124
|
Example:
|
|
107
125
|
|
|
108
126
|
```ts
|
|
109
|
-
const
|
|
110
|
-
console.log(
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### clearTelemetry
|
|
114
|
-
|
|
115
|
-
```ts
|
|
116
|
-
clearTelemetry(
|
|
117
|
-
host: TelemetryFacadeBufferHost,
|
|
118
|
-
): void
|
|
127
|
+
const recentTelemetry = getTelemetry(neat);
|
|
128
|
+
console.log(recentTelemetry.at(-1)?.gen);
|
|
119
129
|
```
|
|
120
130
|
|
|
121
|
-
Clear cached telemetry entries.
|
|
122
|
-
|
|
123
|
-
Reach for this when you want a fresh telemetry observation window between
|
|
124
|
-
experiment phases without rebuilding the rest of the controller.
|
|
125
|
-
|
|
126
|
-
Parameters:
|
|
127
|
-
- `host` - - `Neat` instance whose telemetry buffer should be reset.
|
|
128
|
-
|
|
129
|
-
Returns: Nothing. The helper mutates the host buffer in place.
|
|
130
|
-
|
|
131
131
|
### TelemetryFacadeBufferHost
|
|
132
132
|
|
|
133
133
|
Narrow telemetry-facade host surface required by the buffer/export chapter.
|
|
@@ -58,14 +58,14 @@ const lineageSnapshot = getLineageSnapshot(neat);
|
|
|
58
58
|
console.log(lineageSnapshot.at(-1)?.parents);
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
###
|
|
61
|
+
### LINEAGE_SNAPSHOT_DEFAULT_LIMIT
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Default limit for lineage snapshots to avoid large payloads.
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
The lineage view is meant for inspection, tests, and compact summaries, not
|
|
66
|
+
for exporting the full ancestry of every genome in a large population. This
|
|
67
|
+
default keeps snapshots small enough to log or render quickly while still
|
|
68
|
+
showing inheritance patterns near the front of the population.
|
|
69
69
|
|
|
70
70
|
### TelemetryFacadeLineageHost
|
|
71
71
|
|
|
@@ -77,11 +77,11 @@ That narrowness is deliberate: the telemetry facade only needs enough data
|
|
|
77
77
|
to build a compact current snapshot, not the broader history and policy
|
|
78
78
|
state owned by the full lineage subsystem.
|
|
79
79
|
|
|
80
|
-
###
|
|
80
|
+
### TelemetryLineageSnapshotEntry
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Compact lineage entry exposed by the telemetry facade.
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
This read model stays intentionally small so inspection helpers can show
|
|
85
|
+
immediate ancestry without exporting full genealogy trees.
|
|
86
|
+
It is meant to answer "who were this genome's parents?" quickly, not to
|
|
87
|
+
preserve every lineage annotation the deeper lineage subsystem may track.
|
|
@@ -28,6 +28,50 @@ flowchart TD
|
|
|
28
28
|
|
|
29
29
|
## neat/telemetry/facade/objectives/telemetry.facade.objectives.ts
|
|
30
30
|
|
|
31
|
+
### clearTelemetryObjectives
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
clearTelemetryObjectives(
|
|
35
|
+
host: TelemetryFacadeObjectivesHost,
|
|
36
|
+
): void
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Remove all registered custom objectives so only the default objective path remains.
|
|
40
|
+
|
|
41
|
+
Reach for this when an experiment wants to reset the objective surface to its
|
|
42
|
+
baseline state without rebuilding the whole controller.
|
|
43
|
+
|
|
44
|
+
Parameters:
|
|
45
|
+
- `host` - - `Neat` instance whose objective registry should be cleared.
|
|
46
|
+
|
|
47
|
+
Returns: Nothing. The helper mutates the objective registry in place.
|
|
48
|
+
|
|
49
|
+
### getObjectiveEvents
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
getObjectiveEvents(
|
|
53
|
+
host: TelemetryFacadeObjectivesHost,
|
|
54
|
+
): { gen: number; type: "add" | "remove"; key: string; }[]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Snapshot recent objective add/remove events for telemetry consumers.
|
|
58
|
+
|
|
59
|
+
This is the historical companion to {@link getObjectives}. The descriptor
|
|
60
|
+
summary tells you what is active now; the event log tells you how the active
|
|
61
|
+
set changed across recent generations.
|
|
62
|
+
|
|
63
|
+
Parameters:
|
|
64
|
+
- `host` - - `Neat` instance storing objective lifecycle events.
|
|
65
|
+
|
|
66
|
+
Returns: Shallow copy of the recorded objective events.
|
|
67
|
+
|
|
68
|
+
Example:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
const recentEvents = getObjectiveEvents(neat);
|
|
72
|
+
console.log(recentEvents.at(-1));
|
|
73
|
+
```
|
|
74
|
+
|
|
31
75
|
### getObjectiveKeys
|
|
32
76
|
|
|
33
77
|
```ts
|
|
@@ -104,50 +148,6 @@ Parameters:
|
|
|
104
148
|
|
|
105
149
|
Returns: Nothing. The objective registry on `host` is updated in place.
|
|
106
150
|
|
|
107
|
-
### clearTelemetryObjectives
|
|
108
|
-
|
|
109
|
-
```ts
|
|
110
|
-
clearTelemetryObjectives(
|
|
111
|
-
host: TelemetryFacadeObjectivesHost,
|
|
112
|
-
): void
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Remove all registered custom objectives so only the default objective path remains.
|
|
116
|
-
|
|
117
|
-
Reach for this when an experiment wants to reset the objective surface to its
|
|
118
|
-
baseline state without rebuilding the whole controller.
|
|
119
|
-
|
|
120
|
-
Parameters:
|
|
121
|
-
- `host` - - `Neat` instance whose objective registry should be cleared.
|
|
122
|
-
|
|
123
|
-
Returns: Nothing. The helper mutates the objective registry in place.
|
|
124
|
-
|
|
125
|
-
### getObjectiveEvents
|
|
126
|
-
|
|
127
|
-
```ts
|
|
128
|
-
getObjectiveEvents(
|
|
129
|
-
host: TelemetryFacadeObjectivesHost,
|
|
130
|
-
): { gen: number; type: "add" | "remove"; key: string; }[]
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Snapshot recent objective add/remove events for telemetry consumers.
|
|
134
|
-
|
|
135
|
-
This is the historical companion to {@link getObjectives}. The descriptor
|
|
136
|
-
summary tells you what is active now; the event log tells you how the active
|
|
137
|
-
set changed across recent generations.
|
|
138
|
-
|
|
139
|
-
Parameters:
|
|
140
|
-
- `host` - - `Neat` instance storing objective lifecycle events.
|
|
141
|
-
|
|
142
|
-
Returns: Shallow copy of the recorded objective events.
|
|
143
|
-
|
|
144
|
-
Example:
|
|
145
|
-
|
|
146
|
-
```ts
|
|
147
|
-
const recentEvents = getObjectiveEvents(neat);
|
|
148
|
-
console.log(recentEvents.at(-1));
|
|
149
|
-
```
|
|
150
|
-
|
|
151
151
|
### TelemetryFacadeObjectivesHost
|
|
152
152
|
|
|
153
153
|
Narrow telemetry-facade host surface required by the objectives chapter.
|
|
@@ -26,32 +26,6 @@ flowchart TD
|
|
|
26
26
|
|
|
27
27
|
## neat/telemetry/facade/runtime/telemetry.facade.runtime.ts
|
|
28
28
|
|
|
29
|
-
### getPerformanceStats
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
getPerformanceStats(
|
|
33
|
-
host: TelemetryFacadeRuntimeHost,
|
|
34
|
-
): { lastEvalMs: number | undefined; lastEvolveMs: number | undefined; }
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Return coarse timing metrics for the last evaluation and evolution passes.
|
|
38
|
-
|
|
39
|
-
Keeping this beside the diversity snapshot helper makes the runtime chapter a
|
|
40
|
-
compact place to inspect the latest controller-health signals without mixing
|
|
41
|
-
them with lineage, species, or archive reads.
|
|
42
|
-
|
|
43
|
-
Parameters:
|
|
44
|
-
- `host` - - `Neat` instance tracking performance timings.
|
|
45
|
-
|
|
46
|
-
Returns: Snapshot of the last evaluation and evolution durations.
|
|
47
|
-
|
|
48
|
-
Example:
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
const performance = getPerformanceStats(neat);
|
|
52
|
-
console.log(performance.lastEvalMs, performance.lastEvolveMs);
|
|
53
|
-
```
|
|
54
|
-
|
|
55
29
|
### getDiversityStats
|
|
56
30
|
|
|
57
31
|
```ts
|
|
@@ -83,6 +57,32 @@ const diversity = getDiversityStats(neat);
|
|
|
83
57
|
console.log(diversity.population, diversity.meanCompat);
|
|
84
58
|
```
|
|
85
59
|
|
|
60
|
+
### getPerformanceStats
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
getPerformanceStats(
|
|
64
|
+
host: TelemetryFacadeRuntimeHost,
|
|
65
|
+
): { lastEvalMs: number | undefined; lastEvolveMs: number | undefined; }
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Return coarse timing metrics for the last evaluation and evolution passes.
|
|
69
|
+
|
|
70
|
+
Keeping this beside the diversity snapshot helper makes the runtime chapter a
|
|
71
|
+
compact place to inspect the latest controller-health signals without mixing
|
|
72
|
+
them with lineage, species, or archive reads.
|
|
73
|
+
|
|
74
|
+
Parameters:
|
|
75
|
+
- `host` - - `Neat` instance tracking performance timings.
|
|
76
|
+
|
|
77
|
+
Returns: Snapshot of the last evaluation and evolution durations.
|
|
78
|
+
|
|
79
|
+
Example:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
const performance = getPerformanceStats(neat);
|
|
83
|
+
console.log(performance.lastEvalMs, performance.lastEvolveMs);
|
|
84
|
+
```
|
|
85
|
+
|
|
86
86
|
### TelemetryFacadeRuntimeHost
|
|
87
87
|
|
|
88
88
|
Narrow telemetry-facade host surface required by the runtime-metrics chapter.
|
|
@@ -91,33 +91,6 @@ const jsonl = exportSpeciesHistoryJSONL(neat, 50);
|
|
|
91
91
|
console.log(jsonl.split('\n').at(0));
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
### getSpeciesStats
|
|
95
|
-
|
|
96
|
-
```ts
|
|
97
|
-
getSpeciesStats(
|
|
98
|
-
host: TelemetryFacadeSpeciesHost,
|
|
99
|
-
): { id: number; size: number; bestScore: number; lastImproved: number; }[]
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Return a concise summary for each current species.
|
|
103
|
-
|
|
104
|
-
This is the "what does the roster look like right now?" read path.
|
|
105
|
-
Reach for it when you want dashboard-friendly state such as current species
|
|
106
|
-
sizes, best scores, and recent improvement markers without paying for the
|
|
107
|
-
heavier historical buffer.
|
|
108
|
-
|
|
109
|
-
Parameters:
|
|
110
|
-
- `host` - - `Neat` instance whose live species registry should be summarized.
|
|
111
|
-
|
|
112
|
-
Returns: Array of current species summaries.
|
|
113
|
-
|
|
114
|
-
Example:
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
const speciesStats = getSpeciesStats(neat);
|
|
118
|
-
console.table(speciesStats);
|
|
119
|
-
```
|
|
120
|
-
|
|
121
94
|
### getSpeciesHistory
|
|
122
95
|
|
|
123
96
|
```ts
|
|
@@ -149,6 +122,33 @@ const speciesHistory = getSpeciesHistory(neat);
|
|
|
149
122
|
console.log(speciesHistory.at(-1));
|
|
150
123
|
```
|
|
151
124
|
|
|
125
|
+
### getSpeciesStats
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
getSpeciesStats(
|
|
129
|
+
host: TelemetryFacadeSpeciesHost,
|
|
130
|
+
): { id: number; size: number; bestScore: number; lastImproved: number; }[]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Return a concise summary for each current species.
|
|
134
|
+
|
|
135
|
+
This is the "what does the roster look like right now?" read path.
|
|
136
|
+
Reach for it when you want dashboard-friendly state such as current species
|
|
137
|
+
sizes, best scores, and recent improvement markers without paying for the
|
|
138
|
+
heavier historical buffer.
|
|
139
|
+
|
|
140
|
+
Parameters:
|
|
141
|
+
- `host` - - `Neat` instance whose live species registry should be summarized.
|
|
142
|
+
|
|
143
|
+
Returns: Array of current species summaries.
|
|
144
|
+
|
|
145
|
+
Example:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
const speciesStats = getSpeciesStats(neat);
|
|
149
|
+
console.table(speciesStats);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
152
|
### TelemetryFacadeSpeciesHost
|
|
153
153
|
|
|
154
154
|
Narrow telemetry-facade host surface required by the species chapter.
|