@reicek/neataptic-ts 0.1.21 → 0.1.22

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 (223) hide show
  1. package/.github/agents/boundary-mapper.agent.md +29 -0
  2. package/.github/agents/docs-scout.agent.md +29 -0
  3. package/.github/agents/plan-scout.agent.md +29 -0
  4. package/.github/agents/solid-split.agent.md +138 -0
  5. package/.github/copilot-instructions.md +103 -0
  6. package/package.json +6 -3
  7. package/plans/ES2023 migration +13 -8
  8. package/plans/Evolution_Training_Interoperability_Contracts.md +1 -1
  9. package/plans/Interactive_Examples_and_Learning_Path.md +10 -2
  10. package/plans/Memory_Optimization.md +3 -3
  11. package/plans/README.md +63 -0
  12. package/plans/Roadmap.md +15 -3
  13. package/plans/asciiMaze_SOLID_split.done.md +130 -0
  14. package/plans/flappy_bird_SOLID_split.done.md +67 -0
  15. package/scripts/assets/theme.css +221 -34
  16. package/scripts/copy-examples.mjs +9 -5
  17. package/scripts/export-onnx.mjs +3 -3
  18. package/scripts/generate-bench-tables.mjs +10 -10
  19. package/scripts/generate-bench-tables.ts +10 -10
  20. package/scripts/generate-docs.ts +1415 -449
  21. package/scripts/render-docs-html.ts +15 -8
  22. package/src/README.md +101 -223
  23. package/src/architecture/README.md +57 -185
  24. package/src/architecture/layer/README.md +38 -38
  25. package/src/architecture/network/README.md +33 -31
  26. package/src/architecture/network/activate/README.md +77 -77
  27. package/src/architecture/network/connect/README.md +15 -13
  28. package/src/architecture/network/deterministic/README.md +7 -7
  29. package/src/architecture/network/evolve/README.md +44 -44
  30. package/src/architecture/network/gating/README.md +20 -20
  31. package/src/architecture/network/genetic/README.md +51 -51
  32. package/src/architecture/network/mutate/README.md +97 -97
  33. package/src/architecture/network/onnx/README.md +264 -264
  34. package/src/architecture/network/prune/README.md +39 -39
  35. package/src/architecture/network/remove/README.md +26 -26
  36. package/src/architecture/network/serialize/README.md +56 -56
  37. package/src/architecture/network/slab/README.md +61 -61
  38. package/src/architecture/network/standalone/README.md +24 -24
  39. package/src/architecture/network/stats/README.md +9 -9
  40. package/src/architecture/network/topology/README.md +46 -46
  41. package/src/architecture/network/training/README.md +21 -21
  42. package/src/methods/README.md +9 -87
  43. package/src/multithreading/README.md +8 -77
  44. package/src/multithreading/workers/README.md +2 -2
  45. package/src/multithreading/workers/browser/README.md +0 -6
  46. package/src/multithreading/workers/node/README.md +0 -3
  47. package/src/neat/README.md +562 -568
  48. package/src/utils/README.md +18 -18
  49. package/test/examples/asciiMaze/README.md +59 -59
  50. package/test/examples/asciiMaze/asciiMaze.e2e.test.ts +14 -9
  51. package/test/examples/asciiMaze/browser-entry/README.md +196 -0
  52. package/test/examples/asciiMaze/browser-entry/browser-entry.abort.services.ts +95 -0
  53. package/test/examples/asciiMaze/browser-entry/browser-entry.constants.ts +23 -0
  54. package/test/examples/asciiMaze/browser-entry/browser-entry.curriculum.services.ts +115 -0
  55. package/test/examples/asciiMaze/browser-entry/browser-entry.globals.services.ts +106 -0
  56. package/test/examples/asciiMaze/browser-entry/browser-entry.host.services.ts +157 -0
  57. package/test/examples/asciiMaze/browser-entry/browser-entry.services.ts +14 -0
  58. package/test/examples/asciiMaze/browser-entry/browser-entry.ts +129 -0
  59. package/test/examples/asciiMaze/browser-entry/browser-entry.types.ts +120 -0
  60. package/test/examples/asciiMaze/browser-entry/browser-entry.utils.ts +98 -0
  61. package/test/examples/asciiMaze/browser-entry.ts +10 -576
  62. package/test/examples/asciiMaze/dashboardManager/README.md +276 -0
  63. package/test/examples/asciiMaze/dashboardManager/archive/README.md +16 -0
  64. package/test/examples/asciiMaze/dashboardManager/archive/dashboardManager.archive.services.ts +267 -0
  65. package/test/examples/asciiMaze/dashboardManager/dashboardManager.constants.ts +35 -0
  66. package/test/examples/asciiMaze/dashboardManager/dashboardManager.services.ts +103 -0
  67. package/test/examples/asciiMaze/dashboardManager/dashboardManager.ts +181 -0
  68. package/test/examples/asciiMaze/dashboardManager/dashboardManager.types.ts +267 -0
  69. package/test/examples/asciiMaze/dashboardManager/dashboardManager.utils.ts +254 -0
  70. package/test/examples/asciiMaze/dashboardManager/live/README.md +14 -0
  71. package/test/examples/asciiMaze/dashboardManager/live/dashboardManager.live.services.ts +264 -0
  72. package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +47 -0
  73. package/test/examples/asciiMaze/dashboardManager/telemetry/dashboardManager.telemetry.services.ts +513 -0
  74. package/test/examples/asciiMaze/dashboardManager.ts +13 -2335
  75. package/test/examples/asciiMaze/evolutionEngine/README.md +1058 -0
  76. package/test/examples/asciiMaze/evolutionEngine/curriculumPhase.ts +90 -0
  77. package/test/examples/asciiMaze/evolutionEngine/engineState.constants.ts +36 -0
  78. package/test/examples/asciiMaze/evolutionEngine/engineState.ts +58 -513
  79. package/test/examples/asciiMaze/evolutionEngine/engineState.types.ts +212 -0
  80. package/test/examples/asciiMaze/evolutionEngine/engineState.utils.ts +301 -0
  81. package/test/examples/asciiMaze/evolutionEngine/evolutionEngine.types.ts +445 -0
  82. package/test/examples/asciiMaze/evolutionEngine/evolutionLoop.ts +81 -50
  83. package/test/examples/asciiMaze/evolutionEngine/optionsAndSetup.ts +2 -4
  84. package/test/examples/asciiMaze/evolutionEngine/populationDynamics.ts +17 -33
  85. package/test/examples/asciiMaze/evolutionEngine/populationPruning.ts +1 -1
  86. package/test/examples/asciiMaze/evolutionEngine/rngAndTiming.ts +1 -2
  87. package/test/examples/asciiMaze/evolutionEngine/sampling.ts +1 -1
  88. package/test/examples/asciiMaze/evolutionEngine/scratchPools.ts +2 -5
  89. package/test/examples/asciiMaze/evolutionEngine/setupHelpers.ts +30 -37
  90. package/test/examples/asciiMaze/evolutionEngine/telemetryMetrics.ts +16 -58
  91. package/test/examples/asciiMaze/evolutionEngine/trainingWarmStart.ts +2 -2
  92. package/test/examples/asciiMaze/evolutionEngine.ts +55 -55
  93. package/test/examples/asciiMaze/fitness.ts +2 -2
  94. package/test/examples/asciiMaze/fitness.types.ts +65 -0
  95. package/test/examples/asciiMaze/interfaces.ts +64 -1352
  96. package/test/examples/asciiMaze/mazeMovement/README.md +356 -0
  97. package/test/examples/asciiMaze/mazeMovement/finalization/README.md +49 -0
  98. package/test/examples/asciiMaze/mazeMovement/finalization/mazeMovement.finalization.ts +138 -0
  99. package/test/examples/asciiMaze/mazeMovement/mazeMovement.constants.ts +101 -0
  100. package/test/examples/asciiMaze/mazeMovement/mazeMovement.services.ts +230 -0
  101. package/test/examples/asciiMaze/mazeMovement/mazeMovement.ts +299 -0
  102. package/test/examples/asciiMaze/mazeMovement/mazeMovement.types.ts +185 -0
  103. package/test/examples/asciiMaze/mazeMovement/mazeMovement.utils.ts +153 -0
  104. package/test/examples/asciiMaze/mazeMovement/policy/README.md +91 -0
  105. package/test/examples/asciiMaze/mazeMovement/policy/mazeMovement.policy.ts +467 -0
  106. package/test/examples/asciiMaze/mazeMovement/runtime/README.md +95 -0
  107. package/test/examples/asciiMaze/mazeMovement/runtime/mazeMovement.runtime.ts +354 -0
  108. package/test/examples/asciiMaze/mazeMovement/shaping/README.md +124 -0
  109. package/test/examples/asciiMaze/mazeMovement/shaping/mazeMovement.shaping.ts +459 -0
  110. package/test/examples/asciiMaze/mazeMovement.ts +12 -2978
  111. package/test/examples/flappy_bird/Trace-20260309T191949.json +24124 -0
  112. package/test/examples/flappy_bird/browser-entry/README.md +1129 -0
  113. package/test/examples/flappy_bird/browser-entry/browser-entry.host.utils.ts +4 -324
  114. package/test/examples/flappy_bird/browser-entry/browser-entry.network-view.utils.ts +6 -399
  115. package/test/examples/flappy_bird/browser-entry/browser-entry.playback.utils.ts +1 -717
  116. package/test/examples/flappy_bird/browser-entry/browser-entry.spawn.utils.ts +11 -31
  117. package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.utils.ts +15 -893
  118. package/test/examples/flappy_bird/browser-entry/host/README.md +307 -0
  119. package/test/examples/flappy_bird/browser-entry/host/host.resize.service.ts +1 -295
  120. package/test/examples/flappy_bird/browser-entry/host/host.ts +562 -6
  121. package/test/examples/flappy_bird/browser-entry/host/resize/README.md +274 -0
  122. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.constants.ts +31 -0
  123. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.services.ts +360 -0
  124. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.ts +117 -0
  125. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.types.ts +63 -0
  126. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.utils.ts +250 -0
  127. package/test/examples/flappy_bird/browser-entry/network-view/README.md +399 -0
  128. package/test/examples/flappy_bird/browser-entry/network-view/network-view.topology.utils.ts +255 -0
  129. package/test/examples/flappy_bird/browser-entry/network-view/network-view.ts +802 -7
  130. package/test/examples/flappy_bird/browser-entry/playback/README.md +684 -0
  131. package/test/examples/flappy_bird/browser-entry/playback/background/README.md +277 -0
  132. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +770 -0
  133. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.cache.services.ts +178 -0
  134. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.constants.ts +107 -0
  135. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.utils.ts +518 -0
  136. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.ts +117 -0
  137. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.ts +233 -0
  138. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.services.ts +211 -0
  139. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.ts +48 -0
  140. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.types.ts +212 -0
  141. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.utils.ts +81 -0
  142. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.cache.services.ts +96 -0
  143. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.constants.ts +62 -0
  144. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.services.ts +244 -0
  145. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.ts +53 -0
  146. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.types.ts +68 -0
  147. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.utils.ts +100 -0
  148. package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +310 -0
  149. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.ts +92 -0
  150. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.services.ts +272 -0
  151. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.types.ts +39 -0
  152. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.utils.ts +493 -0
  153. package/test/examples/flappy_bird/browser-entry/playback/playback.constants.ts +1 -1
  154. package/test/examples/flappy_bird/browser-entry/playback/playback.frame-render.service.ts +4 -0
  155. package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.ts +44 -0
  156. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.service.ts +39 -122
  157. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.services.ts +272 -0
  158. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.types.ts +62 -0
  159. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.utils.ts +11 -4
  160. package/test/examples/flappy_bird/browser-entry/playback/playback.ts +409 -8
  161. package/test/examples/flappy_bird/browser-entry/playback/playback.types.ts +4 -12
  162. package/test/examples/flappy_bird/browser-entry/runtime/README.md +235 -0
  163. package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-launch.service.ts +45 -0
  164. package/test/examples/flappy_bird/browser-entry/runtime/runtime.lifecycle.service.ts +81 -0
  165. package/test/examples/flappy_bird/browser-entry/runtime/runtime.startup.service.ts +74 -0
  166. package/test/examples/flappy_bird/browser-entry/runtime/runtime.ts +31 -121
  167. package/test/examples/flappy_bird/browser-entry/runtime/runtime.types.ts +36 -0
  168. package/test/examples/flappy_bird/browser-entry/visualization/README.md +557 -0
  169. package/test/examples/flappy_bird/browser-entry/visualization/visualization.constants.ts +110 -0
  170. package/test/examples/flappy_bird/browser-entry/visualization/visualization.draw.service.ts +957 -19
  171. package/test/examples/flappy_bird/browser-entry/visualization/visualization.legend.utils.ts +138 -3
  172. package/test/examples/flappy_bird/browser-entry/visualization/visualization.topology.utils.ts +3 -27
  173. package/test/examples/flappy_bird/browser-entry/visualization/visualization.ts +1 -23
  174. package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +156 -0
  175. package/test/examples/flappy_bird/constants/README.md +1179 -0
  176. package/test/examples/flappy_bird/constants/constants.network-view.ts +24 -0
  177. package/test/examples/flappy_bird/constants/constants.palette.ts +7 -0
  178. package/test/examples/flappy_bird/constants/constants.starfield.ts +78 -3
  179. package/test/examples/flappy_bird/environment/README.md +143 -0
  180. package/test/examples/flappy_bird/environment/environment.observation.utils.ts +1 -19
  181. package/test/examples/flappy_bird/environment/environment.step.service.ts +3 -66
  182. package/test/examples/flappy_bird/evaluation/README.md +130 -0
  183. package/test/examples/flappy_bird/evaluation/evaluation.fitness.utils.ts +1 -1
  184. package/test/examples/flappy_bird/evaluation/evaluation.rollout.service.ts +5 -375
  185. package/test/examples/flappy_bird/evaluation/rollout/README.md +291 -0
  186. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.constants.ts +30 -0
  187. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.service.ts +58 -0
  188. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.services.ts +310 -0
  189. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.types.ts +56 -0
  190. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.utils.ts +368 -0
  191. package/test/examples/flappy_bird/flappy-evolution-worker/README.md +618 -0
  192. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.playback.service.ts +7 -7
  193. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.frame.service.ts +364 -0
  194. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.types.ts +14 -0
  195. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.utils.ts +4 -201
  196. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +184 -345
  197. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.warm-start.service.ts +291 -0
  198. package/test/examples/flappy_bird/flappy.simulation.shared.utils.ts +5 -0
  199. package/test/examples/flappy_bird/simulation-shared/README.md +417 -0
  200. package/test/examples/flappy_bird/simulation-shared/observation/README.md +183 -0
  201. package/test/examples/flappy_bird/simulation-shared/observation/observation.features.utils.ts +301 -0
  202. package/test/examples/flappy_bird/simulation-shared/observation/observation.ts +9 -0
  203. package/test/examples/flappy_bird/simulation-shared/observation/observation.vector.utils.ts +59 -0
  204. package/test/examples/flappy_bird/simulation-shared/simulation-shared.observation.utils.ts +5 -403
  205. package/test/examples/flappy_bird/simulation-shared/simulation-shared.spawn.utils.ts +20 -6
  206. package/test/examples/flappy_bird/{evaluation/evaluation.statistics.utils.ts → simulation-shared/simulation-shared.statistics.utils.ts} +23 -8
  207. package/test/examples/flappy_bird/trainer/README.md +563 -0
  208. package/test/examples/flappy_bird/trainer/evaluation/README.md +199 -0
  209. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.constants.ts +9 -0
  210. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.services.ts +73 -0
  211. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.ts +165 -0
  212. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.types.ts +25 -0
  213. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.utils.ts +161 -0
  214. package/test/examples/flappy_bird/trainer/trainer.evaluation.service.ts +13 -0
  215. package/test/examples/flappy_bird/trainer/trainer.report.service.services.ts +181 -0
  216. package/test/examples/flappy_bird/trainer/trainer.report.service.ts +126 -0
  217. package/test/examples/flappy_bird/trainer/trainer.selection.utils.ts +89 -0
  218. package/test/examples/flappy_bird/trainer/trainer.ts +11 -553
  219. package/test/examples/flappy_bird/browser-entry/browser-entry.utils.ts +0 -12
  220. package/test/examples/flappy_bird/environment/environment.ts +0 -7
  221. package/test/examples/flappy_bird/evaluation/evaluation.ts +0 -7
  222. package/test/examples/flappy_bird/simulation-shared/simulation-shared.ts +0 -15
  223. package/test/examples/flappy_bird/trainer/trainer.statistics.utils.ts +0 -78
@@ -0,0 +1,130 @@
1
+ # asciiMaze SOLID Split
2
+
3
+ Purpose
4
+
5
+ - Keep `test/examples/asciiMaze` aligned with the stronger modular example direction established by `test/examples/flappy_bird`.
6
+ - Track only the durable, high-level structural work still needed to reach a strict SOLID, DRY, maintainable end state.
7
+ - Keep this document resumable across sessions.
8
+ - Keep this document short; detailed split design belongs in the implementation step.
9
+
10
+ Progress rules
11
+
12
+ - Use `[]` for a step that is not yet completed.
13
+ - Use `[DONE]` immediately after finishing a step.
14
+ - Update this document whenever the step order changes, a step is added, a step is removed, or the overall plan shifts.
15
+ - Keep completed steps in place so progress is visible when resuming later.
16
+ - Do not expand this file with temporary implementation detail; only record durable high-level progress.
17
+
18
+ Current read
19
+
20
+ - `asciiMaze` is already meaningfully decomposed compared with an older flat layout.
21
+ - The remaining work is concentrated in a small number of large coordination and policy-heavy modules.
22
+ - Confirmed current runtime orchestration order: `browser-entry.ts` bootstraps host services and invokes `EvolutionEngine.runMazeEvolution()`, `evolutionEngine.ts` normalizes and prepares the run, `evolutionEngine/evolutionLoop.ts` owns generation orchestration, `mazeMovement.ts` executes per-agent simulation, and `dashboardManager.ts` emits telemetry back to browser listeners and host globals.
23
+ - The existing Step 2-8 order still matches that flow: split simulation policy first, then presentation, then browser host glue, then shared contracts, and only then collapse the remaining engine-side reporting and runtime adapter seams.
24
+ - Step 2 is now finalized around the dedicated `mazeMovement/` folder boundary: shared simulation types live in `mazeMovement.types.ts`, constants in `mazeMovement.constants.ts`, reusable helpers in `mazeMovement.utils.ts`, pooled mutable infrastructure in `mazeMovement.services.ts`, runtime primitives in `mazeMovement/runtime/mazeMovement.runtime.ts`, action policy in `mazeMovement/policy/mazeMovement.policy.ts`, reward shaping in `mazeMovement/shaping/mazeMovement.shaping.ts`, result assembly in `mazeMovement/finalization/mazeMovement.finalization.ts`, and the public class facade now lives in `mazeMovement/mazeMovement.ts` with the old top-level file reduced to a compatibility re-export.
25
+ - Step 3 is now finalized around the dedicated `dashboardManager/` folder boundary: shared dashboard types live in `dashboardManager.types.ts`, constants in `dashboardManager.constants.ts`, reusable formatting and calculation helpers live in `dashboardManager.utils.ts`, rendering/archive/telemetry orchestration now lives in `dashboardManager.services.ts`, and the public class facade now lives in `dashboardManager/dashboardManager.ts` with the old top-level file reduced to a compatibility re-export.
26
+ - Step 4 is now finalized around the dedicated `browser-entry/` folder boundary: shared browser host contracts live in `browser-entry.types.ts`, host and curriculum constants live in `browser-entry.constants.ts`, DOM resolution and curriculum helpers live in `browser-entry.utils.ts`, host bootstrap/resize wiring/abort composition/globals compatibility/runtime orchestration now live in `browser-entry.services.ts`, and the public browser facade now lives in `browser-entry/browser-entry.ts` with the old top-level file reduced to a compatibility re-export.
27
+ - Step 5 is now finalized around focused contract owners instead of the old `interfaces.ts` dependency bucket: evolution run/configuration and engine-internal helper contracts now live in `evolutionEngine/evolutionEngine.types.ts`, fitness evaluation contracts now live in `fitness.types.ts`, existing browser-entry/dashboardManager/mazeMovement module-owned `*.types.ts` files remain the primary owners for their split boundaries, and the top-level `interfaces.ts` file is now reduced to a narrow shared/core compatibility layer that re-exports moved contracts while retaining only the genuinely cross-cutting network, dashboard-abstraction, maze-run-result, and terminal-result shapes.
28
+ - Step 6 is now finalized around a narrow engine-owned host adapter boundary: `evolutionEngine/evolutionEngine.types.ts` owns the `EvolutionHostAdapter` and stop-event contracts, `evolutionEngine/setupHelpers.ts` now reads cooperative pause state through that adapter instead of polling browser globals directly, `evolutionEngine/evolutionLoop.ts` now reports solve and stop outcomes through the adapter instead of dispatching browser behavior itself, and `browser-entry/browser-entry.globals.services.ts` owns the browser implementation that maps those engine events back to browser globals and solved-event compatibility behavior.
29
+ - Step 7 is now finalized around owner-defined runtime and presentation contracts instead of browser-entry-local runtime shims: `dashboardManager/dashboardManager.types.ts` now owns the shared browser/non-browser presentation seam through `DashboardPresentationAdapter`, `DashboardTelemetryPayload`, and `AsciiMazeTelemetrySnapshot`; `browser-entry/browser-entry.types.ts` now consumes those dashboard-owned contracts for the public run handle and host services instead of defining its own `RuntimeDashboard`/`RuntimeEvolutionResult` adapters; and `evolutionEngine/evolutionEngine.types.ts` now owns the shared run-result and loose runtime helper contracts (`MazeEvolutionRunResult`, tracked network/genome helpers, species-history host) consumed by the engine facade, telemetry helpers, and population-dynamics helpers. The remaining compatibility-only runtime shapes are the browser platform shims in `browser-entry/browser-entry.types.ts` (`RuntimeWindow` and abort-signal helpers), not duplicated presentation or engine result seams.
30
+ - Step 8 is now finalized around an engine-owned curriculum/refinement boundary: `evolutionEngine/curriculumPhase.ts` now owns phase-outcome interpretation, curriculum solve-threshold evaluation, and refined winner carry-over resolution; `browser-entry/browser-entry.curriculum.services.ts` now focuses on browser-only dimension scheduling, animation-frame pacing, and lifecycle completion; and `asciiMaze.e2e.test.ts` now reuses the same engine-owned helper instead of re-implementing winner-refinement carry-over locally. The remaining compatibility surface is the underlying `networkRefinement.ts` implementation, which stays reusable behind the engine-owned curriculum helper rather than being called directly by browser-entry.
31
+ - Step 9 is now finalized around final-shape validation rather than further splitting: the folder-owned boundaries remain `mazeMovement/`, `dashboardManager/`, `browser-entry/`, and `evolutionEngine/`; the top-level compatibility files remain intentionally narrow for stable imports; the engine facade now explicitly documents `resolveMazeEvolutionPhaseOutcome` as a compatibility export owned by `evolutionEngine/curriculumPhase.ts`; and the required final validations succeeded with `npx tsc --noEmit -p tsconfig.json` and `npm run docs`.
32
+
33
+ Split standard
34
+
35
+ - Large or multi-responsibility example files should not be split into a growing pile of sibling files at the same level.
36
+ - When a main file becomes a real module boundary, split it into a dedicated folder that keeps orchestration, contracts, helpers, constants, errors, and services together.
37
+ - The exported main surface should remain easy to find and should keep the module's public orchestration flow.
38
+
39
+ Required naming pattern
40
+
41
+ - For a main module named `module`, prefer:
42
+ - `module/module.ts`
43
+ - `module/module.utils.ts`
44
+ - `module/module.types.ts`
45
+ - `module/module.errors.ts`
46
+ - `module/module.services.ts`
47
+ - `module/module.constants.ts`
48
+
49
+ - For a nested sub-module named `sub-module` inside `module`, prefer:
50
+ - `module/sub-module/module.sub-module.ts`
51
+ - `module/sub-module/module.sub-module.utils.ts`
52
+ - `module/sub-module/module.sub-module.types.ts`
53
+ - `module/sub-module/module.sub-module.errors.ts`
54
+ - `module/sub-module/module.sub-module.services.ts`
55
+ - `module/sub-module/module.sub-module.constants.ts`
56
+
57
+ Naming intent
58
+
59
+ - `*.ts`: main orchestration or primary public surface for that module boundary.
60
+ - `*.utils.ts`: pure or mostly pure helpers that do not define the module's main orchestration.
61
+ - `*.types.ts`: focused types, DTOs, interfaces, and narrow contracts.
62
+ - `*.errors.ts`: named error classes and error helpers local to the module.
63
+ - `*.services.ts`: side-effecting or stateful service helpers used by the orchestration layer.
64
+ - `*.constants.ts`: named constants and lookup tables local to the module.
65
+
66
+ Boundary rules
67
+
68
+ - Do not create dedicated folders for trivial files that are already small and single-purpose.
69
+ - Do create a dedicated folder once a file becomes a real subsystem with multiple helper categories.
70
+ - Keep the top-level `module/module.ts` file orchestration-first rather than turning it into another utility bucket.
71
+ - Prefer subfolders when a subsystem inside a module grows into its own concern, instead of continuing to append helper files to the parent module folder.
72
+ - Keep runtime-host glue, domain policy, rendering, telemetry, and shared contracts in separate files once they stop being tiny.
73
+
74
+ asciiMaze target shape
75
+
76
+ - `evolutionEngine.ts` should continue toward a dedicated `evolutionEngine/` orchestration-first module, which is already the correct direction.
77
+ - `mazeMovement.ts` should move toward a dedicated `mazeMovement/` folder rather than being split into multiple top-level siblings.
78
+ - `dashboardManager.ts` should move toward a dedicated `dashboardManager/` folder with rendering, archive, telemetry, and formatting boundaries.
79
+ - `browser-entry.ts` should move toward a dedicated `browser-entry/` folder that separates host bootstrap, runtime orchestration, globals compatibility, and resize behavior.
80
+ - `interfaces.ts` should be replaced by narrower module-local `*.types.ts` files plus a smaller shared contract surface where truly needed.
81
+
82
+ High-level gaps
83
+
84
+ - `mazeMovement.ts` is still a god module.
85
+ - It mixes simulation state, pooled buffers, action policy, exploration heuristics, reward shaping, saturation handling, and result finalization.
86
+ - Shared static mutable state in `mazeMovement.ts` weakens substitutability, test isolation, and future worker-safe reuse.
87
+ - When split, this should become a dedicated `mazeMovement/` folder instead of several new top-level files.
88
+
89
+ - `browser-entry.ts` still combines host bootstrapping with runtime policy.
90
+ - It currently handles DOM lookup, logger wiring, dashboard setup, resize behavior, abort composition, curriculum progression, best-network carry-over, compatibility globals, and auto-start behavior.
91
+ - This should be split into smaller host/runtime/bootstrap services so the browser entry becomes thin orchestration only.
92
+ - When split, prefer a dedicated `browser-entry/` folder with runtime, host, globals, and resize sub-areas.
93
+
94
+ - Runtime shape adapters are now mostly centralized in owning module boundaries.
95
+ - Engine-side loose runtime helper contracts now live in `evolutionEngine/evolutionEngine.types.ts`, and browser/non-browser presentation contracts now live in `dashboardManager/dashboardManager.types.ts`.
96
+ - Remaining runtime-specific shapes are limited to browser platform compatibility helpers rather than duplicated presentation or evolution-result adapters.
97
+
98
+ - Browser and non-browser presentation concerns are now more parallel.
99
+ - Host-specific browser wiring now depends on the shared dashboard-owned presentation model instead of re-declaring telemetry and redraw seams locally.
100
+ - Remaining follow-up work is concentrated in refinement, curriculum, and evolution orchestration boundaries rather than presentation-contract drift.
101
+
102
+ - Refinement, curriculum progression, and evolution orchestration now have clearer owners.
103
+ - The engine-owned curriculum helper interprets completed run results and refines carry-over winners, while browser-entry stays focused on host scheduling and maze-dimension progression.
104
+ - Future changes to winner refinement or curriculum carry-over policy should now land in the engine boundary instead of cross-cutting browser-entry and curriculum-style callers.
105
+
106
+ Execution steps
107
+
108
+ - [DONE] Step 1: Audit the remaining `asciiMaze` coordination-heavy surfaces and confirm the execution order across `mazeMovement`, `dashboardManager`, `browser-entry`, shared contracts, and engine-side reporting seams.
109
+ - [DONE] Step 2: Split `mazeMovement.ts` into a dedicated `mazeMovement/` module boundary so simulation state, pooled buffers, action policy, exploration heuristics, reward shaping, saturation handling, and result finalization stop accumulating in one file.
110
+ - [DONE] Step 3: Split `dashboardManager.ts` into a dedicated `dashboardManager/` module boundary so live rendering, solved-archive rendering, telemetry aggregation, bounded history storage, event emission, and formatting evolve behind focused files.
111
+ - [DONE] Step 4: Thin `browser-entry.ts` into a dedicated `browser-entry/` module boundary so host bootstrap, runtime orchestration, globals compatibility, and resize behavior evolve independently.
112
+ - [DONE] Step 5: Decompose `interfaces.ts` into focused module-owned `*.types.ts` files and leave behind only the smallest shared contract surface that is still truly cross-cutting.
113
+ - [DONE] Step 6: Remove browser-facing solve, stop, and pause side effects from engine internals so `evolutionEngine` reports through a narrower adapter or reporting boundary instead of touching host behavior directly.
114
+ - [DONE] Step 7: Consolidate scattered runtime shape adapters and presentation seams so browser and non-browser paths depend on clearer shared contracts rather than ad hoc local `Runtime*` compensating interfaces.
115
+ - [DONE] Step 8: Recheck refinement, curriculum, and evolution boundaries so follow-up changes do not reintroduce cross-cutting orchestration drift after the earlier splits.
116
+ - [DONE] Step 9: Validate the final shape by checking naming consistency, folder ownership, generated-doc expectations, and TypeScript/build health.
117
+
118
+ Execution expectation
119
+
120
+ - Each major split should create a dedicated folder first, then move one helper category at a time.
121
+ - Preserve the public entry surface in the main module file inside that folder.
122
+ - Avoid introducing one-off naming styles for each refactor; use the module and sub-module naming pattern above.
123
+
124
+ Done criteria
125
+
126
+ - No single demo file remains the obvious coordination sink for multiple unrelated responsibilities.
127
+ - Host glue, simulation policy, telemetry aggregation, and rendering each have clear module boundaries.
128
+ - Shared contracts are focused enough that runtime-specific adapters stop proliferating.
129
+ - The example remains educational, but the top-level flow becomes orchestration rather than implementation-heavy.
130
+ - Dedicated folders, file names, and subfolder names follow one predictable pattern instead of ad hoc split layouts.
@@ -0,0 +1,67 @@
1
+ # flappy_bird SOLID Split
2
+
3
+ Purpose
4
+
5
+ - Keep `test/examples/flappy_bird` as the reference demo for SOLID, modular example work.
6
+ - Keep this document resumable across sessions.
7
+ - Keep this document high level only.
8
+ - Keep implementation details, temporary file maps, and short-lived decisions in the chat session rather than in this file.
9
+
10
+ Progress rules
11
+
12
+ - Use `[]` for a step that is not yet completed.
13
+ - Use `[DONE]` immediately after finishing a step.
14
+ - Update this document whenever the step order changes, a step is added, a step is removed, or the overall plan shifts.
15
+ - Keep completed steps in place so progress is visible when resuming later.
16
+ - Do not expand this file with temporary implementation detail; only record durable high-level progress.
17
+
18
+ Split standard
19
+
20
+ - Large or multi-responsibility demo files should not grow into a wider pile of sibling files at the same folder level.
21
+ - When an area becomes a real subsystem, move it into a dedicated folder that keeps orchestration, contracts, helpers, constants, errors, and services together.
22
+ - Keep the main exported module file as the easiest entry point and keep it orchestration-first.
23
+ - Prefer dedicated subfolders once a subsystem has clear internal categories.
24
+ - Preserve domain-scoped constants instead of recentralizing them.
25
+
26
+ Naming pattern
27
+
28
+ - Main module pattern:
29
+ - `module/module.ts`
30
+ - `module/module.utils.ts`
31
+ - `module/module.types.ts`
32
+ - `module/module.errors.ts`
33
+ - `module/module.services.ts`
34
+ - `module/module.constants.ts`
35
+
36
+ - Nested sub-module pattern:
37
+ - `module/sub-module/module.sub-module.ts`
38
+ - `module/sub-module/module.sub-module.utils.ts`
39
+ - `module/sub-module/module.sub-module.types.ts`
40
+ - `module/sub-module/module.sub-module.errors.ts`
41
+ - `module/sub-module/module.sub-module.services.ts`
42
+ - `module/sub-module/module.sub-module.constants.ts`
43
+
44
+ Execution steps
45
+
46
+ - [DONE] Step 1: Audit `browser-entry` utility surfaces and confirm which broad files still need dedicated subfolder splits.
47
+ - [DONE] Step 2: Continue the `browser-entry/playback/` split so playback orchestration, rendering support, and snapshot interpretation stay in focused module-owned files.
48
+ - [DONE] Step 3: Continue the `browser-entry/visualization/` split so visualization orchestration, layout, rendering, and interpretation responsibilities stay separate.
49
+ - [DONE] Step 4: Continue the `browser-entry/network-view/` split so layout, color semantics, labeling, and draw-time interpretation do not collapse into one broad utility surface.
50
+ - [DONE] Step 5: Continue the `browser-entry/host/` split so DOM assembly stays compositional and host setup does not keep accumulating in one utility file.
51
+ - [DONE] Step 6: Keep `trainer/trainer.ts` orchestration-first by moving reporting, policy, planning, and stop-control details behind trainer-owned helpers and services.
52
+ - [DONE] Step 7: Keep the worker entry surface thin by preserving `flappy-evolution-worker` as a protocol-first boundary with playback, simulation, evolution, and runtime details behind worker-owned modules.
53
+ - [DONE] Step 8: Continue splitting `simulation-shared` observation assembly so shared observation logic does not reform into a broad policy hub.
54
+ - [DONE] Step 9: Recheck the browser visualization and network-view path for responsibility drift after the earlier splits, and realign any overlap back into explicit module boundaries.
55
+ - [DONE] Step 10: Validate the final shape by checking naming consistency, folder ownership, generated-doc expectations, and TypeScript/build health.
56
+ - [DONE] Step 11: Extract playback background composition into a dedicated background submodule so sky, horizon, and future ground parallax can evolve independently.
57
+ - [DONE] Step 12: Extract host resize orchestration, layout math, and DOM mutation helpers into a dedicated `host/resize/` submodule so responsive layout policies evolve without bloating the host root.
58
+ - [DONE] Step 13: Extract playback starfield contracts and tile-render mechanics into dedicated starfield-owned files so cache orchestration stays thin and reusable.
59
+ - [DONE] Step 14: Extract evaluation rollout orchestration into a dedicated `evaluation/rollout/` submodule so runtime state, policy, shaping helpers, and rollout-local contracts evolve behind one stable public entry.
60
+
61
+ Done criteria
62
+
63
+ - Browser runtime files read as orchestration over focused services rather than large utility buckets.
64
+ - Trainer and worker entrypoints stay thin, with domain logic living behind explicit service boundaries.
65
+ - Visualization, observation, playback, and host setup each evolve independently without overlapping responsibility.
66
+ - Dedicated folders, file names, and subfolder names continue following one predictable pattern instead of drifting into ad hoc layouts.
67
+ - The demo remains the stronger reference shape that other examples can copy and resume cleanly.
@@ -1,34 +1,221 @@
1
- :root{--bg:#0b0f14;--panel:#121a24;--panel-2:#0f1722;--text:#d7e4f3;--muted:#8aa0b8;--line:#263446;--brand:#5a86ff;--brand-2:#88a8ff;--code:#0f141c}
2
- *{box-sizing:border-box}
3
- html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:'Open Sans',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}
4
- a{color:var(--brand-2);text-decoration:none}
5
- a:hover{text-decoration:underline}
6
- .topbar{position:sticky;top:0;z-index:30;background:rgba(10,14,20,.9);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
7
- .topbar .inner{max-width:1400px;margin:0 auto;padding:12px 18px;display:flex;align-items:center;justify-content:space-between;gap:20px}
8
- .brand a{font-family:'Raleway',sans-serif;font-weight:700;color:#fff;font-size:1.1rem}
9
- .main-nav{display:flex;gap:14px;flex-wrap:wrap}
10
- .main-nav a{padding:6px 10px;border-radius:8px;color:var(--muted)}
11
- .main-nav a.active,.main-nav a:hover{background:#1a2533;color:#fff;text-decoration:none}
12
- .layout{max-width:1400px;margin:0 auto;display:grid;grid-template-columns:280px minmax(0,1fr)280px;gap:20px;padding:20px 18px 30px}
13
- .sidebar,.toc{position:sticky;top:72px;max-height:calc(100vh - 90px);overflow:auto;background:var(--panel-2);border:1px solid var(--line);border-radius:12px;padding:12px}
14
- .content{min-width:0;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:24px}
15
- .sidebar-sections{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}
16
- .sidebar-sections ul{list-style:none;padding-left:12px;margin:8px 0 0}
17
- .sidebar-sections li a{display:block;padding:5px 8px;border-radius:7px;color:var(--muted)}
18
- .sidebar-sections li.current>a,.sidebar-sections li a:hover{background:#1a2533;color:#fff;text-decoration:none}
19
- .g-head{font-family:'Raleway',sans-serif;font-weight:700;color:#c7d6ea;padding:6px 8px}
20
- h1,h2,h3,h4{font-family:'Raleway',sans-serif;color:#fff;line-height:1.25}
21
- h1{margin-top:0}
22
- p,li,td,th{line-height:1.6}
23
- pre,code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
24
- code{background:var(--code);padding:.1rem .35rem;border-radius:6px;border:1px solid #1c2634}
25
- pre{background:var(--code);padding:14px;border-radius:10px;border:1px solid #1c2634;overflow:auto}
26
- table{width:100%;border-collapse:collapse;display:block;overflow:auto}
27
- th,td{border:1px solid var(--line);padding:8px 10px;text-align:left}
28
- th{background:#172231}
29
- blockquote{margin:0;padding:12px 14px;border-left:3px solid var(--brand);background:#121d2b;border-radius:8px}
30
- .page-toc h2{margin:0 0 8px}
31
- .toc-file{margin:0 0 8px}
32
- .site-footer{margin-top:28px;padding-top:14px;border-top:1px solid var(--line);color:var(--muted);font-size:.92rem}
33
- @media (max-width:1180px){.layout{grid-template-columns:260px minmax(0,1fr)}.toc{display:none}}
34
- @media (max-width:900px){.layout{grid-template-columns:1fr}.sidebar{position:static;max-height:none}.content{padding:18px}}
1
+ :root {
2
+ --bg: #0b0f14;
3
+ --panel: #121a24;
4
+ --panel-2: #0f1722;
5
+ --text: #d7e4f3;
6
+ --muted: #8aa0b8;
7
+ --line: #263446;
8
+ --brand: #5a86ff;
9
+ --brand-2: #88a8ff;
10
+ --code: #0f141c;
11
+ }
12
+ * {
13
+ box-sizing: border-box;
14
+ }
15
+ html,
16
+ body {
17
+ margin: 0;
18
+ padding: 0;
19
+ background: var(--bg);
20
+ color: var(--text);
21
+ font-family:
22
+ 'Open Sans',
23
+ system-ui,
24
+ -apple-system,
25
+ Segoe UI,
26
+ Roboto,
27
+ Arial,
28
+ sans-serif;
29
+ }
30
+ a {
31
+ color: var(--brand-2);
32
+ text-decoration: none;
33
+ }
34
+ a:hover {
35
+ text-decoration: underline;
36
+ }
37
+ .topbar {
38
+ position: sticky;
39
+ top: 0;
40
+ z-index: 30;
41
+ background: rgba(10, 14, 20, 0.9);
42
+ backdrop-filter: blur(8px);
43
+ border-bottom: 1px solid var(--line);
44
+ }
45
+ .topbar .inner {
46
+ max-width: 1400px;
47
+ margin: 0 auto;
48
+ padding: 12px 18px;
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: space-between;
52
+ gap: 20px;
53
+ }
54
+ .brand a {
55
+ font-family: 'Raleway', sans-serif;
56
+ font-weight: 700;
57
+ color: #fff;
58
+ font-size: 1.1rem;
59
+ }
60
+ .main-nav {
61
+ display: flex;
62
+ gap: 14px;
63
+ flex-wrap: wrap;
64
+ }
65
+ .main-nav a {
66
+ padding: 6px 10px;
67
+ border-radius: 8px;
68
+ color: var(--muted);
69
+ }
70
+ .main-nav a.active,
71
+ .main-nav a:hover {
72
+ background: #1a2533;
73
+ color: #fff;
74
+ text-decoration: none;
75
+ }
76
+ .layout {
77
+ max-width: 1400px;
78
+ margin: 0 auto;
79
+ display: grid;
80
+ grid-template-columns: 280px minmax(0, 1fr) 280px;
81
+ gap: 20px;
82
+ padding: 20px 18px 30px;
83
+ }
84
+ .sidebar,
85
+ .toc {
86
+ position: sticky;
87
+ top: 72px;
88
+ max-height: calc(100vh - 90px);
89
+ overflow: auto;
90
+ background: var(--panel-2);
91
+ border: 1px solid var(--line);
92
+ border-radius: 12px;
93
+ padding: 12px;
94
+ }
95
+ .content {
96
+ min-width: 0;
97
+ background: var(--panel);
98
+ border: 1px solid var(--line);
99
+ border-radius: 12px;
100
+ padding: 24px;
101
+ }
102
+ .sidebar-sections {
103
+ list-style: none;
104
+ padding: 0;
105
+ margin: 0;
106
+ display: flex;
107
+ flex-direction: column;
108
+ gap: 8px;
109
+ }
110
+ .sidebar-sections ul {
111
+ list-style: none;
112
+ padding-left: 12px;
113
+ margin: 8px 0 0;
114
+ }
115
+ .sidebar-sections li a {
116
+ display: block;
117
+ padding: 5px 8px;
118
+ border-radius: 7px;
119
+ color: var(--muted);
120
+ }
121
+ .sidebar-sections li.current > a,
122
+ .sidebar-sections li a:hover {
123
+ background: #1a2533;
124
+ color: #fff;
125
+ text-decoration: none;
126
+ }
127
+ .g-head {
128
+ font-family: 'Raleway', sans-serif;
129
+ font-weight: 700;
130
+ color: #c7d6ea;
131
+ padding: 6px 8px;
132
+ }
133
+ h1,
134
+ h2,
135
+ h3,
136
+ h4 {
137
+ font-family: 'Raleway', sans-serif;
138
+ color: #fff;
139
+ line-height: 1.25;
140
+ }
141
+ h1 {
142
+ margin-top: 0;
143
+ }
144
+ p,
145
+ li,
146
+ td,
147
+ th {
148
+ line-height: 1.6;
149
+ }
150
+ pre,
151
+ code {
152
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
153
+ }
154
+ code {
155
+ background: var(--code);
156
+ padding: 0.1rem 0.35rem;
157
+ border-radius: 6px;
158
+ border: 1px solid #1c2634;
159
+ }
160
+ pre {
161
+ background: var(--code);
162
+ padding: 14px;
163
+ border-radius: 10px;
164
+ border: 1px solid #1c2634;
165
+ overflow: auto;
166
+ }
167
+ table {
168
+ width: 100%;
169
+ border-collapse: collapse;
170
+ display: block;
171
+ overflow: auto;
172
+ }
173
+ th,
174
+ td {
175
+ border: 1px solid var(--line);
176
+ padding: 8px 10px;
177
+ text-align: left;
178
+ }
179
+ th {
180
+ background: #172231;
181
+ }
182
+ blockquote {
183
+ margin: 0;
184
+ padding: 12px 14px;
185
+ border-left: 3px solid var(--brand);
186
+ background: #121d2b;
187
+ border-radius: 8px;
188
+ }
189
+ .page-toc h2 {
190
+ margin: 0 0 8px;
191
+ }
192
+ .toc-file {
193
+ margin: 0 0 8px;
194
+ }
195
+ .site-footer {
196
+ margin-top: 28px;
197
+ padding-top: 14px;
198
+ border-top: 1px solid var(--line);
199
+ color: var(--muted);
200
+ font-size: 0.92rem;
201
+ }
202
+ @media (max-width: 1180px) {
203
+ .layout {
204
+ grid-template-columns: 260px minmax(0, 1fr);
205
+ }
206
+ .toc {
207
+ display: none;
208
+ }
209
+ }
210
+ @media (max-width: 900px) {
211
+ .layout {
212
+ grid-template-columns: 1fr;
213
+ }
214
+ .sidebar {
215
+ position: static;
216
+ max-height: none;
217
+ }
218
+ .content {
219
+ padding: 18px;
220
+ }
221
+ }
@@ -6,7 +6,7 @@ function copyAsciiMaze() {
6
6
  const srcDir = path.resolve('test', 'examples', 'asciiMaze');
7
7
  if (!fs.existsSync(srcDir)) {
8
8
  console.warn(
9
- '[docs:examples] asciiMaze source directory not found, skipping'
9
+ '[docs:examples] asciiMaze source directory not found, skipping',
10
10
  );
11
11
  return;
12
12
  }
@@ -26,7 +26,7 @@ function copyFlappyBird() {
26
26
  const srcDir = path.resolve('test', 'examples', 'flappy_bird');
27
27
  if (!fs.existsSync(srcDir)) {
28
28
  console.warn(
29
- '[docs:examples] flappy_bird source directory not found, skipping'
29
+ '[docs:examples] flappy_bird source directory not found, skipping',
30
30
  );
31
31
  return;
32
32
  }
@@ -47,7 +47,11 @@ function writeExamplesLandingPage() {
47
47
  fs.mkdirSync(examplesDir, { recursive: true });
48
48
 
49
49
  const demoEntries = [
50
- { dirName: 'asciiMaze', label: 'asciiMaze', title: 'ASCII Maze (NeatapticTS)' },
50
+ {
51
+ dirName: 'asciiMaze',
52
+ label: 'asciiMaze',
53
+ title: 'ASCII Maze (NeatapticTS)',
54
+ },
51
55
  {
52
56
  dirName: 'flappy_bird',
53
57
  label: 'flappy_bird',
@@ -57,11 +61,11 @@ function writeExamplesLandingPage() {
57
61
 
58
62
  const linksMarkup = demoEntries
59
63
  .filter((entry) =>
60
- fs.existsSync(path.join(examplesDir, entry.dirName, 'index.html'))
64
+ fs.existsSync(path.join(examplesDir, entry.dirName, 'index.html')),
61
65
  )
62
66
  .map(
63
67
  (entry) =>
64
- `<li><a href="./${entry.dirName}/index.html">${entry.title}</a> <span class="demo-path">(examples/${entry.label})</span></li>`
68
+ `<li><a href="./${entry.dirName}/index.html">${entry.title}</a> <span class="demo-path">(examples/${entry.label})</span></li>`,
65
69
  )
66
70
  .join('');
67
71
 
@@ -21,7 +21,7 @@ const flag = (name) => args.includes(name);
21
21
 
22
22
  if (flag('--help') || flag('-h')) {
23
23
  console.log(
24
- `Usage: node scripts/export-onnx.mjs --in network.json --out model.onnx.json [--metadata] [--batch] [--legacy] [--partial] [--mixed]\n`
24
+ `Usage: node scripts/export-onnx.mjs --in network.json --out model.onnx.json [--metadata] [--batch] [--legacy] [--partial] [--mixed]\n`,
25
25
  );
26
26
  process.exit(0);
27
27
  }
@@ -48,7 +48,7 @@ async function loadDist() {
48
48
  // Fallback to network/network.onnx if direct path changed
49
49
  return import(
50
50
  pathToFileURL(
51
- path.resolve('dist', 'architecture', 'network', 'network.onnx.js')
51
+ path.resolve('dist', 'architecture', 'network', 'network.onnx.js'),
52
52
  ).href
53
53
  );
54
54
  });
@@ -76,7 +76,7 @@ async function loadDist() {
76
76
  fs.writeFileSync(
77
77
  path.resolve(outputFile),
78
78
  JSON.stringify(onnx, null, 2),
79
- 'utf8'
79
+ 'utf8',
80
80
  );
81
81
  console.log(`ONNX JSON written to ${outputFile}`);
82
82
  } catch (err) {
@@ -61,10 +61,10 @@ function buildVariantDeltaTable(artifact) {
61
61
  const ordered = Array.from(sizes).sort((a, b) => parseInt(a) - parseInt(b));
62
62
  const rows = [];
63
63
  rows.push(
64
- 'Size Metric Src Mean Dist Mean Δ Abs Δ % Flag Result'
64
+ 'Size Metric Src Mean Dist Mean Δ Abs Δ % Flag Result',
65
65
  );
66
66
  rows.push(
67
- '------ ----------------- ------------- ------------- ------------- ---------- ------------- ------------------------------------------------------------'
67
+ '------ ----------------- ------------- ------------- ------------- ---------- ------------- ------------------------------------------------------------',
68
68
  );
69
69
  const metrics = ['buildMs', 'fwdAvgMs', 'bytesPerConn'];
70
70
  for (const size of ordered) {
@@ -91,8 +91,8 @@ function buildVariantDeltaTable(artifact) {
91
91
  ? 'Dist bytes divergence'
92
92
  : 'Parity'
93
93
  : flag === '(REG)'
94
- ? `Dist ${dAbs > 0 ? 'slower' : 'faster'} ${metric}`
95
- : 'Parity';
94
+ ? `Dist ${dAbs > 0 ? 'slower' : 'faster'} ${metric}`
95
+ : 'Parity';
96
96
  rows.push(
97
97
  cell(size, 6) +
98
98
  ' ' +
@@ -106,19 +106,19 @@ function buildVariantDeltaTable(artifact) {
106
106
  typeof dAbs === 'number'
107
107
  ? (dAbs >= 0 ? '+' : '') + fmtNum(dAbs, 4)
108
108
  : '',
109
- 13
109
+ 13,
110
110
  ) +
111
111
  ' ' +
112
112
  cell(
113
113
  typeof dPct === 'number'
114
114
  ? (dPct >= 0 ? '+' : '') + fmtNum(dPct, 2)
115
115
  : '',
116
- 10
116
+ 10,
117
117
  ) +
118
118
  ' ' +
119
119
  cell(flag, 13) +
120
120
  ' ' +
121
- note
121
+ note,
122
122
  );
123
123
  }
124
124
  }
@@ -130,10 +130,10 @@ function buildHeapTable(artifact) {
130
130
  const ordered = Array.from(sizes).sort((a, b) => parseInt(a) - parseInt(b));
131
131
  const rows = [];
132
132
  rows.push(
133
- 'Size Metric Src Bytes Dist Bytes Src MB Dist MB Δ Bytes Δ % Note'
133
+ 'Size Metric Src Bytes Dist Bytes Src MB Dist MB Δ Bytes Δ % Note',
134
134
  );
135
135
  rows.push(
136
- '------ -------------- ------------ ------------ --------- --------- ----------- ------- -------------------------------------------------'
136
+ '------ -------------- ------------ ------------ --------- --------- ----------- ------- -------------------------------------------------',
137
137
  );
138
138
  for (const size of ordered) {
139
139
  for (const metric of ['heapUsed', 'rss']) {
@@ -159,7 +159,7 @@ function buildHeapTable(artifact) {
159
159
  ' ' +
160
160
  cell((dPct >= 0 ? '+' : '') + dPct.toFixed(2), 7) +
161
161
  ' ' +
162
- 'Informational'
162
+ 'Informational',
163
163
  );
164
164
  }
165
165
  }