portograph 0.0.0-stage → 0.2.0

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 (446) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +233 -2
  3. package/bin/cli.mjs +256 -0
  4. package/bin/compute.mjs +177 -0
  5. package/bin/font-check.d.mts +4 -0
  6. package/bin/font-check.mjs +58 -0
  7. package/bin/portograph.mjs +23 -0
  8. package/dist/cli.d.cts +109 -0
  9. package/dist/cli.d.ts +109 -0
  10. package/dist/geometry/index.d.cts +14 -0
  11. package/dist/geometry/index.d.ts +14 -0
  12. package/dist/geometry/oriented.d.cts +34 -0
  13. package/dist/geometry/oriented.d.ts +34 -0
  14. package/dist/geometry/planar.d.cts +69 -0
  15. package/dist/geometry/planar.d.ts +69 -0
  16. package/dist/index.cjs +20 -0
  17. package/dist/index.d.cts +24 -0
  18. package/dist/index.d.ts +24 -0
  19. package/dist/index.js +1 -0
  20. package/dist/internal.d.cts +73 -0
  21. package/dist/internal.d.ts +73 -0
  22. package/dist/layout/alignment-targets.d.cts +76 -0
  23. package/dist/layout/alignment-targets.d.ts +76 -0
  24. package/dist/layout/approach.d.cts +13 -0
  25. package/dist/layout/approach.d.ts +13 -0
  26. package/dist/layout/attempt-counters.d.cts +117 -0
  27. package/dist/layout/attempt-counters.d.ts +117 -0
  28. package/dist/layout/attempt-ledger.d.cts +31 -0
  29. package/dist/layout/attempt-ledger.d.ts +31 -0
  30. package/dist/layout/attempt-timings.d.cts +41 -0
  31. package/dist/layout/attempt-timings.d.ts +41 -0
  32. package/dist/layout/bands.d.cts +348 -0
  33. package/dist/layout/bands.d.ts +348 -0
  34. package/dist/layout/bar-width.d.cts +9 -0
  35. package/dist/layout/bar-width.d.ts +9 -0
  36. package/dist/layout/bars.d.cts +26 -0
  37. package/dist/layout/bars.d.ts +26 -0
  38. package/dist/layout/block-checks.d.cts +5 -0
  39. package/dist/layout/block-checks.d.ts +5 -0
  40. package/dist/layout/box-writers.d.cts +53 -0
  41. package/dist/layout/box-writers.d.ts +53 -0
  42. package/dist/layout/bundle-channel.d.cts +8 -0
  43. package/dist/layout/bundle-channel.d.ts +8 -0
  44. package/dist/layout/bundle-geometry.d.cts +163 -0
  45. package/dist/layout/bundle-geometry.d.ts +163 -0
  46. package/dist/layout/bundle-junctions.d.cts +41 -0
  47. package/dist/layout/bundle-junctions.d.ts +41 -0
  48. package/dist/layout/bundle-merge.d.cts +4 -0
  49. package/dist/layout/bundle-merge.d.ts +4 -0
  50. package/dist/layout/bundle-need.d.cts +23 -0
  51. package/dist/layout/bundle-need.d.ts +23 -0
  52. package/dist/layout/bundle-order.d.cts +10 -0
  53. package/dist/layout/bundle-order.d.ts +10 -0
  54. package/dist/layout/bundle-paths.d.cts +33 -0
  55. package/dist/layout/bundle-paths.d.ts +33 -0
  56. package/dist/layout/bundles.d.cts +5 -0
  57. package/dist/layout/bundles.d.ts +5 -0
  58. package/dist/layout/bus-room.d.cts +48 -0
  59. package/dist/layout/bus-room.d.ts +48 -0
  60. package/dist/layout/bus.d.cts +100 -0
  61. package/dist/layout/bus.d.ts +100 -0
  62. package/dist/layout/centre.d.cts +108 -0
  63. package/dist/layout/centre.d.ts +108 -0
  64. package/dist/layout/chord-boxes.d.cts +9 -0
  65. package/dist/layout/chord-boxes.d.ts +9 -0
  66. package/dist/layout/chord-clear.d.cts +32 -0
  67. package/dist/layout/chord-clear.d.ts +32 -0
  68. package/dist/layout/close-up.d.cts +37 -0
  69. package/dist/layout/close-up.d.ts +37 -0
  70. package/dist/layout/column-arrangement.d.cts +37 -0
  71. package/dist/layout/column-arrangement.d.ts +37 -0
  72. package/dist/layout/columns.d.cts +240 -0
  73. package/dist/layout/columns.d.ts +240 -0
  74. package/dist/layout/constraints/catalogue.d.cts +25 -0
  75. package/dist/layout/constraints/catalogue.d.ts +25 -0
  76. package/dist/layout/constraints/evaluate.d.cts +24 -0
  77. package/dist/layout/constraints/evaluate.d.ts +24 -0
  78. package/dist/layout/constraints/index.d.cts +8 -0
  79. package/dist/layout/constraints/index.d.ts +8 -0
  80. package/dist/layout/constraints/separation.d.cts +33 -0
  81. package/dist/layout/constraints/separation.d.ts +33 -0
  82. package/dist/layout/constraints/types.d.cts +65 -0
  83. package/dist/layout/constraints/types.d.ts +65 -0
  84. package/dist/layout/corridor-order.d.cts +61 -0
  85. package/dist/layout/corridor-order.d.ts +61 -0
  86. package/dist/layout/course-bypass.d.cts +63 -0
  87. package/dist/layout/course-bypass.d.ts +63 -0
  88. package/dist/layout/course-gap.d.cts +54 -0
  89. package/dist/layout/course-gap.d.ts +54 -0
  90. package/dist/layout/course-lanes.d.cts +79 -0
  91. package/dist/layout/course-lanes.d.ts +79 -0
  92. package/dist/layout/course-measure.d.cts +114 -0
  93. package/dist/layout/course-measure.d.ts +114 -0
  94. package/dist/layout/course-plan.d.cts +22 -0
  95. package/dist/layout/course-plan.d.ts +22 -0
  96. package/dist/layout/course-rows.d.cts +51 -0
  97. package/dist/layout/course-rows.d.ts +51 -0
  98. package/dist/layout/courses.d.cts +31 -0
  99. package/dist/layout/courses.d.ts +31 -0
  100. package/dist/layout/decide.d.cts +123 -0
  101. package/dist/layout/decide.d.ts +123 -0
  102. package/dist/layout/diagonal-text.d.cts +49 -0
  103. package/dist/layout/diagonal-text.d.ts +49 -0
  104. package/dist/layout/direct-families.d.cts +91 -0
  105. package/dist/layout/direct-families.d.ts +91 -0
  106. package/dist/layout/elk-graph.d.cts +36 -0
  107. package/dist/layout/elk-graph.d.ts +36 -0
  108. package/dist/layout/elk-worker.d.cts +34 -0
  109. package/dist/layout/elk-worker.d.ts +34 -0
  110. package/dist/layout/end-trim.d.cts +41 -0
  111. package/dist/layout/end-trim.d.ts +41 -0
  112. package/dist/layout/face-centre.d.cts +25 -0
  113. package/dist/layout/face-centre.d.ts +25 -0
  114. package/dist/layout/fan-admission.d.cts +47 -0
  115. package/dist/layout/fan-admission.d.ts +47 -0
  116. package/dist/layout/fan-spread.d.cts +43 -0
  117. package/dist/layout/fan-spread.d.ts +43 -0
  118. package/dist/layout/feed-order.d.cts +53 -0
  119. package/dist/layout/feed-order.d.ts +53 -0
  120. package/dist/layout/feed-split.d.cts +34 -0
  121. package/dist/layout/feed-split.d.ts +34 -0
  122. package/dist/layout/flanks.d.cts +21 -0
  123. package/dist/layout/flanks.d.ts +21 -0
  124. package/dist/layout/frame-paths.d.cts +209 -0
  125. package/dist/layout/frame-paths.d.ts +209 -0
  126. package/dist/layout/frames.d.cts +112 -0
  127. package/dist/layout/frames.d.ts +112 -0
  128. package/dist/layout/gap-band.d.cts +10 -0
  129. package/dist/layout/gap-band.d.ts +10 -0
  130. package/dist/layout/gap-plan.d.cts +229 -0
  131. package/dist/layout/gap-plan.d.ts +229 -0
  132. package/dist/layout/gap-room.d.cts +71 -0
  133. package/dist/layout/gap-room.d.ts +71 -0
  134. package/dist/layout/gap-runs.d.cts +95 -0
  135. package/dist/layout/gap-runs.d.ts +95 -0
  136. package/dist/layout/given-back.d.cts +23 -0
  137. package/dist/layout/given-back.d.ts +23 -0
  138. package/dist/layout/grid-chains.d.cts +84 -0
  139. package/dist/layout/grid-chains.d.ts +84 -0
  140. package/dist/layout/grid.d.cts +314 -0
  141. package/dist/layout/grid.d.ts +314 -0
  142. package/dist/layout/group-exit-check.d.cts +36 -0
  143. package/dist/layout/group-exit-check.d.ts +36 -0
  144. package/dist/layout/group-exits.d.cts +53 -0
  145. package/dist/layout/group-exits.d.ts +53 -0
  146. package/dist/layout/group-padding.d.cts +6 -0
  147. package/dist/layout/group-padding.d.ts +6 -0
  148. package/dist/layout/growth-guard.d.cts +25 -0
  149. package/dist/layout/growth-guard.d.ts +25 -0
  150. package/dist/layout/joint-order.d.cts +149 -0
  151. package/dist/layout/joint-order.d.ts +149 -0
  152. package/dist/layout/label-room-guard.d.cts +8 -0
  153. package/dist/layout/label-room-guard.d.ts +8 -0
  154. package/dist/layout/lane-kind.d.cts +11 -0
  155. package/dist/layout/lane-kind.d.ts +11 -0
  156. package/dist/layout/lanes.d.cts +278 -0
  157. package/dist/layout/lanes.d.ts +278 -0
  158. package/dist/layout/legend.d.cts +88 -0
  159. package/dist/layout/legend.d.ts +88 -0
  160. package/dist/layout/lift-judge.d.cts +28 -0
  161. package/dist/layout/lift-judge.d.ts +28 -0
  162. package/dist/layout/lift.d.cts +164 -0
  163. package/dist/layout/lift.d.ts +164 -0
  164. package/dist/layout/link-label-geometry.d.cts +32 -0
  165. package/dist/layout/link-label-geometry.d.ts +32 -0
  166. package/dist/layout/link-labels.d.cts +129 -0
  167. package/dist/layout/link-labels.d.ts +129 -0
  168. package/dist/layout/link-layer.d.cts +6 -0
  169. package/dist/layout/link-layer.d.ts +6 -0
  170. package/dist/layout/move-reservations.d.cts +49 -0
  171. package/dist/layout/move-reservations.d.ts +49 -0
  172. package/dist/layout/mutation.d.cts +32 -0
  173. package/dist/layout/mutation.d.ts +32 -0
  174. package/dist/layout/node-geometry.d.cts +3 -0
  175. package/dist/layout/node-geometry.d.ts +3 -0
  176. package/dist/layout/objective.d.cts +232 -0
  177. package/dist/layout/objective.d.ts +232 -0
  178. package/dist/layout/overlay-nest.d.cts +27 -0
  179. package/dist/layout/overlay-nest.d.ts +27 -0
  180. package/dist/layout/overlay-order.d.cts +140 -0
  181. package/dist/layout/overlay-order.d.ts +140 -0
  182. package/dist/layout/overlay-paths.d.cts +303 -0
  183. package/dist/layout/overlay-paths.d.ts +303 -0
  184. package/dist/layout/overlay-place.d.cts +99 -0
  185. package/dist/layout/overlay-place.d.ts +99 -0
  186. package/dist/layout/overlay-tracks.d.cts +93 -0
  187. package/dist/layout/overlay-tracks.d.ts +93 -0
  188. package/dist/layout/overlay-window.d.cts +83 -0
  189. package/dist/layout/overlay-window.d.ts +83 -0
  190. package/dist/layout/parallel-sets.d.cts +51 -0
  191. package/dist/layout/parallel-sets.d.ts +51 -0
  192. package/dist/layout/parent-stand.d.cts +40 -0
  193. package/dist/layout/parent-stand.d.ts +40 -0
  194. package/dist/layout/path-end.d.cts +34 -0
  195. package/dist/layout/path-end.d.ts +34 -0
  196. package/dist/layout/peers.d.cts +28 -0
  197. package/dist/layout/peers.d.ts +28 -0
  198. package/dist/layout/pill-reach.d.cts +14 -0
  199. package/dist/layout/pill-reach.d.ts +14 -0
  200. package/dist/layout/placement-attempt.d.cts +58 -0
  201. package/dist/layout/placement-attempt.d.ts +58 -0
  202. package/dist/layout/placement-refusal.d.cts +67 -0
  203. package/dist/layout/placement-refusal.d.ts +67 -0
  204. package/dist/layout/port-insets.d.cts +15 -0
  205. package/dist/layout/port-insets.d.ts +15 -0
  206. package/dist/layout/port-side.d.cts +8 -0
  207. package/dist/layout/port-side.d.ts +8 -0
  208. package/dist/layout/postconditions.d.cts +40 -0
  209. package/dist/layout/postconditions.d.ts +40 -0
  210. package/dist/layout/rank-cells.d.cts +24 -0
  211. package/dist/layout/rank-cells.d.ts +24 -0
  212. package/dist/layout/rank-input.d.cts +8 -0
  213. package/dist/layout/rank-input.d.ts +8 -0
  214. package/dist/layout/ranks.d.cts +36 -0
  215. package/dist/layout/ranks.d.ts +36 -0
  216. package/dist/layout/read/arrangement.d.cts +3 -0
  217. package/dist/layout/read/arrangement.d.ts +3 -0
  218. package/dist/layout/read/canton.d.cts +48 -0
  219. package/dist/layout/read/canton.d.ts +48 -0
  220. package/dist/layout/read/chain.d.cts +11 -0
  221. package/dist/layout/read/chain.d.ts +11 -0
  222. package/dist/layout/read/courses.d.cts +67 -0
  223. package/dist/layout/read/courses.d.ts +67 -0
  224. package/dist/layout/read/crossings.d.cts +79 -0
  225. package/dist/layout/read/crossings.d.ts +79 -0
  226. package/dist/layout/read/feeds.d.cts +53 -0
  227. package/dist/layout/read/feeds.d.ts +53 -0
  228. package/dist/layout/read/overlay-straight.d.cts +33 -0
  229. package/dist/layout/read/overlay-straight.d.ts +33 -0
  230. package/dist/layout/read/parent-spread.d.cts +13 -0
  231. package/dist/layout/read/parent-spread.d.ts +13 -0
  232. package/dist/layout/read/tier.d.cts +19 -0
  233. package/dist/layout/read/tier.d.ts +19 -0
  234. package/dist/layout/read/title-edge.d.cts +19 -0
  235. package/dist/layout/read/title-edge.d.ts +19 -0
  236. package/dist/layout/rectangle-index.d.cts +33 -0
  237. package/dist/layout/rectangle-index.d.ts +33 -0
  238. package/dist/layout/region-rebuild.d.cts +9 -0
  239. package/dist/layout/region-rebuild.d.ts +9 -0
  240. package/dist/layout/regions.d.cts +37 -0
  241. package/dist/layout/regions.d.ts +37 -0
  242. package/dist/layout/reservation-checks.d.cts +16 -0
  243. package/dist/layout/reservation-checks.d.ts +16 -0
  244. package/dist/layout/reservations.d.cts +267 -0
  245. package/dist/layout/reservations.d.ts +267 -0
  246. package/dist/layout/row-paths.d.cts +62 -0
  247. package/dist/layout/row-paths.d.ts +62 -0
  248. package/dist/layout/rows.d.cts +5 -0
  249. package/dist/layout/rows.d.ts +5 -0
  250. package/dist/layout/rule-geometry-hook.d.cts +5 -0
  251. package/dist/layout/rule-geometry-hook.d.ts +5 -0
  252. package/dist/layout/run-label-box.d.cts +139 -0
  253. package/dist/layout/run-label-box.d.ts +139 -0
  254. package/dist/layout/side-chords.d.cts +55 -0
  255. package/dist/layout/side-chords.d.ts +55 -0
  256. package/dist/layout/side-hints.d.cts +34 -0
  257. package/dist/layout/side-hints.d.ts +34 -0
  258. package/dist/layout/side-judge.d.cts +65 -0
  259. package/dist/layout/side-judge.d.ts +65 -0
  260. package/dist/layout/side-lanes.d.cts +27 -0
  261. package/dist/layout/side-lanes.d.ts +27 -0
  262. package/dist/layout/side-measure.d.cts +55 -0
  263. package/dist/layout/side-measure.d.ts +55 -0
  264. package/dist/layout/sides-one.d.cts +24 -0
  265. package/dist/layout/sides-one.d.ts +24 -0
  266. package/dist/layout/sides-two.d.cts +159 -0
  267. package/dist/layout/sides-two.d.ts +159 -0
  268. package/dist/layout/size.d.cts +114 -0
  269. package/dist/layout/size.d.ts +114 -0
  270. package/dist/layout/skeleton-geometry.d.cts +38 -0
  271. package/dist/layout/skeleton-geometry.d.ts +38 -0
  272. package/dist/layout/skeleton-graph.d.cts +33 -0
  273. package/dist/layout/skeleton-graph.d.ts +33 -0
  274. package/dist/layout/skeleton.d.cts +21 -0
  275. package/dist/layout/skeleton.d.ts +21 -0
  276. package/dist/layout/solid-blocks.d.cts +24 -0
  277. package/dist/layout/solid-blocks.d.ts +24 -0
  278. package/dist/layout/span-judge.d.cts +13 -0
  279. package/dist/layout/span-judge.d.ts +13 -0
  280. package/dist/layout/span-lanes.d.cts +37 -0
  281. package/dist/layout/span-lanes.d.ts +37 -0
  282. package/dist/layout/span-measure.d.cts +35 -0
  283. package/dist/layout/span-measure.d.ts +35 -0
  284. package/dist/layout/stagger.d.cts +40 -0
  285. package/dist/layout/stagger.d.ts +40 -0
  286. package/dist/layout/title-room.d.cts +50 -0
  287. package/dist/layout/title-room.d.ts +50 -0
  288. package/dist/layout/tolerance.d.cts +60 -0
  289. package/dist/layout/tolerance.d.ts +60 -0
  290. package/dist/layout/trial-copy.d.cts +9 -0
  291. package/dist/layout/trial-copy.d.ts +9 -0
  292. package/dist/layout/trial-findings.d.cts +25 -0
  293. package/dist/layout/trial-findings.d.ts +25 -0
  294. package/dist/layout/trunk.d.cts +69 -0
  295. package/dist/layout/trunk.d.ts +69 -0
  296. package/dist/layout/turn-measure.d.cts +42 -0
  297. package/dist/layout/turn-measure.d.ts +42 -0
  298. package/dist/layout/turn-order.d.cts +83 -0
  299. package/dist/layout/turn-order.d.ts +83 -0
  300. package/dist/migrate/index.d.cts +13 -0
  301. package/dist/migrate/index.d.ts +13 -0
  302. package/dist/model/classes.d.cts +21 -0
  303. package/dist/model/classes.d.ts +21 -0
  304. package/dist/model/document.d.cts +174 -0
  305. package/dist/model/document.d.ts +174 -0
  306. package/dist/model/geometry.d.cts +12 -0
  307. package/dist/model/geometry.d.ts +12 -0
  308. package/dist/model/index.d.cts +5 -0
  309. package/dist/model/index.d.ts +5 -0
  310. package/dist/model/json-equality.d.cts +2 -0
  311. package/dist/model/json-equality.d.ts +2 -0
  312. package/dist/model/layout.d.cts +1142 -0
  313. package/dist/model/layout.d.ts +1142 -0
  314. package/dist/model/link-ids.d.cts +16 -0
  315. package/dist/model/link-ids.d.ts +16 -0
  316. package/dist/model/model.d.cts +26 -0
  317. package/dist/model/model.d.ts +26 -0
  318. package/dist/model/read-cache.d.cts +20 -0
  319. package/dist/model/read-cache.d.ts +20 -0
  320. package/dist/node.cjs +43 -0
  321. package/dist/node.d.cts +6 -0
  322. package/dist/parse/css.d.cts +2 -0
  323. package/dist/parse/css.d.ts +2 -0
  324. package/dist/parse/index.d.cts +23 -0
  325. package/dist/parse/index.d.ts +23 -0
  326. package/dist/parse/link-order.d.cts +24 -0
  327. package/dist/parse/link-order.d.ts +24 -0
  328. package/dist/parse/validation.d.cts +39 -0
  329. package/dist/parse/validation.d.ts +39 -0
  330. package/dist/pipeline/budget.d.cts +28 -0
  331. package/dist/pipeline/budget.d.ts +28 -0
  332. package/dist/pipeline/deadline.d.cts +1 -0
  333. package/dist/pipeline/deadline.d.ts +1 -0
  334. package/dist/pipeline/driver.d.cts +14 -0
  335. package/dist/pipeline/driver.d.ts +14 -0
  336. package/dist/pipeline/env.d.cts +54 -0
  337. package/dist/pipeline/env.d.ts +54 -0
  338. package/dist/pipeline/index.d.cts +17 -0
  339. package/dist/pipeline/index.d.ts +17 -0
  340. package/dist/pipeline/initial.d.cts +3 -0
  341. package/dist/pipeline/initial.d.ts +3 -0
  342. package/dist/pipeline/lift-round.d.cts +9 -0
  343. package/dist/pipeline/lift-round.d.ts +9 -0
  344. package/dist/pipeline/limits.d.cts +16 -0
  345. package/dist/pipeline/limits.d.ts +16 -0
  346. package/dist/pipeline/options.d.cts +85 -0
  347. package/dist/pipeline/options.d.ts +85 -0
  348. package/dist/pipeline/place.d.cts +9 -0
  349. package/dist/pipeline/place.d.ts +9 -0
  350. package/dist/pipeline/publish.d.cts +4 -0
  351. package/dist/pipeline/publish.d.ts +4 -0
  352. package/dist/pipeline/round.d.cts +86 -0
  353. package/dist/pipeline/round.d.ts +86 -0
  354. package/dist/pipeline/rounds.d.cts +85 -0
  355. package/dist/pipeline/rounds.d.ts +85 -0
  356. package/dist/pipeline/state.d.cts +46 -0
  357. package/dist/pipeline/state.d.ts +46 -0
  358. package/dist/pipeline/width-budget.d.cts +6 -0
  359. package/dist/pipeline/width-budget.d.ts +6 -0
  360. package/dist/portograph-avoid-worker.mjs +260 -0
  361. package/dist/portograph.js +43369 -0
  362. package/dist/portograph.umd.cjs +154 -0
  363. package/dist/profiles/network/content.d.cts +29 -0
  364. package/dist/profiles/network/content.d.ts +29 -0
  365. package/dist/profiles/network/icons.d.cts +27 -0
  366. package/dist/profiles/network/icons.d.ts +27 -0
  367. package/dist/profiles/network/snack.d.cts +50 -0
  368. package/dist/profiles/network/snack.d.ts +50 -0
  369. package/dist/profiles/network/theme.d.cts +246 -0
  370. package/dist/profiles/network/theme.d.ts +246 -0
  371. package/dist/profiles/network/themes.d.cts +60 -0
  372. package/dist/profiles/network/themes.d.ts +60 -0
  373. package/dist/profiles/network/tiers.d.cts +8 -0
  374. package/dist/profiles/network/tiers.d.ts +8 -0
  375. package/dist/render/anonymous-end.d.cts +8 -0
  376. package/dist/render/anonymous-end.d.ts +8 -0
  377. package/dist/render/author-css.d.cts +9 -0
  378. package/dist/render/author-css.d.ts +9 -0
  379. package/dist/render/check-options.d.cts +8 -0
  380. package/dist/render/check-options.d.ts +8 -0
  381. package/dist/render/drawio.d.cts +35 -0
  382. package/dist/render/drawio.d.ts +35 -0
  383. package/dist/render/frame-order.d.cts +36 -0
  384. package/dist/render/frame-order.d.ts +36 -0
  385. package/dist/render/index.d.cts +19 -0
  386. package/dist/render/index.d.ts +19 -0
  387. package/dist/render/shared.d.cts +137 -0
  388. package/dist/render/shared.d.ts +137 -0
  389. package/dist/render/svg.d.cts +22 -0
  390. package/dist/render/svg.d.ts +22 -0
  391. package/dist/render/theme.d.cts +81 -0
  392. package/dist/render/theme.d.ts +81 -0
  393. package/dist/render/tooltips.d.cts +11 -0
  394. package/dist/render/tooltips.d.ts +11 -0
  395. package/dist/resolve/fan-family.d.cts +19 -0
  396. package/dist/resolve/fan-family.d.ts +19 -0
  397. package/dist/resolve/index.d.cts +30 -0
  398. package/dist/resolve/index.d.ts +30 -0
  399. package/dist/resolve/mesh-bus.d.cts +19 -0
  400. package/dist/resolve/mesh-bus.d.ts +19 -0
  401. package/dist/resolve/solid-blocks.d.cts +2 -0
  402. package/dist/resolve/solid-blocks.d.ts +2 -0
  403. package/dist/route/containment.d.cts +8 -0
  404. package/dist/route/containment.d.ts +8 -0
  405. package/dist/route/index.d.cts +48 -0
  406. package/dist/route/index.d.ts +48 -0
  407. package/dist/route/obstacles.d.cts +59 -0
  408. package/dist/route/obstacles.d.ts +59 -0
  409. package/dist/route/paths.d.cts +100 -0
  410. package/dist/route/paths.d.ts +100 -0
  411. package/dist/route/plan.d.cts +182 -0
  412. package/dist/route/plan.d.ts +182 -0
  413. package/dist/route/reservations.d.cts +15 -0
  414. package/dist/route/reservations.d.ts +15 -0
  415. package/dist/route/types.d.cts +59 -0
  416. package/dist/route/types.d.ts +59 -0
  417. package/dist/route/validate.d.cts +41 -0
  418. package/dist/route/validate.d.ts +41 -0
  419. package/dist/route/worker.d.cts +73 -0
  420. package/dist/route/worker.d.ts +73 -0
  421. package/dist/score/counts.d.cts +12 -0
  422. package/dist/score/counts.d.ts +12 -0
  423. package/dist/score/gates.d.cts +16 -0
  424. package/dist/score/gates.d.ts +16 -0
  425. package/dist/score/geometry.d.cts +2 -0
  426. package/dist/score/geometry.d.ts +2 -0
  427. package/dist/score/index.d.cts +5 -0
  428. package/dist/score/index.d.ts +5 -0
  429. package/dist/score/metrics.d.cts +7 -0
  430. package/dist/score/metrics.d.ts +7 -0
  431. package/dist/score/model.d.cts +76 -0
  432. package/dist/score/model.d.ts +76 -0
  433. package/dist/score/types.d.cts +135 -0
  434. package/dist/score/types.d.ts +135 -0
  435. package/dist/text/font-metrics.d.cts +9 -0
  436. package/dist/text/font-metrics.d.ts +9 -0
  437. package/dist/text/index.d.cts +32 -0
  438. package/dist/text/index.d.ts +32 -0
  439. package/dist/theme/content.d.cts +33 -0
  440. package/dist/theme/content.d.ts +33 -0
  441. package/dist/theme/geometry.d.cts +81 -0
  442. package/dist/theme/geometry.d.ts +81 -0
  443. package/dist/theme/legend.d.cts +26 -0
  444. package/dist/theme/legend.d.ts +26 -0
  445. package/dist/warm-elk.cjs +43 -0
  446. package/package.json +109 -4
@@ -0,0 +1,76 @@
1
+ import { AlignmentDeclineReason, AlignmentTarget, LayoutLink, LayoutModel } from '../model/layout.cjs';
2
+ import { Feed } from './read/feeds.cjs';
3
+ /**
4
+ * The alignment-target record of the centring steps (architecture-2 ticket 66, `LayoutModel.alignmentTargets`). One producer writes it, the end of
5
+ * each centring step (`writeAlignmentTargets`); the vertical tally of ticket 65 reads its declined entries (`declinedTargets`); the publication
6
+ * check refuses a malformed record (`alignmentTargetsFault`) and names a decline its own replay writes that the record lacks (`sameDeclines`).
7
+ */
8
+ /** The reasons a step declines a target, in the order the kept branch reads them: ticket 65's post-conditions, then the overlay guard. */
9
+ export declare const ALIGNMENT_DECLINE_REASONS: readonly AlignmentDeclineReason[];
10
+ /** The finding of the publication check: a face where the replay declines a target the record does not. */
11
+ export declare const ALIGNMENT_TARGETS_DIFFER = "alignment-targets-differ";
12
+ /** What one step learned about its targets, read by the writer at the step's end on whatever geometry the step leaves. */
13
+ export interface TargetNotes {
14
+ /** The feed of each wanted child port, and the x it wants (`groupFeeds`). */
15
+ seats: ReadonlyMap<string, Feed>;
16
+ wanted: ReadonlyMap<string, number>;
17
+ /** The body edges, from the wanted x, of each target `alignSide` widened the body toward in this step. */
18
+ grown: Map<string, {
19
+ low: number;
20
+ high: number;
21
+ }>;
22
+ /** The body edges, from the wanted x, of each wanted port where the step began: the room of a target that stood and that the step moves off. */
23
+ start: Map<string, {
24
+ low: number;
25
+ high: number;
26
+ }>;
27
+ /** The targets the kept branch refused to keep, with the guard or post-condition and its key. */
28
+ declined: Map<string, {
29
+ reason: AlignmentDeclineReason;
30
+ by: string;
31
+ }>;
32
+ }
33
+ /** The direct members of the direct families: a direct member owes a vertical even as a held cross chord. */
34
+ export declare const directMembers: (model: LayoutModel) => Set<string>;
35
+ /**
36
+ * Whether a feed owes a vertical (ticket 65): its link is an orthogonal link, a frame chord or a direct member. A held cross-frame chord owes none
37
+ * (CONTEXT.md: any angle). One predicate for the tally and the record.
38
+ */
39
+ export declare function owesVertical(model: LayoutModel, link: LayoutLink | undefined, direct: ReadonlySet<string>): boolean;
40
+ /** Where a feed's x is read: the far port, or the lane of a transit feed (the lane of the feed's link that stands at the feed's x). */
41
+ export declare function feedFar(model: LayoutModel, feed: Feed): string;
42
+ /**
43
+ * Test only: a sink for the record's events (the kept branch's verdict, the record 7f publishes). Unset in production; the layout never reads it.
44
+ * Its own tap, not `verdictTap`: these are no judges, and the verdict digests of the judges must not move for them.
45
+ */
46
+ export declare const targetTap: {
47
+ sink?: (name: string, value: string) => void;
48
+ };
49
+ /** Gives an event to the test sink, when there is one. `value` is built only then. */
50
+ export declare function tapTarget(name: string, value: () => string): void;
51
+ /**
52
+ * The wanted ports of `nodes` whose target is declined. Absent says no target is declined: a model before 7c, a routed model, or one whose
53
+ * centre rule ran no producer (a hand-made transaction; `centreDraft` names that case, `ALIGNMENT_TARGETS_UNDECIDED`).
54
+ */
55
+ export declare function declinedTargets(model: LayoutModel, nodes: readonly string[]): Set<string>;
56
+ /**
57
+ * Writes the targets of one step at its end, read on the geometry the step leaves (all exits: it stood, the window or a post-condition declined it,
58
+ * the guard of ticket 75 undid it). Each wanted port: a declined entry stays (final for the attempt); a target the kept branch refused is
59
+ * `declined`; one that stands (miss <= 0.5 px, as `unresolved` reads it) is `kept`; one the step grew the body toward, or one that was kept or
60
+ * grown before, is `grown` with its room. A port that is no target in any state has no entry. Every face of the group that has entries is
61
+ * written again, so a face whose feeds yielded keeps only its declined entries (or `[]`). An entry whose decision does not change keeps the pass
62
+ * that wrote it. No record (before 7c, after 7f): nothing is written.
63
+ */
64
+ export declare function writeAlignmentTargets(model: LayoutModel, nodes: readonly string[], notes: TargetNotes, pass: number): void;
65
+ /**
66
+ * Whether a replay of a step writes no decline the stored face lacks (the publication check, R1/R5). A decline is the one decision of the record:
67
+ * final, and read by the tally. `kept` and `grown` are where the targets stood when the producer's last step on the group ended, and a move
68
+ * after it (the parent stand, a region rebuild, a 7f move) can leave them behind without a decision changing, so they are not compared.
69
+ * A stored decline the replay drops cannot happen (the writer keeps a decline); one it writes again equal is the same decision.
70
+ */
71
+ export declare function sameDeclines(stored: readonly AlignmentTarget[] | undefined, replayed: readonly AlignmentTarget[] | undefined): boolean;
72
+ /**
73
+ * The first fault of a stored record, or undefined (R5): a record outside the stages it lives at; a face of a node in the model, a port on that face, a link that ends at it, a far end
74
+ * that exists (the link's other port, or a lane of the link), the enum values and the fields each state carries, port-key order and no repeat.
75
+ */
76
+ export declare function alignmentTargetsFault(model: LayoutModel): string | undefined;
@@ -0,0 +1,76 @@
1
+ import { AlignmentDeclineReason, AlignmentTarget, LayoutLink, LayoutModel } from '../model/layout.js';
2
+ import { Feed } from './read/feeds.js';
3
+ /**
4
+ * The alignment-target record of the centring steps (architecture-2 ticket 66, `LayoutModel.alignmentTargets`). One producer writes it, the end of
5
+ * each centring step (`writeAlignmentTargets`); the vertical tally of ticket 65 reads its declined entries (`declinedTargets`); the publication
6
+ * check refuses a malformed record (`alignmentTargetsFault`) and names a decline its own replay writes that the record lacks (`sameDeclines`).
7
+ */
8
+ /** The reasons a step declines a target, in the order the kept branch reads them: ticket 65's post-conditions, then the overlay guard. */
9
+ export declare const ALIGNMENT_DECLINE_REASONS: readonly AlignmentDeclineReason[];
10
+ /** The finding of the publication check: a face where the replay declines a target the record does not. */
11
+ export declare const ALIGNMENT_TARGETS_DIFFER = "alignment-targets-differ";
12
+ /** What one step learned about its targets, read by the writer at the step's end on whatever geometry the step leaves. */
13
+ export interface TargetNotes {
14
+ /** The feed of each wanted child port, and the x it wants (`groupFeeds`). */
15
+ seats: ReadonlyMap<string, Feed>;
16
+ wanted: ReadonlyMap<string, number>;
17
+ /** The body edges, from the wanted x, of each target `alignSide` widened the body toward in this step. */
18
+ grown: Map<string, {
19
+ low: number;
20
+ high: number;
21
+ }>;
22
+ /** The body edges, from the wanted x, of each wanted port where the step began: the room of a target that stood and that the step moves off. */
23
+ start: Map<string, {
24
+ low: number;
25
+ high: number;
26
+ }>;
27
+ /** The targets the kept branch refused to keep, with the guard or post-condition and its key. */
28
+ declined: Map<string, {
29
+ reason: AlignmentDeclineReason;
30
+ by: string;
31
+ }>;
32
+ }
33
+ /** The direct members of the direct families: a direct member owes a vertical even as a held cross chord. */
34
+ export declare const directMembers: (model: LayoutModel) => Set<string>;
35
+ /**
36
+ * Whether a feed owes a vertical (ticket 65): its link is an orthogonal link, a frame chord or a direct member. A held cross-frame chord owes none
37
+ * (CONTEXT.md: any angle). One predicate for the tally and the record.
38
+ */
39
+ export declare function owesVertical(model: LayoutModel, link: LayoutLink | undefined, direct: ReadonlySet<string>): boolean;
40
+ /** Where a feed's x is read: the far port, or the lane of a transit feed (the lane of the feed's link that stands at the feed's x). */
41
+ export declare function feedFar(model: LayoutModel, feed: Feed): string;
42
+ /**
43
+ * Test only: a sink for the record's events (the kept branch's verdict, the record 7f publishes). Unset in production; the layout never reads it.
44
+ * Its own tap, not `verdictTap`: these are no judges, and the verdict digests of the judges must not move for them.
45
+ */
46
+ export declare const targetTap: {
47
+ sink?: (name: string, value: string) => void;
48
+ };
49
+ /** Gives an event to the test sink, when there is one. `value` is built only then. */
50
+ export declare function tapTarget(name: string, value: () => string): void;
51
+ /**
52
+ * The wanted ports of `nodes` whose target is declined. Absent says no target is declined: a model before 7c, a routed model, or one whose
53
+ * centre rule ran no producer (a hand-made transaction; `centreDraft` names that case, `ALIGNMENT_TARGETS_UNDECIDED`).
54
+ */
55
+ export declare function declinedTargets(model: LayoutModel, nodes: readonly string[]): Set<string>;
56
+ /**
57
+ * Writes the targets of one step at its end, read on the geometry the step leaves (all exits: it stood, the window or a post-condition declined it,
58
+ * the guard of ticket 75 undid it). Each wanted port: a declined entry stays (final for the attempt); a target the kept branch refused is
59
+ * `declined`; one that stands (miss <= 0.5 px, as `unresolved` reads it) is `kept`; one the step grew the body toward, or one that was kept or
60
+ * grown before, is `grown` with its room. A port that is no target in any state has no entry. Every face of the group that has entries is
61
+ * written again, so a face whose feeds yielded keeps only its declined entries (or `[]`). An entry whose decision does not change keeps the pass
62
+ * that wrote it. No record (before 7c, after 7f): nothing is written.
63
+ */
64
+ export declare function writeAlignmentTargets(model: LayoutModel, nodes: readonly string[], notes: TargetNotes, pass: number): void;
65
+ /**
66
+ * Whether a replay of a step writes no decline the stored face lacks (the publication check, R1/R5). A decline is the one decision of the record:
67
+ * final, and read by the tally. `kept` and `grown` are where the targets stood when the producer's last step on the group ended, and a move
68
+ * after it (the parent stand, a region rebuild, a 7f move) can leave them behind without a decision changing, so they are not compared.
69
+ * A stored decline the replay drops cannot happen (the writer keeps a decline); one it writes again equal is the same decision.
70
+ */
71
+ export declare function sameDeclines(stored: readonly AlignmentTarget[] | undefined, replayed: readonly AlignmentTarget[] | undefined): boolean;
72
+ /**
73
+ * The first fault of a stored record, or undefined (R5): a record outside the stages it lives at; a face of a node in the model, a port on that face, a link that ends at it, a far end
74
+ * that exists (the link's other port, or a lane of the link), the enum values and the fields each state carries, port-key order and no repeat.
75
+ */
76
+ export declare function alignmentTargetsFault(model: LayoutModel): string | undefined;
@@ -0,0 +1,13 @@
1
+ import { Point, Side } from '../model/geometry.cjs';
2
+ import { LayoutLink, LayoutModel, LayoutPort } from '../model/layout.cjs';
3
+ /** The point on the pill of `port` where an approach from `approach` meets it, or undefined for an anonymous port or an approach that is not tangential. */
4
+ export declare function approachPoint(port: LayoutPort, approach: Side): Point | undefined;
5
+ /**
6
+ * The extra reach of a virtual port's stem: how far its anchor stands inside the node's own face on the approach side. The stem still ends one side reach
7
+ * (`portStemReach`) beyond that face, as the stem of every top or bottom port does, so its tip stands where the tips of the node's other ports on that face stand.
8
+ */
9
+ export declare const approachReach: WeakMap<LayoutPort, number>;
10
+ /** The port that `end` of `link` really meets: the port itself, or its virtual port on the approach the link carries. */
11
+ export declare function endPort(model: LayoutModel, link: LayoutLink, end: 'from' | 'to'): LayoutPort | undefined;
12
+ /** Whether `end` of `link` meets its pill on an approach. */
13
+ export declare const hasApproach: (link: LayoutLink, end: "from" | "to") => boolean;
@@ -0,0 +1,13 @@
1
+ import { Point, Side } from '../model/geometry.js';
2
+ import { LayoutLink, LayoutModel, LayoutPort } from '../model/layout.js';
3
+ /** The point on the pill of `port` where an approach from `approach` meets it, or undefined for an anonymous port or an approach that is not tangential. */
4
+ export declare function approachPoint(port: LayoutPort, approach: Side): Point | undefined;
5
+ /**
6
+ * The extra reach of a virtual port's stem: how far its anchor stands inside the node's own face on the approach side. The stem still ends one side reach
7
+ * (`portStemReach`) beyond that face, as the stem of every top or bottom port does, so its tip stands where the tips of the node's other ports on that face stand.
8
+ */
9
+ export declare const approachReach: WeakMap<LayoutPort, number>;
10
+ /** The port that `end` of `link` really meets: the port itself, or its virtual port on the approach the link carries. */
11
+ export declare function endPort(model: LayoutModel, link: LayoutLink, end: 'from' | 'to'): LayoutPort | undefined;
12
+ /** Whether `end` of `link` meets its pill on an approach. */
13
+ export declare const hasApproach: (link: LayoutLink, end: "from" | "to") => boolean;
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Counters of the repeated work inside the stage-7f placement attempt. They exist for tests and measurements only: nothing reads them to
3
+ * decide anything, and they are never written into the layout model or its JSON. A leaf module, so any producer may count into it.
4
+ *
5
+ * Two kinds of counter. The cheap ones are plain increments and always run. The invalidation counters that need a read of the model
6
+ * (`read`, `tierGapPlans`, `blockedChords`) run only when `ledger` is on or an `attemptTrace` was asked for; off, they cost one boolean test.
7
+ */
8
+ /** Whether the last 7f attempt kept an optional move (the linkless step or the chord step). The pipeline reads it right after the baseline run; it decides no layout. */
9
+ export declare const lastAttempt: {
10
+ moved: boolean; /** The first settled copy of the attempt's baseline, taken before any kept move: the unmoved state (undefined when a move came first or none was judged). */
11
+ unmoved: import('../model/layout.cjs').LayoutModel | undefined;
12
+ };
13
+ export interface AttemptCounters {
14
+ /** Calls of one round of the tier-gap growth and the canton close-up (`settleRound`). */
15
+ settleCalls: number;
16
+ /** Passes of the centring producer (each spends one pass of an eight-pass budget). */
17
+ centringPasses: number;
18
+ /** Copies of the model made to try something on: a chord step, a probe, a settled trial, a producer replay. */
19
+ candidateCopies: number;
20
+ /** Replays of a producer by a validator, to see that a published model is its own fixed point. */
21
+ validationReplays: number;
22
+ /** Calls of `replayRegions` (the regions, the grid and the labels), on the draft and on every copy. */
23
+ replays: number;
24
+ /** Settled copies the chord step judged a move on (its baselines included). */
25
+ settledTrials: number;
26
+ /** Cheap trials of the chord step: a move made and read before a settled copy is paid for. */
27
+ cheapTrials: number;
28
+ /**
29
+ * Replays of the centring check that wrote to a part the trials share and ran again on a full copy (`readCentreViolations`, architecture-2 ticket 63).
30
+ * 0 on every sheet measured; a count above 0 names a step that writes what the per-step copy does not hold.
31
+ */
32
+ centreCheckFallbacks: number;
33
+ /**
34
+ * Producer steps of the centring passes at a chord stage (architecture-2 ticket 62): `carried` took the readings the step before left, `fresh` read them
35
+ * from the model (the first step of a pass, after a declined step or a cleared group, or when the rebuild of the group changed its nodes).
36
+ */
37
+ centreCarry: {
38
+ carried: number;
39
+ fresh: number;
40
+ };
41
+ /** Runs of the one tier-gap solve (`solveTierGaps`, architecture-2 ticket 57): one per 7f attempt body. */
42
+ gapSolves: number;
43
+ /** Runs of the placement stages 1 to 7e (the first, the fan re-runs, the side re-run). */
44
+ placeRuns: number;
45
+ /** Starts of the stages 1 to 7e, counted at the entry of `place`, so a run that is refused before or after ELK is counted too (the cap is on starts, and a start is never given back). */
46
+ placeStarts: number;
47
+ /** Runs of the 7f placement attempt (the baseline and the side trial). */
48
+ attempts: number;
49
+ /** Rounds of the 7f loop, over all attempts, and how many of them ended with the close-up still open. */
50
+ rounds: number;
51
+ openRounds: number;
52
+ /** Rounds in which the chord step moved a mover. */
53
+ chordRoundsMoved: number;
54
+ /** What the reseat of the lanes decided at the end of 7f. */
55
+ reseat: {
56
+ adopted: number;
57
+ refused: number;
58
+ none: number;
59
+ };
60
+ /** Set by a test (or by the trace) to read the invalidations that need a read of the model. */
61
+ ledger: boolean;
62
+ /** Depth of `placementAttempt` runs now on the stack: a producer counts its 7f work only inside one. */
63
+ in7f: number;
64
+ /** Things a later pass undid or could have reserved. Each is counted at the pass that finds it. */
65
+ invalidations: Invalidations;
66
+ /** One entry for each run of the stages 1 to 7e, in order (the first, then the fan re-runs, then the side re-run). Filled only with the ledger on. */
67
+ placements: PlacementEntry[];
68
+ /** One entry for each run of the 7f attempt, in order (the baseline, then the side trial). Filled only with the ledger on, except the round counts. */
69
+ attemptLog: AttemptEntry[];
70
+ }
71
+ /** What the stages 1 to 7e of one placement run lost: routed chords, and straight overlay links over all stages and at `centre` alone. */
72
+ export interface PlacementEntry {
73
+ chordsLost: number;
74
+ overlayLost: number;
75
+ overlayGained: number;
76
+ centreOverlayLost: number;
77
+ centreOverlayGained: number;
78
+ }
79
+ /** What the 7f loop of one attempt did. */
80
+ export interface AttemptEntry {
81
+ rounds: number;
82
+ openRounds: number;
83
+ chordRoundsMoved: number;
84
+ overlayLost: number;
85
+ overlayGained: number;
86
+ alignedLost: number;
87
+ bodiesOnFrozenChord: number;
88
+ }
89
+ export interface Invalidations {
90
+ /** A round opened (the close-up moved 0.5 px or more) right after a round in which the chord step moved something. */
91
+ closeUpReopened: number;
92
+ /** Overlay links straight before a step of 7f (or of stages 7a to 7e, `pre`) and not after it, and the ones it made straight. */
93
+ overlayStraightLost: number;
94
+ overlayStraightGained: number;
95
+ /** Routed links aligned (straight, on one axis) before a step of 7f and not after it. */
96
+ routedAlignedLost: number;
97
+ /** Routed chords (frame, cross) held before a stage of 7a to 7e and not after it, and the ones it gained. */
98
+ preRoutedChordLost: number;
99
+ preOverlayStraightLost: number;
100
+ preOverlayStraightGained: number;
101
+ /** Bodies that came to stand on a frozen chord during the 7f loop. */
102
+ bodyOnFrozenChord: number;
103
+ /** The held-axis probe would have moved a column, so the warnings were only refreshed. */
104
+ heldProbeMoved: number;
105
+ /** Tier gaps that still ask for room after the rounds of 7f. */
106
+ shortGapsAfterRounds: number;
107
+ /** A run of the overlay windows kept inside a 7f run (the draft and every copy). */
108
+ overlayWindowsKept: number;
109
+ /** A placement re-run: a fan re-run, a side re-run. */
110
+ fanReruns: number;
111
+ sideReruns: number;
112
+ /** A 7f run that ended with the cantons not settled. */
113
+ cantonNonConvergence: number;
114
+ }
115
+ export declare const attemptCounters: AttemptCounters;
116
+ /** Zeroes every count. The `ledger` switch stays as the caller set it. */
117
+ export declare function resetAttemptCounters(): void;
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Counters of the repeated work inside the stage-7f placement attempt. They exist for tests and measurements only: nothing reads them to
3
+ * decide anything, and they are never written into the layout model or its JSON. A leaf module, so any producer may count into it.
4
+ *
5
+ * Two kinds of counter. The cheap ones are plain increments and always run. The invalidation counters that need a read of the model
6
+ * (`read`, `tierGapPlans`, `blockedChords`) run only when `ledger` is on or an `attemptTrace` was asked for; off, they cost one boolean test.
7
+ */
8
+ /** Whether the last 7f attempt kept an optional move (the linkless step or the chord step). The pipeline reads it right after the baseline run; it decides no layout. */
9
+ export declare const lastAttempt: {
10
+ moved: boolean; /** The first settled copy of the attempt's baseline, taken before any kept move: the unmoved state (undefined when a move came first or none was judged). */
11
+ unmoved: import('../model/layout.js').LayoutModel | undefined;
12
+ };
13
+ export interface AttemptCounters {
14
+ /** Calls of one round of the tier-gap growth and the canton close-up (`settleRound`). */
15
+ settleCalls: number;
16
+ /** Passes of the centring producer (each spends one pass of an eight-pass budget). */
17
+ centringPasses: number;
18
+ /** Copies of the model made to try something on: a chord step, a probe, a settled trial, a producer replay. */
19
+ candidateCopies: number;
20
+ /** Replays of a producer by a validator, to see that a published model is its own fixed point. */
21
+ validationReplays: number;
22
+ /** Calls of `replayRegions` (the regions, the grid and the labels), on the draft and on every copy. */
23
+ replays: number;
24
+ /** Settled copies the chord step judged a move on (its baselines included). */
25
+ settledTrials: number;
26
+ /** Cheap trials of the chord step: a move made and read before a settled copy is paid for. */
27
+ cheapTrials: number;
28
+ /**
29
+ * Replays of the centring check that wrote to a part the trials share and ran again on a full copy (`readCentreViolations`, architecture-2 ticket 63).
30
+ * 0 on every sheet measured; a count above 0 names a step that writes what the per-step copy does not hold.
31
+ */
32
+ centreCheckFallbacks: number;
33
+ /**
34
+ * Producer steps of the centring passes at a chord stage (architecture-2 ticket 62): `carried` took the readings the step before left, `fresh` read them
35
+ * from the model (the first step of a pass, after a declined step or a cleared group, or when the rebuild of the group changed its nodes).
36
+ */
37
+ centreCarry: {
38
+ carried: number;
39
+ fresh: number;
40
+ };
41
+ /** Runs of the one tier-gap solve (`solveTierGaps`, architecture-2 ticket 57): one per 7f attempt body. */
42
+ gapSolves: number;
43
+ /** Runs of the placement stages 1 to 7e (the first, the fan re-runs, the side re-run). */
44
+ placeRuns: number;
45
+ /** Starts of the stages 1 to 7e, counted at the entry of `place`, so a run that is refused before or after ELK is counted too (the cap is on starts, and a start is never given back). */
46
+ placeStarts: number;
47
+ /** Runs of the 7f placement attempt (the baseline and the side trial). */
48
+ attempts: number;
49
+ /** Rounds of the 7f loop, over all attempts, and how many of them ended with the close-up still open. */
50
+ rounds: number;
51
+ openRounds: number;
52
+ /** Rounds in which the chord step moved a mover. */
53
+ chordRoundsMoved: number;
54
+ /** What the reseat of the lanes decided at the end of 7f. */
55
+ reseat: {
56
+ adopted: number;
57
+ refused: number;
58
+ none: number;
59
+ };
60
+ /** Set by a test (or by the trace) to read the invalidations that need a read of the model. */
61
+ ledger: boolean;
62
+ /** Depth of `placementAttempt` runs now on the stack: a producer counts its 7f work only inside one. */
63
+ in7f: number;
64
+ /** Things a later pass undid or could have reserved. Each is counted at the pass that finds it. */
65
+ invalidations: Invalidations;
66
+ /** One entry for each run of the stages 1 to 7e, in order (the first, then the fan re-runs, then the side re-run). Filled only with the ledger on. */
67
+ placements: PlacementEntry[];
68
+ /** One entry for each run of the 7f attempt, in order (the baseline, then the side trial). Filled only with the ledger on, except the round counts. */
69
+ attemptLog: AttemptEntry[];
70
+ }
71
+ /** What the stages 1 to 7e of one placement run lost: routed chords, and straight overlay links over all stages and at `centre` alone. */
72
+ export interface PlacementEntry {
73
+ chordsLost: number;
74
+ overlayLost: number;
75
+ overlayGained: number;
76
+ centreOverlayLost: number;
77
+ centreOverlayGained: number;
78
+ }
79
+ /** What the 7f loop of one attempt did. */
80
+ export interface AttemptEntry {
81
+ rounds: number;
82
+ openRounds: number;
83
+ chordRoundsMoved: number;
84
+ overlayLost: number;
85
+ overlayGained: number;
86
+ alignedLost: number;
87
+ bodiesOnFrozenChord: number;
88
+ }
89
+ export interface Invalidations {
90
+ /** A round opened (the close-up moved 0.5 px or more) right after a round in which the chord step moved something. */
91
+ closeUpReopened: number;
92
+ /** Overlay links straight before a step of 7f (or of stages 7a to 7e, `pre`) and not after it, and the ones it made straight. */
93
+ overlayStraightLost: number;
94
+ overlayStraightGained: number;
95
+ /** Routed links aligned (straight, on one axis) before a step of 7f and not after it. */
96
+ routedAlignedLost: number;
97
+ /** Routed chords (frame, cross) held before a stage of 7a to 7e and not after it, and the ones it gained. */
98
+ preRoutedChordLost: number;
99
+ preOverlayStraightLost: number;
100
+ preOverlayStraightGained: number;
101
+ /** Bodies that came to stand on a frozen chord during the 7f loop. */
102
+ bodyOnFrozenChord: number;
103
+ /** The held-axis probe would have moved a column, so the warnings were only refreshed. */
104
+ heldProbeMoved: number;
105
+ /** Tier gaps that still ask for room after the rounds of 7f. */
106
+ shortGapsAfterRounds: number;
107
+ /** A run of the overlay windows kept inside a 7f run (the draft and every copy). */
108
+ overlayWindowsKept: number;
109
+ /** A placement re-run: a fan re-run, a side re-run. */
110
+ fanReruns: number;
111
+ sideReruns: number;
112
+ /** A 7f run that ended with the cantons not settled. */
113
+ cantonNonConvergence: number;
114
+ }
115
+ export declare const attemptCounters: AttemptCounters;
116
+ /** Zeroes every count. The `ledger` switch stays as the caller set it. */
117
+ export declare function resetAttemptCounters(): void;
@@ -0,0 +1,31 @@
1
+ import { LayoutModel } from '../model/layout.cjs';
2
+ import { AttemptEntry, PlacementEntry } from './attempt-counters.cjs';
3
+ /**
4
+ * The readers behind the invalidation counters of `attempt-counters.ts` (architecture ticket 13, phase 1). A snapshot is the set of routed chords,
5
+ * the straight overlay links and the aligned routed links the model holds now; the difference of two snapshots is what a step lost and gained.
6
+ * Every read here costs a pass over the links, so a caller asks `ledgerOn` first and reads nothing when it is off. Nothing here writes the model.
7
+ */
8
+ export interface LedgerSnapshot {
9
+ chords: ReadonlySet<string>;
10
+ overlay: ReadonlySet<string>;
11
+ aligned: ReadonlySet<string>;
12
+ blocked: ReadonlySet<string>;
13
+ }
14
+ /** Whether the invalidations that need a read of the model are counted: a test turned the ledger on, or a trace was asked for. */
15
+ export declare const ledgerOn: (traced: boolean) => boolean;
16
+ export declare function ledgerSnapshot(model: LayoutModel): LedgerSnapshot;
17
+ /** What a step of 7f changed: the links it lost and the ones it gained. */
18
+ export declare function ledgerStep(before: LedgerSnapshot, after: LedgerSnapshot): {
19
+ overlayLost: string[];
20
+ overlayGained: string[];
21
+ alignedLost: string[];
22
+ newlyBlocked: string[];
23
+ };
24
+ /** Adds one 7f step to the counters and to the entry of the attempt, and gives the trace verdict that names it. */
25
+ export declare function countStep(before: LedgerSnapshot, after: LedgerSnapshot, entry: AttemptEntry): string;
26
+ /** A new entry for the run that starts now; it joins the attempt log only when `logged`. */
27
+ export declare function startAttemptEntry(logged: boolean): AttemptEntry;
28
+ /** A new entry of the placement log, for the run that starts now. */
29
+ export declare function startPlacementEntry(): PlacementEntry;
30
+ /** The same for one stage of 7a to 7e: the routed chords and the straight overlay links it lost and gained. */
31
+ export declare function countStage(stage: string, before: LedgerSnapshot, after: LedgerSnapshot, entry: PlacementEntry): void;
@@ -0,0 +1,31 @@
1
+ import { LayoutModel } from '../model/layout.js';
2
+ import { AttemptEntry, PlacementEntry } from './attempt-counters.js';
3
+ /**
4
+ * The readers behind the invalidation counters of `attempt-counters.ts` (architecture ticket 13, phase 1). A snapshot is the set of routed chords,
5
+ * the straight overlay links and the aligned routed links the model holds now; the difference of two snapshots is what a step lost and gained.
6
+ * Every read here costs a pass over the links, so a caller asks `ledgerOn` first and reads nothing when it is off. Nothing here writes the model.
7
+ */
8
+ export interface LedgerSnapshot {
9
+ chords: ReadonlySet<string>;
10
+ overlay: ReadonlySet<string>;
11
+ aligned: ReadonlySet<string>;
12
+ blocked: ReadonlySet<string>;
13
+ }
14
+ /** Whether the invalidations that need a read of the model are counted: a test turned the ledger on, or a trace was asked for. */
15
+ export declare const ledgerOn: (traced: boolean) => boolean;
16
+ export declare function ledgerSnapshot(model: LayoutModel): LedgerSnapshot;
17
+ /** What a step of 7f changed: the links it lost and the ones it gained. */
18
+ export declare function ledgerStep(before: LedgerSnapshot, after: LedgerSnapshot): {
19
+ overlayLost: string[];
20
+ overlayGained: string[];
21
+ alignedLost: string[];
22
+ newlyBlocked: string[];
23
+ };
24
+ /** Adds one 7f step to the counters and to the entry of the attempt, and gives the trace verdict that names it. */
25
+ export declare function countStep(before: LedgerSnapshot, after: LedgerSnapshot, entry: AttemptEntry): string;
26
+ /** A new entry for the run that starts now; it joins the attempt log only when `logged`. */
27
+ export declare function startAttemptEntry(logged: boolean): AttemptEntry;
28
+ /** A new entry of the placement log, for the run that starts now. */
29
+ export declare function startPlacementEntry(): PlacementEntry;
30
+ /** The same for one stage of 7a to 7e: the routed chords and the straight overlay links it lost and gained. */
31
+ export declare function countStage(stage: string, before: LedgerSnapshot, after: LedgerSnapshot, entry: PlacementEntry): void;
@@ -0,0 +1,41 @@
1
+ import { LayoutModel } from '../model/layout.cjs';
2
+ /**
3
+ * Timings of the sub-steps inside a settled trial of the 7f chord step (architecture 2, ticket 05, phase 0). A measurement only: nothing reads
4
+ * it to decide anything, it writes nothing into the layout model or its JSON, and a run with `on` false pays one boolean test per call.
5
+ * A leaf module, like `attempt-counters.ts`. A test turns `on` on and reads `trials`.
6
+ *
7
+ * A step is recorded by its exclusive time (its own time less the steps it contains) and its inclusive time, and only inside a trial.
8
+ */
9
+ export interface StepTime {
10
+ calls: number;
11
+ own: number;
12
+ total: number;
13
+ }
14
+ export interface TrialTiming {
15
+ steps: Map<string, StepTime>;
16
+ total: number;
17
+ }
18
+ /** Observers a test may set, to read the model at the points the measurement needs. Called only when `on` is true. */
19
+ export interface TimingHooks {
20
+ /** The draft, just after `settleRound` of a round, before the linkless step: the state the settled trials of the round are judged against. */
21
+ base?(draft: LayoutModel): void;
22
+ /** The start of a round of the 7f loop. */
23
+ round?(draft: LayoutModel): void;
24
+ /** A settled trial: the probe before `follow` ran on it, and after. */
25
+ enter?(probe: LayoutModel): void;
26
+ exit?(probe: LayoutModel): void;
27
+ }
28
+ export declare const attemptTimings: {
29
+ on: boolean;
30
+ trials: TrialTiming[];
31
+ hooks: TimingHooks;
32
+ current: TrialTiming | undefined;
33
+ stack: {
34
+ child: number;
35
+ }[];
36
+ };
37
+ export declare function resetAttemptTimings(): void;
38
+ /** Runs `fn`; with timings on and a trial open, adds its time to the step `label`. */
39
+ export declare function timed<T>(label: string, fn: () => T): T;
40
+ /** Opens a trial record (a settled copy: its copy, its `follow` and its verdict) around `fn`. A trial inside a trial is not opened. */
41
+ export declare function timedTrial<T>(fn: () => T): T;
@@ -0,0 +1,41 @@
1
+ import { LayoutModel } from '../model/layout.js';
2
+ /**
3
+ * Timings of the sub-steps inside a settled trial of the 7f chord step (architecture 2, ticket 05, phase 0). A measurement only: nothing reads
4
+ * it to decide anything, it writes nothing into the layout model or its JSON, and a run with `on` false pays one boolean test per call.
5
+ * A leaf module, like `attempt-counters.ts`. A test turns `on` on and reads `trials`.
6
+ *
7
+ * A step is recorded by its exclusive time (its own time less the steps it contains) and its inclusive time, and only inside a trial.
8
+ */
9
+ export interface StepTime {
10
+ calls: number;
11
+ own: number;
12
+ total: number;
13
+ }
14
+ export interface TrialTiming {
15
+ steps: Map<string, StepTime>;
16
+ total: number;
17
+ }
18
+ /** Observers a test may set, to read the model at the points the measurement needs. Called only when `on` is true. */
19
+ export interface TimingHooks {
20
+ /** The draft, just after `settleRound` of a round, before the linkless step: the state the settled trials of the round are judged against. */
21
+ base?(draft: LayoutModel): void;
22
+ /** The start of a round of the 7f loop. */
23
+ round?(draft: LayoutModel): void;
24
+ /** A settled trial: the probe before `follow` ran on it, and after. */
25
+ enter?(probe: LayoutModel): void;
26
+ exit?(probe: LayoutModel): void;
27
+ }
28
+ export declare const attemptTimings: {
29
+ on: boolean;
30
+ trials: TrialTiming[];
31
+ hooks: TimingHooks;
32
+ current: TrialTiming | undefined;
33
+ stack: {
34
+ child: number;
35
+ }[];
36
+ };
37
+ export declare function resetAttemptTimings(): void;
38
+ /** Runs `fn`; with timings on and a trial open, adds its time to the step `label`. */
39
+ export declare function timed<T>(label: string, fn: () => T): T;
40
+ /** Opens a trial record (a settled copy: its copy, its `follow` and its verdict) around `fn`. A trial inside a trial is not opened. */
41
+ export declare function timedTrial<T>(fn: () => T): T;