@vibecook/ice 0.11.0 → 0.14.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 (381) hide show
  1. package/README.md +79 -50
  2. package/dist/chunk-BA7XJC27.js +2429 -0
  3. package/dist/chunk-BA7XJC27.js.map +1 -0
  4. package/dist/chunk-BKV4ZEU3.js +1 -0
  5. package/dist/chunk-BKV4ZEU3.js.map +1 -0
  6. package/dist/{chunk-VGVDJZSP.js → chunk-DYK6KNLG.js} +13206 -7387
  7. package/dist/chunk-DYK6KNLG.js.map +1 -0
  8. package/dist/chunk-ENIFIUEP.js +155 -0
  9. package/dist/chunk-ENIFIUEP.js.map +1 -0
  10. package/dist/chunk-IBWWLA6D.js +634 -0
  11. package/dist/chunk-IBWWLA6D.js.map +1 -0
  12. package/dist/{chunk-OR5FNVUE.js → chunk-JS6PG6YD.js} +398 -167
  13. package/dist/chunk-JS6PG6YD.js.map +1 -0
  14. package/dist/chunk-QXOCF56A.js +148 -0
  15. package/dist/chunk-QXOCF56A.js.map +1 -0
  16. package/dist/chunk-ZPUPBULB.js +7399 -0
  17. package/dist/chunk-ZPUPBULB.js.map +1 -0
  18. package/dist/desk-engine.js +36 -0
  19. package/dist/desk-engine.js.map +1 -0
  20. package/dist/desk-kit.js +244 -0
  21. package/dist/desk-kit.js.map +1 -0
  22. package/dist/desk-objects.js +12728 -0
  23. package/dist/desk-objects.js.map +1 -0
  24. package/dist/desk.js +469 -0
  25. package/dist/desk.js.map +1 -0
  26. package/dist/devtools.js +233 -189
  27. package/dist/devtools.js.map +1 -1
  28. package/dist/dom.js +7 -19
  29. package/dist/index.js +232 -20
  30. package/dist/kernel.js +53 -25
  31. package/dist/react.js +1045 -38
  32. package/dist/react.js.map +1 -1
  33. package/dist/types/packages/core/src/behavior/define-behavior.d.ts +11 -0
  34. package/dist/types/packages/core/src/behavior/runtime.d.ts +4 -0
  35. package/dist/types/packages/core/src/canvas/define-canvas-type.d.ts +86 -0
  36. package/dist/types/packages/core/src/canvas/define-container.d.ts +17 -0
  37. package/dist/types/packages/core/src/canvas/diagnostics.d.ts +27 -0
  38. package/dist/types/packages/core/src/canvas/engine-catalog.d.ts +70 -0
  39. package/dist/types/packages/core/src/canvas/extensions.d.ts +125 -0
  40. package/dist/types/packages/core/src/canvas/frame-behavior-host.d.ts +16 -0
  41. package/dist/types/packages/core/src/canvas/frame-preview.d.ts +79 -0
  42. package/dist/types/packages/core/src/canvas/frame-projection.d.ts +38 -0
  43. package/dist/types/packages/core/src/canvas/frame-view.d.ts +36 -0
  44. package/dist/types/packages/core/src/canvas/migrate.d.ts +14 -0
  45. package/dist/types/packages/core/src/canvas/placement.d.ts +30 -0
  46. package/dist/types/packages/core/src/canvas/presentation-transition.d.ts +100 -0
  47. package/dist/types/packages/core/src/canvas/runtime-extension-host.d.ts +16 -0
  48. package/dist/types/packages/core/src/canvas/session.d.ts +47 -0
  49. package/dist/types/packages/core/src/catalog/camera-derived.d.ts +16 -27
  50. package/dist/types/packages/core/src/catalog/desk.d.ts +326 -0
  51. package/dist/types/packages/core/src/catalog/gesture.d.ts +51 -0
  52. package/dist/types/packages/core/src/catalog/graph.d.ts +2 -2
  53. package/dist/types/packages/core/src/catalog/index.d.ts +2 -0
  54. package/dist/types/packages/core/src/catalog/pointer.d.ts +42 -0
  55. package/dist/types/packages/core/src/catalog/selection-presence.d.ts +7 -0
  56. package/dist/types/packages/core/src/catalog/settings-resources.d.ts +28 -2
  57. package/dist/types/packages/core/src/catalog/surface.d.ts +1 -0
  58. package/dist/types/packages/core/src/doc/doc-commit-sink.d.ts +18 -2
  59. package/dist/types/packages/core/src/doc/doc-kit.d.ts +21 -2
  60. package/dist/types/packages/core/src/doc/envelope.d.ts +5 -2
  61. package/dist/types/packages/core/src/doc/schema-migrate.d.ts +1 -1
  62. package/dist/types/packages/core/src/doc/version-gate.d.ts +21 -3
  63. package/dist/types/packages/core/src/engine/commit-sink.d.ts +10 -1
  64. package/dist/types/packages/core/src/engine/engine.d.ts +6 -0
  65. package/dist/types/packages/core/src/engine/frame-control.d.ts +74 -0
  66. package/dist/types/packages/core/src/engine/guests.d.ts +4 -1
  67. package/dist/types/packages/core/src/engine/world-doors.d.ts +12 -0
  68. package/dist/types/packages/core/src/facade/create-canvas-engine.d.ts +146 -13
  69. package/dist/types/packages/core/src/index.d.ts +33 -12
  70. package/dist/types/packages/core/src/input/queue.d.ts +3 -1
  71. package/dist/types/packages/core/src/interaction/install.d.ts +30 -0
  72. package/dist/types/packages/core/src/interaction/wakes.d.ts +24 -0
  73. package/dist/types/packages/core/src/nav/nav-geometry.d.ts +100 -0
  74. package/dist/types/packages/core/src/nav/nested-canvas.d.ts +47 -4
  75. package/dist/types/packages/core/src/ops/cascade.d.ts +2 -1
  76. package/dist/types/packages/core/src/ops/claims.d.ts +6 -0
  77. package/dist/types/packages/core/src/ops/insert.d.ts +4 -0
  78. package/dist/types/packages/core/src/ops/point-pick.d.ts +4 -1
  79. package/dist/types/packages/core/src/ops/sibling-order.d.ts +14 -4
  80. package/dist/types/packages/core/src/ops/tray.d.ts +48 -0
  81. package/dist/types/packages/core/src/presence/presence-kit.d.ts +5 -0
  82. package/dist/types/packages/core/src/schema/meta.d.ts +10 -0
  83. package/dist/types/packages/core/src/schema/prefab.d.ts +8 -0
  84. package/dist/types/packages/core/src/settings/defaults.d.ts +25 -6
  85. package/dist/types/packages/core/src/surface/gpu-device.d.ts +55 -0
  86. package/dist/types/packages/core/src/systems/camera-sim.d.ts +29 -0
  87. package/dist/types/packages/core/src/systems/chrome.d.ts +15 -23
  88. package/dist/types/packages/core/src/systems/drag-mods.d.ts +34 -0
  89. package/dist/types/packages/core/src/systems/held.d.ts +71 -0
  90. package/dist/types/packages/core/src/systems/insert-ghost.d.ts +2 -0
  91. package/dist/types/packages/core/src/systems/l0-input.d.ts +14 -0
  92. package/dist/types/packages/core/src/systems/l1-pick.d.ts +37 -1
  93. package/dist/types/packages/core/src/systems/l2-arbitrate.d.ts +18 -4
  94. package/dist/types/packages/core/src/systems/l3-behave.d.ts +4 -1
  95. package/dist/types/packages/core/src/systems/l3-claim.d.ts +7 -0
  96. package/dist/types/packages/core/src/systems/l3-connect.d.ts +1 -1
  97. package/dist/types/packages/core/src/systems/l3-drop.d.ts +30 -1
  98. package/dist/types/packages/core/src/systems/l3-marquee.d.ts +2 -1
  99. package/dist/types/packages/core/src/systems/l3-ports.d.ts +1 -1
  100. package/dist/types/packages/core/src/systems/l4-cursor.d.ts +5 -0
  101. package/dist/types/packages/core/src/systems/nav-flight.d.ts +85 -3
  102. package/dist/types/packages/core/src/systems/nav-tap.d.ts +44 -0
  103. package/dist/types/packages/core/src/systems/press-wheel.d.ts +11 -0
  104. package/dist/types/packages/core/src/systems/tray.d.ts +108 -0
  105. package/dist/types/packages/core/src/systems/zoom-through.d.ts +30 -0
  106. package/dist/types/packages/core/src/tools/define-tool.d.ts +10 -0
  107. package/dist/types/packages/core/src/widget/define-widget.d.ts +166 -63
  108. package/dist/types/packages/core/src/widget/equip.d.ts +14 -2
  109. package/dist/types/packages/core/src/widget/held-tools.d.ts +83 -0
  110. package/dist/types/packages/core/src/widget/menu-actions.d.ts +44 -0
  111. package/dist/types/packages/core/src/widget/mount-store.d.ts +21 -46
  112. package/dist/types/packages/core/src/widget/spawn.d.ts +1 -1
  113. package/dist/types/packages/desk/src/assets/blue-noise.gen.d.ts +10 -0
  114. package/dist/types/packages/desk/src/card/card.d.ts +103 -0
  115. package/dist/types/packages/desk/src/compose/ambient.d.ts +59 -0
  116. package/dist/types/packages/desk/src/compose/builder.d.ts +285 -0
  117. package/dist/types/packages/desk/src/compose/children.d.ts +3 -0
  118. package/dist/types/packages/desk/src/compose/index.d.ts +14 -0
  119. package/dist/types/packages/desk/src/compose/marks.d.ts +126 -0
  120. package/dist/types/packages/desk/src/compose/pick.d.ts +5 -0
  121. package/dist/types/packages/desk/src/compose/reflector.d.ts +111 -0
  122. package/dist/types/packages/desk/src/compose/tap.d.ts +5 -0
  123. package/dist/types/packages/desk/src/docs.d.ts +23 -0
  124. package/dist/types/packages/desk/src/engine/budget.d.ts +38 -0
  125. package/dist/types/packages/desk/src/engine/device.d.ts +54 -0
  126. package/dist/types/packages/desk/src/engine/index.d.ts +5 -0
  127. package/dist/types/packages/desk/src/engine/pipeline.d.ts +36 -0
  128. package/dist/types/packages/desk/src/engine/rasters.d.ts +66 -0
  129. package/dist/types/packages/desk/src/engine/records.d.ts +56 -0
  130. package/dist/types/packages/desk/src/engine/shader.d.ts +22 -0
  131. package/dist/types/packages/desk/src/engine/struct.d.ts +39 -0
  132. package/dist/types/packages/desk/src/engine/target.d.ts +26 -0
  133. package/dist/types/packages/desk/src/gpu-ablation.d.ts +61 -0
  134. package/dist/types/packages/desk/src/gpu-memory.d.ts +54 -0
  135. package/dist/types/packages/desk/src/gpu-profiler.d.ts +141 -0
  136. package/dist/types/packages/desk/src/gpu-wrap.d.ts +8 -0
  137. package/dist/types/packages/desk/src/ground.d.ts +388 -0
  138. package/dist/types/packages/desk/src/hold/focus.d.ts +53 -0
  139. package/dist/types/packages/desk/src/hold/pose.d.ts +132 -0
  140. package/dist/types/packages/desk/src/hold/shaders.d.ts +9 -0
  141. package/dist/types/packages/desk/src/host/editor.d.ts +18 -0
  142. package/dist/types/packages/desk/src/host/index.d.ts +9 -0
  143. package/dist/types/packages/desk/src/host/ink.d.ts +18 -0
  144. package/dist/types/packages/desk/src/host/layer.d.ts +430 -0
  145. package/dist/types/packages/desk/src/host/picture.d.ts +2 -0
  146. package/dist/types/packages/desk/src/host/surface.d.ts +5 -0
  147. package/dist/types/packages/desk/src/index.d.ts +13 -0
  148. package/dist/types/packages/desk/src/kind.d.ts +187 -0
  149. package/dist/types/packages/desk/src/kinds/world.d.ts +429 -0
  150. package/dist/types/packages/desk/src/kit/arrays.d.ts +88 -0
  151. package/dist/types/packages/desk/src/kit/blobs.d.ts +40 -0
  152. package/dist/types/packages/desk/src/kit/book.d.ts +2 -0
  153. package/dist/types/packages/desk/src/kit/editor.d.ts +103 -0
  154. package/dist/types/packages/desk/src/kit/eye.d.ts +37 -0
  155. package/dist/types/packages/desk/src/kit/hold.d.ts +1 -0
  156. package/dist/types/packages/desk/src/kit/index.d.ts +26 -0
  157. package/dist/types/packages/desk/src/kit/inside.d.ts +116 -0
  158. package/dist/types/packages/desk/src/kit/layer.d.ts +159 -0
  159. package/dist/types/packages/desk/src/kit/light.d.ts +3 -0
  160. package/dist/types/packages/desk/src/kit/mesh.d.ts +29 -0
  161. package/dist/types/packages/desk/src/kit/mips.d.ts +2 -0
  162. package/dist/types/packages/desk/src/kit/nav.d.ts +2 -0
  163. package/dist/types/packages/desk/src/kit/paper-tex.d.ts +5 -0
  164. package/dist/types/packages/desk/src/kit/physics.d.ts +44 -0
  165. package/dist/types/packages/desk/src/kit/place.d.ts +44 -0
  166. package/dist/types/packages/desk/src/kit/print.d.ts +30 -0
  167. package/dist/types/packages/desk/src/kit/raster.d.ts +34 -0
  168. package/dist/types/packages/desk/src/kit/sdf.d.ts +1 -0
  169. package/dist/types/packages/desk/src/kit/seeds.d.ts +11 -0
  170. package/dist/types/packages/desk/src/kit/services.d.ts +34 -0
  171. package/dist/types/packages/desk/src/kit/springs.d.ts +12 -0
  172. package/dist/types/packages/desk/src/kit/strokes.d.ts +93 -0
  173. package/dist/types/packages/desk/src/kit/text.d.ts +142 -0
  174. package/dist/types/packages/desk/src/kit/uniform.d.ts +8 -0
  175. package/dist/types/packages/desk/src/kit/view.d.ts +39 -0
  176. package/dist/types/packages/desk/src/kit/wgsl.d.ts +15 -0
  177. package/dist/types/packages/desk/src/lattice/line.d.ts +15 -0
  178. package/dist/types/packages/desk/src/lattice/lod.d.ts +52 -0
  179. package/dist/types/packages/desk/src/lattice/ruler.d.ts +88 -0
  180. package/dist/types/packages/desk/src/marks/assemble.d.ts +65 -0
  181. package/dist/types/packages/desk/src/marks/ease.d.ts +4 -0
  182. package/dist/types/packages/desk/src/marks/laser.d.ts +41 -0
  183. package/dist/types/packages/desk/src/marks/layout.d.ts +167 -0
  184. package/dist/types/packages/desk/src/marks/pass.d.ts +59 -0
  185. package/dist/types/packages/desk/src/marks/shaders.d.ts +12 -0
  186. package/dist/types/packages/desk/src/mat/grid.d.ts +50 -0
  187. package/dist/types/packages/desk/src/mat/lamp.d.ts +14 -0
  188. package/dist/types/packages/desk/src/mat/layout.d.ts +144 -0
  189. package/dist/types/packages/desk/src/mat/mat-pass.d.ts +83 -0
  190. package/dist/types/packages/desk/src/mat/night.d.ts +95 -0
  191. package/dist/types/packages/desk/src/mat/projector.d.ts +39 -0
  192. package/dist/types/packages/desk/src/mat/shaders.d.ts +17 -0
  193. package/dist/types/packages/desk/src/mat/tilt.d.ts +14 -0
  194. package/dist/types/packages/desk/src/nav/flight.d.ts +186 -0
  195. package/dist/types/packages/desk/src/nav/portal.d.ts +95 -0
  196. package/dist/types/packages/desk/src/object.d.ts +46 -0
  197. package/dist/types/packages/desk/src/pass-instrument.d.ts +89 -0
  198. package/dist/types/packages/desk/src/shaders.d.ts +12 -0
  199. package/dist/types/packages/desk/src/shaders.gen.d.ts +16 -0
  200. package/dist/types/packages/desk/src/submit-instrument.d.ts +36 -0
  201. package/dist/types/packages/desk/src/theme.d.ts +475 -0
  202. package/dist/types/packages/desk/src/tray/carry.d.ts +99 -0
  203. package/dist/types/packages/desk/src/tray/drawer.d.ts +113 -0
  204. package/dist/types/packages/desk/src/tray/flux.d.ts +46 -0
  205. package/dist/types/packages/desk/src/tray/index.d.ts +4 -0
  206. package/dist/types/packages/desk/src/tray/lattice.d.ts +71 -0
  207. package/dist/types/packages/desk/src/tray/layout.d.ts +7 -0
  208. package/dist/types/packages/desk/src/tray/look.d.ts +29 -0
  209. package/dist/types/packages/desk/src/tray/pass.d.ts +96 -0
  210. package/dist/types/packages/desk/src/tray/shaders.d.ts +10 -0
  211. package/dist/types/packages/desk/src/tray/specimens.d.ts +199 -0
  212. package/dist/types/packages/devtools/src/attach.d.ts +22 -8
  213. package/dist/types/packages/devtools/src/dock.d.ts +18 -14
  214. package/dist/types/packages/devtools/src/gpu-panel.d.ts +105 -0
  215. package/dist/types/packages/devtools/src/index.d.ts +5 -4
  216. package/dist/types/packages/dom/src/desk-host.d.ts +91 -0
  217. package/dist/types/packages/dom/src/host.d.ts +13 -14
  218. package/dist/types/packages/dom/src/index.d.ts +12 -10
  219. package/dist/types/packages/dom/src/loop.d.ts +18 -1
  220. package/dist/types/packages/dom/src/pointer-adapter.d.ts +5 -29
  221. package/dist/types/packages/dom/src/widget-focus.d.ts +17 -13
  222. package/dist/types/packages/ice/src/desk-engine.d.ts +2 -0
  223. package/dist/types/packages/ice/src/desk-kit.d.ts +6 -0
  224. package/dist/types/packages/ice/src/desk-objects.d.ts +5 -0
  225. package/dist/types/packages/ice/src/desk.d.ts +5 -0
  226. package/dist/types/packages/kernel/src/atlas-pack.d.ts +157 -0
  227. package/dist/types/packages/kernel/src/bezier.d.ts +0 -15
  228. package/dist/types/packages/kernel/src/coords.d.ts +0 -39
  229. package/dist/types/packages/kernel/src/index.d.ts +2 -2
  230. package/dist/types/packages/kernel/src/nav-flight.d.ts +6 -0
  231. package/dist/types/packages/kernel/src/tray.d.ts +155 -0
  232. package/dist/types/packages/objects/src/board/board-pass.d.ts +180 -0
  233. package/dist/types/packages/objects/src/board/board-pen.d.ts +36 -0
  234. package/dist/types/packages/objects/src/board/board.d.ts +104 -0
  235. package/dist/types/packages/objects/src/board/data.d.ts +31 -0
  236. package/dist/types/packages/objects/src/board/history.d.ts +33 -0
  237. package/dist/types/packages/objects/src/board/kind.d.ts +208 -0
  238. package/dist/types/packages/objects/src/board/layout.d.ts +102 -0
  239. package/dist/types/packages/objects/src/board/object.d.ts +7 -0
  240. package/dist/types/packages/objects/src/board/pen.d.ts +71 -0
  241. package/dist/types/packages/objects/src/board/shaders.d.ts +36 -0
  242. package/dist/types/packages/objects/src/board/stroke.d.ts +99 -0
  243. package/dist/types/packages/objects/src/board/theme.d.ts +150 -0
  244. package/dist/types/packages/objects/src/calendar/data.d.ts +97 -0
  245. package/dist/types/packages/objects/src/calendar/events.d.ts +58 -0
  246. package/dist/types/packages/objects/src/calendar/hand.d.ts +53 -0
  247. package/dist/types/packages/objects/src/calendar/host/input.d.ts +67 -0
  248. package/dist/types/packages/objects/src/calendar/host/print.d.ts +9 -0
  249. package/dist/types/packages/objects/src/calendar/kind.d.ts +297 -0
  250. package/dist/types/packages/objects/src/calendar/law.d.ts +151 -0
  251. package/dist/types/packages/objects/src/calendar/layout.d.ts +47 -0
  252. package/dist/types/packages/objects/src/calendar/month.d.ts +75 -0
  253. package/dist/types/packages/objects/src/calendar/object.d.ts +45 -0
  254. package/dist/types/packages/objects/src/calendar/pad.d.ts +42 -0
  255. package/dist/types/packages/objects/src/calendar/pass.d.ts +229 -0
  256. package/dist/types/packages/objects/src/calendar/print.d.ts +87 -0
  257. package/dist/types/packages/objects/src/calendar/printing.d.ts +80 -0
  258. package/dist/types/packages/objects/src/calendar/roll.d.ts +45 -0
  259. package/dist/types/packages/objects/src/calendar/shaders.d.ts +12 -0
  260. package/dist/types/packages/objects/src/calendar/sheet.d.ts +43 -0
  261. package/dist/types/packages/objects/src/calendar/tiles.d.ts +67 -0
  262. package/dist/types/packages/objects/src/calendar/turn.d.ts +73 -0
  263. package/dist/types/packages/objects/src/calendar/writing.d.ts +42 -0
  264. package/dist/types/packages/objects/src/index.d.ts +22 -0
  265. package/dist/types/packages/objects/src/kinds.d.ts +24 -0
  266. package/dist/types/packages/objects/src/minimat/inside.d.ts +17 -0
  267. package/dist/types/packages/objects/src/minimat/kind.d.ts +51 -0
  268. package/dist/types/packages/objects/src/minimat/layout.d.ts +83 -0
  269. package/dist/types/packages/objects/src/minimat/minimat.d.ts +179 -0
  270. package/dist/types/packages/objects/src/minimat/object.d.ts +8 -0
  271. package/dist/types/packages/objects/src/minimat/pass.d.ts +61 -0
  272. package/dist/types/packages/objects/src/minimat/shaders.d.ts +10 -0
  273. package/dist/types/packages/objects/src/minimat/theme.d.ts +98 -0
  274. package/dist/types/packages/objects/src/notebook/ink.d.ts +70 -0
  275. package/dist/types/packages/objects/src/notebook/kind.d.ts +236 -0
  276. package/dist/types/packages/objects/src/notebook/law.d.ts +129 -0
  277. package/dist/types/packages/objects/src/notebook/layout.d.ts +46 -0
  278. package/dist/types/packages/objects/src/notebook/leaf.d.ts +44 -0
  279. package/dist/types/packages/objects/src/notebook/mesh.d.ts +20 -0
  280. package/dist/types/packages/objects/src/notebook/motion.d.ts +107 -0
  281. package/dist/types/packages/objects/src/notebook/object.d.ts +8 -0
  282. package/dist/types/packages/objects/src/notebook/pages.d.ts +56 -0
  283. package/dist/types/packages/objects/src/notebook/pass.d.ts +197 -0
  284. package/dist/types/packages/objects/src/notebook/pick.d.ts +30 -0
  285. package/dist/types/packages/objects/src/notebook/raster.d.ts +28 -0
  286. package/dist/types/packages/objects/src/notebook/shaders.d.ts +11 -0
  287. package/dist/types/packages/objects/src/notebook/shape.d.ts +155 -0
  288. package/dist/types/packages/objects/src/notebook/theme.d.ts +76 -0
  289. package/dist/types/packages/objects/src/palette.d.ts +577 -0
  290. package/dist/types/packages/objects/src/paper/host/body.d.ts +30 -0
  291. package/dist/types/packages/objects/src/paper/kind.d.ts +81 -0
  292. package/dist/types/packages/objects/src/paper/layout.d.ts +73 -0
  293. package/dist/types/packages/objects/src/paper/object.d.ts +31 -0
  294. package/dist/types/packages/objects/src/paper/pages.d.ts +43 -0
  295. package/dist/types/packages/objects/src/paper/paper-pass.d.ts +86 -0
  296. package/dist/types/packages/objects/src/paper/paper.d.ts +117 -0
  297. package/dist/types/packages/objects/src/paper/shaders.d.ts +18 -0
  298. package/dist/types/packages/objects/src/paper/theme.d.ts +58 -0
  299. package/dist/types/packages/objects/src/paper/typing.d.ts +51 -0
  300. package/dist/types/packages/objects/src/paper/writing.d.ts +161 -0
  301. package/dist/types/packages/objects/src/photo/carry.d.ts +33 -0
  302. package/dist/types/packages/objects/src/photo/kind.d.ts +136 -0
  303. package/dist/types/packages/objects/src/photo/layout.d.ts +39 -0
  304. package/dist/types/packages/objects/src/photo/object.d.ts +5 -0
  305. package/dist/types/packages/objects/src/photo/photo-pass.d.ts +104 -0
  306. package/dist/types/packages/objects/src/photo/photo.d.ts +262 -0
  307. package/dist/types/packages/objects/src/photo/pictures.d.ts +152 -0
  308. package/dist/types/packages/objects/src/photo/sample.d.ts +9 -0
  309. package/dist/types/packages/objects/src/photo/shaders.d.ts +18 -0
  310. package/dist/types/packages/objects/src/preset.d.ts +44 -0
  311. package/dist/types/packages/objects/src/shaders.d.ts +3 -0
  312. package/dist/types/packages/objects/src/shaders.gen.d.ts +21 -0
  313. package/dist/types/packages/react/src/canvas-hooks.d.ts +12 -0
  314. package/dist/types/packages/react/src/desk.d.ts +56 -0
  315. package/dist/types/packages/react/src/engine-context.d.ts +2 -2
  316. package/dist/types/packages/react/src/frame-preview-boundary.d.ts +19 -0
  317. package/dist/types/packages/react/src/hooks.d.ts +9 -14
  318. package/dist/types/packages/react/src/index.d.ts +16 -9
  319. package/dist/types/packages/react/src/keymap.d.ts +21 -2
  320. package/dist/types/packages/react/src/selection-menu.d.ts +171 -0
  321. package/dist/types/packages/react/src/tray-bar.d.ts +124 -0
  322. package/package.json +64 -31
  323. package/dist/chunk-2TNVB2ON.js +0 -1163
  324. package/dist/chunk-2TNVB2ON.js.map +0 -1
  325. package/dist/chunk-OR5FNVUE.js.map +0 -1
  326. package/dist/chunk-Q665T4L7.js +0 -681
  327. package/dist/chunk-Q665T4L7.js.map +0 -1
  328. package/dist/chunk-VGVDJZSP.js.map +0 -1
  329. package/dist/ground.js +0 -1108
  330. package/dist/ground.js.map +0 -1
  331. package/dist/r3f.js +0 -1644
  332. package/dist/r3f.js.map +0 -1
  333. package/dist/types/packages/core/src/input/measure-queue.d.ts +0 -30
  334. package/dist/types/packages/core/src/settings/ground-config.d.ts +0 -101
  335. package/dist/types/packages/core/src/systems/measure-ingest.d.ts +0 -26
  336. package/dist/types/packages/devtools/src/gl-panel.d.ts +0 -69
  337. package/dist/types/packages/dom/src/measure-adapter.d.ts +0 -31
  338. package/dist/types/packages/dom/src/measure-wiring.d.ts +0 -49
  339. package/dist/types/packages/dom/src/planes.d.ts +0 -33
  340. package/dist/types/packages/dom/src/reflectors/chrome.d.ts +0 -33
  341. package/dist/types/packages/dom/src/reflectors/dom-widgets.d.ts +0 -59
  342. package/dist/types/packages/dom/src/reflectors/graybox.d.ts +0 -31
  343. package/dist/types/packages/dom/src/reflectors/plane-transform.d.ts +0 -38
  344. package/dist/types/packages/ground/src/index.d.ts +0 -69
  345. package/dist/types/packages/ground/src/layer.d.ts +0 -40
  346. package/dist/types/packages/ground/src/pass.d.ts +0 -41
  347. package/dist/types/packages/ground/src/passes/grid-contract.d.ts +0 -28
  348. package/dist/types/packages/ground/src/passes/grid-magnet-pass.d.ts +0 -2
  349. package/dist/types/packages/ground/src/passes/grid-magnet.d.ts +0 -31
  350. package/dist/types/packages/ground/src/passes/grid.d.ts +0 -10
  351. package/dist/types/packages/ground/src/passes/guides-collect.d.ts +0 -14
  352. package/dist/types/packages/ground/src/passes/guides.d.ts +0 -3
  353. package/dist/types/packages/ground/src/passes/magnet-collect.d.ts +0 -63
  354. package/dist/types/packages/ground/src/passes/soup-collect.d.ts +0 -35
  355. package/dist/types/packages/ground/src/passes/soup-mesh.d.ts +0 -8
  356. package/dist/types/packages/ground/src/passes/wires-collect.d.ts +0 -35
  357. package/dist/types/packages/ground/src/passes/wires.d.ts +0 -10
  358. package/dist/types/packages/ground/src/poles.d.ts +0 -47
  359. package/dist/types/packages/ground/src/renderer.d.ts +0 -15
  360. package/dist/types/packages/ice/src/ground.d.ts +0 -1
  361. package/dist/types/packages/ice/src/r3f.d.ts +0 -1
  362. package/dist/types/packages/kernel/src/eviction.d.ts +0 -23
  363. package/dist/types/packages/kernel/src/zoom-bands.d.ts +0 -19
  364. package/dist/types/packages/r3f/src/bridge.d.ts +0 -129
  365. package/dist/types/packages/r3f/src/composite-material.d.ts +0 -26
  366. package/dist/types/packages/r3f/src/compositor-pass.d.ts +0 -105
  367. package/dist/types/packages/r3f/src/dev-write-trap.d.ts +0 -30
  368. package/dist/types/packages/r3f/src/gl-root.d.ts +0 -96
  369. package/dist/types/packages/r3f/src/gl-router.d.ts +0 -70
  370. package/dist/types/packages/r3f/src/index.d.ts +0 -17
  371. package/dist/types/packages/r3f/src/island-state.d.ts +0 -112
  372. package/dist/types/packages/r3f/src/island.d.ts +0 -13
  373. package/dist/types/packages/r3f/src/pool.d.ts +0 -56
  374. package/dist/types/packages/r3f/src/preview-capture.d.ts +0 -19
  375. package/dist/types/packages/r3f/src/resource-registry.d.ts +0 -30
  376. package/dist/types/packages/r3f/src/self-sustain.d.ts +0 -39
  377. package/dist/types/packages/r3f/src/use-island-frame.d.ts +0 -39
  378. package/dist/types/packages/react/src/infinite-canvas.d.ts +0 -140
  379. package/dist/types/packages/react/src/preview-snapshots.d.ts +0 -17
  380. package/dist/types/packages/react/src/widget-preview.d.ts +0 -14
  381. package/dist/types/packages/react/src/widget-root.d.ts +0 -33
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../desk/src/kind.ts","../../desk/src/tray/drawer.ts","../../desk/src/tray/lattice.ts","../../desk/src/marks/shaders.ts","../../desk/src/tray/layout.ts","../../desk/src/tray/shaders.ts","../../desk/src/card/card.ts","../../desk/src/hold/focus.ts","../../desk/src/mat/mat-pass.ts","../../desk/src/marks/layout.ts","../../desk/src/marks/pass.ts","../../desk/src/tray/look.ts","../../desk/src/tray/carry.ts","../../desk/src/tray/specimens.ts","../../desk/src/tray/pass.ts","../../desk/src/ground.ts","../../desk/src/mat/tilt.ts","../../desk/src/compose/ambient.ts","../../desk/src/kinds/world.ts","../../desk/src/marks/laser.ts","../../desk/src/marks/assemble.ts","../../desk/src/compose/marks.ts","../../desk/src/object.ts","../../desk/src/compose/builder.ts","../../desk/src/engine/budget.ts","../../desk/src/engine/rasters.ts","../../desk/src/compose/pick.ts","../../desk/src/tray/flux.ts","../../desk/src/compose/reflector.ts","../../desk/src/assets/blue-noise.gen.ts","../../desk/src/host/picture.ts","../../desk/src/docs.ts","../../desk/src/compose/tap.ts","../../desk/src/host/editor.ts","../../desk/src/gpu-wrap.ts","../../desk/src/gpu-memory.ts","../../desk/src/submit-instrument.ts","../../desk/src/pass-instrument.ts","../../desk/src/gpu-profiler.ts","../../desk/src/host/surface.ts","../../desk/src/hold/shaders.ts","../../desk/src/mat/shaders.ts","../../desk/src/compose/children.ts","../../desk/src/host/layer.ts","../../desk/src/host/ink.ts","../../desk/src/gpu-ablation.ts","../../desk/src/engine/records.ts"],"sourcesContent":["// The KIND contract — the render half of design-015 §5.2's `ObjectKind`. The ground\n// (ground.ts, the composition root) draws a desk's objects without naming one of them:\n// every kind registers a PROGRAM (its name, its stratum, how its pass is made on the\n// root's mat), and the ground asks each slot's PASS of that kind to prepare the kind's\n// records and draw them in ranges. The world half — resolve, record, hit, reach, the\n// reads the builder pulls — is D2a-world's; nothing here knows the world.\n//\n// Paint order (design-015 §4.2, D-D4): the mat is the ground's own; then the STRATA in\n// order — pads, sheets, things — and within a stratum the objects in the caller's paint\n// order, cut into RUNS of one kind: one `drawRange` per run, each kind counting its own\n// records. A sheet that holds a desk (the mini mat) splits its run where its live inside\n// goes: the inside draws right after it, then the sheet's marks over the inside\n// (`drawOver` — the mini mat's chips while the inside's objects come in).\n\nimport type { BindKind } from \"./engine/pipeline\";\nimport type { RecordStoreStats } from \"./engine/records\";\nimport type { ComposeOptions } from \"./engine/shader\";\nimport type { MatLight } from \"./kit/light\";\nimport type { Presentation } from \"./kit/nav\";\nimport type { FadeIn, MatConfig, MatFrame, MatPass, SlotLight, View } from \"./kit/view\";\nimport type { GroundTheme, RGB } from \"./theme\";\n\n/** The strata of the desk a kind can lie in (design-015 §4.2): beneath everything, flat on the mat holding a desk, every other thing. */\nexport type StratumName = \"pads\" | \"sheets\" | \"things\";\n\n/**\n * The strata in paint order. The mat (stratum 0) is the ground's own and draws first; the held set and the\n * marks (strata 4 and 5) are D4's. A kind's place in the registry never moves it out of its stratum.\n */\nexport const STRATA: readonly StratumName[] = [\"pads\", \"sheets\", \"things\"];\n\n/**\n * Everything a kind's pass is prepared with for one slot, one frame — what each object pass's `prepare`\n * took as arguments before the registry, in one record. The ground fills it; a kind reads what it needs.\n */\n/**\n * What a slot is prepared FOR (D7): `frame` — the canvas (and the hand's own slot over it); `copy` — the held desk copy behind the\n * hand, the desk at half the dpr (design-015 §8). A held frame prepares the root twice, once for each, so a pass that keeps state\n * between its prepares keeps the copy's apart.\n */\n/**\n * The render a slot is prepared for (D7): the FRAME (the desk as it is), the COPY (the desk behind a carried object, made once\n * per stamp and blurred), or the HAND (K9 R4 — the carried object alone, prepared EVERY frame of the carry while the copy\n * stands). A pass that keeps state per render keeps the copy's apart; a pass whose residency asks are per prepare (the\n * pictures' details, the boards' pool) re-asks what it has bound under the hand, else the tick's step — seeing only the hand's\n * asks — would free every other detail on the desk behind it, a softness pop at every put-down.\n */\nexport type RenderTarget = \"frame\" | \"copy\" | \"hand\";\n\nexport interface SlotContext {\n /** The slot's camera and box (CSS px) and the device pixel ratio. */\n readonly view: View & { readonly dpr: number };\n /** The slot's grid's fade-in window AS ITS GRID NAMES IT — `dressGrid` dresses the mat's lattice alone, never the objects. */\n readonly fadeIn: FadeIn;\n /** The slot's mat config (its gobo, its rulers, its vinyl). The block a pass draws with is the slot's (`MatPass.view`, K4a): read, never copied. */\n readonly cfg: MatConfig;\n /** The mat's clocks and tilt this frame; undefined = a still (a pass fills `STILL_MAT_FRAME`). */\n readonly frame: MatFrame | undefined;\n /** The OBJECTS' presentation: the slot's opacity times their own presence (`Presentation.objects`), and the slot's chain. */\n readonly present: Presentation | undefined;\n /** The Sun or the Moon (the theme's `matLight`). */\n readonly light: MatLight;\n /** The lamp the slot is lit by: undefined = its own camera's, exactly (the root at rest); else its host's (MINIMAT.md §4). */\n readonly lit: SlotLight | undefined;\n /** The selection ring's colour (the theme's `select`). */\n readonly select: RGB;\n /** The theme in force. */\n readonly theme: GroundTheme;\n /** The render this slot is prepared for; absent = the frame's (D7). */\n readonly target?: RenderTarget;\n}\n\n/**\n * What the ground knows of a kind's records beyond the slot, this frame. `live(i)`: record `i`'s live inside —\n * its objects' presence over the record's face (0..1), or −1 where none is drawn — which the ground computes from\n * the slot's portals, by the kind's OWN record index. A sheet that holds a desk lets its face's far LOD give way\n * to it (the mini mat); every other kind ignores it.\n */\nexport interface KindExtra {\n readonly live: (index: number) => number;\n /**\n * The records' KEYS, one per record in the same order (design-015 §4.3; D6) — the builder's entity (a ghost's negated), stable\n * across frames, so a pass with persistent records keeps a record's slot and writes it only when the record object changed.\n * Absent (the oracle, a bare host): every record is packed afresh this frame.\n */\n readonly keys?: readonly number[];\n}\n\n/**\n * One slot's pass of one kind. The root's is made by the kind's program on the root's mat; every other slot's is\n * `spawn`ed from it — its own buffers on the shared pipelines, reading its own mat's wind and light.\n */\nexport interface KindPass<R = unknown> {\n /** A slot's own buffers on the shared pipelines, reading `mat`'s silhouette — a live inside's, a flight's departed desk's. */\n spawn(mat: MatPass): KindPass<R>;\n /** Take the root's laws (the prototype's `tune()` / `copy()`): a spawned slot's pass does, every frame, before it prepares. */\n tune?(root: KindPass<R>): void;\n /** Draw with a host's LIVE law (D5a — `handle.tuneLaw`): the root's pass takes it, and its slots follow through `tune`. */\n setLaw?(law: unknown): void;\n /**\n * Upload this frame's records — the kind's objects in this slot, in paint order — for `slot`'s camera and light.\n * `encoder` is the frame's: work that must precede the frame's pass may be recorded into it (or a pass may submit\n * its own before the frame's, as the whiteboard's stamps and drying do). Returns the count that will draw.\n */\n prepare(encoder: GPUCommandEncoder, slot: SlotContext, records: readonly R[], extra?: KindExtra): number;\n /** Draw records [first, end) — indices into this frame's `records` — in their order, into the open pass. */\n drawRange(pass: GPURenderPassEncoder, first: number, end: number): void;\n /**\n * The kind's persistent record store's counters (design-015 §4.3; D6) — records packed and uploaded, draw lists rewritten — a\n * rig's witness that a camera move writes no standing record. Absent for a kind that keeps none (the composites' layers).\n */\n records?(): RecordStoreStats;\n /**\n * The records this slot's last `prepare` turned away at the pass's CAP (its buffers' ceiling — the layered kinds' fixed tables,\n * the record stores' most) — objects the builder resolved that will NOT draw. Never silent (D7): the ground sums them into the\n * frame's `GroundStats.dropped` and the host says so.\n */\n dropped?(): number;\n /** The hold is over (D7): a pass that kept the held desk copy's state apart (`SlotContext.target`) gives it back. */\n endHold?(): void;\n /**\n * Let go of the device targets this slot's pass makes again at its next draw, when none of its objects was drawn within `ms`\n * (K6a's D-K6a.3 — a layered kind's layer): asked each tick of the slots a host keeps beyond the root (the tray's, K5a).\n */\n idle?(ms: number): void;\n /**\n * When `idle(ms)` next lets something go (K7a): the host registers it as a TIME wake, so a desk asleep since the drawer shut\n * still wakes to give the layer back. ∞, or absent: nothing to let go (a pass that says no time is let go at a tick taken anyway).\n */\n idleAt?(ms: number): number;\n /** A sheet's marks over its live inside, drawn right after the inside (the mini mat's chips while the inside's objects come in). */\n drawOver?(pass: GPURenderPassEncoder, index: number): void;\n /**\n * K7b: this slot's resources for the kind's CARD MATERIAL (`KindProgram.card`), in its `bindings` order, and a number that moves\n * whenever one of them is replaced (a record store grown, a texture array grown) — the card's bind group is made again then.\n */\n cardResources?(): { readonly version: number; readonly resources: readonly (GPUBuffer | GPUTextureView | GPUSampler)[] };\n /**\n * K7b: record `index` of the last `prepare` drawn by the desk's FLAT-CARD pipeline — its slot in the kind's records, which the\n * material's functions read — or −1: this pass draws it itself (a print with its detail bound, a board with its raster).\n */\n cardSlot?(index: number): number;\n /** This slot's buffers (the shared resources go with the last slot standing). */\n dispose(): void;\n}\n\n/**\n * A kind as the ground registers it: its name (unique in a ground), its stratum, and how its root pass is made on\n * the root's mat — once per device; every other slot's pass is `spawn`ed from that one.\n */\nexport interface KindProgram<R = unknown> {\n readonly name: string;\n readonly stratum: StratumName;\n /**\n * A kind that lays a COMPOSITE (design-015 §4.2): its pass renders every one of its objects into a target of its own in `prepare`\n * (depth, MSAA, shadow maps — the notebook's layer, the calendar's) and `drawRange` lays that target over the frame in one draw.\n * The ground draws such a kind as ONE run, [0, count), after every other run of its stratum — its objects cannot interleave with\n * another kind's without a target per run (D-D4's exception: a note laid on a notebook draws under it). Absent: the kind's objects\n * are cut into runs in the slot's paint order.\n */\n readonly composite?: boolean;\n /**\n * K7b: the kind's CARD MATERIAL — its records drawn by the desk's ONE flat-card pipeline (card/card.ts), interleaved with every\n * other material kind's objects in one run. Absent: the kind draws every record itself, a run of its own.\n */\n readonly card?: CardMaterial;\n create(device: GPUDevice, format: GPUTextureFormat, mat: MatPass): Promise<KindPass<R>>;\n}\n\n/** A binding of a CARD MATERIAL (K7b): the WGSL the card declares after `@group(0) @binding(n)`, and its layout (the stages, what it is). */\nexport interface CardBinding {\n /** Whole, after the attribute: `var<uniform> paper_k: PaperUniforms` — its name UNIQUE across every kind's material (a kind prefixes its own). */\n readonly wgsl: string;\n readonly entry: BindKind;\n}\n\n/**\n * A kind's CARD MATERIAL (K7b, design-016 §6 K7 — the run question). In mixed sibling order a run of one kind ends at the next\n * object of another (rig:scale: draws ≈ 0.3 × the objects drawn, at every zoom); the kinds that declare a material are composed\n * into ONE pipeline, so interleaved objects of every such kind are one run, one draw. Each object is drawn there by its OWN kind's\n * functions over its own kind's records, uniforms and textures — the pixels its own pipeline makes. The card's module is the\n * kit's pieces and every material's structs and modules (deduplicated by name and label), then its bindings, its `only`, its\n * card functions (`shaders.entry` — the same text its own pass composes) and a dispatch on the card's material.\n */\nexport interface CardMaterial {\n /**\n * The kind's program as its own pass composes it — the kit's pieces, its structs, its pure modules — its `entry` the CARD FUNCTIONS\n * over its bindings; asked when the card is composed (a host's text read then, as a pass reads it when it is made).\n */\n shaders(): ComposeOptions;\n /** WGSL the card composes that the kind's own entry defines otherwise (a texel read from its thumbnails alone — the card binds no pool). */\n readonly only?: string;\n /** Its bindings beyond the slot's view block and mat (`u`, `gobo_tex`, `noise_tex` — the card's), in its pass's `cardResources` order. */\n readonly bindings: readonly CardBinding[];\n /** `fn <quad>(slot: u32, vid: u32) -> vec4f`: corner `vid`'s clip position; (2, 2, 2, 1) — the degenerate — collapses a culled one. */\n readonly quad: string;\n /** `fn <frag>(slot: u32, clip: vec4f) -> vec4f`: the fragment's premultiplied colour through the slot's presentation; alpha < 0 = discard. */\n readonly frag?: string;\n /**\n * The fragment WRITTEN OUT instead of `frag`'s call: WGSL statements over `slot` and `in.clip` that set `c` (or discard) — the\n * kind's own entry's fragment, statement for statement. For a kind whose shade reached through one more function compiles to\n * other bits (the board's: one LSB on a pixel a scene — measured, K7b): the card then runs the very code its entry runs.\n */\n readonly fragInline?: string;\n}\n","// THE DRAWER (design-017 §5, §7; design-018 §5) — where the pegboard sits on screen, in CSS px, and how it moves: widgetlab rev 1's\n// drawer (`translate(-50%, 112%) → 0` in 340 ms on `cubic-bezier(0.32,0.72,0,1)`, top radius 22) on the desk. A PURE module: the\n// tray pass shades the rect it returns, the flux publishes the same rect to core's hit tests, the tests read both.\n\nimport { cubicBezierEase, trayScrollMax } from \"@ice/kernel\";\n\n/** The drawer's numbers (design-017 §7). Lengths are CSS px; times ms. */\nexport const DRAWER = {\n /** The pegboard's pitch — the research's unit on screen, chosen by eye for a UI board. */\n pitch: 40,\n /** `min(1120 px, 100 % − 32 px)`, snapped DOWN to whole pitches (its sides a solid border — lattice.ts `PEG.border`, D-K3.1). */\n maxWidth: 1120,\n margin: 16,\n /** ≈ 44 % of the view high, clamped. */\n heightFrac: 0.44,\n minHeight: 220,\n maxHeight: 640,\n /**\n * The top corners' radius — a hardboard panel's, about SKÅDIS's ¼ pitch (design-018 §2: widgetlab's 22 read as a card) — and the\n * ARRIS: the board's edge, a quarter-round this wide where its face meets the outline, in the face's own material (the rim retired;\n * D-R1.1 — the thinner end of design-018's 1.5–2: at 2 px the lit top edge read as a thin cream rim again).\n */\n radius: 10,\n arris: 1.5,\n /** The edge's inner shadow on the lamp's side (D-R1.2): black at this alpha just inside the edge, fading over this many px. */\n inner: { alpha: 0.18, width: 3 },\n /**\n * The HEADER (design-018 R4 — James, 2026-09-28: \"make the fade stronger and more gap, and design the filters nicely at that empty\n * safe top space instead\"): a CLEAR band this high under the face's top edge (inside the arris) where what hangs on the board — the\n * specimens, their shadows, their accessories and their tags — and the holes are wholly gone: the plain face, on which the bar lays\n * its category chips as label tape (`<TrayBar>`, @ice/react — the handle's `anchor().drawer.header`). The face's portal clip starts\n * this far down, so nothing of the content is even drawn above it.\n */\n header: 48,\n /**\n * The CONTENT's fade under the header (design-018 §4, R4): the specimens, their shadows, their accessories, their tags and the holes\n * fade in over this band (CSS px, 0.8 pitch) — `smoothstep(top + header, top + header + fade, y)`, `top` the face's top edge — the\n * feather on the face's portal clip (R1's 28 px band at the edge itself, stretched and moved down: D-R4.1). The board does not fade.\n */\n fade: 32,\n /** The slide: widgetlab rev 1's curve. */\n slideMs: 340,\n curve: [0.32, 0.72, 0, 1] as const,\n /** Black over the desk at the full slide: widgetlab's 10 % by day, 40 % by night. */\n dim: { day: 0.1, night: 0.4 },\n /**\n * The shadows on the desk: the ROOM's, round the whole outline (what shows above the drawer: it lies over the desk), and the LAMP's,\n * pushed along its ground direction — each the outline's SDF blurred σ, at α.\n */\n shadow: { room: { sigma: 14, alpha: 0.22 }, lamp: { sigma: 18, alpha: 0.18, push: 8 } },\n /** The rubber band: its asymptote and stiffness (iOS's curve), how long the scroll input must be quiet before it lets go, the settle's spring. */\n band: { max: 72, c: 0.55, letGoMs: 120, hz: 8 },\n /** A specimen's hover lift spring (K5a). */\n hoverHz: 7,\n /** A click's slop. */\n slop: 4,\n} as const;\n\n/**\n * How far the drawer's shadows reach past its outline (CSS px): three of the wider blur's σ and the lamp's push — tray.wgsl's `reach`,\n * one law. Closed, the drawer rests this far below the view, so nothing of it — its shadows included — is on screen (design-018 §5).\n */\nexport const SHADOW_REACH = 3 * Math.max(DRAWER.shadow.lamp.sigma, DRAWER.shadow.room.sigma) + DRAWER.shadow.lamp.push;\n\n/** A rect on screen, CSS px: the drawer's outline box as drawn (its top-left, its width, its FULL height — the part below the view included). */\nexport interface DrawerRect {\n readonly x: number;\n readonly y: number;\n readonly w: number;\n readonly h: number;\n}\n\n/** The drawer's size in a view: whole pitches wide (≤ 1120, ≤ the view − 32), ≈ 44 % of the view high, clamped. */\nexport function drawerSize(vw: number, vh: number): { readonly w: number; readonly h: number } {\n const P = DRAWER.pitch;\n const w = P * Math.max(2, Math.floor(Math.min(DRAWER.maxWidth, vw - 2 * DRAWER.margin) / P));\n const h = Math.min(DRAWER.maxHeight, Math.max(DRAWER.minHeight, Math.round(DRAWER.heightFrac * vh)));\n return { w, h };\n}\n\n/**\n * The drawer as drawn at slide `p` (0 closed … 1 open): centred on whole CSS px — open, its bottom flush with the view; closed, wholly\n * below it with its shadows' reach (design-018 §5: no lip — at p 0 nothing of the drawer is on screen, and nothing is drawn).\n */\nexport function drawerRect(vw: number, vh: number, p: number): DrawerRect {\n const { w, h } = drawerSize(vw, vh);\n return { x: Math.round((vw - w) / 2), y: vh + SHADOW_REACH - (h + SHADOW_REACH) * p, w, h };\n}\n\n/**\n * What of the board's CONTENT shows at screen `y` under a drawer drawn at `rect` (design-018 §4, R4) — the shaders' law on the CPU (the\n * face's feather in `portal_cover`, `tray_board`'s holes, `tray_accessory`, the tags' draw): 0 above the face and in its header, the\n * smoothstep over `fade` under it, 1 past it.\n */\nexport function contentShown(rect: DrawerRect, y: number): number {\n const t = Math.min(Math.max((y - rect.y - DRAWER.arris - DRAWER.header) / DRAWER.fade, 0), 1);\n return t * t * (3 - 2 * t);\n}\n\n/** The slide's ease: widgetlab rev 1's `cubic-bezier(0.32,0.72,0,1)`, the exact curve CSS runs (the kernel's). */\nexport const slideEase: (t: number) => number = cubicBezierEase(...DRAWER.curve);\n\n/**\n * The rubber band (design-017 §3): what a pull of `stretch` px past an end SHOWS — iOS's curve, `B·(1 − 1/(1 + |s|·c/B))`,\n * signed: ever less per px pulled, never past `B`.\n */\nexport function band(stretch: number): number {\n const B = DRAWER.band.max;\n const a = Math.abs(stretch);\n return Math.sign(stretch) * B * (1 - 1 / (1 + (a * DRAWER.band.c) / B));\n}\n\n/**\n * How far the board scrolls before the band (design-017 §8; K5a — K3's 26-row stub retired): the laid content's foot (`TrayContent.bottom`,\n * board px) plus a pitch, less the face the drawer shows (its whole height: the face runs to the outline — design-018 §2) — kernel\n * `trayScrollMax`; 0 with nothing laid.\n */\nexport function scrollRange(vw: number, vh: number, bottom: number): number {\n const { h } = drawerSize(vw, vh);\n return trayScrollMax(bottom, h, DRAWER.pitch);\n}\n","// THE PEGBOARD'S LATTICE (design-017 §6.1–§6.2) — the research board's geometry (research/sdf-pegboard, shader.js\n// `sdBoard` · `cellCoord` · `sdStadiumV`) in units of the PITCH, and the CPU half of the CARRY that keeps the pattern\n// exact at any scroll. A PURE module: shaders/tray/tray.wgsl is the same arithmetic on the GPU; the tests and the rigs\n// read this mirror.\n//\n// A board point is (x, Y) in pitches: x from the drawer's left edge, Y down the board from its top at scroll 0. Y is\n// never formed as one float on the GPU: the scroll's whole rows are carried as an integer (`carry`) and the shader adds\n// the rows on screen to it in i32, so every row index, every stagger parity and every noise lattice point is an exact\n// integer however far down the board is scrolled.\n\n/** The board in pitches (the research's unit, ≈ 20 mm): SKÅDIS-style vertical stadium holes, odd rows shifted half a pitch. */\nexport const PEG = {\n /** The stadium's radius and its straight half-length: a hole 0.26 × 0.66 of a pitch. */\n holeR: 0.13,\n holeHalf: 0.2,\n /** The smooth-max fillet on the punched rims. */\n rimK: 0.018,\n /**\n * The hardboard's thickness, and its height off the mat: it LIES on it (design-018 §3 — the research's spacer and wall retired) —\n * a 4 mm board on a hair of air, 0.13 pitch in all: the height the drawer's own lamp shadow is pushed by (8 px at the HOME lamp).\n */\n thick: 0.1,\n gap: 0.03,\n /** The phase (§6.1): holes at x = c + ¼ + ½·(r odd) from the drawer's left edge, rows at Y = r + ¾ below its top at scroll 0. */\n colPhase: 0.25,\n rowPhase: 0.75,\n /**\n * The solid BORDER along the sides (D-K3.1): a hole is punched only where its centre lies this far from both — as a manufactured\n * board's is. (Across both parities the holes stand every ½ pitch, so no phase alone keeps them all clear of a sawn side.)\n */\n border: 0.75,\n} as const;\n\n/**\n * The scroll's CARRY (§6.2): the shown scroll (CSS px, any size) split into whole ROWS — an integer the shader adds to its\n * rows on screen in i32 — and the FRACTION of a row, the only part of the scroll that ever enters an f32.\n */\nexport function carry(scroll: number, pitch: number): { readonly rowBase: number; readonly frac: number } {\n const rows = scroll / pitch;\n const rowBase = Math.floor(rows);\n if (!(Math.abs(rowBase) < 2 ** 31)) throw new Error(`tray: a scroll of ${scroll} px is past the i32 rows the carry holds`);\n return { rowBase, frac: rows - rowBase };\n}\n\n/** A board point as the shader forms it: `x` in pitches, `R` the whole row of Y (an integer), `fy` ∈ [0,1) the rest. */\nexport interface PegPoint {\n readonly x: number;\n readonly R: number;\n readonly fy: number;\n}\n\n/** A point on screen, on the board: `y` CSS px below the drawer's top, under the carry — `R` = rowBase + ⌊ly⌋ in integers (the shader's `peg_point`). */\nexport function pointAt(xPitches: number, yPx: number, pitch: number, c: { readonly rowBase: number; readonly frac: number }): PegPoint {\n const ly = yPx / pitch + c.frac;\n const fl = Math.floor(ly);\n return { x: xPitches, R: c.rowBase + fl, fy: ly - fl };\n}\n\n/** The hole nearest a board point — its row (the nearest row: a hole's half-height, 0.33, is under half a pitch), its column, and the point's offset from its centre. */\nexport interface PegCell {\n readonly row: number;\n readonly col: number;\n readonly odd: boolean;\n readonly qx: number;\n readonly qy: number;\n}\n\n/** The cell of a board point (the shader's `peg_hole`; half-up rounding throughout — WGSL's `round` ties to even, so neither side uses it). */\nexport function cellOf(p: PegPoint): PegCell {\n const dr = Math.floor(p.fy - PEG.rowPhase + 0.5); // −1 or 0: the row whose centre is nearest\n const row = p.R + dr;\n const odd = (row & 1) !== 0;\n const hx = p.x - PEG.colPhase - (odd ? 0.5 : 0);\n const col = Math.floor(hx + 0.5);\n return { row, col, odd, qx: hx - col, qy: p.fy - dr - PEG.rowPhase };\n}\n\n/** Is the cell's hole punched on a board `width` pitches wide — its centre at least the border from both sides? (The shader's `peg_hole` answers the same.) */\nexport function punched(cell: PegCell, width: number): boolean {\n const x = cell.col + PEG.colPhase + (cell.odd ? 0.5 : 0);\n return x >= PEG.border && x <= width - PEG.border;\n}\n\n/** The vertical stadium's signed distance at an offset from its centre, pitches: negative inside the hole. */\nexport function holeSdf(qx: number, qy: number): number {\n const dy = qy - Math.min(Math.max(qy, -PEG.holeHalf), PEG.holeHalf);\n return Math.hypot(qx, dy) - PEG.holeR;\n}\n\n/** The centre of hole (row, col), in board pitches (x from the left edge, Y from the top at scroll 0) — the stagger's law. */\nexport function holeCentre(row: number, col: number): { readonly x: number; readonly y: number } {\n return { x: col + PEG.colPhase + ((row & 1) !== 0 ? 0.5 : 0), y: row + PEG.rowPhase };\n}\n\n/**\n * The TURNED lattice's cell of a board point (tray.wgsl `peg_rot`, the face's tone and grain): lattice coordinates M·(x, Y)·num/den with\n * M = [[a, −b], [b, a]] an integer rotation and scale. The carried row splits R = den·Q + r, so Q's share (−b·num·Q, a·num·Q) is an\n * exact integer and only the small rest is a float — the shader's f32 (`Math.fround`) — at any depth.\n */\nexport function rotCell(p: PegPoint, a: number, b: number, num: number, den: number): { readonly u: number; readonly v: number; readonly fu: number; readonly fv: number } {\n const q = Math.floor(p.R / den);\n const r = Math.fround(p.R - q * den + p.fy);\n const s = Math.fround(num / den);\n const U = Math.fround(Math.fround(a * p.x - b * r) * s);\n const V = Math.fround(Math.fround(b * p.x + a * r) * s);\n const cu = Math.floor(U);\n const cv = Math.floor(V);\n return { u: cu - b * num * q, v: cv + a * num * q, fu: U - cu, fv: V - cv };\n}\n","// Assemble the marks pass's shader parts from raw text — the browser from the generated module, the\n// Node oracle from the .wgsl files on disk; byte-identical either way (the paper pass's convention).\n\nimport type { ShaderPart } from \"../engine/shader\";\n\nexport interface MarksShaders {\n readonly modules: readonly ShaderPart[]; // primitives, marks\n readonly entry: ShaderPart; // marks-pass\n}\n\nexport interface MarksShaderText {\n readonly primitives: string;\n readonly marks: string;\n readonly marksPass: string;\n}\n\nexport const MARKS_SHADER_FILES: Record<keyof MarksShaderText, string> = {\n primitives: \"primitives.wgsl\",\n marks: \"marks/marks.wgsl\",\n marksPass: \"marks/marks-pass.wgsl\",\n};\n\nexport function marksShaders(t: MarksShaderText): MarksShaders {\n const part = (label: string, text: string): ShaderPart => ({ label, text });\n return {\n modules: [part(\"primitives.wgsl\", t.primitives), part(\"marks/marks.wgsl\", t.marks)],\n entry: part(\"marks/marks-pass.wgsl\", t.marksPass),\n };\n}\n","// The tray's own record (tray.wgsl `t`) — the block the pass writes beside its light block (tray/pass.ts) and the struct its\n// program composes after the kit's (tray/shaders.ts): a pass's records in its layout.ts, as the marks and the kinds keep theirs.\n\nimport { defineStruct } from \"../engine/struct\";\n\n/** The tray's own block (tray.wgsl `t`). */\nexport const TrayUniforms = defineStruct(\"TrayUniforms\", [\n [\"view\", \"vec4f\"], // the view: CSS width, height, dpr, the pitch (CSS px)\n [\"rect\", \"vec4f\"], // the drawer as drawn (drawer.ts `drawerRect`): left, top, width, full height — CSS px\n [\"rowBase\", \"i32\"], // THE CARRY (lattice.ts): the shown scroll's whole rows…\n [\"frac\", \"f32\"], // …and the fraction of a row, the only part of the scroll in an f32\n [\"fp\", \"f32\"], // pitches per device px — the footprint every band fades by\n [\"dim\", \"f32\"], // the dim's alpha this frame\n [\"shape\", \"vec4f\"], // the top corners' radius, the arris (the board's edge) — CSS px; its inner shadow's alpha, its width (CSS px)\n [\"hole\", \"vec4f\"], // the stadium's radius and straight half-length, the rim fillet k, the solid side border — pitches\n [\"depth\", \"vec4f\"], // the board's thickness, its height off the mat — pitches; the phase: columns, rows\n [\"lamp\", \"vec4f\"], // the unit direction to the lamp (x right, y down, z toward the eye), its angular radius (rad)\n [\"room\", \"vec4f\"], // the room's shadow round the outline: σ, α — CSS px; —, —\n [\"shadow\", \"vec4f\"], // the lamp's shadow: σ, α, its push along the lamp's ground direction (x, y) — CSS px\n [\"face\", \"vec4f\"], // the tempered face, linear\n [\"faceSrgb\", \"vec4f\"], // …and its configured byte (sRGB): the plain face's colour lit flat\n [\"edge\", \"vec4f\"], // the punched fibre, linear\n [\"cavity\", \"vec4f\"], // the room's light on the mat in a hole: at its edge, at its heart, over what width (pitches)\n [\"keepFace\", \"vec4f\"], // each band's share at this footprint (tray.wgsl, the research's fade): the face's grain (≈ 19 a pitch), —, 85, 190…\n [\"keepFine\", \"vec4f\"], // …its 210 (bump) · 42 · 105 (flecks)…\n [\"keepEdge\", \"vec4f\"], // …and the punched fibre's 9 · 18 · 36\n [\"accessory\", \"vec4f\"], // K5a: the accessories' powder coat, linear, and their shadows' strength on the board\n [\"fade\", \"vec4f\"], // the content's fade under the header (design-018 §4, R4): its band F, the clear header H above it, CSS px; —, —\n]);\n\n/**\n * One specimen's ACCESSORY (K5a — tray.wgsl `tray_accessory`): drawn with the board, one instance each, its quad the accessory and its\n * shadow's reach. Screen CSS px throughout (the drawer's camera is zoom 1): the quad, the specimen's rect, up to four pegs' hole centres.\n */\nexport const TrayAccessoryStruct = defineStruct(\"TrayAccessory\", [\n [\"box\", \"vec4f\"], // the quad: x0, y0, x1, y1\n [\"kind\", \"vec4f\"], // the accessory (0 hook · 1 shelf · 2 clip · 3 rail), its pegs, how far it stands off the board (px), —\n [\"rect\", \"vec4f\"], // the specimen: x0, y0, x1, y1\n [\"pegs0\", \"vec4f\"], // pegs 0 and 1: x, y\n [\"pegs1\", \"vec4f\"], // pegs 2 and 3\n]);\n","// Assemble the tray pass's program from the host's shader text — the browser's generated module, the Node oracle's files on\n// disk; byte-identical either way. The kit brings, by name (kit/wgsl.ts), the view block's struct (`MatUniforms`), the card's\n// primitives and the mat's light — `shade_mat`, `night_mat`, the colour chain; the tray's own record, module and entry follow.\n// The tray is ENGINE CHROME, not a kind (design-016 K-L6 — it stays in desk): its entry binds its OWN block of that struct,\n// never a slot's (tray/pass.ts says why).\n\nimport type { ComposeOptions } from \"../engine/shader\";\nimport { kitWgsl, type ShaderText } from \"../kit/wgsl\";\nimport { TrayAccessoryStruct, TrayUniforms } from \"./layout\";\n\n/** The tray's own shader files (the kit's pieces come by name). */\nexport const TRAY_SHADER_FILES = { tray: \"tray/tray.wgsl\", trayPass: \"tray/tray-pass.wgsl\" } as const;\n\n/** The tray pass's program: the kit's view · sdf · light, then the tray's record, module and entry. */\nexport type TrayShaders = ComposeOptions;\n\nexport function trayShaders(text: ShaderText): TrayShaders {\n const t = text(TRAY_SHADER_FILES);\n return kitWgsl([\"view\", \"sdf\", \"light\"], {\n structs: [TrayUniforms, TrayAccessoryStruct],\n modules: [{ label: \"tray/tray.wgsl\", text: t.tray }],\n entry: { label: \"tray/tray-pass.wgsl\", text: t.trayPass },\n }, text);\n}\n","// THE FLAT-CARD PIPELINE (K7b, design-016 §6 K7 — the run question). In mixed sibling order a run of one kind ends at the\n// next object of another: rig:scale measured draws ≈ 0.3 × the objects drawn at every zoom (610 at zoom 0.2 — a pipeline and a\n// bind group a run). The kinds that declare a CARD MATERIAL (kind.ts `CardMaterial` — the note, the print, the whiteboard) are\n// composed here into ONE pipeline: the kit's pieces and every material's structs and modules (deduplicated by name and label),\n// every material's bindings (numbers dealt after the card's own four), its card functions and a dispatch on the card's\n// material. Interleaved objects of every such kind are then one run, ONE draw: an instance a card, `cards[i]` its material (the\n// high byte) and its slot in that kind's records (the low 24 bits). Each is drawn by its OWN kind's functions over its own\n// kind's records, uniforms and textures, bound here beside the slot's view block and mat — the pixels its own pipeline makes\n// (the golden holds it). A kind still draws what its pass keeps (`cardSlot` −1: a print with its detail bound, a board with its\n// raster or its live stroke), and an object with a live inside always (its inside goes right after it).\n//\n// The ground names no kind here either (design-015 §5.2, K-L2): a plugin kind that declares a material is composed the same way.\n\nimport { type BindEntry, bindGroup, bindLayout, renderPipeline, storageBuffer } from \"../engine/pipeline\";\nimport { type ComposeOptions, compile, compose, type ShaderPart } from \"../engine/shader\";\nimport type { StructDef } from \"../engine/struct\";\nimport type { CardMaterial, KindPass, KindProgram, SlotContext } from \"../kind\";\nimport type { MatPass } from \"../kit/view\";\nimport { litByOwn } from \"../mat/layout\";\n\n/** Premultiplied \"source over\" — every flat kind's blend; the card draws what they draw, into the pass they share. */\nconst BLEND_PREMUL: GPUBlendState = {\n color: { srcFactor: \"one\", dstFactor: \"one-minus-src-alpha\", operation: \"add\" },\n alpha: { srcFactor: \"one\", dstFactor: \"one-minus-src-alpha\", operation: \"add\" },\n};\n\n/** A card's slot in its kind's records: the low 24 bits; the high byte its material. */\nexport const CARD_SLOT_BITS = 24;\nconst SLOT_MASK = 2 ** CARD_SLOT_BITS - 1;\n/** The card's own bindings before the materials': the slot's view block, its gobo silhouette, the blue noise, the draw list. */\nconst OWN: readonly BindEntry[] = [\n { binding: 0, stages: [\"vertex\", \"fragment\"], buffer: \"uniform\" },\n { binding: 1, stages: [\"fragment\"], texture: \"float\" },\n { binding: 2, stages: [\"fragment\"], texture: \"float\" },\n { binding: 3, stages: [\"vertex\"], buffer: \"read-only-storage\" },\n];\n\n/** A kind composed into the card: its name (the ground's key), its material, and its program (the material's `shaders()`, asked once). */\nexport interface CardKind { readonly name: string; readonly material: CardMaterial; readonly shaders: ComposeOptions }\n\n/** What one card pipeline composes: its kinds by material index, and what it could not (a limit it would pass — they draw themselves). */\nexport interface CardPlan { readonly kinds: readonly CardKind[]; readonly left: readonly { readonly name: string; readonly why: string }[] }\n\ntype Limits = Pick<GPUSupportedLimits, \"maxSampledTexturesPerShaderStage\" | \"maxSamplersPerShaderStage\" | \"maxStorageBuffersPerShaderStage\" | \"maxUniformBuffersPerShaderStage\" | \"maxBindingsPerBindGroup\">;\n\n/** The card's own bindings' names (`cardEntry`): a material's binding may not take one. */\nconst OWN_NAMES: readonly string[] = [\"u\", \"gobo_tex\", \"noise_tex\", \"cards\"];\n/** A binding's name from its WGSL (`var<uniform> paper_k: PaperUniforms` → `paper_k`); null when it declares none the card can read. */\nexport const bindingName = (wgsl: string): string | null => /^\\s*var(?:\\s*<[^>]*>)?\\s+([A-Za-z_][A-Za-z0-9_]*)\\s*:/.exec(wgsl)?.[1] ?? null;\n\n/**\n * What one card program cannot hold twice (K9 R3): a binding's name, a card function's name, a struct's name with OTHER text, a\n * module's label with OTHER text. `cardShaders` deduplicates structs by name and modules by label — two kinds sharing the kit's\n * pieces compose them once — but a kind whose struct or module only NAMES like another's, with different fields or text, would\n * either fail the compile (and, before K9, take every kind's card down) or read the other's layout silently. The names go to the\n * kind registered first; the later kind is left out and draws itself.\n */\ninterface Taken {\n readonly names: Map<string, string>; // a binding or card function name → the kind that has it (the card's own: \"the card\")\n readonly structs: Map<string, { readonly text: string; readonly by: string }>;\n readonly modules: Map<string, { readonly text: string; readonly by: string }>;\n}\n\n/** Why `k` cannot join the card beside what `taken` already holds — null when it can (then its names are recorded). */\nfunction collision(k: CardKind, taken: Taken): string | null {\n const names: string[] = [];\n for (const b of k.material.bindings) {\n const n = bindingName(b.wgsl);\n if (n === null) return `its binding \\`${b.wgsl}\\` declares no name (\\`var… <name>: <type>\\`)`;\n names.push(n);\n }\n names.push(k.material.quad);\n if (k.material.frag !== undefined) names.push(k.material.frag);\n for (const n of names) {\n const by = taken.names.get(n);\n if (by !== undefined) return `its name \\`${n}\\` is ${by === \"the card\" ? \"the card's own\" : `\"${by}\"'s`}`;\n }\n if (new Set(names).size !== names.length) return \"two of its bindings or card functions share a name\";\n for (const s of k.shaders.structs ?? []) {\n const had = taken.structs.get(s.name);\n if (had !== undefined && had.text !== s.wgsl) return `its struct \\`${s.name}\\` differs from \"${had.by}\"'s of the same name`;\n }\n for (const m of k.shaders.modules ?? []) {\n const had = taken.modules.get(m.label);\n if (had !== undefined && had.text !== m.text) return `its module \"${m.label}\" differs from \"${had.by}\"'s of the same label`;\n }\n for (const n of names) taken.names.set(n, k.name);\n for (const s of k.shaders.structs ?? []) if (!taken.structs.has(s.name)) taken.structs.set(s.name, { text: s.wgsl, by: k.name });\n for (const m of k.shaders.modules ?? []) if (!taken.modules.has(m.label)) taken.modules.set(m.label, { text: m.text, by: k.name });\n return null;\n}\n\n/**\n * The kinds one card pipeline composes, in registration order — a material kind is left out (and draws itself) when it is a\n * composite (its objects are one target's), when adding it would pass one of the device's per-stage limits, or (K9 R3) when a\n * name of its would collide with the card's own or an earlier kind's.\n */\nexport function planCards(programs: readonly KindProgram[], limits: Limits): CardPlan {\n const kinds: CardKind[] = [];\n const left: { name: string; why: string }[] = [];\n // what the card's own four take: a uniform block (both stages), two textures, a storage buffer (the vertex stage)\n const used = { vertex: { tex: 0, samp: 0, sto: 1, uni: 1 }, fragment: { tex: 2, samp: 0, sto: 0, uni: 1 }, bindings: OWN.length };\n const taken: Taken = { names: new Map(OWN_NAMES.map((n) => [n, \"the card\"])), structs: new Map(), modules: new Map() };\n for (const p of programs) {\n if (p.card === undefined) continue;\n if (p.composite === true) { left.push({ name: p.name, why: \"a composite draws one target of its own\" }); continue; }\n if (p.card.frag === undefined && p.card.fragInline === undefined) { left.push({ name: p.name, why: \"its material names no fragment\" }); continue; }\n if (kinds.length > 255) { left.push({ name: p.name, why: \"a card's material is its high byte: 256 at most\" }); continue; }\n const next = { vertex: { ...used.vertex }, fragment: { ...used.fragment }, bindings: used.bindings + p.card.bindings.length };\n for (const b of p.card.bindings) {\n for (const st of b.entry.stages) {\n if (st === \"compute\") continue;\n const u = next[st];\n if (\"buffer\" in b.entry) { if (b.entry.buffer === \"uniform\") u.uni += 1; else u.sto += 1; }\n else if (\"texture\" in b.entry) u.tex += 1;\n else u.samp += 1;\n }\n }\n const over = ([\"vertex\", \"fragment\"] as const).find((st) => next[st].tex > limits.maxSampledTexturesPerShaderStage || next[st].samp > limits.maxSamplersPerShaderStage || next[st].sto > limits.maxStorageBuffersPerShaderStage || next[st].uni > limits.maxUniformBuffersPerShaderStage);\n if (over !== undefined || next.bindings > limits.maxBindingsPerBindGroup) { left.push({ name: p.name, why: `its bindings would pass the device's ${over ?? \"bind group\"} limits` }); continue; }\n const k: CardKind = { name: p.name, material: p.card, shaders: p.card.shaders() };\n const clash = collision(k, taken);\n if (clash !== null) { left.push({ name: p.name, why: clash }); continue; }\n used.vertex = next.vertex; used.fragment = next.fragment; used.bindings = next.bindings;\n kinds.push(k);\n }\n return { kinds, left };\n}\n\n/** The card's own entry: its bindings, every material's, their `only` and card functions, and the dispatch on the card's material. */\nexport function cardEntry(kinds: readonly CardKind[]): string {\n const out: string[] = [\n \"// THE FLAT-CARD PIPELINE (K7b; desk card/card.ts): every card material's functions over its own bindings, one dispatch.\",\n \"override LIT_ELSEWHERE: bool = false;\",\n \"@group(0) @binding(0) var<uniform> u: MatUniforms;\",\n \"@group(0) @binding(1) var gobo_tex: texture_2d<f32>;\",\n \"@group(0) @binding(2) var noise_tex: texture_2d<f32>;\",\n \"@group(0) @binding(3) var<storage, read> cards: array<u32>; // the draw list: material << 24 | the record's slot in its kind\",\n ];\n let b = OWN.length;\n for (const k of kinds) for (const x of k.material.bindings) out.push(`@group(0) @binding(${b++}) ${x.wgsl}; // ${k.name}`);\n for (const k of kinds) if (k.material.only !== undefined) out.push(k.material.only);\n for (const k of kinds) out.push(k.shaders.entry.text);\n const vs = kinds.map((k, m) => ` case ${m}u: { out.clip = ${k.material.quad}(slot, vid); }`).join(\"\\n\");\n const fs = kinds.map((k, m) => (k.material.fragInline !== undefined ? ` case ${m}u: {\\n${k.material.fragInline}\\n }` : ` case ${m}u: { c = ${k.material.frag}(slot, in.clip); }`)).join(\"\\n\");\n out.push(`struct CardOut {\n @builtin(position) clip: vec4f,\n @location(0) @interpolate(flat) card: u32,\n}\n\n@vertex\nfn vs(@builtin(vertex_index) vid: u32, @builtin(instance_index) iid: u32) -> CardOut {\n var out: CardOut;\n out.clip = vec4f(2.0, 2.0, 2.0, 1.0);\n let c = cards[iid];\n out.card = c;\n let slot = c & ${SLOT_MASK}u;\n switch (c >> ${CARD_SLOT_BITS}u) {\n${vs}\n default: {}\n }\n return out;\n}\n\n@fragment\nfn fs(in: CardOut) -> @location(0) vec4f {\n let slot = in.card & ${SLOT_MASK}u;\n var c = vec4f(-1.0);\n switch (in.card >> ${CARD_SLOT_BITS}u) {\n${fs}\n default: {}\n }\n if (c.a < 0.0) { discard; }\n return c;\n}\n`);\n return out.join(\"\\n\");\n}\n\n/** The card's program: every material's structs (by name) and modules (by label) once, in order, then the card's entry. */\nexport function cardShaders(kinds: readonly CardKind[]): ComposeOptions {\n const structs: StructDef<string>[] = [];\n const modules: ShaderPart[] = [];\n const names = new Set<string>();\n const labels = new Set<string>();\n for (const k of kinds) {\n for (const s of k.shaders.structs ?? []) if (!names.has(s.name)) { names.add(s.name); structs.push(s); }\n for (const m of k.shaders.modules ?? []) if (!labels.has(m.label)) { labels.add(m.label); modules.push(m); }\n }\n return { structs, modules, entry: { label: \"card/card (composed)\", text: cardEntry(kinds) } };\n}\n\n/** The layout: the card's own four, then every material's bindings in order. */\nexport function cardLayoutEntries(kinds: readonly CardKind[]): BindEntry[] {\n const entries: BindEntry[] = [...OWN];\n for (const k of kinds) for (const x of k.material.bindings) entries.push({ ...x.entry, binding: entries.length } as BindEntry);\n return entries;\n}\n\n/** The pipelines every slot's card draws with (once per device). */\nexport interface CardShared {\n /** The kinds composed, by material index. */\n readonly kinds: readonly string[];\n readonly material: ReadonlyMap<string, number>;\n readonly layout: GPUBindGroupLayout;\n readonly pipeline: GPURenderPipeline;\n /** The same, for a slot lit from elsewhere (MINIMAT.md §4) — the materials' `LIT_ELSEWHERE`. */\n readonly litPipeline: GPURenderPipeline;\n /** What was left out, and why. */\n readonly left: CardPlan[\"left\"];\n}\n\ntype Built = { readonly ok: true; readonly layout: GPUBindGroupLayout; readonly pipeline: GPURenderPipeline; readonly litPipeline: GPURenderPipeline } | { readonly ok: false; readonly why: string };\n\n/** One card program over `kinds` — its layout, module and both pipelines — or why the device refused it (the compile's first error). */\nasync function buildCard(device: GPUDevice, format: GPUTextureFormat, kinds: readonly CardKind[]): Promise<Built> {\n try {\n const layout = bindLayout(device, cardLayoutEntries(kinds), \"card/flat\");\n const module = await compile(device, compose(cardShaders(kinds)));\n const pl = device.createPipelineLayout({ bindGroupLayouts: [layout] });\n const [pipeline, litPipeline] = await Promise.all([\n renderPipeline(device, { label: \"card/flat\", layout: pl, module, format, blend: BLEND_PREMUL }),\n renderPipeline(device, { label: \"card/flat, lit from elsewhere\", layout: pl, module, format, blend: BLEND_PREMUL, constants: { LIT_ELSEWHERE: 1 } }),\n ]);\n return { ok: true, layout, pipeline, litPipeline };\n } catch (e) {\n const lines = (e instanceof Error ? e.message : String(e)).split(\"\\n\").map((l) => l.trim()).filter((l) => l.length > 0);\n return { ok: false, why: (lines.length > 1 && lines[0]?.startsWith(\"WGSL \") ? lines[1] : lines[0]) ?? \"refused\" };\n }\n}\n\n/**\n * The card's pipelines for the registered programs; null when none declares a material the device can compose. A material the\n * device REFUSES (K9 R3 — a plugin's WGSL error, a binding whose type its layout belies) takes only its own kind out of the card:\n * each material is then compiled alone and the ones that fail are left with their error; if what remains still fails together (a\n * collision the plan did not see), the last registered goes until the card compiles (a plugin registers after the built-ins).\n * Every kind left out draws itself, as one past the device's limits does, and is said once (`console.error`, and `left`).\n */\nexport async function createCardShared(device: GPUDevice, format: GPUTextureFormat, programs: readonly KindProgram[]): Promise<CardShared | null> {\n const plan = planCards(programs, device.limits);\n const left = [...plan.left];\n const leave = (k: CardKind, why: string): void => { left.push({ name: k.name, why }); console.error(`desk: kind \"${k.name}\" is left out of the flat card — it draws itself: ${why}`); };\n let kinds = plan.kinds;\n let built: Built | null = kinds.length === 0 ? null : await buildCard(device, format, kinds);\n if (built !== null && !built.ok) {\n const alone = await Promise.all(kinds.map((k) => buildCard(device, format, [k])));\n const kept: CardKind[] = [];\n kinds.forEach((k, i) => { const b = alone[i] as Built; if (b.ok) kept.push(k); else leave(k, `its card material does not compile: ${b.why}`); });\n kinds = kept;\n built = kinds.length === 0 ? null : await buildCard(device, format, kinds);\n while (built !== null && !built.ok) {\n // the kind whose removal alone lets the rest compile — the LAST registered such one goes (of a clashing pair, the later: a\n // plugin registers after the built-ins); none (two clashes at once): the last registered goes, and the rest are asked again\n const why = built.why;\n let culprit = kinds.length - 1;\n let rest: Built | null = null;\n for (let i = kinds.length - 1; i >= 0; i--) {\n const others = kinds.filter((_, j) => j !== i);\n const b = others.length === 0 ? null : await buildCard(device, format, others);\n if (b === null || b.ok) { culprit = i; rest = b; break; }\n }\n leave(kinds[culprit] as CardKind, `its card material does not compile beside the kinds it is composed with: ${why}`);\n kinds = kinds.filter((_, j) => j !== culprit);\n built = rest !== null ? rest : kinds.length === 0 ? null : await buildCard(device, format, kinds);\n }\n }\n if (built === null || !built.ok) return null;\n return { kinds: kinds.map((k) => k.name), material: new Map(kinds.map((k, i) => [k.name, i])), layout: built.layout, pipeline: built.pipeline, litPipeline: built.litPipeline, left };\n}\n\n/**\n * One slot's card: its draw list (the ground pushes a card for every object a material kind's pass lets go, in the order its\n * runs walk them) and the bind group over the slot's view block and mat and ITS kinds' resources — made again only when one of\n * them was replaced. The list is uploaded only when it changed (a camera move over a settled desk writes nothing).\n */\nexport class CardPass {\n readonly name = \"card\";\n /** Off: the ground routes nothing here — every object is drawn by its kind's own pass (a witness's second draw, a rig's A/B). */\n on = true;\n private list = new Uint32Array(256);\n private sent = new Uint32Array(256);\n private n = 0;\n private sentN = -1;\n private buffer: GPUBuffer;\n private group: GPUBindGroup | null = null;\n /** What the group was made over: the mat's assets, the list's buffer, and each material's version. */\n private boundOver: number[] = [];\n private litElsewhere = false;\n /** Each object's card this frame (−1: none) — a slot's route, reused frame to frame (`route`). */\n private routes = new Int32Array(256);\n private readonly device: GPUDevice;\n private readonly shared: CardShared;\n private readonly mat: MatPass;\n private readonly kinds: ReadonlyMap<string, KindPass>;\n private bufferVersion = 0;\n\n constructor(device: GPUDevice, shared: CardShared, mat: MatPass, kinds: ReadonlyMap<string, { readonly pass: KindPass }>) {\n this.device = device; this.shared = shared; this.mat = mat;\n this.kinds = new Map(shared.kinds.map((name) => [name, (kinds.get(name) as { readonly pass: KindPass }).pass]));\n this.buffer = storageBuffer(device, this.list.byteLength, \"card/list\");\n }\n\n /** A slot's card on the same pipelines, over ITS mat and kinds. */\n spawn(mat: MatPass, kinds: ReadonlyMap<string, { readonly pass: KindPass }>): CardPass { return new CardPass(this.device, this.shared, mat, kinds); }\n\n /** The material index of kind `name`, or undefined when the card does not draw it. */\n materialOf(name: string): number | undefined { return this.shared.material.get(name); }\n\n /** A frame's list begins, and a route for `n` objects, every one −1 (drawn by its kind). */\n begin(n: number): Int32Array {\n this.n = 0;\n if (this.routes.length < n) this.routes = new Int32Array(Math.max(n, this.routes.length * 2));\n const r = this.routes.subarray(0, n);\n r.fill(-1);\n return r;\n }\n\n /** A card for record `slot` of material `m`: its index in this frame's list (the ground's run counts it). */\n push(m: number, slot: number): number {\n if (this.n === this.list.length) { const next = new Uint32Array(this.list.length * 2); next.set(this.list); this.list = next; }\n this.list[this.n] = ((m << CARD_SLOT_BITS) | (slot & SLOT_MASK)) >>> 0;\n return this.n++;\n }\n\n /** The list uploaded when it changed, the group made again when anything under it moved, the pipeline for the slot's light. */\n prepare(slot: SlotContext): number {\n const n = this.n;\n if (n > 0) {\n if (this.buffer.size < n * 4) {\n this.buffer.destroy();\n this.buffer = storageBuffer(this.device, this.list.byteLength, \"card/list\");\n this.bufferVersion += 1;\n this.sentN = -1;\n }\n let same = n === this.sentN;\n if (same) for (let i = 0; i < n; i++) if (this.list[i] !== this.sent[i]) { same = false; break; }\n if (!same) {\n this.device.queue.writeBuffer(this.buffer, 0, this.list, 0, n);\n if (this.sent.length < this.list.length) this.sent = new Uint32Array(this.list.length);\n this.sent.set(this.list.subarray(0, n));\n this.sentN = n;\n }\n this.rebind();\n }\n this.litElsewhere = !litByOwn(slot.view, slot.lit);\n return n;\n }\n\n private rebind(): void {\n const over = this.boundOver;\n let stale = this.group === null || over[0] !== this.mat.assetVersion || over[1] !== this.bufferVersion;\n let i = 2;\n for (const pass of this.kinds.values()) { const v = pass.cardResources?.().version ?? -1; if (over[i] !== v) stale = true; i++; }\n if (!stale) return;\n const resources: (GPUBuffer | GPUTextureView | GPUSampler)[] = [this.mat.view, this.mat.silhouette, this.mat.noiseTexture.createView(), this.buffer];\n const versions = [this.mat.assetVersion, this.bufferVersion];\n for (const [name, pass] of this.kinds) {\n const r = pass.cardResources?.();\n if (r === undefined) throw new Error(`card: kind \"${name}\" declares a card material but its pass hands no resources`);\n resources.push(...r.resources);\n versions.push(r.version);\n }\n this.group = bindGroup(this.device, this.shared.layout, resources, \"card/flat\");\n this.boundOver = versions;\n }\n\n /** Cards [first, end) of this frame's list — interleaved objects of every material kind — as ONE instanced draw. */\n drawRange(pass: GPURenderPassEncoder, first: number, end: number): void {\n const hi = Math.min(end, this.n);\n if (first >= hi || this.group === null) return;\n pass.setPipeline(this.litElsewhere ? this.shared.litPipeline : this.shared.pipeline);\n pass.setBindGroup(0, this.group);\n pass.draw(6, hi - first, 0, first);\n }\n\n /** The cards this frame. */\n get count(): number { return this.n; }\n\n dispose(): void { this.buffer.destroy(); }\n}\n","// THE FOCUS BEHIND THE HAND (design-015 §8; D4b) — the desk goes out of focus while something is held:\n// \"a half-size copy of the desk frame, dual-Kawase blur 14 px (10 on a phone) + 8 % dim, scaled by the\n// carry amount — rendered ONCE when the pick-up settles and reused while the desk stands still (the held\n// object redraws alone)\". This pass owns the targets and the fullscreen draws; ground.ts decides WHEN the\n// copy is remade (its `stamp`) and draws the desk and the hand into the targets with the kinds' own passes.\n//\n// The pipeline, per held frame: [the desk copy, only when its stamp moved: the frame without the held\n// object → `desk` (half the surface, half the dpr) → `blur(...)`: two Kawase down passes (÷2, ÷4 of the\n// copy) and two up passes back into `blurred`] · the hand: the one object under the pose's camera →\n// `hand` (the surface's size, cleared to 0 — premultiplied by the kinds' source-over) · the frame:\n// `composite(...)` = the desk as mix(sharp, blurred, e) · (1 − dim), then the hand over it through the\n// reading light. Blur once per settled desk; per held frame a full-size clear + the one object + two\n// fullscreen draws.\n//\n// THE MIX (a ruling, D-D4b): the focus at a carry `e` is the SHARP copy cross-faded into the FULLY blurred\n// one by `e`, not a re-blur at radius 14·e per e-step — the brief's cheaper honest option: one blur per\n// settled desk, zero per held frame. Visually a cross-fade toward soft reads as going soft over 560 ms; the\n// phone's 10 px and the desk's 14 px are the radius the ONE blur is made at.\n//\n// THE RADIUS: a dual-Kawase chain's spread is set by its offset and its levels, not by a σ; with two levels\n// the impulse response's σ is close to 4 × the offset in the copy's texels (each level doubles the taps'\n// reach), so `offset = radiusTexels / 4` — the design's \"blur(14px)\" read as a Gaussian of σ 14 CSS px.\n// The oracle's stills pin the bytes; the number is documented, not measured to the pixel (D-D4b).\n\nimport { bindGroup, bindLayout, renderPipeline, uniformBuffer } from \"../engine/pipeline\";\nimport { compile, compose } from \"../engine/shader\";\nimport { defineStruct } from \"../engine/struct\";\nimport { beginPass, Target } from \"../engine/target\";\nimport type { HoldShaders } from \"./shaders\";\n\n/** The pass's knobs: `texel` = (1/w, 1/h of the SOURCE, the Kawase offset in half-texels, 0); `mix` = (the carry e, the dim, the saturate, the brightness). */\nexport const HoldUniformsStruct = defineStruct(\"HoldUniforms\", [\n [\"texel\", \"vec4f\"],\n [\"mix\", \"vec4f\"],\n]);\n\n/** The dual-Kawase chain's shape: two levels below the half-size copy; the offset per texel of radius. */\nexport const KAWASE = { levels: 2, offsetPerTexel: 0.25 } as const;\n\n/** The blend that lays a premultiplied target over the frame. */\nconst BLEND_PREMUL: GPUBlendState = {\n color: { srcFactor: \"one\", dstFactor: \"one-minus-src-alpha\", operation: \"add\" },\n alpha: { srcFactor: \"one\", dstFactor: \"one-minus-src-alpha\", operation: \"add\" },\n};\n\nexport interface CompositeKnobs {\n /** The carry amount: how far toward the blurred copy the background goes. */\n readonly e: number;\n /** The dim of the desk behind (already scaled by the carry). */\n readonly dim: number;\n /** The reading light on the hand (1, 1 by day; toward .62, .82 by night as the carry rises). */\n readonly saturate: number;\n readonly brightness: number;\n}\n\nexport class HoldPass {\n private readonly device: GPUDevice;\n private readonly layout: GPUBindGroupLayout;\n private readonly sampler: GPUSampler;\n private readonly down: GPURenderPipeline;\n private readonly up: GPURenderPipeline;\n private readonly deskPipe: GPURenderPipeline;\n private readonly handPipe: GPURenderPipeline;\n /** The desk's half-size copy, the Kawase levels below it, the blurred copy back at half size, the hand at full size. */\n readonly desk: Target;\n readonly blurred: Target;\n readonly hand: Target;\n private readonly levels: Target[] = [];\n /** One uniform buffer per draw the chain records (each holds its own texel size and offset). */\n private readonly knobs: GPUBuffer[] = [];\n private readonly values = HoldUniformsStruct.alloc();\n private groups: GPUBindGroup[] = [];\n /** The size the groups were built for — rebuilt when a target resized. */\n private built = \"\";\n\n private constructor(device: GPUDevice, format: GPUTextureFormat, layout: GPUBindGroupLayout, pipes: readonly [GPURenderPipeline, GPURenderPipeline, GPURenderPipeline, GPURenderPipeline]) {\n this.device = device;\n this.layout = layout;\n [this.down, this.up, this.deskPipe, this.handPipe] = pipes;\n this.sampler = device.createSampler({ label: \"hold/sampler\", magFilter: \"linear\", minFilter: \"linear\", addressModeU: \"clamp-to-edge\", addressModeV: \"clamp-to-edge\" });\n this.desk = new Target(device, { format, label: \"hold/desk\" });\n this.blurred = new Target(device, { format, label: \"hold/blurred\" });\n this.hand = new Target(device, { format, label: \"hold/hand\" });\n for (let i = 0; i < KAWASE.levels; i++) this.levels.push(new Target(device, { format, label: `hold/level-${i + 1}` }));\n // the chain's draws: `levels` down, `levels` up, the desk composite, the hand composite\n for (let i = 0; i < KAWASE.levels * 2 + 2; i++) this.knobs.push(uniformBuffer(device, HoldUniformsStruct.size, `hold/knobs-${i}`));\n }\n\n /** The four pipelines on `format` (the surface's — every target here is that format too, so one layout serves all). */\n static async create(device: GPUDevice, format: GPUTextureFormat, src: HoldShaders): Promise<HoldPass> {\n const module = await compile(device, compose({ structs: [HoldUniformsStruct], entry: src.entry }));\n const layout = bindLayout(device, [\n { binding: 0, stages: [\"fragment\"], buffer: \"uniform\" },\n { binding: 1, stages: [\"fragment\"], texture: \"float\" },\n { binding: 2, stages: [\"fragment\"], texture: \"float\" },\n { binding: 3, stages: [\"fragment\"], sampler: \"filtering\" },\n ], \"hold\");\n const pl = device.createPipelineLayout({ label: \"hold\", bindGroupLayouts: [layout] });\n const pipes = await Promise.all([\n renderPipeline(device, { label: \"hold/down\", layout: pl, module, fragment: \"fs_down\", format }),\n renderPipeline(device, { label: \"hold/up\", layout: pl, module, fragment: \"fs_up\", format }),\n renderPipeline(device, { label: \"hold/desk\", layout: pl, module, fragment: \"fs_desk\", format }),\n renderPipeline(device, { label: \"hold/hand\", layout: pl, module, fragment: \"fs_hand\", format, blend: BLEND_PREMUL }),\n ] as const);\n return new HoldPass(device, format, layout, pipes);\n }\n\n /** Size the targets to the surface (device px): the copies at half, the hand at full. True when any target was remade (its contents gone). */\n fit(w: number, h: number): boolean {\n const hw = Math.max(1, Math.ceil(w / 2));\n const hh = Math.max(1, Math.ceil(h / 2));\n let changed = this.desk.resize(hw, hh);\n changed = this.blurred.resize(hw, hh) || changed;\n changed = this.hand.resize(Math.max(1, w), Math.max(1, h)) || changed;\n let lw = hw;\n let lh = hh;\n for (const l of this.levels) { lw = Math.max(1, Math.ceil(lw / 2)); lh = Math.max(1, Math.ceil(lh / 2)); changed = l.resize(lw, lh) || changed; }\n return changed;\n }\n\n private rebind(): void {\n const key = `${this.desk.width}x${this.desk.height}|${this.hand.width}x${this.hand.height}`;\n if (key === this.built) return;\n this.built = key;\n const g = (i: number, a: GPUTextureView, b: GPUTextureView, label: string): GPUBindGroup => bindGroup(this.device, this.layout, [this.knobs[i] as GPUBuffer, a, b, this.sampler], label);\n const groups: GPUBindGroup[] = [];\n // down: desk → level 1 → level 2 …\n let src = this.desk.view;\n for (let i = 0; i < this.levels.length; i++) { groups.push(g(i, src, src, `hold/down-${i + 1}`)); src = (this.levels[i] as Target).view; }\n // up: level N → level N−1 … → blurred\n for (let i = this.levels.length - 1; i >= 0; i--) { const from = (this.levels[i] as Target).view; groups.push(g(this.levels.length + (this.levels.length - 1 - i), from, from, `hold/up-${i + 1}`)); }\n groups.push(g(this.levels.length * 2, this.desk.view, this.blurred.view, \"hold/desk\"));\n groups.push(g(this.levels.length * 2 + 1, this.hand.view, this.hand.view, \"hold/hand\"));\n this.groups = groups;\n }\n\n private knob(i: number, texel: readonly [number, number, number, number], mix: readonly [number, number, number, number]): void {\n this.values.set({ texel, mix });\n this.device.queue.writeBuffer(this.knobs[i] as GPUBuffer, 0, this.values.view());\n }\n\n /**\n * The blur: from the desk copy through the levels and back into `blurred`, at `radiusTexels` (the radius in the copy's\n * texels: the CSS radius × dpr / 2). Recorded into `encoder` after the copy was drawn; one chain per settled desk.\n */\n blur(encoder: GPUCommandEncoder, radiusTexels: number): void {\n this.rebind();\n const offset = Math.max(0, radiusTexels) * KAWASE.offsetPerTexel;\n const draw = (i: number, into: Target, from: Target, pipe: GPURenderPipeline, label: string): void => {\n this.knob(i, [1 / from.width, 1 / from.height, offset, 0], [0, 0, 0, 0]);\n const pass = beginPass(encoder, into.view, [0, 0, 0, 0], label);\n pass.setPipeline(pipe);\n pass.setBindGroup(0, this.groups[i] as GPUBindGroup);\n pass.draw(3);\n pass.end();\n };\n let from = this.desk;\n for (let i = 0; i < this.levels.length; i++) { const into = this.levels[i] as Target; draw(i, into, from, this.down, `hold/down-${i + 1}`); from = into; }\n for (let i = this.levels.length - 1; i >= 0; i--) {\n const into = i === 0 ? this.blurred : (this.levels[i - 1] as Target);\n draw(this.levels.length + (this.levels.length - 1 - i), into, this.levels[i] as Target, this.up, `hold/up-${i + 1}`);\n }\n }\n\n /** The frame: the desk out of focus, then the hand over it in its light — two fullscreen draws into the open pass. */\n composite(pass: GPURenderPassEncoder, k: CompositeKnobs): void {\n this.rebind();\n const n = this.levels.length * 2;\n this.knob(n, [1 / this.desk.width, 1 / this.desk.height, 0, 0], [k.e, k.dim, 1, 1]);\n pass.setPipeline(this.deskPipe);\n pass.setBindGroup(0, this.groups[n] as GPUBindGroup);\n pass.draw(3);\n this.knob(n + 1, [1 / this.hand.width, 1 / this.hand.height, 0, 0], [k.e, k.dim, k.saturate, k.brightness]);\n pass.setPipeline(this.handPipe);\n pass.setBindGroup(0, this.groups[n + 1] as GPUBindGroup);\n pass.draw(3);\n }\n\n dispose(): void {\n this.desk.dispose();\n this.blurred.dispose();\n this.hand.dispose();\n for (const l of this.levels) l.dispose();\n for (const b of this.knobs) b.destroy();\n }\n}\n","// The cutting mat — the ground's one grid (the dot and the needle retired on\n// 2026-09-25). Two pipelines: the WIND pass (the plate's silhouette animated by\n// three sines, into a 512² r8 target) and the MAT pass (one fullscreen\n// triangle: lines, grain, the gobo projected onto the desk, the reference's\n// grade). `prepare()` uploads the uniforms and records the wind pass when the\n// gobo time moved; `draw()` records the mat into the render pass the ground\n// opened, where the desk's objects follow.\n//\n// One CuttingMat is one SLOT: its own uniforms and bind groups. The pipelines,\n// the samplers, the plates, the blue noise and the WIND TARGETS are shared by\n// every slot spawned from the first (`spawn()` — a flight's departed slot, a mini\n// mat's inside): a plate uploaded through any slot is the plate every slot\n// samples. Since K4a (design-016 K-L3) the slot's uniforms are its ONE VIEW BLOCK\n// (`view`): every kind drawn in the slot binds that buffer, and none writes a\n// copy; and one wind target per plate serves every slot — the wind reads only\n// the clock, the plate's strength and the plate, so a slot whose key another\n// slot drew this frame samples that silhouette and draws none (a second key on\n// the same plate in one frame — a host clocking two slots apart — draws into the\n// slot's own target instead, so no slot ever samples another's clock).\n//\n// Until a host uploads a plate the gobo reads a 1×1 white plate — a lit mat,\n// never a blank — and the blue noise is a 1×1 mid-grey (one blur angle).\n\nimport { BLEND_OVER, bindGroup, bindLayout, renderPipeline, uniformBuffer } from \"../engine/pipeline\";\nimport { compile, compose } from \"../engine/shader\";\nimport { beginPass, Target } from \"../engine/target\";\nimport type { FadeIn, View } from \"../lattice/lod\";\nimport type { Presentation } from \"../nav/portal\";\nimport { MAT_GRID } from \"../theme\";\nimport { type GlyphAtlasMeta, GLYPHS, type MatConfig, type MatFrame, MatUniforms, matUniformValues, NO_GLYPHS, NOISE_SIZE, PLATE_SIZE, type PlateName, RULER_GLYPHS, type SlotLight } from \"./layout\";\nimport { DAY_LIGHT, type MatLight } from \"./night\";\nimport type { MatPass } from \"../kit/view\";\nimport type { MatShaders } from \"./shaders\";\n\nconst PLATE_NAMES: readonly PlateName[] = [\"c\", \"b\"];\n\n/** What every slot shares: the pipelines, the samplers, and the assets (versioned, so a slot rebinds when a plate lands). */\ninterface MatShared {\n readonly windLayout: GPUBindGroupLayout;\n readonly matLayout: GPUBindGroupLayout;\n readonly windPipeline: GPURenderPipeline;\n readonly matPipeline: GPURenderPipeline;\n readonly clampSampler: GPUSampler;\n readonly repeatSampler: GPUSampler;\n readonly plates: Record<PlateName, GPUTexture>;\n noise: GPUTexture;\n /** The rulers' glyph atlas (RULER.md) and what the pass knows about it; a 1×1 empty cell until a host uploads one. */\n glyphs: GPUTexture;\n glyphMeta: GlyphAtlasMeta;\n readonly loaded: { c: boolean; b: boolean; noise: boolean; glyphs: boolean };\n version: number;\n slots: number;\n /** The wind targets, one per plate, made on first use: every slot at a plate's key samples the one silhouette (K4a). */\n readonly winds: Partial<Record<PlateName, Wind>>;\n /** The frame `newFrame` counts (the ground's `prepareFrame`, once a frame) — what tells a key drawn THIS frame from a stale one. */\n frame: number;\n}\n\n/** A wind target and what it holds: the key it was drawn at (NaN: never) and the frame that drew it. */\ninterface Wind { readonly target: Target; key: number; frame: number }\n\nexport class CuttingMat implements MatPass {\n readonly name = \"mat/mat\";\n private readonly uniforms = MatUniforms.alloc(1);\n private readonly uniformBuf: GPUBuffer;\n /** The wind target this slot samples: its plate's shared one, or its own (`own`) after a clash in one frame. */\n private wind: Wind;\n /** This slot's own wind target, made only when two keys meet on one plate in one frame. */\n private own: Wind | null = null;\n private windGroups!: Record<PlateName, GPUBindGroup>;\n private matGroup!: GPUBindGroup;\n private bound = -1;\n private boundWind: Wind | null = null;\n /** Turns over whenever this slot's bind groups are made again — a shared asset landed, or the slot samples another silhouette. */\n private assets = 0;\n private windRuns = 0;\n /** The view block as last uploaded (K7a: uploaded only when its bytes moved; a layered kind compares a layer's view by it). */\n private readonly sentView = new Uint8Array(MatUniforms.size);\n private viewSent = false;\n private readonly device: GPUDevice;\n private readonly shared: MatShared;\n\n private constructor(device: GPUDevice, shared: MatShared) {\n this.device = device; this.shared = shared;\n shared.slots += 1;\n this.uniformBuf = uniformBuffer(device, MatUniforms.size, \"mat/uniforms\");\n this.wind = this.windOf(\"c\");\n this.rebind();\n }\n\n static async create(device: GPUDevice, format: GPUTextureFormat, src: MatShaders): Promise<CuttingMat> {\n const windLayout = bindLayout(device, [\n { binding: 0, stages: [\"fragment\"], buffer: \"uniform\" },\n { binding: 1, stages: [\"fragment\"], texture: \"float\" },\n ], \"mat/wind\");\n const matLayout = bindLayout(device, [\n { binding: 0, stages: [\"fragment\"], buffer: \"uniform\" },\n { binding: 1, stages: [\"fragment\"], texture: \"float\" },\n { binding: 2, stages: [\"fragment\"], sampler: \"filtering\" },\n { binding: 3, stages: [\"fragment\"], texture: \"float\" },\n { binding: 4, stages: [\"fragment\"], sampler: \"filtering\" },\n { binding: 5, stages: [\"fragment\"], texture: \"float\" },\n ], \"mat/mat\");\n const structs = [MatUniforms];\n const [windModule, matModule] = await Promise.all([\n compile(device, compose({ structs, modules: src.modules, entry: src.wind })),\n compile(device, compose({ structs, modules: src.modules, entry: src.entry })),\n ]);\n const [windPipeline, matPipeline] = await Promise.all([\n renderPipeline(device, { label: \"mat/wind\", layout: device.createPipelineLayout({ bindGroupLayouts: [windLayout] }), module: windModule, format: \"r8unorm\" }),\n // Straight-alpha \"over\": alpha is 1 at rest (a plain write), less through a flight's fade and its portal clip.\n renderPipeline(device, { label: \"mat/mat\", layout: device.createPipelineLayout({ bindGroupLayouts: [matLayout] }), module: matModule, format, blend: BLEND_OVER }),\n ]);\n const pixel = (label: string, rgba: readonly [number, number, number, number]): GPUTexture => {\n const t = device.createTexture({ label, size: [1, 1], format: \"rgba8unorm\", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST });\n device.queue.writeTexture({ texture: t }, new Uint8Array(rgba), { bytesPerRow: 4 }, [1, 1]);\n return t;\n };\n const empty = (label: string): GPUTexture => {\n const t = device.createTexture({ label, size: [1, 1], format: \"r8unorm\", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST });\n device.queue.writeTexture({ texture: t }, new Uint8Array([0]), { bytesPerRow: 1 }, [1, 1]);\n return t;\n };\n const shared: MatShared = {\n windLayout, matLayout, windPipeline, matPipeline,\n clampSampler: device.createSampler({ label: \"mat/clamp\", magFilter: \"linear\", minFilter: \"linear\", addressModeU: \"clamp-to-edge\", addressModeV: \"clamp-to-edge\" }),\n repeatSampler: device.createSampler({ label: \"mat/repeat\", magFilter: \"linear\", minFilter: \"linear\", addressModeU: \"repeat\", addressModeV: \"repeat\" }),\n plates: { c: pixel(\"mat/plate c\", [255, 255, 255, 255]), b: pixel(\"mat/plate b\", [255, 255, 255, 255]) },\n noise: pixel(\"mat/noise\", [128, 128, 128, 255]),\n glyphs: empty(\"mat/glyphs\"), glyphMeta: NO_GLYPHS,\n loaded: { c: false, b: false, noise: false, glyphs: false },\n version: 0, slots: 0, winds: {}, frame: 0,\n };\n return new CuttingMat(device, shared);\n }\n\n /** A second slot on the same pipelines and plates — a flight's departed mat, a mini mat's inside. */\n spawn(): CuttingMat { return new CuttingMat(this.device, this.shared); }\n\n /** Which assets a host has uploaded — stats, and the lab's boot line. Shared by every slot. */\n get loaded(): { readonly c: boolean; readonly b: boolean; readonly noise: boolean; readonly glyphs: boolean } { return this.shared.loaded; }\n /** What the pass knows about the glyph atlas it samples (RULER.md). */\n get glyphs(): GlyphAtlasMeta { return this.shared.glyphMeta; }\n /** This slot's animated silhouette — the wind target the mat samples; the paper pass (STICKY.md) samples the same, so a note takes the mat's dapple. */\n get silhouette(): GPUTextureView { return this.wind.target.view; }\n /** The slot's ONE VIEW BLOCK (K4a, design-016 K-L3): the uniforms this mat writes once a frame, which every kind in the slot binds. */\n get view(): GPUBuffer { return this.uniformBuf; }\n /** The glyph atlas as uploaded (a 1×1 empty cell until a host uploads one) — the mini mat pass prints with it. */\n get glyphTexture(): GPUTexture { return this.shared.glyphs; }\n /** The shared blue noise, as uploaded (a 1×1 grey until a host uploads the tile). */\n get noiseTexture(): GPUTexture { return this.shared.noise; }\n /** Bumped whenever a shared asset lands or the slot samples another silhouette — a pass that binds them rebinds on a change. */\n get assetVersion(): number { return this.assets; }\n get viewBytes(): Uint8Array { return this.sentView; }\n get silhouetteKey(): number { return this.wind.key; }\n\n /** A new frame (the ground's `prepareFrame`, before its slots prepare): a wind key drawn before it may be drawn over. */\n newFrame(): void { this.shared.frame += 1; }\n\n /** A plate's shared wind target, made on first use. */\n private windOf(plate: PlateName): Wind {\n const s = this.shared;\n const made = s.winds[plate];\n if (made) return made;\n const w: Wind = { target: new Target(this.device, { format: \"r8unorm\", label: `mat/wind ${plate}` }, PLATE_SIZE, PLATE_SIZE), key: Number.NaN, frame: -1 };\n s.winds[plate] = w;\n return w;\n }\n\n private upload(label: string, bytes: Uint8Array<ArrayBuffer>, size: number): GPUTexture {\n if (bytes.byteLength !== size * size * 4) throw new Error(`${label}: expected ${size}×${size} rgba8 (${size * size * 4} bytes), got ${bytes.byteLength}`);\n const t = this.device.createTexture({ label, size: [size, size], format: \"rgba8unorm\", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST });\n this.device.queue.writeTexture({ texture: t }, bytes, { bytesPerRow: size * 4 }, [size, size]);\n return t;\n }\n\n /** (Re)build this slot's bind groups against the shared assets' current version. */\n private rebind(): void {\n const s = this.shared;\n if (this.bound === s.version && this.boundWind === this.wind) return;\n if (this.bound !== s.version) {\n const windGroup = (name: PlateName) => bindGroup(this.device, s.windLayout, [this.uniformBuf, s.plates[name].createView()], `mat/wind ${name}`);\n this.windGroups = { c: windGroup(\"c\"), b: windGroup(\"b\") };\n }\n this.matGroup = bindGroup(this.device, s.matLayout, [this.uniformBuf, this.wind.target.view, s.clampSampler, s.noise.createView(), s.repeatSampler, s.glyphs.createView()], \"mat/mat\");\n this.bound = s.version;\n this.boundWind = this.wind;\n this.assets += 1;\n }\n\n /** A 512×512 rgba8 plate: R silhouette, G wind amp 1, B phase, A amps 2+3 (assets/gobo-*.rgba). Every slot samples it. */\n setPlate(name: PlateName, bytes: Uint8Array<ArrayBuffer>): void {\n const s = this.shared;\n s.plates[name].destroy();\n s.plates[name] = this.upload(`mat/plate ${name}`, bytes, PLATE_SIZE);\n s.loaded[name] = true;\n s.version += 1; // every slot rebinds on its next prepare, and its wind key (which carries the version) misses\n this.rebind();\n }\n\n /** The 128×128 rgba8 blue-noise tile (assets/blue-noise.rgba). Every slot samples it. */\n setNoise(bytes: Uint8Array<ArrayBuffer>): void {\n const s = this.shared;\n s.noise.destroy();\n s.noise = this.upload(\"mat/noise\", bytes, NOISE_SIZE);\n s.loaded.noise = true;\n s.version += 1;\n this.rebind();\n }\n\n /**\n * The glyph atlas (RULER.md): r8 coverage, `meta.width × meta.height` texels, the\n * first `meta.count` glyphs of `GLYPHS` in a row of `meta.cellW` cells — at least the\n * rulers' twelve; the capitals after them print a mini mat's name (MINIMAT.md §2).\n * Every slot samples it (the mini mat pass too); a host re-uploads when the device's\n * ratio or the text size changes.\n */\n setGlyphs(bytes: Uint8Array<ArrayBuffer>, meta: GlyphAtlasMeta): void {\n if (bytes.byteLength !== meta.width * meta.height) throw new Error(`mat/glyphs: expected ${meta.width}×${meta.height} r8 (${meta.width * meta.height} bytes), got ${bytes.byteLength}`);\n if (meta.count < RULER_GLYPHS || meta.count > GLYPHS.length || meta.cellW * meta.count > meta.width || meta.cellH > meta.height) throw new Error(`mat/glyphs: ${meta.count} cells of ${meta.cellW}×${meta.cellH} do not fit ${meta.width}×${meta.height} (${RULER_GLYPHS}–${GLYPHS.length} glyphs expected)`);\n const s = this.shared;\n s.glyphs.destroy();\n const t = this.device.createTexture({ label: \"mat/glyphs\", size: [meta.width, meta.height], format: \"r8unorm\", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST });\n this.device.queue.writeTexture({ texture: t }, bytes, { bytesPerRow: meta.width }, [meta.width, meta.height]);\n s.glyphs = t; s.glyphMeta = meta; s.loaded.glyphs = true;\n s.version += 1;\n this.rebind();\n }\n\n get windPasses(): number { return this.windRuns; }\n\n /**\n * Upload the uniforms (under `light` — the theme's Sun or Moon, mat/night.ts — through the lamp `lit`\n * says: the slot's own when absent, the host desk's for a mini mat's inside, MINIMAT.md §4); run the\n * wind pass if the silhouette it holds is stale. Returns whether it ran.\n */\n prepare(encoder: GPUCommandEncoder, view: View & { readonly dpr: number }, fadeIn: FadeIn, cfg: MatConfig, frame: MatFrame, present?: Presentation, light: MatLight = DAY_LIGHT, lit?: SlotLight): boolean {\n const plate = PLATE_NAMES.includes(cfg.gobo.plate) ? cfg.gobo.plate : \"c\";\n const strength = MAT_GRID.gobo.plates[plate].strength;\n this.uniforms.set(matUniformValues(view, fadeIn, { ...cfg, gobo: { ...cfg.gobo, plate } }, frame, strength, present, light, this.shared.glyphMeta, lit));\n const bytes = this.uniforms.view();\n let same = this.viewSent;\n for (let i = 0; same && i < bytes.byteLength; i++) same = bytes[i] === this.sentView[i];\n if (!same) {\n this.device.queue.writeBuffer(this.uniformBuf, 0, bytes);\n this.sentView.set(bytes);\n this.viewSent = true;\n }\n // a gobo at opacity 0 never consults its silhouette (mat.wgsl `sample_gobo`): the slot keeps the target it has, drawing none\n if (cfg.gobo.opacity <= 0) { this.rebind(); return false; }\n const key = frame.goboTime * 1.000001 + strength * 7.3 + PLATE_NAMES.indexOf(plate) * 1e3 + this.shared.version * 1e5;\n // the plate's shared target when it holds this key, or is free to take it (drawn in an earlier frame); else — another slot drew\n // another key on this plate THIS frame — the slot's own\n const common = this.windOf(plate);\n let w = common;\n if (common.key !== key && common.frame === this.shared.frame) {\n this.own ??= { target: new Target(this.device, { format: \"r8unorm\", label: \"mat/wind own\" }, PLATE_SIZE, PLATE_SIZE), key: Number.NaN, frame: -1 };\n w = this.own;\n }\n this.wind = w;\n this.rebind();\n if (w.key === key) return false;\n const pass = beginPass(encoder, w.target.view, [1, 0, 0, 1], \"mat/wind\");\n pass.setPipeline(this.shared.windPipeline);\n pass.setBindGroup(0, this.windGroups[plate]);\n pass.draw(3);\n pass.end();\n w.key = key;\n w.frame = this.shared.frame;\n this.windRuns += 1;\n return true;\n }\n\n draw(pass: GPURenderPassEncoder): void {\n pass.setPipeline(this.shared.matPipeline);\n pass.setBindGroup(0, this.matGroup);\n pass.draw(3);\n }\n\n /** This slot's buffers; the shared plates go with the last slot standing. */\n dispose(): void {\n this.uniformBuf.destroy(); this.own?.target.dispose();\n const s = this.shared;\n s.slots -= 1;\n if (s.slots === 0) {\n for (const n of PLATE_NAMES) { s.plates[n].destroy(); s.winds[n]?.target.dispose(); }\n s.noise.destroy(); s.glyphs.destroy();\n }\n }\n}\n","// The MARKS' LAYOUT — pure (design-015 §7, stratum 5; D4a). What the desk's chrome draws this frame, as\n// the records the marks pass shades (shaders/marks/marks.wgsl): *Marks on the Mat*'s reference drawing\n// code (vibe-field/draft/desk-chrome/chrome.js — `drawSelection` · `drawMember` · `drawUnion` ·\n// `drawMarquee` · `drawGuides` · `flare` · `pill` · `drawRulerBand`) re-expressed as a list of SDF\n// primitives, number for number (theme.ts `MARKS`), in SCREEN px: the marks keep their size at every\n// zoom — they are the desk's chrome, not its objects. The one exception is the TAPE, the object's own\n// attachment, which zooms with it and is moonlit by night (desk.css `.obj-tape`).\n//\n// A MarksInput is what the desk says about the frame — the objects' frames ON SCREEN with their marks'\n// clocks, several's union, the vellum, the laser's guides and gaps, the tape, your extent on the rulers\n// — assembled from the world by the builder (compose/marks.ts) or from a scene by the oracle. Paint\n// order is chrome.js's: the tape (it lies on its object, under every pencil stroke), each object's\n// marks, the union, the vellum, the laser, your extent on the rulers. A light mark (the laser's bloom,\n// its wall-to-wall lines, the flares, the rulers' laser ticks) is flagged: the pass ADDS it.\n\nimport { defineStruct } from \"../engine/struct\";\nimport { GLYPH_PAD, GLYPHS, type GlyphAtlasMeta, NO_GLYPHS } from \"../mat/layout\";\nimport { cssColor, MARKS, type RGBA } from \"../theme\";\nimport { easeLift } from \"./ease\";\n\n/** One mark, as the shader reads it — see each field's use per kind in marks.wgsl. */\nexport const MarkStruct = defineStruct(\"Mark\", [\n [\"shape\", \"vec4f\"], // kind, flags (1 = light: added), width (CSS px), reach (a bracket's) · a tape's fibre period (object units)\n [\"centre\", \"vec4f\"], // x, y (CSS px), angle (rad), corner radius (CSS px) · a flare's radius · a tape's presence\n [\"half\", \"vec4f\"], // half extents (CSS px) · a segment's or a bar's end B · a glyph cell's size; z, w: a flare's stop · a tape's sheen (top, foot)\n [\"colour\", \"vec4f\"], // straight sRGB and alpha, the presence folded in\n [\"aux\", \"vec4f\"], // a dotted line's period · a bar's tick · a flare's core (rgba) · a glyph's cell and halo · a tape's units, saturate, brightness, fibre alpha\n [\"quad\", \"vec4f\"], // the screen rect the mark may paint: x0, y0, x1, y1 (CSS px)\n]);\n\n/** The pass's block: the view (CSS px, dpr) and the glyph atlas (width, height in texels, texels per CSS px, cell width in texels). */\nexport const MarksUniformsStruct = defineStruct(\"MarksUniforms\", [\n [\"view\", \"vec4f\"],\n [\"atlas\", \"vec4f\"],\n [\"fade\", \"vec4f\"], // the tray's tags' fade (design-018 §4): the band's top, its width (CSS px), the first tag's record; 0 width = none\n]);\n\n/** The primitives (marks.wgsl's `MARK_*`). */\nexport const MARK = { stroke: 0, fill: 1, brackets: 2, segment: 3, bar: 4, flare: 5, glyph: 6, tape: 7 } as const;\n/** A mark of light: added, never painted over. */\nexport const LIGHT = 1;\n\nexport type V4 = readonly [number, number, number, number];\nexport interface MarkRecord {\n readonly shape: V4;\n readonly centre: V4;\n readonly half: V4;\n readonly colour: V4;\n readonly aux: V4;\n readonly quad: V4;\n}\n\n/** A screen rect, CSS px. */\nexport interface MarkBox { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number }\n\n/** An object's silhouette as the marks go around it: its centre, half extents, turn and corner — world units from a kind (`frame`), CSS px on screen. */\nexport interface MarkFrame {\n readonly cx: number;\n readonly cy: number;\n readonly hx: number;\n readonly hy: number;\n readonly angle: number;\n readonly r: number;\n}\n\n/**\n * One object's marks: `brackets` (a sole selection — `t` the lock-on's LINEAR progress 0..1, eased here on\n * `--vf-ease-lift`; `alpha` its presence, 0 when it has left) or `member` (one of several, or touched by the\n * vellum: quiet ticks at `alpha`); `knobs` where it resizes and nothing moves it.\n */\nexport interface MarkObject {\n readonly frame: MarkFrame;\n readonly style: \"brackets\" | \"member\";\n readonly t: number;\n readonly alpha: number;\n readonly knobs: boolean;\n}\n/** Several's union: the members' screen box (the frames' extents), its lock-on and presence. */\nexport interface MarkUnion { readonly box: MarkBox; readonly t: number; readonly alpha: number }\n/** The vellum being drawn: its screen rect, what it touches (the count by the cursor), the cursor. */\nexport interface MarkMarquee { readonly rect: MarkBox; readonly count: number; readonly pointer: { readonly x: number; readonly y: number } | null }\n/** A laser guide (kernel `SnapGuide` on screen): its line's `at`, edge or centre, the span it is bright over (the aligned objects' extent), the aligned corners (flares). */\nexport interface MarkGuide {\n readonly axis: \"x\" | \"y\";\n readonly at: number;\n readonly type: \"edge\" | \"center\";\n readonly span: readonly [number, number];\n readonly points: readonly (readonly [number, number])[];\n}\n/** An equal gap (core `SpacingBar` on screen): along `axis` from → to at `perp`, its size in WORLD units (the number). */\nexport interface MarkBar { readonly axis: \"x\" | \"y\"; readonly from: number; readonly to: number; readonly perp: number; readonly gap: number }\n/** A taped object's tape: its frame on screen, CSS px per object unit (the zoom, the lift), each strip's press (0..1, linear), the tape's presence. */\nexport interface MarkTape { readonly frame: MarkFrame; readonly units: number; readonly press: readonly [number, number]; readonly alpha: number }\n/** Your extent on the rulers: the selection's screen box, its world edges, and the rulers' margin and band (CSS px). */\nexport interface MarkRuler { readonly sel: MarkBox; readonly world: MarkBox; readonly margin: number; readonly band: number }\n\nexport interface MarksInput {\n readonly view: { readonly width: number; readonly height: number; readonly dpr: number };\n /** The Moon is up: the tape is moonlit and the vellum cooler; the pencil and the laser are light and do not change. */\n readonly night: boolean;\n readonly tape: readonly MarkTape[];\n readonly objects: readonly MarkObject[];\n readonly union: MarkUnion | null;\n readonly marquee: MarkMarquee | null;\n readonly guides: readonly MarkGuide[];\n readonly bars: readonly MarkBar[];\n /** A new alignment's strike, 1 … 0 over 160 ms: the bloom and the flares at up to 1.8×. */\n readonly strike: number;\n readonly ruler: MarkRuler | null;\n}\n\n/** A frame with nothing marked. */\nexport const NO_MARKS = (view: MarksInput[\"view\"], night = false): MarksInput => ({ view, night, tape: [], objects: [], union: null, marquee: null, guides: [], bars: [], strike: 0, ruler: null });\n\n// ---------------------------------------------------------------- inks, parsed once (theme.ts is their one home)\n\nconst I = MARKS.inks;\nconst INK = {\n pencil: cssColor(I.pencil.css),\n keyline: cssColor(I.keyline.css),\n paper: cssColor(I.paper.css),\n laser: cssColor(I.laser.css),\n laserLine: cssColor(I.laserLine.css),\n laserCore: cssColor(I.laserCore.css),\n ink: cssColor(I.tray.css),\n white: cssColor(I.white.css),\n tape: cssColor(I.tape.css),\n vellumDay: cssColor(I.vellumDay.css),\n vellumNight: cssColor(I.vellumNight.css),\n};\n\n/** A colour at `a` times its own alpha. */\nconst at = (c: RGBA, a: number): V4 => [c[0], c[1], c[2], c[3] * a];\nconst clamp = (x: number, a: number, b: number): number => Math.min(Math.max(x, a), b);\nconst Z4: V4 = [0, 0, 0, 0];\n\n/** The screen box a turned box (half extents grown by `pad`) covers. */\nfunction turnedQuad(cx: number, cy: number, hx: number, hy: number, angle: number, pad: number): V4 {\n const c = Math.abs(Math.cos(angle));\n const s = Math.abs(Math.sin(angle));\n const ex = c * hx + s * hy + pad;\n const ey = s * hx + c * hy + pad;\n return [cx - ex, cy - ey, cx + ex, cy + ey];\n}\n\n/** A point of a frame's own (turned) axes, on screen. */\nfunction onScreen(f: MarkFrame, x: number, y: number): readonly [number, number] {\n const c = Math.cos(f.angle);\n const s = Math.sin(f.angle);\n return [f.cx + c * x - s * y, f.cy + s * x + c * y];\n}\n\n// ---------------------------------------------------------------- the primitives\n\ntype Out = MarkRecord[];\n\nfunction box(out: Out, kind: number, cx: number, cy: number, hx: number, hy: number, angle: number, r: number, width: number, colour: V4, reach = 0, flags = 0): void {\n if (colour[3] <= 0) return;\n out.push({ shape: [kind, flags, width, reach], centre: [cx, cy, angle, r], half: [hx, hy, 0, 0], colour, aux: Z4, quad: turnedQuad(cx, cy, hx, hy, angle, width / 2 + 1.5) });\n}\n\nfunction segment(out: Out, a: readonly [number, number], b: readonly [number, number], width: number, colour: V4, flags = 0, period = 0): void {\n if (colour[3] <= 0) return;\n const pad = width / 2 + 1.5;\n out.push({ shape: [MARK.segment, flags, width, 0], centre: [a[0], a[1], 0, 0], half: [b[0], b[1], 0, 0], colour, aux: [period, 0, 0, 0], quad: [Math.min(a[0], b[0]) - pad, Math.min(a[1], b[1]) - pad, Math.max(a[0], b[0]) + pad, Math.max(a[1], b[1]) + pad] });\n}\n\nfunction bar(out: Out, a: readonly [number, number], b: readonly [number, number], tick: number, width: number, colour: V4, flags = 0): void {\n const pad = width / 2 + tick + 1.5;\n out.push({ shape: [MARK.bar, flags, width, 0], centre: [a[0], a[1], 0, 0], half: [b[0], b[1], 0, 0], colour, aux: [tick, 0, 0, 0], quad: [Math.min(a[0], b[0]) - pad, Math.min(a[1], b[1]) - pad, Math.max(a[0], b[0]) + pad, Math.max(a[1], b[1]) + pad] });\n}\n\n/** A light mark with its keyline (chrome.js `strokeMark`): the cast 2 px wider underneath, then the ink. */\nfunction keyed(draw: (width: number, colour: V4) => void, width: number, ink: RGBA, a: number): void {\n draw(width + MARKS.keyline.grow, at(INK.keyline, a));\n draw(width, at(ink, a));\n}\n\n// ---------------------------------------------------------------- selection (chrome.js `drawSelection`, `drawMember`, `drawUnion`)\n\n/** A bracket's reach: never over 30 % of the frame's side, never under its corner + 2 (chrome.js `bracketsPath`). */\nexport const bracketReach = (reach: number, X: number, Y: number, R: number): number => Math.max(Math.min(reach, MARKS.select.share * 2 * X, MARKS.select.share * 2 * Y), R + MARKS.select.minOverR);\n\n/** A sole selection's frame at lock-on progress `t`: how far out it stands (6 at rest, 8 further as it arrives), its corner, its presence at `alpha`. */\nexport function selectionGeometry(f: MarkFrame, t: number, alpha: number): { readonly gap: number; readonly X: number; readonly Y: number; readonly R: number; readonly a: number; readonly collapsed: boolean } {\n const S = MARKS.select;\n const e = easeLift(clamp(t, 0, 1));\n const gap = S.gap + (1 - e) * S.arrive;\n const X = f.hx + gap;\n const Y = f.hy + gap;\n return { gap, X, Y, R: Math.min(f.r + gap, S.radiusMax), a: alpha * clamp(t * S.rise, 0, 1), collapsed: Math.min(f.hx, f.hy) * 2 < S.collapse };\n}\n\nfunction selection(out: Out, f: MarkFrame, t: number, alpha: number, knobs: boolean, dpr: number): void {\n if (alpha <= 0.001) return;\n const S = MARKS.select;\n const g = selectionGeometry(f, t, alpha);\n const { X, Y, R, a } = g;\n if (g.collapsed) {\n // far out: under 24 px on screen the brackets become one ring\n keyed((w, c) => box(out, MARK.stroke, f.cx, f.cy, X, Y, f.angle, R, w, c), S.stroke, INK.pencil, a);\n return;\n }\n box(out, MARK.stroke, f.cx, f.cy, X, Y, f.angle, R, 1 / dpr, at(INK.pencil, S.hair * a));\n const L = bracketReach(S.reach, X, Y, R);\n keyed((w, c) => box(out, MARK.brackets, f.cx, f.cy, X, Y, f.angle, R, w, c, L), S.stroke, INK.pencil, a);\n if (!knobs) return;\n const k = R * (1 - Math.SQRT1_2);\n for (const [sx, sy] of [[-1, -1], [1, -1], [1, 1], [-1, 1]] as const) {\n const [x, y] = onScreen(f, sx * (X - k), sy * (Y - k));\n box(out, MARK.fill, x, y, S.knob + 1, S.knob + 1, 0, S.knob + 1, 0, at(INK.keyline, (S.knobShadow / INK.keyline[3]) * a));\n box(out, MARK.fill, x, y, S.knob, S.knob, 0, S.knob, 0, at(INK.paper, a));\n box(out, MARK.stroke, x, y, S.knob, S.knob, 0, S.knob, S.knobStroke, at(INK.pencil, a));\n }\n}\n\nfunction member(out: Out, f: MarkFrame, alpha: number): void {\n if (alpha <= 0.001) return;\n const M = MARKS.member;\n const a = alpha * M.alpha;\n const X = f.hx + M.gap;\n const Y = f.hy + M.gap;\n const R = Math.min(f.r + M.gap, M.radiusMax);\n const L = bracketReach(M.reach, X, Y, R);\n keyed((w, c) => box(out, MARK.brackets, f.cx, f.cy, X, Y, f.angle, R, w, c, L), M.stroke, INK.pencil, a);\n}\n\n/** Several's union: square to the mat, 10 out (the selection's frame is 6 out, so the box grows by 4), corner 4. */\nfunction union(out: Out, u: MarkUnion, dpr: number): void {\n if (u.alpha <= 0.001) return;\n const grow = MARKS.union.gap - MARKS.select.gap;\n const f: MarkFrame = { cx: (u.box.x0 + u.box.x1) / 2, cy: (u.box.y0 + u.box.y1) / 2, hx: (u.box.x1 - u.box.x0) / 2 + grow, hy: (u.box.y1 - u.box.y0) / 2 + grow, angle: 0, r: MARKS.union.radius };\n selection(out, f, u.t, u.alpha, false, dpr);\n}\n\n// ---------------------------------------------------------------- numbers (chrome.js `pill`) — the rulers' mono atlas\n\n/** The atlas's metrics in CSS px: one character's advance, the cell, the pad, the ascent and descent over the baseline. */\nfunction metrics(atlas: GlyphAtlasMeta): { readonly advance: number; readonly cellW: number; readonly cellH: number; readonly pad: number; readonly ascent: number; readonly descent: number; readonly live: boolean } {\n const s = atlas.scale;\n return {\n advance: atlas.advance / s, cellW: atlas.cellW / s, cellH: atlas.cellH / s, pad: GLYPH_PAD / s,\n ascent: (atlas.baseline - GLYPH_PAD) / s, descent: (atlas.cellH - atlas.baseline - GLYPH_PAD) / s,\n live: atlas.count > 0,\n };\n}\n\n/** How wide a string sets in the atlas, CSS px (10 px mono: a 6 px advance before an atlas is here). */\nexport function textWidth(text: string, atlas: GlyphAtlasMeta): number {\n const m = metrics(atlas);\n return text.length * (m.live ? m.advance : MARKS.pill.size * 0.6);\n}\n\n/**\n * A string from the atlas, its baseline's start at (x, y), turned `angle` about that point; every cell on a whole\n * device px (a glyph samples its texels 1:1 where the atlas was made at the view's ratio). `halo` > 0: the\n * coverage dilated that far instead (a label's keyline — chrome.js's 3 px stroked text).\n */\nfunction text(out: Out, s: string, x: number, y: number, angle: number, colour: V4, atlas: GlyphAtlasMeta, dpr: number, halo = 0): void {\n const m = metrics(atlas);\n if (!m.live || colour[3] <= 0) return;\n const c = Math.cos(angle);\n const sn = Math.sin(angle);\n const snap = (v: number): number => Math.round(v * dpr) / dpr;\n for (let i = 0; i < s.length; i++) {\n const cell = GLYPHS.indexOf(s[i] as string);\n if (cell < 0 || cell >= atlas.count) continue;\n // the cell's top-left in the text's own frame, then its centre on screen\n const lx = i * m.advance - m.pad;\n const ly = -(m.ascent + m.pad);\n const ox = angle === 0 ? snap(x + lx) - x : lx;\n const oy = angle === 0 ? snap(y + ly) - y : ly;\n const cx = x + c * (ox + m.cellW / 2) - sn * (oy + m.cellH / 2);\n const cy = y + sn * (ox + m.cellW / 2) + c * (oy + m.cellH / 2);\n out.push({ shape: [MARK.glyph, 0, 0, 0], centre: [cx, cy, angle, 0], half: [m.cellW, m.cellH, 0, 0], colour, aux: [cell, halo, 0, 0], quad: turnedQuad(cx, cy, m.cellW / 2, m.cellH / 2, angle, halo + 1.5) });\n }\n}\n\n/** Where a string's baseline sits for it to be centred on `y` (Canvas2D's \"middle\": the font box's middle). */\nfunction middleBaseline(y: number, atlas: GlyphAtlasMeta): number {\n const m = metrics(atlas);\n return y + (m.ascent - m.descent) / 2;\n}\n\n/** A number the desk states: a rounded pill 8 wider than its text and 15 tall, the text centred in it (chrome.js `pill`). */\nexport function pillBox(x: number, y: number, s: string, align: \"center\" | \"left\" | \"right\", atlas: GlyphAtlasMeta): MarkBox {\n const P = MARKS.pill;\n const w = Math.ceil(textWidth(s, atlas)) + P.pad;\n const h = P.height;\n const px = Math.round(align === \"center\" ? x - w / 2 : align === \"left\" ? x : x - w);\n const py = Math.round(y - h / 2);\n return { x0: px, y0: py, x1: px + w, y1: py + h };\n}\n\nfunction pill(out: Out, x: number, y: number, s: string, fill: RGBA, ink: RGBA, align: \"center\" | \"left\" | \"right\", atlas: GlyphAtlasMeta, dpr: number): void {\n const b = pillBox(x, y, s, align, atlas);\n const w = b.x1 - b.x0;\n const h = b.y1 - b.y0;\n box(out, MARK.fill, b.x0 + w / 2, b.y0 + h / 2, w / 2, h / 2, 0, MARKS.pill.radius, 0, at(fill, 1));\n text(out, s, b.x0 + w / 2 - textWidth(s, atlas) / 2, middleBaseline(b.y0 + h / 2 + 0.5, atlas), 0, at(ink, 1), atlas, dpr);\n}\n\n/**\n * The tray's name tags' look (K5b, D-K5b.7 — a call for James; one word switches back): `\"tape\"` — a strip of LABEL-MAKER tape stuck\n * to the board under each specimen, its capitals embossed; `\"pill\"` — K5a's marks-style chip.\n */\nexport const TRAY_TAG_STYLE: \"tape\" | \"pill\" = \"tape\";\n\n/**\n * The label tape (K5b): a strip `height` CSS px high running `pad` past the capitals, its corners barely rounded; the tape near-black,\n * the capitals the pale plastic an embosser stretches (raised: the tape's shade just under each), a faint sheen along its top edge and\n * its shadow on the board. By night the plastic's white steps back with the paper's, the sheen goes, the shadow lightens.\n */\nconst LABEL = {\n height: 13,\n pad: 5,\n radius: 1.5,\n tape: cssColor(MARKS.label.tape),\n letters: cssColor(MARKS.label.letters),\n shade: [0, 0, 0, 0.55] as V4,\n sheen: [1, 1, 1, 0.1] as V4,\n shadow: [0, 0, 0, 0.24] as V4,\n night: { letters: 0.45, shadow: 0.5 },\n} as const;\n\n/**\n * A NAME TAG (design-017 §8; K5a — under each of the tray's specimens), centred at (x, y) — screen px, the label in the rulers' capitals\n * (the atlas holds no other case): by `TRAY_TAG_STYLE`, a strip of embossed label tape (K5b) or the marks' pill in the paper's white with\n * the pencil's ink (K5a). By night (`night` 0 … 1) each steps back as a card does under the Moon.\n */\nexport function tagMarks(label: string, x: number, y: number, atlas: GlyphAtlasMeta, dpr: number, night = 0, style: \"tape\" | \"pill\" = TRAY_TAG_STYLE): MarkRecord[] {\n const out: Out = [];\n const n = Math.min(Math.max(night, 0), 1);\n const s = label.toUpperCase();\n if (style === \"pill\") {\n pill(out, x, y, s, at(INK.paper, 1 - 0.55 * n), at(INK.pencil, 1 - 0.25 * n), \"center\", atlas, dpr);\n return out;\n }\n const L = LABEL;\n const tw = textWidth(s, atlas);\n const hx = Math.ceil(tw / 2) + L.pad;\n const hy = L.height / 2;\n const cx = Math.round(x);\n const cy = Math.round(y);\n // stuck to the board: its shadow, the tape, the sheen along its top edge\n box(out, MARK.fill, cx + 0.6, cy + 0.9, hx, hy, 0, L.radius, 0, at(L.shadow, 1 - L.night.shadow * n));\n box(out, MARK.fill, cx, cy, hx, hy, 0, L.radius, 0, at(L.tape, 1));\n box(out, MARK.fill, cx, cy - hy + 0.8, hx - L.radius, 0.45, 0, 0, 0, at(L.sheen, 1 - n));\n // the capitals, RAISED: the tape's shade just under each, the stretched pale plastic over it\n const x0 = cx - tw / 2;\n const base = middleBaseline(cy + 0.5, atlas);\n text(out, s, x0, base + 0.8, 0, L.shade, atlas, dpr);\n text(out, s, x0, base, 0, at(L.letters, 1 - L.night.letters * n), atlas, dpr);\n return out;\n}\n\n// ---------------------------------------------------------------- the vellum (chrome.js `drawMarquee`)\n\nfunction marquee(out: Out, m: MarkMarquee, night: boolean, dpr: number, atlas: GlyphAtlasMeta): void {\n const Q = MARKS.marquee;\n const x0 = Math.min(m.rect.x0, m.rect.x1);\n const x1 = Math.max(m.rect.x0, m.rect.x1);\n const y0 = Math.min(m.rect.y0, m.rect.y1);\n const y1 = Math.max(m.rect.y0, m.rect.y1);\n const cx = (x0 + x1) / 2;\n const cy = (y0 + y1) / 2;\n const hx = (x1 - x0) / 2;\n const hy = (y1 - y0) / 2;\n box(out, MARK.fill, cx, cy, hx, hy, 0, 0, 0, at(night ? INK.vellumNight : INK.vellumDay, 1));\n box(out, MARK.stroke, cx, cy, hx, hy, 0, 0, 1 / dpr, at(INK.pencil, Q.edge));\n if (x1 - x0 > Q.minSide && y1 - y0 > Q.minSide) {\n const r = 0.01;\n const L = bracketReach(Q.reach, hx, hy, r);\n keyed((w, c) => box(out, MARK.brackets, cx, cy, hx, hy, 0, r, w, c, L), MARKS.select.stroke, INK.pencil, 1);\n }\n if (m.count > 0 && m.pointer !== null) pill(out, m.pointer.x + Q.count[0], m.pointer.y + Q.count[1], String(m.count), INK.pencil, INK.ink, \"left\", atlas, dpr);\n}\n\n// ---------------------------------------------------------------- the laser (chrome.js `drawGuides`, `flare`)\n\nfunction laser(out: Out, guides: readonly MarkGuide[], bars: readonly MarkBar[], strike: number, view: MarksInput[\"view\"], atlas: GlyphAtlasMeta): void {\n const L = MARKS.laser;\n const dpr = view.dpr;\n const boost = 1 + clamp(strike, 0, 1) * L.strike;\n for (const g of guides) {\n const dotted = g.type === \"center\";\n const period = dotted ? L.dotted.period : 0;\n const along = (a: number, b: number): [readonly [number, number], readonly [number, number]] => (g.axis === \"x\" ? [[g.at, a], [g.at, b]] : [[a, g.at], [b, g.at]]);\n const span = g.axis === \"x\" ? view.height : view.width;\n // a laser level's line runs wall to wall, faint; light, so it is added\n const [w0, w1] = along(0, span);\n const [wide, wideA] = L.wall[0];\n const [thin, thinA] = L.wall[1];\n segment(out, w0, w1, wide, at(INK.laser, wideA), LIGHT, period);\n segment(out, w0, w1, 1 / dpr + thin, at(INK.laser, thinA), LIGHT, period);\n // bright between the objects it aligns\n const [a, b] = along(g.span[0], g.span[1]);\n for (const [w, al] of L.bloom) segment(out, a, b, dotted ? w * L.dotted.bloom : w, at(INK.laser, Math.min(1, al * boost)), LIGHT, period);\n segment(out, a, b, dotted ? L.dotted.line : L.line, at(INK.laserLine, L.alpha), 0, period);\n segment(out, a, b, dotted ? L.dotted.core : L.core, at(INK.laserCore, L.alpha), 0, period);\n for (const [x, y] of g.points) {\n const F = L.flare;\n out.push({ shape: [MARK.flare, LIGHT, 0, 0], centre: [x, y, 0, F.radius], half: [F.stop, 0, 0, 0], colour: at(INK.laser, F.mid), aux: [INK.laserCore[0], INK.laserCore[1], INK.laserCore[2], Math.min(1, F.core * boost)], quad: [x - F.radius - 1, y - F.radius - 1, x + F.radius + 1, y + F.radius + 1] });\n }\n }\n for (const b of bars) {\n const B = L.bar;\n const horizontal = b.axis === \"x\";\n const A: readonly [number, number] = horizontal ? [b.from, b.perp] : [b.perp, b.from];\n const Z: readonly [number, number] = horizontal ? [b.to, b.perp] : [b.perp, b.to];\n bar(out, A, Z, B.tick, B.bloom[0], at(INK.laser, B.bloom[1]), LIGHT);\n bar(out, A, Z, B.tick, B.line, at(INK.laserLine, L.alpha));\n const mx = (A[0] + Z[0]) / 2;\n const my = (A[1] + Z[1]) / 2;\n const label = String(Math.round(b.gap));\n const len = Math.hypot(Z[0] - A[0], Z[1] - A[1]);\n if (len > B.pillFrom) pill(out, mx, my, label, INK.laser, INK.white, \"center\", atlas, dpr);\n else pill(out, horizontal ? mx : mx + B.off[0], horizontal ? my - B.off[1] : my, label, INK.laser, INK.white, \"center\", atlas, dpr);\n }\n}\n\n// ---------------------------------------------------------------- your extent on the rulers (chrome.js `drawRulerBand`)\n\nfunction ruler(out: Out, R: MarkRuler, guides: readonly MarkGuide[], view: MarksInput[\"view\"], atlas: GlyphAtlasMeta): void {\n const K = MARKS.ruler;\n const dpr = view.dpr;\n const m = R.margin;\n const inner = R.margin + R.band;\n const W = view.width;\n const H = view.height;\n const { sel } = R;\n // the top band, clipped to [inner, W − m]: the wash, the two edges, the edge coordinates\n const tx0 = Math.max(sel.x0, inner);\n const tx1 = Math.min(sel.x1, W - m);\n if (tx1 > tx0) box(out, MARK.fill, (tx0 + tx1) / 2, m + R.band / 2, (tx1 - tx0) / 2, R.band / 2, 0, 0, 0, at(INK.pencil, K.wash));\n for (const x of [Math.round(sel.x0) + 0.5, Math.round(sel.x1) - 0.5]) if (x >= inner && x <= W - m) segment(out, [x, m], [x, inner], 1, at(INK.pencil, K.edge));\n const lx = String(Math.round(R.world.x0));\n const rx = String(Math.round(R.world.x1));\n const label = (s: string, x: number, y: number, angle: number, inside: boolean): void => {\n if (!inside) return;\n text(out, s, x, y, angle, at(INK.keyline, K.label.haloAlpha / INK.keyline[3]), atlas, dpr, K.label.halo);\n text(out, s, x, y, angle, at(INK.pencil, 1), atlas, dpr);\n };\n const lw = textWidth(lx, atlas);\n const inTop = (x0: number, x1: number): boolean => x0 >= inner && x1 <= W - m;\n label(lx, sel.x0 - K.label.gap - lw, inner - K.label.lift, 0, inTop(sel.x0 - K.label.gap - lw, sel.x0 - K.label.gap));\n label(rx, sel.x1 + K.label.gap, inner - K.label.lift, 0, inTop(sel.x1 + K.label.gap, sel.x1 + K.label.gap + textWidth(rx, atlas)));\n // the left band, clipped to [inner, H − m]: the same, its labels turned a quarter (reading down)\n const ty0 = Math.max(sel.y0, inner);\n const ty1 = Math.min(sel.y1, H - m);\n if (ty1 > ty0) box(out, MARK.fill, m + R.band / 2, (ty0 + ty1) / 2, R.band / 2, (ty1 - ty0) / 2, 0, 0, 0, at(INK.pencil, K.wash));\n for (const y of [Math.round(sel.y0) + 0.5, Math.round(sel.y1) - 0.5]) if (y >= inner && y <= H - m) segment(out, [m, y], [inner, y], 1, at(INK.pencil, K.edge));\n const ty = String(Math.round(R.world.y0));\n const by = String(Math.round(R.world.y1));\n const tw = textWidth(ty, atlas);\n const inLeft = (y0: number, y1: number): boolean => y0 >= inner && y1 <= H - m;\n label(ty, inner - K.label.lift, sel.y0 - K.label.gap - tw, Math.PI / 2, inLeft(sel.y0 - K.label.gap - tw, sel.y0 - K.label.gap));\n label(by, inner - K.label.lift, sel.y1 + K.label.gap, Math.PI / 2, inLeft(sel.y1 + K.label.gap, sel.y1 + K.label.gap + textWidth(by, atlas)));\n // where a guide stands, the laser ticks the ruler\n for (const g of guides) {\n if (g.axis === \"x\" && g.at > inner && g.at < W - m) segment(out, [g.at, m + K.tick.inset], [g.at, inner - 1], K.tick.width, at(INK.laser, K.tick.alpha), LIGHT);\n if (g.axis === \"y\" && g.at > inner && g.at < H - m) segment(out, [m + K.tick.inset, g.at], [inner - 1, g.at], K.tick.width, at(INK.laser, K.tick.alpha), LIGHT);\n }\n}\n\n// ---------------------------------------------------------------- the tape (desk.css `.obj-tape`)\n\n/** The two strips on screen: centre, half extents, turn, presence — each pressed from 1.22× on `--vf-ease-lift`. */\nexport function tapeStrips(t: MarkTape): { readonly cx: number; readonly cy: number; readonly hx: number; readonly hy: number; readonly angle: number; readonly alpha: number }[] {\n const T = MARKS.tape;\n const u = t.units;\n const f = t.frame;\n const turn = (T.turn * Math.PI) / 180;\n // in the object's frame: 5 over its top edge and 20 past each side, 60 × 17 (object units)\n const ox = f.hx - (T.w / 2 - T.past) * u;\n const oy = -f.hy + (T.h / 2 - T.over) * u;\n return ([[-1, -turn], [1, turn]] as const).map(([side, spin], i) => {\n const p = clamp(t.press[i] ?? 1, 0, 1);\n const e = easeLift(p);\n const s = 1 + (T.press - 1) * (1 - e);\n const [cx, cy] = onScreen(f, side * ox, oy);\n return { cx, cy, hx: (T.w / 2) * u * s, hy: (T.h / 2) * u * s, angle: f.angle + spin, alpha: t.alpha * clamp(e, 0, 1) };\n });\n}\n\nfunction tape(out: Out, t: MarkTape, night: boolean): void {\n const T = MARKS.tape;\n const [sat, bright] = night ? [T.night.saturate, T.night.brightness] : [1, 1];\n for (const s of tapeStrips(t)) {\n if (s.alpha <= 0.001) continue;\n out.push({ shape: [MARK.tape, 0, 0, T.fibre.every], centre: [s.cx, s.cy, s.angle, s.alpha], half: [s.hx, s.hy, T.sheen[0], T.sheen[1]], colour: at(INK.tape, 1), aux: [t.units, sat, bright, T.fibre.alpha], quad: turnedQuad(s.cx, s.cy, s.hx, s.hy, s.angle, 1.5) });\n }\n}\n\n// ---------------------------------------------------------------- the frame's marks\n\n/** Every mark this frame, in paint order, for the pass. `atlas` = the rulers' glyph atlas (the numbers; none = no numbers). */\nexport function layoutMarks(input: MarksInput, atlas: GlyphAtlasMeta = NO_GLYPHS): MarkRecord[] {\n const out: MarkRecord[] = [];\n const dpr = input.view.dpr;\n for (const t of input.tape) tape(out, t, input.night);\n for (const o of input.objects) {\n if (o.style === \"member\") member(out, o.frame, o.alpha);\n else selection(out, o.frame, o.t, o.alpha, o.knobs, dpr);\n }\n if (input.union !== null) union(out, input.union, dpr);\n if (input.marquee !== null) marquee(out, input.marquee, input.night, dpr, atlas);\n if (input.guides.length > 0 || input.bars.length > 0) laser(out, input.guides, input.bars, input.strike, input.view, atlas);\n if (input.ruler !== null) ruler(out, input.ruler, input.guides, input.view, atlas);\n return out;\n}\n\n/** The screen box of the frames (each turned frame's extent) — several's union, the menu's anchor. */\nexport function framesBox(frames: readonly MarkFrame[]): MarkBox | null {\n if (frames.length === 0) return null;\n let x0 = Number.POSITIVE_INFINITY;\n let y0 = Number.POSITIVE_INFINITY;\n let x1 = Number.NEGATIVE_INFINITY;\n let y1 = Number.NEGATIVE_INFINITY;\n for (const f of frames) {\n const [qx0, qy0, qx1, qy1] = turnedQuad(f.cx, f.cy, f.hx, f.hy, f.angle, 0);\n x0 = Math.min(x0, qx0); y0 = Math.min(y0, qy0); x1 = Math.max(x1, qx1); y1 = Math.max(y1, qy1);\n }\n return { x0, y0, x1, y1 };\n}\n\n/** A world frame under a camera (`Camera.x/y` = the view's world top-left), CSS px — the marks' one conversion. */\nexport function frameOnScreen(f: MarkFrame, cam: { readonly x: number; readonly y: number; readonly zoom: number }): MarkFrame {\n const z = cam.zoom;\n return { cx: (f.cx - cam.x) * z, cy: (f.cy - cam.y) * z, hx: f.hx * z, hy: f.hy * z, angle: f.angle, r: f.r * z };\n}\n\n/** The box the marks around a selection occupy on screen — the brackets' (6 out) or the union's (10 out): the selection menu's anchor. */\nexport function selectionBox(frames: readonly MarkFrame[]): MarkBox | null {\n const b = framesBox(frames);\n if (b === null) return null;\n const g = frames.length > 1 ? MARKS.union.gap : MARKS.select.gap;\n return { x0: b.x0 - g, y0: b.y0 - g, x1: b.x1 + g, y1: b.y1 + g };\n}\n","// The MARKS PASS — the desk's chrome on the GPU (design-015 §4.2 stratum 5, §7; D4a): one pipeline,\n// one instanced draw of the frame's marks (marks/layout.ts) after every stratum of the ROOT slot, in\n// screen px. It samples the rulers' glyph atlas off the root's mat (the pills' numerals are the rulers'\n// face) and rebinds when the mat's assets change; its records grow by doubling. Premultiplied blend:\n// a mark of light returns alpha 0 and is ADDED (Canvas2D's \"lighter\"), everything else is painted over.\n\nimport { bindGroup, bindLayout, renderPipeline, storageBuffer, uniformBuffer } from \"../engine/pipeline\";\nimport { compile, compose } from \"../engine/shader\";\nimport type { StructBuffer } from \"../engine/struct\";\nimport type { MatPass } from \"../kit/view\";\nimport { layoutMarks, type MarkRecord, MarkStruct, type MarksInput, MarksUniformsStruct, tagMarks } from \"./layout\";\nimport type { MarksShaders } from \"./shaders\";\n\nconst BLEND_PREMUL: GPUBlendState = {\n color: { srcFactor: \"one\", dstFactor: \"one-minus-src-alpha\", operation: \"add\" },\n alpha: { srcFactor: \"one\", dstFactor: \"one-minus-src-alpha\", operation: \"add\" },\n};\n\ntype MarkField = \"shape\" | \"centre\" | \"half\" | \"colour\" | \"aux\" | \"quad\";\n\nexport class MarksPass {\n private readonly device: GPUDevice;\n private readonly mat: MatPass;\n private readonly pipeline: GPURenderPipeline;\n private readonly layout: GPUBindGroupLayout;\n private readonly sampler: GPUSampler;\n private readonly uniformBuf: GPUBuffer;\n private readonly uniforms = MarksUniformsStruct.alloc();\n private records: StructBuffer<MarkField>;\n private recordBuf: GPUBuffer;\n private group: GPUBindGroup | null = null;\n private boundAssets = -1;\n private count = 0;\n private tags = 0;\n private last: readonly MarkRecord[] = [];\n private lastTags: readonly MarkRecord[] = [];\n\n private constructor(device: GPUDevice, mat: MatPass, pipeline: GPURenderPipeline, layout: GPUBindGroupLayout) {\n this.device = device;\n this.mat = mat;\n this.pipeline = pipeline;\n this.layout = layout;\n this.sampler = device.createSampler({ label: \"marks/glyphs\", magFilter: \"linear\", minFilter: \"linear\", addressModeU: \"clamp-to-edge\", addressModeV: \"clamp-to-edge\" });\n this.uniformBuf = uniformBuffer(device, MarksUniformsStruct.size, \"marks/uniforms\");\n this.records = MarkStruct.alloc(64) as StructBuffer<MarkField>;\n this.recordBuf = storageBuffer(device, MarkStruct.size * 64, \"marks/records\");\n }\n\n /** The pipeline on `format`, sampling `mat`'s glyph atlas (the root's: its assets are every slot's). */\n static async create(device: GPUDevice, format: GPUTextureFormat, src: MarksShaders, mat: MatPass): Promise<MarksPass> {\n const module = await compile(device, compose({ structs: [MarksUniformsStruct, MarkStruct], modules: src.modules, entry: src.entry }));\n const layout = bindLayout(device, [\n { binding: 0, stages: [\"vertex\", \"fragment\"], buffer: \"uniform\" },\n { binding: 1, stages: [\"vertex\", \"fragment\"], buffer: \"read-only-storage\" },\n { binding: 2, stages: [\"fragment\"], texture: \"float\" },\n { binding: 3, stages: [\"fragment\"], sampler: \"filtering\" },\n ], \"marks\");\n const pl = device.createPipelineLayout({ label: \"marks\", bindGroupLayouts: [layout] });\n const pipeline = await renderPipeline(device, { label: \"marks\", layout: pl, module, format, blend: BLEND_PREMUL });\n return new MarksPass(device, mat, pipeline, layout);\n }\n\n /**\n * Lay this frame's marks out and upload them (before the frame's pass begins); after them, the tray's NAME TAGS (K5a — drawn apart,\n * `drawTags`, where the tray says). Returns the count of the frame's marks that will draw (`draw`).\n */\n prepare(input: MarksInput | undefined, tray?: { readonly view: { readonly width: number; readonly height: number; readonly dpr: number }; readonly tags: readonly { readonly label: string; readonly x: number; readonly y: number }[]; readonly night?: number; readonly fade?: { readonly top: number; readonly band: number } | undefined }): number {\n const marks = input === undefined ? [] : layoutMarks(input, this.mat.glyphs);\n const view = input?.view ?? tray?.view;\n const tags = view === undefined ? [] : (tray?.tags ?? []).flatMap((t) => tagMarks(t.label, t.x, t.y, this.mat.glyphs, view.dpr, tray?.night ?? 0));\n this.last = marks;\n this.lastTags = tags;\n const total = marks.length + tags.length;\n if (total > this.records.count) {\n let n = this.records.count;\n while (n < total) n *= 2;\n this.records = MarkStruct.alloc(n) as StructBuffer<MarkField>;\n this.recordBuf.destroy();\n this.recordBuf = storageBuffer(this.device, MarkStruct.size * n, \"marks/records\");\n this.group = null;\n }\n for (let i = 0; i < marks.length; i++) this.records.set(marks[i] as MarkRecord, i);\n for (let i = 0; i < tags.length; i++) this.records.set(tags[i] as MarkRecord, marks.length + i);\n this.count = marks.length;\n this.tags = tags.length;\n if (view === undefined) return 0;\n const atlas = this.mat.glyphs;\n // the tags are gone in the drawer's header and fade in under it as its specimens do (design-018 §4, R4): from the band's top (the\n // header's foot), over its width, from the first tag on\n const fade = tray?.fade !== undefined && tags.length > 0 ? [tray.fade.top, tray.fade.band, marks.length, 0] : [0, 0, 0, 0];\n this.uniforms.set({ view: [view.width, view.height, view.dpr, 0], atlas: [atlas.width, atlas.height, atlas.scale, atlas.cellW], fade });\n this.device.queue.writeBuffer(this.uniformBuf, 0, this.uniforms.view());\n if (total > 0) this.device.queue.writeBuffer(this.recordBuf, 0, this.records.view(total));\n return marks.length;\n }\n\n /** The pipeline and its group, bound (rebound when the mat's assets or the records' buffer changed). */\n private bind(pass: GPURenderPassEncoder): void {\n if (this.group === null || this.boundAssets !== this.mat.assetVersion) {\n this.group = bindGroup(this.device, this.layout, [this.uniformBuf, this.recordBuf, this.mat.glyphTexture.createView(), this.sampler], \"marks\");\n this.boundAssets = this.mat.assetVersion;\n }\n pass.setPipeline(this.pipeline);\n pass.setBindGroup(0, this.group);\n }\n\n /** The marks into the open pass — over everything drawn so far (the caller resets the scissor to the view). */\n draw(pass: GPURenderPassEncoder): void {\n if (this.count === 0) return;\n this.bind(pass);\n pass.draw(6, this.count, 0, 0);\n }\n\n /** The tray's name tags (K5a) into the open pass, under the caller's scissor (the drawer's face). */\n drawTags(pass: GPURenderPassEncoder): void {\n if (this.tags === 0) return;\n this.bind(pass);\n pass.draw(6, this.tags, 0, this.count);\n }\n\n /** The tray's name tags laid by the last prepare. */\n get tagCount(): number { return this.tags; }\n /** …and their records (a rig's witness). */\n get tagsLaid(): readonly MarkRecord[] { return this.lastTags; }\n\n /** Marks drawn by the last prepare. */\n get drawn(): number { return this.count; }\n /** The last prepare's records — a rig's and a check's witness (what was drawn, where). */\n get laid(): readonly MarkRecord[] { return this.last; }\n\n dispose(): void { this.uniformBuf.destroy(); this.recordBuf.destroy(); }\n}\n","// THE PEGBOARD'S LOOK (design-017 §6.5–§6.6; design-018 §3) — theme.ts's `TRAY` law as the pass reads it: the two materials linear,\n// the punched edge derived from the face by the research's edge/face albedo ratio. (A hole shows the desk — the plaster retired.)\n\nimport { linear } from \"../mat/night\";\nimport { type RGB, rgb, TRAY } from \"../theme\";\n\nconst faceSrgb = rgb(TRAY.face.css);\nconst face = linear(faceSrgb);\nconst { research } = TRAY;\n\nexport const TRAY_LOOK = {\n /** The tempered hardboard face — and the byte it is configured as (a flat, lit face is drawn at exactly this). */\n face,\n faceSrgb,\n /** The paler, fuzzier punched edge: the face scaled by the research's edge/face ratio. */\n edge: [0, 1, 2].map((i) => (face[i] as number) * ((research.edge[i] as number) / (research.face[i] as number))) as unknown as RGB,\n /** The room's light on the mat in a hole: at its edge, at its heart, over what width (pitches). */\n cavity: TRAY.cavity,\n /** The unit direction to the lamp in the board's frame (x right, y down, z toward the eye) — the research's HOME lamp, its y turned down. */\n lamp: (() => {\n const az = (TRAY.lamp.azimuth * Math.PI) / 180;\n const el = (TRAY.lamp.elevation * Math.PI) / 180;\n return [Math.sin(az) * Math.cos(el), -Math.sin(el), Math.cos(az) * Math.cos(el)] as const;\n })(),\n /** The lamp's angular radius, rad. */\n lampSize: TRAY.lampSize,\n /** K5a: the accessories' powder coat, linear; each accessory's standing-off (pitches); their shadows' strength. */\n accessory: linear(rgb(TRAY.accessory.css)),\n accessoryHeight: TRAY.accessory.height,\n accessoryShadow: TRAY.accessory.shadow,\n /** K5a: a hovered specimen's lift — a share of its kind's hold. */\n hoverLift: TRAY.hoverLift,\n} as const;\n","// THE CARRY (design-017 §9; K5b) — the take's motion, which lives in the renderer and nowhere else. The COPY lifted off the board: the\n// object a take makes, under the grab point, following the pointer at ×1.06 of its specimen's scale (the lift a spring; the specimen stays\n// hung — James: \"the dragged away tile item now re-appears\"). PUT BACK when the take ends in the drawer (a release there, the drawer shut\n// under it): it glides onto its specimen at the specimen's scale and is gone — a put-down, widgetlab's glide. HANDED when it leaves the\n// drawer: it holds its pose for the frame the insert ghost is spawned after, and the ghost then GROWS out of it about the grab point — the\n// two coincide at the hand-off (the same pivot, the same scale: no pop) — on the drawer's own curve, drawn HERE, over the drawer and its\n// dim, until it is its own size and the drawer has gone; the desk draws it from then on (the builder's `presented`). An insert ghost flying\n// HOME (Esc, a rejected drop, a release back over the drawer) is drawn here too, SHRINKING to nothing as its tween flies it (\"also shrink\n// its size … along with the fly\"). A PURE module: the facts are core's — `Tray`'s take and the insert ghosts in the world — read each\n// frame; the out is POSES (a pivot on screen, a scale, a lift) that `carryViews` turns into views for the kinds' own records (K-L3).\n\nimport { settled, spring } from \"../kit/springs\";\nimport { DRAWER, slideEase } from \"./drawer\";\n\n/** The carry's numbers: the lift's scale (widgetlab's ×1.06) and spring, the put-back's glide, the hand-off's patience, the grow's length. */\nexport const CARRY = {\n /** The copy at its full lift is this much larger than its specimen, about the grab point. */\n liftScale: 1.06,\n liftHz: 9,\n /** A take put back glides home in this long (widgetlab's 240 ms), on the drawer's curve. */\n backMs: 240,\n /** A handed copy waits this many frames for its ghost; none (the hand-off was refused), it is put back. */\n handFrames: 3,\n /** The ghost grows to its own size in the drawer's slide (340 ms, its curve): it is itself as the drawer is gone. */\n growMs: DRAWER.slideMs,\n} as const;\n\n/** The take as core holds it (`Tray`): the type lifted (\"\" none), the grab point across the object, the pointer, the hand-off count. */\nexport interface CarryFacts {\n readonly take: string;\n readonly u: number;\n readonly v: number;\n readonly x: number;\n readonly y: number;\n readonly handed: number;\n}\n\n/** A specimen as the board drew it this frame: its type, the scale its kind drew it at, its object's rect on screen (CSS px). */\nexport interface CarrySpecimen {\n readonly type: string;\n readonly zoom: number;\n readonly x0: number;\n readonly y0: number;\n readonly x1: number;\n readonly y1: number;\n}\n\n/** An insert ghost in the world: its entity and type, its rect (world, top-left), whether it flies home and how far (its tween, 0 … 1). */\nexport interface CarryGhost {\n readonly entity: number;\n readonly type: string;\n readonly x: number;\n readonly y: number;\n readonly w: number;\n readonly h: number;\n readonly retiring: boolean;\n readonly progress: number;\n}\n\n/** The desk's camera (world → screen: `(p − cam) · zoom`). */\nexport interface CarryCamera { readonly x: number; readonly y: number; readonly zoom: number }\n\n/**\n * One carried object this frame. `ghost` — the insert ghost's entity (its rect is the world's, its props the world's), absent for a copy\n * (its rect its natural size about the origin, its props what one taken is made with). The object's point `(u, v)` across its rect lies at\n * `(px, py)` on screen, at `zoom` screen px per object unit; `lift` its hold (0 … 1).\n */\nexport interface CarryPose {\n /** The carried thing's id — stable from its lift to its put-back or its hand-off (a copy's record key). */\n readonly id: number;\n readonly type: string;\n readonly ghost?: number;\n readonly u: number;\n readonly v: number;\n readonly px: number;\n readonly py: number;\n readonly zoom: number;\n readonly lift: number;\n /** The phase, a rig's witness. */\n readonly phase: \"lift\" | \"back\" | \"handing\" | \"grow\" | \"home\";\n}\n\ntype Item = { id: number } & (\n | { phase: \"lift\"; type: string; u: number; v: number; x: number; y: number; l: number; lv: number }\n | { phase: \"back\"; type: string; u: number; v: number; x: number; y: number; zoom: number; l: number; t0: number; to: { x: number; y: number; zoom: number } }\n | { phase: \"handing\"; type: string; u: number; v: number; x: number; y: number; zoom: number; l: number; frames: number }\n | { phase: \"grow\"; type: string; u: number; v: number; ghost: number; k0: number; t0: number; k: number }\n | { phase: \"home\"; type: string; ghost: number; k0: number });\n\nexport interface TrayCarry {\n /**\n * Step to `now` (frame clock, ms) with this frame's facts: the take (undefined: no tray), the specimens as drawn, the insert ghosts, the\n * camera, the drawer's slide `p` (the ghost is the desk's again once it is its own size and the drawer is gone). Returns the poses.\n */\n step(now: number, facts: CarryFacts | undefined, specimens: readonly CarrySpecimen[], ghosts: readonly CarryGhost[], cam: CarryCamera, p: number): readonly CarryPose[];\n /** The ghosts drawn here this frame — none of the desk's rows (the builder's `presented`). */\n presented(): ReadonlySet<number>;\n /** Something still moves: the next frame paints too. */\n live(): boolean;\n /** The types whose copy is up or on its way (their slots are made ahead of a hand-off — a composite kind's pass is made async). */\n types(): readonly string[];\n state(): { readonly poses: readonly CarryPose[]; readonly handed: number; readonly live: boolean };\n}\n\nconst EPS = 1e-4;\nconst clamp01 = (x: number): number => Math.min(Math.max(x, 0), 1);\n\n/** Where a specimen's point `(u, v)` is on screen, and its scale — a put-back's target. */\nfunction homeOf(s: CarrySpecimen, u: number, v: number): { x: number; y: number; zoom: number } {\n return { x: s.x0 + u * (s.x1 - s.x0), y: s.y0 + v * (s.y1 - s.y0), zoom: s.zoom };\n}\n\nexport function createTrayCarry(): TrayCarry {\n let items: Item[] = [];\n let ids = 0;\n let handed = -1;\n let last = -1;\n let moving = false;\n let poses: CarryPose[] = [];\n const presented = new Set<number>();\n /** Ghosts seen before: a handed copy grows into a NEW one. */\n const known = new Set<number>();\n /** Each specimen as last drawn: a put-back aims at it after the drawer has gone. */\n const lastSeen = new Map<string, CarrySpecimen>();\n\n return {\n step(now, facts, specimens, ghosts, cam, p) {\n const dt = last < 0 ? 0 : Math.min(Math.max(now - last, 0), 50) / 1000;\n last = now;\n moving = false;\n for (const s of specimens) lastSeen.set(s.type, s);\n const specimen = (type: string): CarrySpecimen | undefined => lastSeen.get(type);\n const lifted = items.find((i) => i.phase === \"lift\") as Extract<Item, { phase: \"lift\" }> | undefined;\n const zoomOf = (type: string, l: number): number => (specimen(type)?.zoom ?? 1) * (1 + (CARRY.liftScale - 1) * l);\n // THE HAND-OFF: `handed` bumped — the copy up (or, a flick that lifted and left in one event, the take as it left) holds its pose\n if (facts !== undefined && handed >= 0 && facts.handed > handed && facts.take !== \"\") {\n const l = lifted?.l ?? 0;\n if (lifted !== undefined) items = items.filter((i) => i !== lifted);\n items.push({ id: lifted?.id ?? ++ids, phase: \"handing\", type: facts.take, u: facts.u, v: facts.v, x: facts.x, y: facts.y, zoom: zoomOf(facts.take, l), l, frames: 0 });\n } else if (facts !== undefined && facts.take !== \"\") {\n // THE LIFT: the copy follows the pointer; its lift rises\n const cur = lifted !== undefined && lifted.type === facts.take ? lifted : undefined;\n if (cur === undefined) {\n if (lifted !== undefined) items = items.filter((i) => i !== lifted);\n items.push({ id: ++ids, phase: \"lift\", type: facts.take, u: facts.u, v: facts.v, x: facts.x, y: facts.y, l: 0, lv: 0 });\n } else { cur.x = facts.x; cur.y = facts.y; cur.u = facts.u; cur.v = facts.v; }\n } else if (lifted !== undefined) {\n // PUT BACK: the take ended in the drawer (or the drawer shut under it) — it glides onto its specimen\n const s = specimen(lifted.type);\n items = items.filter((i) => i !== lifted);\n if (s !== undefined) items.push({ id: lifted.id, phase: \"back\", type: lifted.type, u: lifted.u, v: lifted.v, x: lifted.x, y: lifted.y, zoom: zoomOf(lifted.type, lifted.l), l: lifted.l, t0: now, to: homeOf(s, lifted.u, lifted.v) });\n }\n if (facts !== undefined) handed = facts.handed;\n const byEntity = new Map(ghosts.map((g) => [g.entity, g] as const));\n const claimed = new Set<number>();\n for (const i of items) if (i.phase === \"grow\" || i.phase === \"home\") claimed.add(i.ghost);\n const next: Item[] = [];\n poses = [];\n for (const i of items) {\n if (i.phase === \"lift\") {\n const [l, lv] = spring(i.l, i.lv, 1, CARRY.liftHz, 1, dt);\n if (settled(l, lv, 1, EPS)) { i.l = 1; i.lv = 0; } else { i.l = l; i.lv = lv; moving = true; }\n next.push(i);\n poses.push({ id: i.id, phase: \"lift\", type: i.type, u: i.u, v: i.v, px: i.x, py: i.y, zoom: zoomOf(i.type, i.l), lift: i.l });\n continue;\n }\n if (i.phase === \"back\") {\n const s = specimen(i.type);\n const to = s !== undefined ? homeOf(s, i.u, i.v) : i.to;\n const k = slideEase(clamp01((now - i.t0) / CARRY.backMs));\n if (k >= 1) continue; // home: the specimen under it is the same object at the same scale\n moving = true;\n next.push(i);\n poses.push({ id: i.id, phase: \"back\", type: i.type, u: i.u, v: i.v, px: i.x + (to.x - i.x) * k, py: i.y + (to.y - i.y) * k, zoom: i.zoom + (to.zoom - i.zoom) * k, lift: i.l * (1 - k) });\n continue;\n }\n if (i.phase === \"handing\") {\n // the ghost the hand-off spawned: a NEW insert ghost of the type (the op ran after the step that handed it)\n const g = ghosts.find((q) => q.type === i.type && !known.has(q.entity) && !claimed.has(q.entity));\n moving = true;\n if (g !== undefined) {\n claimed.add(g.entity);\n const k0 = i.zoom / cam.zoom;\n const grow: Item = { id: i.id, phase: \"grow\", type: i.type, u: i.u, v: i.v, ghost: g.entity, k0, t0: now, k: k0 };\n next.push(grow);\n presented.add(g.entity);\n poses.push(ghostPose(grow, g, cam, k0, 1));\n continue;\n }\n i.frames += 1;\n if (i.frames > CARRY.handFrames) {\n // refused (no ghost came): put back\n const s = specimen(i.type);\n if (s !== undefined) next.push({ id: i.id, phase: \"back\", type: i.type, u: i.u, v: i.v, x: i.x, y: i.y, zoom: i.zoom, l: i.l, t0: now, to: homeOf(s, i.u, i.v) });\n continue;\n }\n next.push(i);\n poses.push({ id: i.id, phase: \"handing\", type: i.type, u: i.u, v: i.v, px: i.x, py: i.y, zoom: i.zoom, lift: i.l });\n continue;\n }\n const g = byEntity.get(i.ghost);\n if (g === undefined) { presented.delete(i.ghost); continue; } // gone: promoted (its twin lands) or reaped home\n if (i.phase === \"grow\") {\n if (g.retiring) {\n const home: Item = { id: i.id, phase: \"home\", type: i.type, ghost: i.ghost, k0: i.k };\n next.push(home);\n poses.push(homePose(home, g, cam));\n moving = true;\n continue;\n }\n const t = clamp01((now - i.t0) / CARRY.growMs);\n i.k = i.k0 + (1 - i.k0) * slideEase(t);\n if (t >= 1 && p <= 0) { presented.delete(i.ghost); continue; } // its own size, the drawer gone: the desk's again\n moving = true;\n next.push(i);\n poses.push(ghostPose(i, g, cam, i.k, 1));\n continue;\n }\n moving = true;\n next.push(i);\n poses.push(homePose(i, g, cam));\n }\n // an insert ghost flying home that nothing here carries (an Esc, a rejected drop — any adoption's): it shrinks as it flies\n for (const g of ghosts) {\n if (!g.retiring || claimed.has(g.entity)) continue;\n const home: Item = { id: ++ids, phase: \"home\", type: g.type, ghost: g.entity, k0: 1 };\n next.push(home);\n presented.add(g.entity);\n poses.push(homePose(home, g, cam));\n moving = true;\n }\n items = next;\n for (const e of [...presented]) if (!items.some((i) => (i.phase === \"grow\" || i.phase === \"home\") && i.ghost === e)) presented.delete(e);\n known.clear();\n for (const g of ghosts) known.add(g.entity);\n return poses;\n },\n presented: () => presented,\n live: () => moving,\n types: () => [...new Set(items.map((i) => i.type))],\n state: () => ({ poses, handed, live: moving }),\n };\n}\n\n/** A ghost growing out of the copy: its grab point where it is on screen, at `k` × the camera's scale. */\nfunction ghostPose(i: Extract<Item, { phase: \"grow\" }>, g: CarryGhost, cam: CarryCamera, k: number, lift: number): CarryPose {\n const wx = g.x + i.u * g.w;\n const wy = g.y + i.v * g.h;\n return { id: i.id, phase: \"grow\", type: i.type, ghost: g.entity, u: i.u, v: i.v, px: (wx - cam.x) * cam.zoom, py: (wy - cam.y) * cam.zoom, zoom: k * cam.zoom, lift };\n}\n\n/** A ghost flying home: its centre where it is on screen, shrinking to nothing as its tween runs; its lift settling with it. */\nfunction homePose(i: Extract<Item, { phase: \"home\" }>, g: CarryGhost, cam: CarryCamera): CarryPose {\n const t = slideEase(clamp01(g.progress));\n const wx = g.x + g.w / 2;\n const wy = g.y + g.h / 2;\n return { id: i.id, phase: \"home\", type: i.type, ghost: g.entity, u: 0.5, v: 0.5, px: (wx - cam.x) * cam.zoom, py: (wy - cam.y) * cam.zoom, zoom: i.k0 * (1 - t) * cam.zoom, lift: 1 - t };\n}\n\n/**\n * A pose's VIEW: the camera under which the object's point `(u, v)` across `rect` (its own units — the world's for a ghost, its natural\n * size about the origin for a copy) lies at the pose's pivot on screen, at its scale.\n */\nexport function carryView(pose: CarryPose, rect: { readonly x: number; readonly y: number; readonly w: number; readonly h: number }): { readonly camX: number; readonly camY: number; readonly zoom: number } {\n const z = Math.max(pose.zoom, 1e-6);\n return { camX: rect.x + pose.u * rect.w - pose.px / z, camY: rect.y + pose.v * rect.h - pose.py / z, zoom: z };\n}\n","// THE SPECIMENS ON THE BOARD (design-017 §8; K5a) — each kind hung on the tray, drawn by its OWN kind's pass (K-L3's per-slot machinery:\n// no kind learns about the tray). A specimen is its object at its natural size (the widget's `defaultSize` — what its kind draws it at;\n// the photo, the notebook and the calendar size themselves by their laws, never by their rect) seen through the drawer at the scale its\n// hang asks: its slot's view block is the DRAWER'S CAMERA — the face's top-left, the shown scroll, the band in it — scaled about the\n// specimen (zoom = hang ÷ natural), so a scroll of Δ moves it Δ on screen exactly as it moves the board. Its lamp is the board's (the\n// research's HOME lamp, D-K3.4): its shadow falls on the board as the accessories' do. Its hover is the kinds' own `lift` and `hover`\n// (flux — the tray's springs). A PURE module for the frames; `TraySlots` holds the GPU half — one slot per specimen, each kind's pass\n// SPAWNED from the root's, a composite kind's (root only, D-D18) made from its program the first time the tray shows one.\n\nimport { specimenFit, type TrayAccessory } from \"@ice/kernel\";\nimport type { GridConfig } from \"../mat/grid\";\nimport type { Lamp } from \"../mat/lamp\";\nimport type { SlotKind, SlotSet } from \"../ground\";\nimport type { KindProgram } from \"../kind\";\nimport { LAYER_IDLE_MS } from \"../kit/layer\";\nimport type { ObjectContext, ObjectKind } from \"../kinds/world\";\nimport type { View } from \"../lattice/lod\";\nimport type { PortalClip, Presentation } from \"../nav/portal\";\nimport type { GroundTheme } from \"../theme\";\nimport { type CarryPose, carryView } from \"./carry\";\nimport { DRAWER, type DrawerRect } from \"./drawer\";\nimport { TRAY_LOOK } from \"./look\";\n\n/** A specimen as the renderer reads it — from the world (the reflector), or a still's scene (the oracle). */\nexport interface TraySpecimen {\n /** A stable key for the kind's persistent records (the world's entity; a still's index). */\n readonly key: number;\n readonly type: string;\n readonly kind: ObjectKind;\n /** The object's own size — the size its kind draws it at (the widget's `defaultSize`). */\n readonly natural: { readonly w: number; readonly h: number };\n /** Where it hangs, board px (x from the drawer's left edge, y down from the board's top at scroll 0): its `Position` and `Size`. */\n readonly rect: { readonly x: number; readonly y: number; readonly w: number; readonly h: number };\n readonly props: Readonly<Record<string, unknown>>;\n /** Its hang's accessory and pegs (pitches from its hang point) — the entry's. */\n readonly accessory: TrayAccessory;\n readonly pegs: readonly (readonly [number, number])[];\n readonly label: string;\n /** K5b (D-K5b.3): its kind's desk state, when its entry draws it with it (`tray.local`) — the face that lives there. */\n readonly local?: unknown;\n /** A per-specimen asset (a still's committed raster — the oracle's; the product's writing pins its own). */\n readonly asset?: unknown;\n}\n\n/** One specimen this frame: its kind's record under its own view block, where it is on screen, its accessory's pegs on screen, its tag. */\nexport interface TraySpecimenFrame {\n readonly type: string;\n /** The kind's registry name, and the record its `record` made for this frame. */\n readonly kind: string;\n readonly record: unknown;\n readonly key: number;\n /** Its slot's camera: the drawer's, scaled about it. */\n readonly view: View & { readonly dpr: number };\n readonly grid: GridConfig;\n /** Its rect on screen, CSS px. */\n readonly screen: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number };\n /** Its OBJECT as drawn on screen (the kernel's fit inside the hang), CSS px (K5b — what a take grabs, where one put back lands). */\n readonly object: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number };\n /** Its pegs' hole centres on screen, CSS px. */\n readonly pegs: readonly (readonly [number, number])[];\n readonly accessory: TrayAccessory;\n readonly label: string;\n}\n\n/** The drawer this frame, as its flux drew it: the rect and the SHOWN scroll (the band in it). */\nexport interface TrayDrawn {\n readonly rect: DrawerRect;\n readonly scroll: number;\n}\n\n/** What building the frames needs of the desk: the view, the theme, the root's grid, the kinds' looks, each specimen's hover lift (0 … 1). */\nexport interface TraySpecimenEnv {\n readonly view: { readonly width: number; readonly height: number; readonly dpr: number };\n readonly theme: GroundTheme;\n readonly grid: GridConfig;\n readonly looks: ReadonlyMap<string, unknown>;\n readonly lift: (type: string) => number;\n}\n\n/**\n * The FACE the specimens show through: the outline inside the board's edge (the arris — design-018 §2: nothing hangs over it), its foot\n * past the view's, its top the HEADER's foot (design-018 R4: `DRAWER.header` under the edge, where nothing of them shows — the bar's\n * chips lie there) — with NO feather (design-018 rev 5): a specimen is opaque to the clip's top, and the VEIL (tray.wgsl `tray_veil`)\n * lays the plain board over it there — whole in the header, fading out over `DRAWER.fade` — so it fades into the board and never\n * turns see-through over a hole (R1–R4's feather let the holes show through it). (Its top corners keep the arris's inner radius, under\n * the veil's whole.)\n */\nexport function faceClip(rect: DrawerRect, vh: number): PortalClip {\n const a = DRAWER.arris;\n const x0 = rect.x + a;\n const x1 = rect.x + rect.w - a;\n const y0 = rect.y + a + DRAWER.header;\n const y1 = Math.max(vh, rect.y + rect.h) + DRAWER.radius;\n return { cx: (x0 + x1) / 2, cy: (y0 + y1) / 2, hx: (x1 - x0) / 2, hy: (y1 - y0) / 2, r: DRAWER.radius - a };\n}\n\n/** The tray's grid: the root's with no gobo dapple (D-K3.6 — the drawer lies above the desk; the wind would wake it). */\nexport function trayGrid(grid: GridConfig): GridConfig {\n return { ...grid, mat: { ...grid.mat, gobo: { ...grid.mat.gobo, opacity: 0 } } };\n}\n\n/** How high over a specimen the board's lamp stands, in the specimen's own units per its size — far enough that its light is the lamp's direction. */\nconst LAMP_FAR = 40;\n\n/** The board's lamp over a point, in the specimen's own units: along the HOME lamp's direction, far off (its light parallel, as the board's is). */\nfunction lampOver(cx: number, cy: number, size: number): Lamp {\n const L = TRAY_LOOK.lamp;\n const h = LAMP_FAR * size;\n return { x: cx + (L[0] / L[2]) * h, y: cy + (L[1] / L[2]) * h, h };\n}\n\n/**\n * The specimens this frame: each culled where it cannot show (its rect and its reach outside the face), else resolved and recorded by\n * its OWN kind — its object at its natural size, centred on its world origin, under the drawer's camera scaled about it — with the\n * board's lamp, the tray's grid, the kind's look, its hover (the kinds' `lift`, a share of the hold's, and `hover`), no local and no\n * asset (a specimen writes nothing into a kind's state on the desk) — unless its entry draws it with its kind's desk state (K5b, D-K5b.3:\n * `tray.local` — a note's writing, a print's pictures), whose records the reflector lets go of as the specimen goes.\n */\nexport function specimenFrames(specimens: readonly TraySpecimen[], drawn: TrayDrawn, env: TraySpecimenEnv): TraySpecimenFrame[] {\n const out: TraySpecimenFrame[] = [];\n const P = DRAWER.pitch;\n const grid = trayGrid(env.grid);\n const { width, height, dpr } = env.view;\n const face = faceClip(drawn.rect, height);\n for (const s of specimens) {\n const x0 = drawn.rect.x + s.rect.x;\n const y0 = drawn.rect.y + s.rect.y - drawn.scroll;\n const reach = P * 2;\n if (y0 + s.rect.h + reach < face.cy - face.hy || y0 - reach > Math.min(height, face.cy + face.hy)) continue;\n // the kernel's fit (K5b — core's grab point reads the same law): the smaller ratio, centred in the hang\n const fit = specimenFit(s.rect, s.natural);\n const zoom = fit.zoom;\n const cx = x0 + s.rect.w / 2;\n const cy = y0 + s.rect.h / 2;\n const view = { camX: -cx / zoom, camY: -cy / zoom, zoom, width, height, dpr };\n const h = Math.min(Math.max(env.lift(s.type), 0), 1);\n const ctx: ObjectContext = {\n entity: s.key as ObjectContext[\"entity\"],\n rect: { cx: 0, cy: 0, w: s.natural.w, h: s.natural.h },\n props: s.props,\n flux: { lift: TRAY_LOOK.hoverLift * h, hover: h, ring: 0, fade: 1 },\n look: env.looks.get(s.kind.name),\n theme: env.theme,\n lamp: lampOver(0, 0, Math.max(s.natural.w, s.natural.h)),\n view,\n grid,\n dt: 0,\n ...(s.local !== undefined ? { local: s.local } : {}),\n ...(s.asset !== undefined ? { asset: s.asset } : {}),\n };\n const record = s.kind.record(s.kind.resolve(ctx), ctx);\n // the hang point: the top edge's centre, or a shelf's bottom edge's; the pegs from it\n const hx = x0 + s.rect.w / 2;\n const hy = s.accessory === \"shelf\" ? y0 + s.rect.h : y0;\n out.push({\n type: s.type, kind: s.kind.name, record, key: s.key, view, grid,\n screen: { x0, y0, x1: x0 + s.rect.w, y1: y0 + s.rect.h },\n object: { x0: drawn.rect.x + fit.x, y0: drawn.rect.y + fit.y - drawn.scroll, x1: drawn.rect.x + fit.x + fit.w, y1: drawn.rect.y + fit.y + fit.h - drawn.scroll },\n pegs: s.pegs.map(([dx, dy]) => [hx + dx * P, hy + dy * P] as const),\n accessory: s.accessory, label: s.label,\n });\n }\n return out;\n}\n\n/** The accessories' numbers (theme.ts `TRAY.accessory`): the kind index the shader reads, each's standing-off in pitches. */\nexport const ACCESSORY_INDEX: Readonly<Record<TrayAccessory, number>> = { hook: 0, shelf: 1, clip: 2, rail: 3 };\n\n/**\n * One specimen's accessory record (tray.wgsl `TrayAccessory`), screen CSS px: its quad the ACCESSORY's own parts — the plugs and what they\n * hold, a shelf's plank, a rail's bar, never the specimen's body between — grown by the shadow's push and blur (down and right, away\n * from the lamp) and a pixel.\n */\nexport function accessoryOf(f: TraySpecimenFrame): { readonly box: number[]; readonly kind: number[]; readonly rect: number[]; readonly pegs0: number[]; readonly pegs1: number[] } {\n const P = DRAWER.pitch;\n const lift = TRAY_LOOK.accessoryHeight[f.accessory] * P;\n const L = TRAY_LOOK.lamp;\n const blur = (TRAY_LOOK.lampSize * lift) / L[2] + 2;\n const pushX = Math.max(0, (-L[0] / L[2]) * lift);\n const pushY = Math.max(0, (-L[1] / L[2]) * lift);\n const r = f.screen;\n let x0 = Number.POSITIVE_INFINITY;\n let y0 = Number.POSITIVE_INFINITY;\n let x1 = Number.NEGATIVE_INFINITY;\n let y1 = Number.NEGATIVE_INFINITY;\n const add = (a: number, b: number, c: number, d: number): void => { x0 = Math.min(x0, a); y0 = Math.min(y0, b); x1 = Math.max(x1, c); y1 = Math.max(y1, d); };\n for (const [x, y] of f.pegs) {\n add(x - 0.35 * P, y - 0.4 * P, x + 0.35 * P, y + 0.4 * P);\n if (f.accessory === \"hook\") add(x - 0.15 * P, y, x + 0.15 * P, y + 0.7 * P);\n if (f.accessory === \"clip\") add(x - 0.3 * P, y - 0.3 * P, x + 0.3 * P, Math.max(y, r.y0) + 0.6 * P);\n if (f.accessory === \"shelf\") add(x - 0.15 * P, Math.min(y, r.y1), x + 0.15 * P, Math.max(y, r.y1) + 0.1 * P);\n }\n if (f.accessory === \"shelf\") add(r.x0 - 0.35 * P, r.y1 - 0.05 * P, r.x1 + 0.35 * P, r.y1 + 0.3 * P);\n if (f.accessory === \"rail\" && f.pegs.length > 0) {\n const xs = f.pegs.map((q) => q[0]);\n const y = (f.pegs[0] as readonly [number, number])[1];\n add(Math.min(...xs) - 0.45 * P, y - 0.2 * P, Math.max(...xs) + 0.45 * P, y + 0.2 * P);\n }\n const peg = (i: number): readonly [number, number] => f.pegs[i] ?? [0, 0];\n return {\n box: [x0 - blur, y0 - blur, x1 + pushX + blur, y1 + pushY + blur],\n kind: [ACCESSORY_INDEX[f.accessory], Math.min(f.pegs.length, 4), lift, 0],\n rect: [r.x0, r.y0, r.x1, r.y1],\n pegs0: [...peg(0), ...peg(1)],\n pegs1: [...peg(2), ...peg(3)],\n };\n}\n\n/** A carried object this frame (K5b — tray/carry.ts): its kind's record under its pose's view, the slot it is drawn in, where it is on screen. */\nexport interface TrayCarriedFrame {\n /** Its slot's key in `TraySlots` — one per type, apart from the specimens' (a copy and its specimen draw in the same frame). */\n readonly slot: string;\n readonly type: string;\n readonly kind: string;\n readonly record: unknown;\n readonly key: number;\n readonly view: View & { readonly dpr: number };\n readonly grid: GridConfig;\n readonly phase: CarryPose[\"phase\"];\n /** The insert ghost it presents (absent: the lifted copy). */\n readonly ghost?: number;\n /** Its object's rect on screen, CSS px. */\n readonly screen: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number };\n}\n\n/** What a carried pose is drawn from: its kind, its rect in its own units (the world's for a ghost — top-left; its natural size about the origin for a copy), its props, its key, the desk's lamp in those units, the kind's desk state. */\nexport interface TrayCarriedSource {\n readonly kind: ObjectKind;\n readonly rect: { readonly x: number; readonly y: number; readonly w: number; readonly h: number };\n readonly props: Readonly<Record<string, unknown>>;\n readonly key: number;\n readonly lamp: Lamp;\n readonly local?: unknown;\n}\n\n/** The slot a carried type draws in. */\nexport const carrySlot = (type: string): string => `carry:${type}`;\n\n/**\n * A carried pose as its kind records it: its view (`carryView` — the object's grab point at the pose's pivot, at its scale), the tray's\n * grid (no dapple: it lies above the desk, D-K3.6), the pose's lift, the desk's lamp where the object is — so the copy lifted off the\n * board and the ghost it becomes are lit alike, and coincide at the hand-off.\n */\nexport function carriedFrame(pose: CarryPose, src: TrayCarriedSource, env: Omit<TraySpecimenEnv, \"lift\">): TrayCarriedFrame {\n const v = carryView(pose, src.rect);\n const view = { camX: v.camX, camY: v.camY, zoom: v.zoom, width: env.view.width, height: env.view.height, dpr: env.view.dpr };\n const grid = trayGrid(env.grid);\n const r = src.rect;\n const ctx: ObjectContext = {\n entity: src.key as ObjectContext[\"entity\"],\n rect: { cx: r.x + r.w / 2, cy: r.y + r.h / 2, w: r.w, h: r.h },\n props: src.props,\n flux: { lift: pose.lift, hover: 0, ring: 0, fade: 1 },\n look: env.looks.get(src.kind.name),\n theme: env.theme,\n lamp: src.lamp,\n view,\n grid,\n dt: 0,\n ...(src.local !== undefined ? { local: src.local } : {}),\n };\n const record = src.kind.record(src.kind.resolve(ctx), ctx);\n const x0 = (r.x - v.camX) * v.zoom;\n const y0 = (r.y - v.camY) * v.zoom;\n return {\n slot: carrySlot(pose.type), type: pose.type, kind: src.kind.name, record, key: src.key, view, grid, phase: pose.phase,\n ...(pose.ghost !== undefined ? { ghost: pose.ghost } : {}),\n screen: { x0, y0, x1: x0 + r.w * v.zoom, y1: y0 + r.h * v.zoom },\n };\n}\n\n/** The presentation every specimen's slot is drawn through: whole, clipped to the face. */\nexport function facePresent(drawn: TrayDrawn, vh: number): Presentation {\n return { opacity: 1, portal: faceClip(drawn.rect, vh) };\n}\n\n/**\n * THE TRAY'S SLOTS (the GPU half): one per specimen type, each its own view block (the mat spawned from the root's — K-L3) and its kind's\n * pass: SPAWNED from the root's (its buffers on the shared pipelines), or — a composite kind, root only by D-D18 (its spawned pass draws\n * nothing) — made from the kind's program on the slot's mat, once, the first time the tray shows one (`warm`; async, so the specimen\n * shows from the frame after it is made — `onReady` asks for that frame). Freed with the ground.\n */\nexport class TraySlots {\n private readonly device: GPUDevice;\n private readonly format: GPUTextureFormat;\n private readonly root: SlotSet;\n private readonly programs: ReadonlyMap<string, KindProgram>;\n private readonly slots = new Map<string, SlotSet>();\n private readonly making = new Set<string>();\n private disposed = false;\n\n constructor(device: GPUDevice, format: GPUTextureFormat, root: SlotSet, programs: readonly KindProgram[]) {\n this.device = device;\n this.format = format;\n this.root = root;\n this.programs = new Map(programs.map((p) => [p.name, p] as const));\n }\n\n /** The slot of a specimen `type` of kind `kind`: spawned at once for a kind that spawns; undefined while a composite kind's pass is made. */\n get(type: string, kind: string): SlotSet | undefined {\n const had = this.slots.get(type);\n if (had !== undefined) return had;\n const own = this.root.kinds.get(kind);\n if (own === undefined || own.composite === true) return undefined;\n const mat = this.root.mat.spawn();\n const slot: SlotSet = { mat, kinds: new Map<string, SlotKind>([[kind, { ...own, pass: own.pass.spawn(mat) }]]) };\n this.slots.set(type, slot);\n return slot;\n }\n\n /** Make the passes of the composite kinds among `wanted` ([type, kind]) not made yet; `onReady` when each is (a frame is due). */\n warm(wanted: readonly (readonly [string, string])[], onReady: () => void): void {\n for (const [type, kind] of wanted) {\n if (this.slots.has(type) || this.making.has(type)) continue;\n const own = this.root.kinds.get(kind);\n const program = this.programs.get(kind);\n if (own?.composite !== true || program === undefined) continue;\n this.making.add(type);\n const mat = this.root.mat.spawn();\n void program.create(this.device, this.format, mat).then((pass) => {\n this.making.delete(type);\n if (this.disposed) { pass.dispose(); mat.dispose(); return; }\n this.slots.set(type, { mat, kinds: new Map<string, SlotKind>([[kind, { ...own, pass }]]) });\n onReady();\n }, (err: unknown) => { this.making.delete(type); mat.dispose(); console.error(`desk: the tray's ${kind} pass could not be made`, err); });\n }\n }\n\n /** Every composite kind's pass among `wanted`, made now — a still's host (the oracle) waits for them. */\n async ready(wanted: readonly (readonly [string, string])[]): Promise<void> {\n let pending = 0;\n await new Promise<void>((resolve) => {\n this.warm(wanted, () => { pending -= 1; if (pending <= 0) resolve(); });\n pending = this.making.size;\n if (pending === 0) resolve();\n });\n for (const [type, kind] of wanted) this.get(type, kind);\n }\n\n /**\n * Each slot's passes let go of what they make again at their next draw when none of their objects was drawn within `ms` (D-K6a.3\n * — the notebook's and the calendar's layers, a few seconds after the drawer shuts); asked every tick, drawing or not.\n */\n idle(ms: number = LAYER_IDLE_MS): void {\n for (const s of this.slots.values()) for (const k of s.kinds.values()) k.pass.idle?.(ms);\n }\n\n /** When `idle` next lets a layer go — the soonest slot's (K7a: the host's registered time wake); ∞ — nothing to let go. */\n idleAt(ms: number = LAYER_IDLE_MS): number {\n let t = Number.POSITIVE_INFINITY;\n for (const s of this.slots.values()) for (const k of s.kinds.values()) t = Math.min(t, k.pass.idleAt?.(ms) ?? Number.POSITIVE_INFINITY);\n return t;\n }\n\n /** The slots made so far (a rig's witness). */\n get size(): number { return this.slots.size; }\n\n dispose(): void {\n this.disposed = true;\n for (const s of this.slots.values()) { s.mat.dispose(); for (const k of s.kinds.values()) k.pass.dispose(); }\n this.slots.clear();\n }\n}\n","// THE TRAY PASS — the pegboard drawer on the GPU (design-017 §5–§6; K3): one pipeline, one draw of one quad in the ROOT's render pass\n// after the marks — the view whole while the desk is dimmed (the dim, the drawer's shadows, the board: each pixel drawn once); shut\n// (p 0) it lies wholly below the view with its shadows and NOTHING is laid, uploaded or drawn (design-018 §5) — where tray.wgsl shades the\n// research board in closed form to its edge (the arris, design-018 §2). Its light is the DESK's: a block of the mat's own struct carrying the theme's light, the\n// root grid's shadow grade and the frame's blue-noise offset (so `shade_mat` / `night_mat` are the mat's functions, not copies),\n// and the research's HOME lamp (D-K3.4). That block is the tray's OWN, never a slot's view block: K-L3 binds a slot's kinds, and the\n// drawer is screen-space chrome drawn in no slot — the desk's camera, box, clocks, portal chain and presence are nothing to it, only\n// the light's words are — so its program asks the kit for the struct and the mat's light by name (shaders.ts) and binds its own.\n// It samples the root mat's blue noise (rebinding when the mat's assets change) and\n// its own HASH texture — every value-noise octave's four lattice corners pre-gathered in one texel (`hashTexels`), made once.\n// Both blocks are uploaded only when they change. Labelled `tray/pegboard` (the pipeline, the bind group, a debug group).\n\nimport { bindGroup, bindLayout, renderPipeline, storageBuffer, uniformBuffer } from \"../engine/pipeline\";\nimport type { StructBuffer } from \"../engine/struct\";\nimport { compile, compose } from \"../engine/shader\";\nimport type { View } from \"../lattice/lod\";\nimport type { GridConfig } from \"../mat/grid\";\nimport { type MatFrame, MatUniforms, NOISE_SIZE } from \"../mat/layout\";\nimport type { MatPass } from \"../kit/view\";\nimport { lightValues } from \"../mat/night\";\nimport type { GroundTheme } from \"../theme\";\nimport { DRAWER, type DrawerRect, drawerRect } from \"./drawer\";\nimport { carry, PEG } from \"./lattice\";\nimport { TrayAccessoryStruct, TrayUniforms } from \"./layout\";\nimport { TRAY_LOOK } from \"./look\";\nimport type { TrayShaders } from \"./shaders\";\nimport { accessoryOf, type TrayCarriedFrame, type TraySpecimenFrame } from \"./specimens\";\n\n/** The tray this frame (the renderer's flux — design-017 §3): where the slide is, and the SHOWN scroll. */\nexport interface TrayFrameInputs {\n /** The slide as drawn: 0 closed (wholly off the view — nothing drawn) … 1 open. */\n readonly p: number;\n /** The SHOWN scroll — CSS px of board past its top, the band included; any size (its whole rows are carried on the CPU). */\n readonly scroll: number;\n /** K5a: the specimens this frame (tray/specimens.ts) — their accessories are the pass's, their pixels their kinds'; absent = none. */\n readonly specimens?: readonly TraySpecimenFrame[];\n /** K5b: what is CARRIED this frame (tray/carry.ts) — the lifted copy, a ghost growing out of it or shrinking home — over the drawer, whole. */\n readonly carried?: readonly TrayCarriedFrame[];\n}\n\ntype TrayField = (typeof TrayUniforms.fields)[number][0];\ntype AccessoryField = (typeof TrayAccessoryStruct.fields)[number][0];\ntype MatField = (typeof MatUniforms.fields)[number][0];\n\nconst BLEND_PREMUL: GPUBlendState = {\n color: { srcFactor: \"one\", dstFactor: \"one-minus-src-alpha\", operation: \"add\" },\n alpha: { srcFactor: \"one\", dstFactor: \"one-minus-src-alpha\", operation: \"add\" },\n};\n\n/** What the last prepare laid (a rig's and a check's witness): the rect, the carry, the dim, the accessories' records (screen px). */\nexport interface TrayLaid {\n readonly rect: DrawerRect;\n readonly rowBase: number;\n readonly frac: number;\n readonly dim: number;\n readonly accessories: readonly ReturnType<typeof accessoryOf>[];\n}\n\n/** The research's pcg (shader.js `pcg`), in 32-bit integer arithmetic. */\nfunction pcg(v: number): number {\n const s = (Math.imul(v >>> 0, 747796405) + 2891336453) >>> 0;\n const w = Math.imul(((s >>> ((s >>> 28) + 4)) ^ s) >>> 0, 277803737) >>> 0;\n return ((w >>> 22) ^ w) >>> 0;\n}\n\n/** The hash texture's side: the noise tiles every 256 lattice cells (for a band of F per pitch, every 256/F pitches). */\nexport const HASH_SIZE = 256;\n\n/**\n * The PRE-GATHERED noise (design-017 §6.7), 256² rgba8 — each texel the four corners one value-noise lookup interpolates, so a band is\n * ONE load: texel (i, j) holds the research's hash of lattice points (i, j), (i+1, j), (i, j+1), (i+1, j+1) (`pcg(i ^ pcg(j))`, its\n * top 8 bits), wrapping at the side; each band reads it at its own offset. It tiles every 256 cells of a band's lattice.\n */\nexport function hashTexels(): Uint8Array<ArrayBuffer> {\n const N = HASH_SIZE;\n const h = new Uint8Array(N * N);\n for (let j = 0; j < N; j++) { const r = pcg(j); for (let i = 0; i < N; i++) h[j * N + i] = pcg((i ^ r) >>> 0) >>> 24; }\n const out = new Uint8Array(N * N * 4);\n for (let j = 0; j < N; j++) {\n for (let i = 0; i < N; i++) {\n const i1 = (i + 1) % N;\n const j1 = (j + 1) % N;\n const o = (j * N + i) * 4;\n out[o] = h[j * N + i] as number;\n out[o + 1] = h[j * N + i1] as number;\n out[o + 2] = h[j1 * N + i] as number;\n out[o + 3] = h[j1 * N + i1] as number;\n }\n }\n return out;\n}\n\n/** A band of F cycles per pitch at a footprint of `fp` pitches per device px: kept while a cycle spans ≥ 4 px, gone at 2 (tray.wgsl's fade). */\nexport function keep(fp: number, F: number): number {\n const x = Math.min(Math.max((fp * F - 0.25) / 0.25, 0), 1);\n return 1 - x * x * (3 - 2 * x);\n}\n\nexport class TrayPass {\n private readonly device: GPUDevice;\n private readonly mat: MatPass;\n private readonly pipeline: GPURenderPipeline;\n /** K5a: the accessories' own fragment entry on the same layout (a branch in one entry slowed the board). */\n private readonly accPipeline: GPURenderPipeline;\n /** The VEIL (design-018 rev 5): the plain board laid over everything the drawer holds at its top — its own entries on the same layout. */\n private readonly veilPipeline: GPURenderPipeline;\n private readonly layout: GPUBindGroupLayout;\n private readonly sampler: GPUSampler;\n private readonly trayBuf: GPUBuffer;\n private readonly lightBuf: GPUBuffer;\n private readonly hash: GPUTexture;\n private readonly tray = TrayUniforms.alloc(1);\n private readonly light = MatUniforms.alloc(1);\n private readonly sentTray = new Uint8Array(TrayUniforms.size);\n private readonly sentLight = new Uint8Array(MatUniforms.size);\n private sent = false;\n /** The quads the last prepare laid: 0 while the drawer is shut (p 0) — then it draws nothing. */\n private quads = 0;\n private group: GPUBindGroup | null = null;\n private boundAssets = -1;\n private last: TrayLaid | null = null;\n // the accessories (K5a): one record per specimen, grown by doubling; uploaded only when their bytes moved\n private acc: StructBuffer<AccessoryField> = TrayAccessoryStruct.alloc(8) as StructBuffer<AccessoryField>;\n private accBuf: GPUBuffer;\n private accSent = new Uint8Array(0);\n private accCount = 0;\n\n private constructor(device: GPUDevice, mat: MatPass, pipelines: readonly [GPURenderPipeline, GPURenderPipeline, GPURenderPipeline], layout: GPUBindGroupLayout) {\n this.device = device;\n this.mat = mat;\n [this.pipeline, this.accPipeline, this.veilPipeline] = pipelines;\n this.layout = layout;\n this.sampler = device.createSampler({ label: \"tray/pegboard/noise\", magFilter: \"linear\", minFilter: \"linear\", addressModeU: \"repeat\", addressModeV: \"repeat\" });\n this.trayBuf = uniformBuffer(device, TrayUniforms.size, \"tray/pegboard/uniforms\");\n this.lightBuf = uniformBuffer(device, MatUniforms.size, \"tray/pegboard/light\");\n this.accBuf = storageBuffer(device, TrayAccessoryStruct.size * 8, \"tray/pegboard/accessories\");\n this.hash = device.createTexture({ label: \"tray/pegboard/hash\", size: [HASH_SIZE, HASH_SIZE], format: \"rgba8unorm\", usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST });\n device.queue.writeTexture({ texture: this.hash }, hashTexels(), { bytesPerRow: HASH_SIZE * 4 }, [HASH_SIZE, HASH_SIZE]);\n }\n\n /** The pipeline on `format`, sampling `mat`'s blue noise (the root's: its assets are every slot's). */\n static async create(device: GPUDevice, format: GPUTextureFormat, src: TrayShaders, mat: MatPass): Promise<TrayPass> {\n const module = await compile(device, compose(src));\n const layout = bindLayout(device, [\n { binding: 0, stages: [\"fragment\"], buffer: \"uniform\" },\n { binding: 1, stages: [\"vertex\", \"fragment\"], buffer: \"uniform\" },\n { binding: 2, stages: [\"fragment\"], texture: \"float\" },\n { binding: 3, stages: [\"fragment\"], sampler: \"filtering\" },\n { binding: 4, stages: [\"fragment\"], texture: \"float\" },\n { binding: 5, stages: [\"vertex\", \"fragment\"], buffer: \"read-only-storage\" },\n ], \"tray/pegboard\");\n const pl = device.createPipelineLayout({ label: \"tray/pegboard\", bindGroupLayouts: [layout] });\n const pipelines = await Promise.all([\n renderPipeline(device, { label: \"tray/pegboard\", layout: pl, module, format, blend: BLEND_PREMUL }),\n renderPipeline(device, { label: \"tray/pegboard/accessories\", layout: pl, module, format, blend: BLEND_PREMUL, fragment: \"fs_accessory\" }),\n renderPipeline(device, { label: \"tray/pegboard/veil\", layout: pl, module, format, blend: BLEND_PREMUL, vertex: \"vs_veil\", fragment: \"fs_veil\" }),\n ]);\n return new TrayPass(device, mat, pipelines as [GPURenderPipeline, GPURenderPipeline, GPURenderPipeline], layout);\n }\n\n /**\n * Lay the drawer out for this frame and upload what changed (before the frame's pass begins): the view, the theme's light, the\n * root grid's grade, the frame's noise offset. Returns the quads that will draw: one (the view whole while it dims) — none while\n * the drawer is shut (p 0: it and its shadows lie below the view — nothing is uploaded, nothing drawn; design-018 §5).\n */\n prepare(view: View & { readonly dpr: number }, theme: GroundTheme, grid: GridConfig, frame: MatFrame | undefined, inputs: TrayFrameInputs): number {\n const P = DRAWER.pitch;\n const p = Math.min(Math.max(inputs.p, 0), 1);\n const rect = drawerRect(view.width, view.height, p);\n const { rowBase, frac } = carry(inputs.scroll, P);\n if (p <= 0) {\n this.last = { rect, rowBase, frac, dim: 0, accessories: [] };\n this.quads = 0;\n return 0;\n }\n const L = TRAY_LOOK.lamp;\n const g = Math.hypot(L[0], L[1]) || 1;\n const S = DRAWER.shadow.lamp;\n const Rm = DRAWER.shadow.room;\n const fp = 1 / (P * view.dpr);\n const dim = (DRAWER.dim.day + (DRAWER.dim.night - DRAWER.dim.day) * Math.min(Math.max(theme.matLight.night, 0), 1)) * p;\n const T = TRAY_LOOK;\n const values: Partial<Record<TrayField, number | readonly number[]>> = {\n view: [view.width, view.height, view.dpr, P],\n rect: [rect.x, rect.y, rect.w, rect.h],\n rowBase, frac, fp, dim,\n shape: [DRAWER.radius, DRAWER.arris, DRAWER.inner.alpha, DRAWER.inner.width],\n hole: [PEG.holeR, PEG.holeHalf, PEG.rimK, PEG.border],\n depth: [PEG.thick, PEG.gap, PEG.colPhase, PEG.rowPhase],\n lamp: [L[0], L[1], L[2], T.lampSize],\n room: [Rm.sigma, Rm.alpha, 0, 0],\n shadow: [S.sigma, S.alpha, (-L[0] / g) * S.push, (-L[1] / g) * S.push],\n face: [...T.face, 0], faceSrgb: [...T.faceSrgb, 0], edge: [...T.edge, 0],\n cavity: [T.cavity.edge, T.cavity.heart, T.cavity.width, 0],\n keepFace: [keep(fp, 6 * Math.sqrt(10)), 0, keep(fp, 85), keep(fp, 190)],\n // the flecks fade by their cell; their strokes are anti-aliased in the shader (tray.wgsl `peg_flecks`)\n keepFine: [keep(fp, 210), keep(fp, 42), keep(fp, 105), 0],\n keepEdge: [keep(fp, 9), keep(fp, 18), keep(fp, 36), 0],\n accessory: [...T.accessory, T.accessoryShadow],\n fade: [DRAWER.fade, DRAWER.header, 0, 0],\n };\n this.tray.set(values);\n const gobo = grid.mat.gobo;\n const noise = frame?.noise ?? [0, 0];\n const light: Partial<Record<MatField, number | readonly number[]>> = {\n gobo: [gobo.opacity, gobo.blurTexels, gobo.shadeMix, gobo.darkFloor],\n grade: [gobo.saturate, 0, 0, 0],\n noise: [noise[0], noise[1], 1 / NOISE_SIZE, 0],\n ...lightValues(theme.matLight),\n };\n this.light.set(light);\n this.upload(this.trayBuf, this.tray.view(), this.sentTray);\n this.upload(this.lightBuf, this.light.view(), this.sentLight);\n this.sent = true;\n const accessories = (inputs.specimens ?? []).map(accessoryOf);\n this.layAccessories(accessories);\n this.last = { rect, rowBase, frac, dim, accessories };\n this.quads = 1;\n return 1;\n }\n\n /** The accessories' records to the GPU — grown by doubling, written only when their bytes moved (a drawer at rest costs no write). */\n private layAccessories(list: readonly ReturnType<typeof accessoryOf>[]): void {\n if (list.length > this.acc.count) {\n let n = this.acc.count;\n while (n < list.length) n *= 2;\n this.acc = TrayAccessoryStruct.alloc(n) as StructBuffer<AccessoryField>;\n this.accBuf.destroy();\n this.accBuf = storageBuffer(this.device, TrayAccessoryStruct.size * n, \"tray/pegboard/accessories\");\n this.accSent = new Uint8Array(0);\n this.group = null;\n }\n for (let i = 0; i < list.length; i++) this.acc.set(list[i] as ReturnType<typeof accessoryOf>, i);\n this.accCount = list.length;\n if (list.length === 0) return;\n const bytes = this.acc.view(list.length);\n let same = bytes.length === this.accSent.length;\n for (let i = 0; same && i < bytes.length; i++) if (bytes[i] !== this.accSent[i]) same = false;\n if (same) return;\n this.accSent = bytes.slice();\n this.device.queue.writeBuffer(this.accBuf, 0, bytes);\n }\n\n /** A block to the GPU only when its bytes moved since the last upload (a drawer at rest costs no write). */\n private upload(buf: GPUBuffer, bytes: Uint8Array<ArrayBuffer>, sent: Uint8Array): void {\n let same = this.sent;\n for (let i = 0; same && i < bytes.length; i++) if (bytes[i] !== sent[i]) same = false;\n if (same) return;\n sent.set(bytes);\n this.device.queue.writeBuffer(buf, 0, bytes);\n }\n\n /** A pipeline and the group, bound (the group remade when the mat's assets or the accessories' buffer changed). */\n private bind(pass: GPURenderPassEncoder, pipeline: GPURenderPipeline): void {\n if (this.group === null || this.boundAssets !== this.mat.assetVersion) {\n this.group = bindGroup(this.device, this.layout, [this.lightBuf, this.trayBuf, this.mat.noiseTexture.createView(), this.sampler, this.hash.createView(), this.accBuf], \"tray/pegboard\");\n this.boundAssets = this.mat.assetVersion;\n }\n pass.setPipeline(pipeline);\n pass.setBindGroup(0, this.group);\n }\n\n /**\n * The drawer UNDER its specimens into the open pass — over everything drawn so far (the caller left the scissor on the whole view):\n * the dim, the drawer's shadows, the board to its edge; then each specimen's accessory with its shadow on the board (K5a).\n */\n draw(pass: GPURenderPassEncoder): void {\n if (this.quads === 0) return;\n pass.pushDebugGroup(\"tray/pegboard\");\n this.bind(pass, this.pipeline);\n pass.draw(6, 1, 0, 0);\n if (this.accCount > 0) { pass.setPipeline(this.accPipeline); pass.draw(6, this.accCount, 0, 1); }\n pass.popDebugGroup();\n }\n\n /**\n * THE VEIL (design-018 rev 5) — LAST, over everything the drawer holds (the caller left the scissor on the whole view): the plain board\n * whole in the header and fading out over its ramp, so what hangs there and the holes behind it fade into the board together — a\n * specimen never turns see-through over a hole. One quad.\n */\n drawVeil(pass: GPURenderPassEncoder): void {\n if (this.quads === 0) return;\n pass.pushDebugGroup(\"tray/pegboard/veil\");\n this.bind(pass, this.veilPipeline);\n pass.draw(6, 1, 0, 0);\n pass.popDebugGroup();\n }\n\n /** What the last prepare laid (a rig's witness). */\n get laid(): TrayLaid | null { return this.last; }\n\n dispose(): void { this.trayBuf.destroy(); this.lightBuf.destroy(); this.accBuf.destroy(); this.hash.destroy(); }\n}\n","// The ground: one device, one swap chain, the mat and the registered KINDS, one render per call.\n//\n// There is no frame LOOP here on purpose. A host decides when a frame is due —\n// the lab's rAF + dirty flags, ICE's reflector, the oracle's single call — and\n// asks for exactly one. That is the shape ICE's layer already has (`always:\n// true` with a private dirty union; an idle scene renders zero frames), so\n// this drops in under it without owning a clock.\n//\n// One command buffer per frame: [the mat's wind] → the desk in ONE render pass.\n// The grid is the cutting mat (the dot and the needle, the card frame and its\n// portal fill retired on 2026-09-25 — MINIMAT.md §1); on it, in paint order: the\n// layers a host laid on the mat (the calendar), then the desk's OBJECTS stratum by\n// stratum — pads, sheets (the mini mats), things (the whiteboards, the notes, every\n// other kind) — and within a stratum in the desk's own paint order, one draw per\n// RUN of one kind (design-015 §4.2). The ground names no kind (design-015 §5.2):\n// each registers a PROGRAM (kind.ts) — its name, its stratum, its pass made on the\n// root's mat — and the ground hands each slot's pass of that kind the kind's\n// records and draws them in ranges. A new kind is added without touching this file.\n//\n// A frame is a TREE of slots (PORTAL.md §2.2). The root slot is the desk the\n// camera is on; a mini mat whose face passes the gate carries a NESTED slot —\n// its inside, under `outgoingCamera(M, cam)`, clipped to its face and drawn\n// right after the mini mat, over its face (MINIMAT.md §3). During a nav flight\n// the arriving and the departed desks are the same tree: on enter the child is\n// the arriving desk through the departed one's mini mat, on exit the departed\n// desk through the arriving one's — and since the child's camera at the cut IS\n// the live portal's, nothing inside the face changes when the flight starts\n// (§2.4). A frozen (depth-capped) flight has no portal and is two whole slots,\n// the departed under on enter and over on exit (design-006's z-rule), fading.\n//\n// A nested slot is visible only where its face lies inside every face above\n// it — the CHAIN (`Presentation.within`, PORTAL.md §10): the ground builds it\n// from the tree, scissors to its bounding box and hands it to every pass. The\n// mini mat's own body lies opaque under its face, so an inside fading in lands\n// on it and nothing under the mini mat ever shows through its edge.\n//\n// And a nested slot is LIT by its host (MINIMAT.md §4): the ground hands each\n// child its parent's light, so a mini mat's inside takes the dapple of the desk\n// the mini mat lies on; the root is lit by its own lamp unless the host says.\n//\n// Slots beyond the root come from a POOL spawned on first use — no compile,\n// no clock — and cost nothing while no portal is on screen and no flight is on.\n\nimport type { Surface } from \"./engine/device\";\nimport { CardPass, createCardShared } from \"./card/card\";\nimport { beginPass } from \"./engine/target\";\nimport { HoldPass } from \"./hold/focus\";\nimport type { HoldShaders } from \"./hold/shaders\";\nimport { type KindPass, type KindProgram, type RenderTarget, type SlotContext, STRATA, type StratumName } from \"./kind\";\nimport { boxOf, type View } from \"./lattice/lod\";\nimport type { MatLight } from \"./mat/night\";\nimport { DEFAULT_GRID, dressGrid, type GridConfig, type GridStats, gridStats, type SlotFrame } from \"./mat/grid\";\nimport { type SlotLight, STILL_MAT_FRAME } from \"./mat/layout\";\nimport { CuttingMat } from \"./mat/mat-pass\";\nimport type { MatShaders } from \"./mat/shaders\";\nimport type { MarksInput } from \"./marks/layout\";\nimport { MarksPass } from \"./marks/pass\";\nimport type { MarksShaders } from \"./marks/shaders\";\nimport { type TrayFrameInputs, TrayPass } from \"./tray/pass\";\nimport type { TrayShaders } from \"./tray/shaders\";\nimport { facePresent, type TrayCarriedFrame, TraySlots } from \"./tray/specimens\";\nimport { DRAWER, drawerRect } from \"./tray/drawer\";\nimport { boxOfPortal, chainOf, intersectBox, PORTAL_CHAIN, scissorOf, type Presentation } from \"./nav/portal\";\nimport type { GroundTheme } from \"./theme\";\n\nexport type { CardBinding, CardMaterial, KindExtra, KindPass, KindProgram, RenderTarget, SlotContext, StratumName } from \"./kind\";\nexport { STRATA } from \"./kind\";\nexport type { MarkBar, MarkBox, MarkFrame, MarkGuide, MarkMarquee, MarkObject, MarkRuler, MarksInput, MarkTape, MarkUnion } from \"./marks/layout\";\nexport { MARKS_SHADER_FILES, marksShaders } from \"./marks/shaders\";\nexport type { TrayFrameInputs } from \"./tray/pass\";\nexport { TRAY_SHADER_FILES, trayShaders } from \"./tray/shaders\";\n\nexport interface GroundOptions {\n /**\n * The device the HOST owns — the engine's (`acquireCompositorDevice()`, handed to the layer through its\n * context) or the layer's own (`engine/device.ts` `acquire()`, as the oracle's is). The ground never\n * makes one: every texture the compose pass samples must live on the same device.\n */\n readonly device: GPUDevice;\n /**\n * The swap chain the frames go into — the HOST makes it (`surface(device, canvas)` from\n * `@ice/desk`'s src/host/, the one module that names a canvas; a test's fake), so this composition\n * root never touches the DOM (design-015 §3 `desk-dom-free`, D2a-world).\n */\n readonly surface: Surface;\n /** The cutting mat (mat/mat-pass.ts) — the ground's own: every slot draws it first. */\n readonly mat: MatShaders;\n /**\n * The kinds this ground draws — its REGISTRY (kind.ts; the desk's own are `DESK_KINDS`, `@ice/desk/kinds`).\n * Names are unique. Each kind's pass is made on the root's mat; the kinds prepare in this order and draw\n * stratum by stratum, then in each slot's paint order.\n */\n readonly kinds: readonly KindProgram[];\n /**\n * The desk's chrome (marks/pass.ts; design-015 §7, D4a): the marks pass, drawn in the ROOT's pass after every\n * stratum — the selection's brackets, the vellum, the laser, the tape — when a frame names its `marks`. Absent =\n * a ground that draws no chrome.\n */\n readonly marks?: MarksShaders;\n /**\n * The hand (hold/focus.ts; design-015 §8, D4b): the focus behind an object in hand and the object over it, when a\n * frame names its `held`. Absent = a ground that never picks anything up (a frame's `held` is then ignored).\n */\n readonly hold?: HoldShaders;\n /**\n * The pegboard tray (tray/pass.ts; design-017, K3): the drawer, drawn in the ROOT's pass after the marks when a frame names its\n * `tray`. Absent = a ground with no tray.\n */\n readonly tray?: TrayShaders;\n}\n\n/** A layer a host rendered first, laid on the mat inside the ground's pass (it sets its own scissor; the ground restores the slot's). */\nexport interface Underlay { draw(pass: GPURenderPassEncoder): void }\n\n/**\n * One object on a desk as the ground takes it: its kind's name (a registered one) and the record that kind's pass draws — and\n * its KEY (D6, design-015 §4.3): stable across frames (the builder's entity; a ghost's negated), so the kind's persistent records\n * keep the object's slot and write it only when the record object changed. Absent: the record is packed afresh every frame.\n */\nexport interface SlotObject {\n readonly kind: string;\n readonly record: unknown;\n readonly key?: number | undefined;\n}\n\n/** One desk's ground: its camera, grid, objects and presentation — the root's, a departed desk's, or a mini mat's inside. */\nexport interface SlotInputs extends SlotFrame {\n /** The grid; the root may leave it unset and set `ground.grid` instead — every other slot names its own. */\n readonly grid?: GridConfig;\n /**\n * Things drawn ON THE MAT by passes of their own, beneath everything else on the desk\n * (CALENDAR.md: the desk calendar — the host renders its layer first, the ground lays it here).\n */\n readonly underlays?: readonly Underlay[];\n /**\n * The objects on this desk in PAINT ORDER, lowest first — the caller sorts: strata first (the ground draws\n * stratum by stratum whatever the list says), then its own order within each. A kind's records are its\n * objects, in this order; every kind named must be registered.\n */\n readonly objects?: readonly SlotObject[];\n /** The live insides of this desk's sheets (MINIMAT.md §3): each drawn right after the object `at` names. */\n readonly portals?: readonly PortalInputs[];\n}\n\n/**\n * A mini mat's inside through its face (PORTAL.md §2.1, MINIMAT.md §3): `present` carries\n * the presence (its opacity — the gate's answer) and the face (its clip); `view` may leave\n * `box` unset — the ground sizes the slot's box from the clip.\n */\nexport interface PortalInputs extends SlotInputs {\n readonly grid: GridConfig;\n /** The mini mat's index in the parent's `objects` (paint order): the slot draws just AFTER it, over its face. */\n readonly at: number;\n}\n\n/** The departed desk's ground for one flight frame: its own camera, grid, objects and presentation. */\nexport interface OutgoingInputs extends SlotInputs {\n readonly grid: GridConfig;\n /** design-006's z-rule for a FROZEN flight: under on enter, over on exit. */\n readonly order: \"under\" | \"over\";\n /**\n * ENTER through a live portal (PORTAL.md §2.4): the mini mat's index in the DEPARTED desk's\n * `objects` — the two desks draw as one tree, the arriving one through the mini mat's face,\n * so the objects over the mini mat stay over the inside and fade with their desk (a live\n * portal of the departed desk at the same index is neither prepared nor drawn: the arriving\n * desk is that face). Absent = two whole slots, `order` decides: a frozen flight, and every\n * EXIT — the departed inside draws OVER the whole parent (whose own live portal shows the\n * same pixels under it) and fades onto them at the landing.\n */\n readonly at?: number;\n}\n\n/**\n * THE HAND for one frame (design-015 §8; D4b — the builder makes it, the ground draws it): the one object in hand as a slot\n * of its own — its record, the pose's CAMERA (`view`) and its grid (no dapple in hand) — drawn by its kind's own pass over the\n * desk out of focus. `e` is the carry amount (the focus follows it); `blur` the radius the ONE blur is made at (CSS px: 14, a\n * phone's 10); `dim` the desk's dim behind (already by the carry); `filter` the reading light on the hand (1, 1 by day);\n * `light` the hand's own light (the day's mixed in by night); `stamp` the desk copy's identity — while it stands, the blurred\n * desk is reused (rendered ONCE per settled state, the held object alone redrawing).\n */\nexport interface HeldFrameInputs {\n readonly object: SlotObject;\n /** What rides with it (D3t-c — a calendar's stuck notes): drawn in the hand's slot after it, under the same camera. */\n readonly riders?: readonly SlotObject[];\n readonly view: View & { readonly dpr: number };\n readonly grid: GridConfig;\n readonly e: number;\n readonly blur: number;\n readonly dim: number;\n readonly filter: { readonly saturate: number; readonly brightness: number };\n readonly light: MatLight;\n readonly stamp: string;\n}\n\nexport interface GroundFrameInputs extends SlotInputs {\n /** The theme in force (`theme.ts`): the clear colour, the selection's colour and the mat's light (the Sun or the Moon) come from it. */\n readonly theme: GroundTheme;\n /** Present only while a nav flight is on. */\n readonly outgoing?: OutgoingInputs;\n /** The desk's marks this frame, in screen px (marks/layout.ts) — stratum 5, over everything; absent = none. */\n readonly marks?: MarksInput;\n /** The object in hand (design-015 §8, D4b) while one is held or flying home; absent = the desk as it is. At `e` 0 the frame is the rest frame, byte for byte. */\n readonly held?: HeldFrameInputs;\n /** The pegboard drawer this frame (design-017 — the renderer's flux: its slide, its shown scroll), over the marks; absent = none. Never drawn over the hand. */\n readonly tray?: TrayFrameInputs;\n}\n\nexport interface GroundStats extends GridStats {\n /** The root's records drawn this frame, by kind name — every registered kind, 0 where it had none. */\n readonly kinds: Readonly<Record<string, number>>;\n /** The departed slot's grid while a flight is on. */\n readonly outgoing: GridStats | null;\n /** Live portals drawn this frame, the root's and the departed desk's together. */\n readonly portals: number;\n /** The records the kinds' CAPS turned away this frame, by kind name, every slot's (absent: none) — resolved and NOT drawn (D7). */\n readonly dropped?: Readonly<Record<string, number>>;\n}\n\n/** One registered kind as a slot holds it: the registry's name and stratum, and the slot's own pass (and whether it lays a composite — `KindProgram.composite`). */\nexport interface SlotKind {\n readonly name: string;\n readonly stratum: StratumName;\n readonly pass: KindPass;\n readonly composite?: boolean;\n}\n\n/** The passes one slot owns: the mat's, and every registered kind's by name, in registration order. The root's are the ground's; the pool spawns the rest on the same pipelines. */\nexport interface SlotSet {\n readonly mat: CuttingMat;\n readonly kinds: ReadonlyMap<string, SlotKind>;\n /** The slot's FLAT-CARD pass (K7b, card/card.ts) over its kinds — absent when no registered kind declares a card material. */\n readonly card?: CardPass;\n}\n\n/** One slot's passes for `drawFrame` — the ground's own, or the oracle's. A parent carries its nested slots. */\nexport interface DrawSlot {\n readonly mat: CuttingMat;\n readonly present?: Presentation | undefined;\n /** BARE: no mat is drawn — the hand's slot (D4b) lays its one object over a frame that is already there. */\n readonly bare?: boolean | undefined;\n /** Layers laid on the mat before everything (the calendar's). */\n readonly underlays?: readonly Underlay[] | undefined;\n /** The slot's kinds, prepared (its `SlotSet.kinds`): an object's kind names its stratum and its pass. */\n readonly kinds: ReadonlyMap<string, SlotKind>;\n /** The slot's objects in paint order — only their kinds matter to the draw: each kind's records are counted along them. */\n readonly objects?: readonly { readonly kind: string }[] | undefined;\n /**\n * The FLAT CARDS (K7b): each object's card in the card pass's list this frame (`route[i]`, −1 = its kind draws it) — a run of cards\n * is one draw whatever kinds it interleaves. Absent: every object is its kind's.\n */\n readonly card?: { readonly pass: CardPass; readonly route: Int32Array } | undefined;\n /** Nested slots, each drawn right after the object `at` names (MINIMAT.md §3) — one that names no object here draws over them all. */\n readonly children?: readonly { readonly at: number; readonly slot: DrawSlot }[] | undefined;\n /** What the slot's grid did this frame. */\n readonly stats: GridStats;\n}\n\n/** A slot at opacity 0 draws nothing: \"source over\" with alpha 0 leaves every pixel as it was. */\nexport const visible = (p: Presentation | undefined): boolean => (p?.opacity ?? 1) > 0;\n\n/**\n * The root slot's passes: the mat's (made first — every kind's pass is made on it) and every registered\n * kind's, made in parallel on the root's mat, in registration order. Names must be unique and strata known.\n * Shared by the ground and the Node oracle.\n */\nexport async function createSlotSet(device: GPUDevice, format: GPUTextureFormat, mat: CuttingMat, programs: readonly KindProgram[]): Promise<SlotSet> {\n const names = new Set<string>();\n for (const p of programs) {\n if (!p.name) throw new Error(\"ground: a kind needs a name — it is the kind's key in every slot\");\n if (names.has(p.name)) throw new Error(`ground: two kinds are named \"${p.name}\" — a kind's name is its key in every slot`);\n if (!STRATA.includes(p.stratum)) throw new Error(`ground: kind \"${p.name}\" lies in no stratum the ground draws (\"${p.stratum}\"; ${STRATA.join(\", \")})`);\n names.add(p.name);\n }\n const [passes, cards] = await Promise.all([Promise.all(programs.map((p) => p.create(device, format, mat))), createCardShared(device, format, programs)]);\n const kinds = new Map<string, SlotKind>();\n for (let i = 0; i < programs.length; i++) {\n const p = programs[i] as KindProgram;\n kinds.set(p.name, { name: p.name, stratum: p.stratum, pass: passes[i] as KindPass, ...(p.composite ? { composite: true } : {}) });\n }\n // the kinds that declare a card material, composed into ONE pipeline (K7b): their objects interleave in one run\n return cards === null ? { mat, kinds } : { mat, kinds, card: new CardPass(device, cards, mat, kinds) };\n}\n\n/** Slots beyond the root, spawned on first use and reused every frame: `reset()` then `acquire()` per slot the frame needs. */\nexport class SlotPool {\n private readonly slots: SlotSet[] = [];\n private used = 0;\n private readonly root: SlotSet;\n constructor(root: SlotSet) { this.root = root; }\n reset(): void { this.used = 0; }\n /** The next slot: on first use its mat spawned from the root's, then every registered kind's pass on that mat, in registration order. */\n acquire(): SlotSet {\n if (this.used === this.slots.length) {\n const mat = this.root.mat.spawn();\n const kinds = new Map<string, SlotKind>();\n for (const k of this.root.kinds.values()) kinds.set(k.name, { name: k.name, stratum: k.stratum, pass: k.pass.spawn(mat), ...(k.composite ? { composite: true } : {}) });\n const card = this.root.card?.spawn(mat, kinds);\n this.slots.push(card === undefined ? { mat, kinds } : { mat, kinds, card });\n }\n return this.slots[this.used++] as SlotSet;\n }\n /** Slots spawned so far — the churn instrument. */\n get size(): number { return this.slots.length; }\n dispose(): void { for (const s of this.slots) { s.mat.dispose(); s.card?.dispose(); for (const k of s.kinds.values()) k.pass.dispose(); } this.slots.length = 0; this.used = 0; }\n}\n\n/**\n * Draw one slot into an open render pass: scissored to its portal (nothing\n * outside it is shaded), skipped outright at opacity 0 — the mat, the layers on\n * it, then the objects stratum by stratum: within a stratum in paint order, one\n * `drawRange` per RUN of one kind (each kind counting its own records), the run\n * cut after an object with a live inside — the inside over its face (restoring\n * this slot's scissor), then that object's marks over the inside. Returns\n * whether it drew.\n */\nexport function drawSlot(pass: GPURenderPassEncoder, size: { readonly w: number; readonly h: number }, dpr: number, slot: DrawSlot): boolean {\n if (!visible(slot.present)) return false;\n const [x, y, w, h] = scissorOf(slot.present, dpr, size);\n if (w === 0 || h === 0) return false; // the portal is off screen: nothing to shade\n pass.setScissorRect(x, y, w, h);\n if (slot.bare !== true) slot.mat.draw(pass);\n // the layers a host laid on the mat (the desk calendar, CALENDAR.md), each setting its own scissor\n if (slot.underlays?.length) { for (const u of slot.underlays) u.draw(pass); pass.setScissorRect(x, y, w, h); }\n // the live insides by the object each lies in (two on one object draw in the order they came)\n const objects = slot.objects ?? [];\n const insides = new Map<number, DrawSlot[]>();\n for (const c of slot.children ?? []) { const listed = insides.get(c.at); if (listed) listed.push(c.slot); else insides.set(c.at, [c.slot]); }\n const inside = (child: DrawSlot) => { if (drawSlot(pass, size, dpr, child)) pass.setScissorRect(x, y, w, h); };\n // the objects, stratum by stratum; within one, in paint order, a run of one kind at a time — cut after an object with a live\n // inside: the run through it, its inside over its face, then its marks over that (the mini mat's chips while the inside's\n // objects fade in — MINIMAT.md §5) — before the objects above it\n const next = new Map<string, number>(); // each kind's next record\n // K7b: an object the card draws runs with the CARDS — one run however the kinds interleave — at its index in the card's list\n const card = slot.card;\n for (const stratum of STRATA) {\n let run: { drawRange(pass: GPURenderPassEncoder, first: number, end: number): void } | undefined;\n let first = 0;\n let end = 0;\n for (let i = 0; i < objects.length; i++) {\n const k = slot.kinds.get((objects[i] as { readonly kind: string }).kind);\n if (!k || k.stratum !== stratum) continue;\n const index = next.get(k.name) ?? 0;\n next.set(k.name, index + 1);\n if (k.composite) continue; // laid once, after the stratum's runs (below)\n const c = card === undefined ? -1 : (card.route[i] as number);\n const p = c >= 0 ? (card as { readonly pass: CardPass }).pass : k.pass;\n const at = c >= 0 ? c : index;\n if (p !== run) { run?.drawRange(pass, first, end); run = p; first = at; }\n end = at + 1;\n const children = insides.get(i);\n if (!children) continue;\n p.drawRange(pass, first, end);\n run = undefined;\n for (const child of children) { inside(child); k.pass.drawOver?.(pass, index); }\n insides.delete(i);\n }\n run?.drawRange(pass, first, end);\n // a kind that lays a composite of its own target (the notebook, the calendar): ONE run over all its records, after every other\n // run of the stratum — one draw lays every one of its objects, so they cannot interleave with another kind's (KindProgram.composite)\n for (const k of slot.kinds.values()) {\n const count = k.composite && k.stratum === stratum ? (next.get(k.name) ?? 0) : 0;\n if (count > 0) k.pass.drawRange(pass, 0, count);\n }\n }\n // an inside whose `at` names no object this slot draws has nothing to lie in: it draws over them all\n for (const children of insides.values()) for (const child of children) inside(child);\n return true;\n}\n\n/**\n * Record one frame into an open render pass: the root slot with its nested\n * slots, and — while a flight is on — the departed slot: through the mini mat\n * as one tree (`outgoing.at`), or whole, under or over, when the flight is\n * frozen. Shared with the Node oracle so both hosts draw a frame through the\n * same code. Returns each slot's grid stats (null = not drawn).\n */\nexport function drawFrame(pass: GPURenderPassEncoder, size: { readonly w: number; readonly h: number }, dpr: number, incoming: DrawSlot, outgoing?: (DrawSlot & { readonly order: \"under\" | \"over\"; readonly at?: number | undefined }) | null): { incoming: GridStats; outgoing: GridStats | null } {\n let drewOut = false;\n if (outgoing && outgoing.at !== undefined) {\n // A portal flight: one tree. Enter = the arriving desk through the departed one's mini mat; exit = the departed desk through the arriving one's.\n const enter = outgoing.order === \"under\";\n const parent = enter ? outgoing : incoming;\n const child = enter ? incoming : outgoing;\n const at = outgoing.at;\n const tree: DrawSlot = { ...parent, children: [...(parent.children ?? []).filter((k) => k.at !== at), { at, slot: child }] };\n const drewParent = drawSlot(pass, size, dpr, tree);\n // the child drew iff the parent did and the child is visible with a portal on screen\n const drewChild = drewParent && visible(child.present) && scissorOf(child.present, dpr, size)[2] > 0 && scissorOf(child.present, dpr, size)[3] > 0;\n drewOut = enter ? drewParent : drewChild;\n } else {\n if (outgoing?.order === \"under\") drewOut = drawSlot(pass, size, dpr, outgoing);\n drawSlot(pass, size, dpr, incoming);\n if (outgoing?.order === \"over\") drewOut = drawSlot(pass, size, dpr, outgoing);\n }\n pass.setScissorRect(0, 0, size.w, size.h);\n return { incoming: incoming.stats, outgoing: outgoing && drewOut ? outgoing.stats : null };\n}\n\n/** What `prepareFrame` hands the draw: the two slots and the counts the stats report. */\nexport interface PreparedFrame {\n readonly incoming: DrawSlot;\n readonly outgoing: (DrawSlot & { readonly order: \"under\" | \"over\"; readonly at?: number | undefined }) | null;\n readonly portals: number;\n /** The root's records that will draw, by kind name — every registered kind. */\n readonly kinds: Readonly<Record<string, number>>;\n /** What the kinds' caps turned away, by kind name, every slot's (absent: nothing) — `GroundStats.dropped` (D7). */\n readonly dropped?: Readonly<Record<string, number>>;\n /** K5a: the tray's specimens, one slot each, prepared — drawn over the board, inside its edge (`drawTray`); absent = none. */\n readonly tray?: readonly DrawSlot[];\n /** K5b: what the tray carries, one slot each, prepared — drawn over the drawer, whole (`drawTray`); absent = none. */\n readonly carried?: readonly DrawSlot[];\n}\n\n/** Where `prepareFrame` finds a specimen's slot (tray/specimens.ts `TraySlots`): undefined while its kind's pass is being made. */\nexport interface TraySlotSource { get(type: string, kind: string): SlotSet | undefined }\n\n/** The light a slot is lit by when nothing says otherwise: its own camera. */\nconst ownLight = (s: SlotFrame): SlotLight => ({ a: { x: s.view.camX, y: s.view.camY, zoom: s.view.zoom } });\n/** What a slot's OBJECTS are presented with: its opacity times their own presence (the mat takes the opacity alone). */\nconst objectsOf = (p: Presentation | undefined): Presentation | undefined => (p?.objects === undefined ? p : { ...p, opacity: p.opacity * p.objects });\n/** A live inside's presence over its mini mat's face: what the face's own drawing gives way to. */\nconst liveOf = (p: Presentation | undefined): number => (p ? p.opacity * (p.objects ?? 1) : 1);\n\n/**\n * Upload one frame's records into its slots — the root's, each live portal's\n * (from the pool), the departed desk's — run the mat's wind where its clock\n * moved, and return the draw tree. Per slot, every registered kind prepares its\n * own records (the slot's objects of that kind, in paint order), told which of\n * them carries a live inside. Shared by the ground and the Node oracle. `grid`\n * is the root's when its inputs name none.\n */\nexport function prepareFrame(encoder: GPUCommandEncoder, root: SlotSet, pool: SlotPool, inputs: GroundFrameInputs, grid: GridConfig = DEFAULT_GRID, target?: RenderTarget, traySlots?: TraySlotSource): PreparedFrame {\n pool.reset();\n root.mat.newFrame(); // a wind key drawn in an earlier frame may be drawn over; one drawn in this one is every slot's (K4a)\n const theme = inputs.theme;\n let portals = 0;\n let rootDrawn: readonly (readonly [string, number])[] = [];\n const dropped: Record<string, number> = {};\n const attach = { width: inputs.view.width, height: inputs.view.height };\n // `host`: the light of the slot this one is nested in — a mini mat's inside is lit by the desk it lies on; `skipAt`: a portal of this\n // slot not to prepare — on an enter, the arriving desk IS that face, and `treeLive` is its presence over the mini mat there.\n const prepare = (s: SlotSet, inp: SlotInputs, fallback: GridConfig, host: SlotLight | undefined, skipAt?: number, treeLive?: number): DrawSlot => {\n const g = inp.grid ?? fallback;\n const light = inp.light ?? host ?? ownLight(inp);\n const lit = inp.light ?? host; // undefined = the slot's own lamp, exactly (the root at rest)\n const cfg = dressGrid(g, inp.view.zoom, inp.lodZoom);\n const wind = s.mat.prepare(encoder, inp.view, cfg.fadeIn, cfg.mat, inp.mat ?? STILL_MAT_FRAME, inp.present, theme.matLight, lit);\n // the objects by kind — each kind's records in paint order, and each object's index among its kind's\n const objects = inp.objects ?? [];\n const records = new Map<string, unknown[]>();\n // …and their keys (D6): a kind's list of keys is handed on only when EVERY one of its objects carries one\n const keys = new Map<string, number[] | null>();\n for (const name of s.kinds.keys()) { records.set(name, []); keys.set(name, []); }\n const indexOf: number[] = [];\n for (const o of objects) {\n const list = records.get(o.kind);\n if (!list) throw new Error(`ground: no kind \"${o.kind}\" is registered (${[...s.kinds.keys()].join(\", \") || \"none\"})`);\n indexOf.push(list.length);\n list.push(o.record);\n const ks = keys.get(o.kind);\n if (ks !== null && ks !== undefined) { if (o.key === undefined) keys.set(o.kind, null); else ks.push(o.key); }\n }\n // each object's live inside, by its kind's own record index: what the face's own drawing gives way to\n const live = new Map<string, Map<number, number>>();\n const tell = (at: number, presence: number): void => {\n const o = objects[at];\n if (!o) return; // no object there: nothing to tell (its inside, if any, draws over the slot's objects)\n const told = live.get(o.kind) ?? new Map<number, number>();\n told.set(indexOf[at] as number, presence);\n live.set(o.kind, told);\n };\n if (skipAt !== undefined && treeLive !== undefined) tell(skipAt, treeLive);\n const children: { at: number; slot: DrawSlot }[] = [];\n // A child is seen through its own face AND every face this slot is seen through — the chain (PORTAL.md §10) — and its box is its face's inside this slot's.\n const within = chainOf(inp.present);\n let parentBox = boxOf(inp.view);\n for (const c of within) parentBox = intersectBox(parentBox, boxOfPortal(c, attach));\n for (const p of inp.portals ?? []) {\n if (!visible(p.present) || !p.present?.portal || p.at === skipAt) continue;\n if (within.length >= PORTAL_CHAIN) continue; // the belt: a face beyond the chain shows nothing (a host's depth belt stops first)\n const box = intersectBox(p.view.box ?? boxOfPortal(p.present.portal, attach), parentBox);\n if (box.w <= 0 || box.h <= 0) continue;\n // the inside comes in over the mini mat's own face — its mat whole, its objects by their presence; it is lit by this desk's lamp\n const present: Presentation = { opacity: p.present.opacity, ...(p.present.objects !== undefined ? { objects: p.present.objects } : {}), portal: p.present.portal, within };\n children.push({ at: p.at, slot: prepare(pool.acquire(), { ...p, view: { ...p.view, box }, present }, p.grid, light) });\n tell(p.at, liveOf(present));\n portals += 1;\n }\n // the kinds, in registration order: each lit by this slot's mat — its light, its lamp's gobo (MINIMAT.md §4) — at the objects'\n // presence, a spawned slot's pass first taking the root's laws, each told which of its records carries a live inside this frame.\n // A kind with no objects in the slot is not prepared at all (K4a, design-016 K-L3: it costs the slot nothing) — the slot's view\n // block is the mat's, written above, so no kind has a copy to keep fresh, and no run of it is drawn (`drawSlot` walks the objects)\n const slot: SlotContext = { view: inp.view, fadeIn: g.fadeIn, cfg: g.mat, frame: inp.mat, present: objectsOf(inp.present), light: theme.matLight, lit, select: theme.select, theme, ...(target !== undefined ? { target } : {}) };\n const drawn: [string, number][] = [];\n for (const k of s.kinds.values()) {\n const list = records.get(k.name) ?? [];\n if (list.length === 0) { drawn.push([k.name, 0]); continue; }\n const own = root.kinds.get(k.name);\n if (own && k.pass !== own.pass) k.pass.tune?.(own.pass);\n const told = live.get(k.name);\n const ks = keys.get(k.name);\n drawn.push([k.name, k.pass.prepare(encoder, slot, list, { live: (i) => told?.get(i) ?? -1, ...(ks !== null && ks !== undefined ? { keys: ks } : {}) })]);\n // what its cap turned away is said, never silent (D7)\n const turned = k.pass.dropped?.() ?? 0;\n if (turned > 0) dropped[k.name] = (dropped[k.name] ?? 0) + turned;\n }\n if (s === root) rootDrawn = drawn;\n // THE CARDS (K7b, card/card.ts): every object of a material kind whose pass lets it go (`cardSlot`) — never one with a live\n // inside (its inside goes right after it) — pushed in the order drawSlot walks them, stratum by stratum, then paint order, so a\n // run of cards is a contiguous range of the card's list\n let card: DrawSlot[\"card\"];\n if (s.card?.on === true && objects.length > 0) {\n const route = s.card.begin(objects.length);\n for (const stratum of STRATA) {\n for (let i = 0; i < objects.length; i++) {\n const o = objects[i] as SlotObject;\n const k = s.kinds.get(o.kind);\n if (k === undefined || k.stratum !== stratum || k.composite === true) continue;\n const m = s.card.materialOf(o.kind);\n if (m === undefined) continue;\n const at = indexOf[i] as number;\n if (live.get(o.kind)?.has(at) === true) continue;\n const cs = k.pass.cardSlot?.(at) ?? -1;\n if (cs >= 0) route[i] = s.card.push(m, cs);\n }\n }\n if (s.card.prepare(slot) > 0) card = { pass: s.card, route };\n }\n return {\n mat: s.mat, present: inp.present, stats: gridStats(inp.view, wind), kinds: s.kinds,\n ...(card !== undefined ? { card } : {}),\n ...(inp.underlays?.length ? { underlays: inp.underlays } : {}),\n ...(objects.length ? { objects } : {}),\n ...(children.length ? { children } : {}),\n };\n };\n const incoming = prepare(root, inputs, grid, undefined);\n let outgoing: PreparedFrame[\"outgoing\"] = null;\n // A departed slot at opacity 0 (the last quarter of an enter, the tail of a frozen dissolve) is neither prepared nor drawn.\n if (inputs.outgoing && visible(inputs.outgoing.present)) {\n const o = inputs.outgoing;\n const enterTree = o.at !== undefined && o.order === \"under\";\n // on enter the departed desk's own portal at the mini mat is the arriving desk's face — never prepared twice — and the arriving\n // desk's presence there is what the mini mat's far LOD gives way to\n const out = prepare(pool.acquire(), o, o.grid, undefined, enterTree ? o.at : undefined, enterTree ? liveOf(inputs.present) : undefined);\n outgoing = { ...out, order: o.order, at: o.at };\n }\n // the tray's specimens (K5a): each in its own slot — its view block the drawer's camera scaled about it (K-L3), its kind's own pass,\n // through the drawer's face; a specimen whose slot is not made yet (a composite kind's pass, being made) waits a frame\n const tray: DrawSlot[] = [];\n const specimens = inputs.tray?.specimens;\n if (specimens !== undefined && specimens.length > 0 && traySlots !== undefined && inputs.tray !== undefined) {\n const present = facePresent({ rect: trayRectOf(inputs), scroll: inputs.tray.scroll }, inputs.view.height);\n for (const f of specimens) {\n const slot = traySlots.get(f.type, f.kind);\n if (slot === undefined) continue;\n tray.push(prepare(slot, { view: f.view, grid: f.grid, objects: [{ kind: f.kind, record: f.record, key: f.key }], present }, f.grid, undefined));\n }\n }\n // …and what it carries (K5b): each in its own slot — the copy lifted off the board, a ghost growing out of it or shrinking home — whole,\n // never through the face (it is off the board); one slot per type, apart from its specimen's\n const carried: DrawSlot[] = [];\n const carriedIn = inputs.tray?.carried;\n if (carriedIn !== undefined && carriedIn.length > 0 && traySlots !== undefined) {\n const byType = new Map<string, TrayCarriedFrame[]>();\n for (const f of carriedIn) byType.set(f.slot, [...(byType.get(f.slot) ?? []), f]);\n for (const [key, list] of byType) {\n const first = list[0] as TrayCarriedFrame;\n const slot = traySlots.get(key, first.kind);\n if (slot === undefined) continue;\n carried.push(prepare(slot, { view: first.view, grid: first.grid, objects: list.map((f) => ({ kind: f.kind, record: f.record, key: f.key })) }, first.grid, undefined));\n }\n }\n return {\n incoming, outgoing, portals, kinds: Object.fromEntries(rootDrawn), ...(Object.keys(dropped).length > 0 ? { dropped } : {}), ...(tray.length > 0 ? { tray } : {}),\n ...(carried.length > 0 ? { carried } : {}),\n };\n}\n\n/** The drawer as its frame inputs lay it (tray/drawer.ts `drawerRect` at the flux's slide). */\nfunction trayRectOf(inputs: GroundFrameInputs): ReturnType<typeof drawerRect> {\n const t = inputs.tray as TrayFrameInputs;\n return drawerRect(inputs.view.width, inputs.view.height, Math.min(Math.max(t.p, 0), 1));\n}\n\n/**\n * THE TRAY, drawn (design-017 §5, §8; K5a) — shared by `Ground.render` and the Node oracle: the drawer UNDER its specimens (the dim, its\n * shadows, the board to its edge, the accessories), each specimen by its own kind through the drawer's face (inside the edge — the rim\n * laid over them all retired, design-018 §2), their name tags (the marks' pills), then the VEIL over them all at the top (design-018\n * rev 5: the plain board, whole in the header and fading out over its ramp — what hangs there fades into the board, never see-through\n * over a hole); then what the tray carries, whole. Shut (p 0) the drawer draws nothing (its pass laid no quad) and only a carried copy\n * is drawn. Leaves the scissor on the whole view.\n */\nexport function drawTray(pass: GPURenderPassEncoder, size: { readonly w: number; readonly h: number }, dpr: number, tray: TrayPass, slots: readonly DrawSlot[] | undefined, marks: MarksPass | null, carried?: readonly DrawSlot[]): void {\n tray.draw(pass);\n const rect = tray.laid?.rect;\n if (rect !== undefined) {\n // each specimen through the drawer's face, once (design-018 §2: the finger notch — and its three scissors — retired)\n for (const s of slots ?? []) drawSlot(pass, size, dpr, { ...s, bare: true });\n if (marks !== null && marks.tagCount > 0) {\n const [x, y, w, h] = scissorOf({ opacity: 1, portal: faceBox(rect, size.h / dpr) }, dpr, size);\n if (w > 0 && h > 0) {\n pass.setScissorRect(x, y, w, h);\n marks.drawTags(pass);\n }\n }\n }\n pass.setScissorRect(0, 0, size.w, size.h);\n tray.drawVeil(pass);\n // what the tray carries (K5b): over the drawer and the dim, whole — it is off the board\n if (carried !== undefined && carried.length > 0) {\n for (const s of carried) drawSlot(pass, size, dpr, { ...s, bare: true });\n pass.setScissorRect(0, 0, size.w, size.h);\n }\n}\n\n/** The drawer's face inside its edge and under its header (design-018 R4) as a clip box (CSS px), square — the tags' scissor. */\nfunction faceBox(rect: { readonly x: number; readonly y: number; readonly w: number; readonly h: number }, vh: number): { cx: number; cy: number; hx: number; hy: number; r: number } {\n const x0 = rect.x + DRAWER.arris;\n const x1 = rect.x + rect.w - DRAWER.arris;\n const y0 = rect.y + DRAWER.arris + DRAWER.header;\n const y1 = Math.max(vh, rect.y + rect.h);\n return { cx: (x0 + x1) / 2, cy: (y0 + y1) / 2, hx: (x1 - x0) / 2, hy: (y1 - y0) / 2, r: 0 };\n}\n\n\n\nexport class Ground {\n readonly device: GPUDevice;\n readonly surface: Surface;\n /** The cutting mat — the root slot's; its plates, noise and glyph atlas are every slot's. */\n readonly mat: CuttingMat;\n /** The root slot's passes: the mat's and every registered kind's, by name (the registry, in registration order). */\n readonly root: SlotSet;\n /** Slots beyond the root — the departed desk's, the live insides of mini mats — spawned on first use. */\n readonly pool: SlotPool;\n /** The root's grid when a frame names none. */\n grid: GridConfig = DEFAULT_GRID;\n /** The desk's chrome — stratum 5 (D4a); null when the options named no marks shaders. */\n readonly marks: MarksPass | null;\n /** The hand — the focus behind an object in hand and the object over it (D4b); null when the options named no hold shaders. */\n readonly hold: HoldPass | null;\n /** The pegboard drawer (design-017, K3); null when the options named no tray shaders. */\n readonly tray: TrayPass | null;\n /** The tray's specimens' slots (K5a) — one per specimen, made as the tray first shows each; null with no tray. */\n readonly traySlots: TraySlots | null;\n /** The desk copy's cache (D4b): the stamp it was made for and the stats of that frame. */\n private readonly heldCache: HeldCache = { stamp: null, stats: null, copies: 0 };\n /** How many desk copies the hand has made so far (D4b) — a rig's witness that the blurred desk is made once per settled state. */\n heldCopies(): number { return this.heldCache.copies; }\n /** The drops last said, by kind (D7). */\n private readonly dropSaid = new Map<string, number>();\n\n private constructor(device: GPUDevice, surface: Surface, root: SlotSet, marks: MarksPass | null, hold: HoldPass | null, tray: TrayPass | null, programs: readonly KindProgram[]) {\n this.device = device; this.surface = surface; this.mat = root.mat; this.root = root; this.marks = marks; this.hold = hold; this.tray = tray;\n this.pool = new SlotPool(root);\n this.traySlots = tray === null ? null : new TraySlots(device, surface.format, root, programs);\n }\n\n static async create(opts: GroundOptions): Promise<Ground> {\n const surf = opts.surface;\n const mat = await CuttingMat.create(opts.device, surf.format, opts.mat);\n const root = await createSlotSet(opts.device, surf.format, mat, opts.kinds);\n const [marks, hold, tray] = await Promise.all([\n opts.marks === undefined ? null : MarksPass.create(opts.device, surf.format, opts.marks, mat),\n opts.hold === undefined ? null : HoldPass.create(opts.device, surf.format, opts.hold),\n opts.tray === undefined ? null : TrayPass.create(opts.device, surf.format, opts.tray, mat),\n ]);\n return new Ground(opts.device, surf, root, marks, hold, tray, opts.kinds);\n }\n\n /** The root's pass of the kind registered as `name` (undefined if none) — a host reaches its kind's own API through it: the note's ink pages, the whiteboard's rasters. */\n pass(name: string): KindPass | undefined { return this.root.kinds.get(name)?.pass; }\n\n /** Size the canvas to its CSS box; returns the CSS size and dpr the frame should use. (A host may size the canvas itself instead.) */\n fit(maxDpr = 2) { return this.surface.fit(maxDpr); }\n\n /** Render one frame now. Synchronous submit; the caller owns the cadence. */\n render(inputs: GroundFrameInputs): GroundStats {\n // the hand (D4b): at a carry above 0 the frame is the desk out of focus with the held object over it; at 0 it is the rest frame\n const held = inputs.held;\n if (held !== undefined && held.e > 0 && this.hold !== null) return this.said(renderHeldFrame(this.device, this.hold, this.root, this.pool, this.grid, this.surface, inputs, held, this.heldCache));\n // the hold is over: the passes give the desk copy's own state back, once — the next pick-up makes its copy afresh (D7)\n if (this.heldCache.stamp !== null) {\n this.heldCache.stamp = null;\n for (const k of this.root.kinds.values()) k.pass.endHold?.();\n }\n const encoder = this.device.createCommandEncoder({ label: \"ground\" });\n // the drawer shut (p 0) lays no quad; what the tray carries is drawn whatever the slide (a ghost grows, or flies home, past it)\n const trayed = inputs.tray !== undefined && this.tray !== null ? this.tray.prepare(inputs.view, inputs.theme, inputs.grid ?? this.grid, inputs.mat, inputs.tray) : 0;\n const prepared = prepareFrame(encoder, this.root, this.pool, inputs, this.grid, undefined, inputs.tray !== undefined ? (this.traySlots ?? undefined) : undefined);\n const marked = this.marks !== null ? this.marks.prepare(inputs.marks, trayed > 0 && this.tray !== null ? { view: inputs.view, tags: tagsOf(inputs.tray), night: inputs.theme.matLight.night } : undefined) : 0;\n const bg = inputs.theme.canvasBg;\n const pass = beginPass(encoder, this.surface.view(), [bg[0], bg[1], bg[2], 1], \"ground\");\n const drawn = drawFrame(pass, this.surface.size(), inputs.view.dpr, prepared.incoming, prepared.outgoing);\n // stratum 5: the marks, over every slot and every stratum (drawFrame left the scissor on the whole view)\n if (marked > 0) this.marks?.draw(pass);\n // …and the pegboard drawer over them (design-017): the dim, its shadow on the desk, the board to its edge, the specimens (K5a)\n if ((trayed > 0 || prepared.carried !== undefined) && this.tray !== null) drawTray(pass, this.surface.size(), inputs.view.dpr, this.tray, prepared.tray, this.marks, prepared.carried);\n pass.end();\n this.device.queue.submit([encoder.finish()]);\n return this.said({ ...drawn.incoming, kinds: prepared.kinds, outgoing: drawn.outgoing, portals: prepared.portals, ...(prepared.dropped ? { dropped: prepared.dropped } : {}) });\n }\n\n /** A kind whose cap turns objects away is an ERROR on the host's console (D7): said when the drop begins and again if it grows. */\n private said(stats: GroundStats): GroundStats {\n const now = stats.dropped ?? {};\n for (const [kind, n] of Object.entries(now)) {\n if (n > (this.dropSaid.get(kind) ?? 0)) console.error(`desk: ${n} ${kind} object${n === 1 ? \"\" : \"s\"} not drawn — past the kind's cap (GroundStats.dropped)`);\n this.dropSaid.set(kind, n);\n }\n for (const kind of [...this.dropSaid.keys()]) if (!(kind in now)) this.dropSaid.delete(kind);\n return stats;\n }\n\n /** The pool's slots, then the root's kinds in reverse registration order, then the mat. */\n dispose(): void { this.pool.dispose(); this.traySlots?.dispose(); this.root.card?.dispose(); for (const k of [...this.root.kinds.values()].reverse()) k.pass.dispose(); this.marks?.dispose(); this.hold?.dispose(); this.tray?.dispose(); this.mat.dispose(); }\n\n /** Make the passes the tray's composite specimens need (K5a — `TraySlots.warm`); `onReady` asks for the frame that shows them. */\n warmTray(wanted: readonly (readonly [string, string])[], onReady: () => void): void { this.traySlots?.warm(wanted, onReady); }\n\n /** The tray's slots let go of what they make again at their next draw once undrawn a while (D-K6a.3; `TraySlots.idle`) — every tick. */\n idleTray(): void { this.traySlots?.idle(); }\n /** When `idleTray` next lets a tray layer go (K7a — a time the host registers; ∞ — nothing to let go). */\n trayIdleAt(): number { return this.traySlots?.idleAt() ?? Number.POSITIVE_INFINITY; }\n}\n\n\n/** The specimens' name tags this frame (K5a): each label centred under its specimen — below a shelf's plank — in screen px. */\nexport function tagsOf(tray: TrayFrameInputs | undefined): { readonly label: string; readonly x: number; readonly y: number }[] {\n const P = DRAWER.pitch;\n return (tray?.specimens ?? []).map((f) => ({ label: f.label, x: (f.screen.x0 + f.screen.x1) / 2, y: f.screen.y1 + (f.accessory === \"shelf\" ? 0.24 * P : 0) + 0.45 * P }));\n}\n\n/** The desk copy's cache between held frames (D4b): the `stamp` it was made for (null: none yet), the stats of that frame, and how many copies were ever made (the \"once per settled state\" witness). */\nexport interface HeldCache { stamp: string | null; stats: GroundStats | null; copies: number }\n\n/** Where a held frame goes: the swap chain's view and size (the ground's surface, or the oracle's target dressed as one). */\nexport interface HeldInto { view(): GPUTextureView; size(): { readonly w: number; readonly h: number } }\n\n/**\n * A HELD FRAME (design-015 §8; D4b) — shared by `Ground.render` and the Node oracle so both hosts draw it through one code path:\n * 1. the DESK COPY, only when its `stamp` moved: the frame WITHOUT the held object (the builder left it out), no marks, prepared\n * and drawn at half the dpr into the hold pass's half-size target, then blurred — its own encoder, SUBMITTED FIRST: the root's\n * passes are about to be prepared again for the hand, and a queue write lands before every later submit, never an earlier one;\n * 2. the HAND: the one object under the pose's camera, its kind's own pass into a transparent full-size target (no mat — a bare\n * slot), the hand's light (the day's by night, as the carry rises);\n * 3. the FRAME: the desk out of focus (the sharp copy mixed toward the blurred one by the carry, dimmed), then the hand over it\n * through the reading light. Two fullscreen draws; the marks stay quiet (the builder hands none).\n * Returns the desk copy's stats (the frame's objects behind the hand).\n */\nexport function renderHeldFrame(device: GPUDevice, hold: HoldPass, root: SlotSet, pool: SlotPool, grid: GridConfig, into: HeldInto, inputs: GroundFrameInputs, held: HeldFrameInputs, cache: HeldCache): GroundStats {\n const size = into.size();\n const dpr = inputs.view.dpr;\n const bg = inputs.theme.canvasBg;\n const remade = hold.fit(size.w, size.h);\n if (remade || cache.stamp !== held.stamp) {\n cache.stamp = held.stamp;\n cache.copies += 1;\n const encoder = device.createCommandEncoder({ label: \"hold/copy\" });\n const { held: _held, marks: _marks, ...rest } = inputs;\n const copy: GroundFrameInputs = { ...rest, view: { ...inputs.view, dpr: dpr / 2 } };\n const prepared = prepareFrame(encoder, root, pool, copy, grid, \"copy\"); // the copy's own state in the passes that keep one (D7)\n const pass = beginPass(encoder, hold.desk.view, [bg[0], bg[1], bg[2], 1], \"hold/copy\");\n const drawn = drawFrame(pass, { w: hold.desk.width, h: hold.desk.height }, dpr / 2, prepared.incoming, prepared.outgoing);\n pass.end();\n hold.blur(encoder, (held.blur * dpr) / 2);\n device.queue.submit([encoder.finish()]);\n cache.stats = { ...drawn.incoming, kinds: prepared.kinds, outgoing: drawn.outgoing, portals: prepared.portals, ...(prepared.dropped ? { dropped: prepared.dropped } : {}) };\n }\n const encoder = device.createCommandEncoder({ label: \"hold\" });\n const handInputs: GroundFrameInputs = { view: held.view, grid: held.grid, objects: [held.object, ...(held.riders ?? [])], theme: { ...inputs.theme, matLight: held.light } };\n const hand = prepareFrame(encoder, root, pool, handInputs, held.grid, \"hand\"); // (K9 R4: the passes re-ask what the copy has bound)\n const handPass = beginPass(encoder, hold.hand.view, [0, 0, 0, 0], \"hold/hand\");\n drawSlot(handPass, size, dpr, { ...hand.incoming, bare: true });\n handPass.end();\n const pass = beginPass(encoder, into.view(), [bg[0], bg[1], bg[2], 1], \"hold\");\n hold.composite(pass, { e: held.e, dim: held.dim, saturate: held.filter.saturate, brightness: held.filter.brightness });\n pass.end();\n device.queue.submit([encoder.finish()]);\n return cache.stats ?? { k0: 0, fade: 0, wind: false, kinds: hand.kinds, outgoing: null, portals: 0 };\n}\n","// The mouse follower behind the projector's tilt: the reference's\n// SecondOrderDynamics (f 1 Hz · ζ 0.3 · r 2), a second-order filter that also\n// feeds the target's velocity forward — the tilt leads the pointer a little\n// and rings once. Two channels, pure, stepped per frame by the host; the\n// engine only ever sees the resulting matrix.\n// (research/tree-shadow/prototype/src/gobo.js, transcribed.)\n\nexport interface SecondOrder {\n readonly k1: number; readonly k2: number; readonly k3: number;\n readonly w: number; readonly z: number; readonly d: number;\n target: [number, number];\n prevTarget: [number, number];\n value: [number, number];\n velocity: [number, number];\n}\n\nexport function secondOrder(f = 1, z = 0.3, r = 2, value: readonly [number, number] = [0, 0]): SecondOrder {\n const w = Math.PI * 2 * f;\n return {\n k1: z / (Math.PI * f), k2: 1 / (w * w), k3: (r * z) / w,\n w, z, d: w * Math.sqrt(Math.abs(z * z - 1)),\n target: [value[0], value[1]], prevTarget: [value[0], value[1]], value: [value[0], value[1]], velocity: [0, 0],\n };\n}\n\nexport function stepSecondOrder(s: SecondOrder, dt: number): void {\n if (dt <= 0) return;\n const tv: [number, number] = [(s.target[0] - s.prevTarget[0]) / dt, (s.target[1] - s.prevTarget[1]) / dt];\n s.prevTarget = [s.target[0], s.target[1]];\n let k1: number;\n let k2: number;\n if (s.w * dt < s.z) {\n k1 = s.k1;\n k2 = Math.max(s.k2, (dt * dt) / 2 + (dt * s.k1) / 2, dt * s.k1);\n } else {\n const t = Math.exp(-s.z * s.w * dt);\n const i = 2 * t * (s.z <= 1 ? Math.cos(dt * s.d) : Math.cosh(dt * s.d));\n const rr = t * t;\n const o = dt / (1 + rr - i);\n k1 = (1 - rr) * o;\n k2 = dt * o;\n }\n for (const c of [0, 1] as const) {\n s.value[c] += s.velocity[c] * dt;\n s.velocity[c] += ((s.target[c] + tv[c] * s.k3 - s.value[c] - s.velocity[c] * k1) * dt) / k2;\n }\n}\n","// The AMBIENT — the mat's clocks and the gobo's tilt follower, and the policy that lets a quiet\n// desk go still (design-015 §4.6, D-D9): the wind is a clock, and a clock is a frame, so a breeze\n// that never stops is a desk that never idles. Three modes: `live` — the prototype's default,\n// the wind at the display rate forever; `idle` (the default) — the wind, the grain's drift, the\n// blue noise's re-roll and the tilt run while the pointer moved or a gesture or flight ran within\n// `idleMs`, then the wind's SPEED eases to zero over `settleMs` (the leaves slow and stop) and the\n// desk idles at ZERO submits; `still` — no wind, no tilt, ever (reduced motion ⇒ still). A parity\n// still PINS the clocks (`pin`): the frame is the scene's, the tilt bypassed, the noise fixed.\n//\n// The ease is on the clock's RATE, not in the shader (D-D2a-world.2): the wind pass and every\n// WGSL stay as the oracle pinned them, so a still frame at any goboTime is the oracle's frame.\n// Pure: a fake clock and a fake random drive it in the tests; the host hands it `now` and dt.\n\nimport { smoothstep } from \"../lattice/lod\";\nimport { HERO_MATRIX, type MatFrame } from \"../mat/layout\";\nimport { tilted } from \"../mat/projector\";\nimport { type SecondOrder, secondOrder, stepSecondOrder } from \"../mat/tilt\";\nimport { MAT_GRID } from \"../theme\";\n\nexport type AmbientMode = \"live\" | \"idle\" | \"still\";\n\nexport interface AmbientOptions {\n /** `idle` by default (design-015 D-D9). */\n readonly mode?: AmbientMode;\n /** How long after the last touch the wind keeps blowing, ms (20 000). */\n readonly idleMs?: number;\n /** How long the wind takes to ease to still once idle, ms (2 000). */\n readonly settleMs?: number;\n /** Seconds of gobo time per second at full speed (theme.ts `MAT_GRID.gobo.wind`). */\n readonly wind?: number;\n /** Radians of projector tilt per unit of smoothed pointer NDC (theme.ts `MAT_GRID.gobo.tilt`). */\n readonly tilt?: number;\n /** The OS asked for reduced motion: the mode is `still` whatever was set. */\n readonly reducedMotion?: boolean;\n /** The blue noise's re-roll (Math.random); a test's fake. */\n readonly random?: () => number;\n}\n\nexport type AmbientPhase = \"live\" | \"easing\" | \"still\" | \"pinned\";\n\nexport interface AmbientState {\n readonly mode: AmbientMode;\n readonly phase: AmbientPhase;\n /** The wind's speed, 0 … 1 of full. */\n readonly speed: number;\n readonly reducedMotion: boolean;\n readonly pinned: boolean;\n}\n\n/** A pinned still's clocks (a parity scene): whatever is absent keeps the engine's still values. */\nexport interface AmbientPin {\n readonly time?: number;\n readonly goboTime?: number;\n readonly noise?: readonly [number, number];\n}\n\nexport interface Ambient {\n /** The pointer moved, a gesture or a flight ran: the wind (re)starts its `idleMs`. */\n touch(now: number): void;\n /** Advance the clocks by `dt` seconds at `now` ms, the tilt following `pointer` (NDC, or null before the pointer was seen); `live` = another frame is wanted. */\n step(dt: number, now: number, pointer: readonly [number, number] | null): { readonly frame: MatFrame; readonly live: boolean };\n /** The frame as the clocks stand, NOT advanced (the pinned one while pinned) — the desk behind the hand stands still (§8, D7). */\n frame(): MatFrame;\n /** Pin the clocks (a still) or unpin (`null`). Pinned, `step` returns the pinned frame and wants no frame. */\n pin(frame: AmbientPin | null): void;\n configure(opts: Pick<AmbientOptions, \"mode\" | \"idleMs\" | \"settleMs\" | \"reducedMotion\">): void;\n state(): AmbientState;\n /** The clocks as they stand (a rig's witness). */\n clocks(): { readonly time: number; readonly goboTime: number };\n}\n\nexport const AMBIENT_DEFAULTS = { mode: \"idle\" as AmbientMode, idleMs: 20_000, settleMs: 2_000 } as const;\n\nexport function createAmbient(opts: AmbientOptions = {}): Ambient {\n let mode: AmbientMode = opts.mode ?? AMBIENT_DEFAULTS.mode;\n let idleMs = opts.idleMs ?? AMBIENT_DEFAULTS.idleMs;\n let settleMs = opts.settleMs ?? AMBIENT_DEFAULTS.settleMs;\n let reducedMotion = opts.reducedMotion ?? false;\n const wind = opts.wind ?? MAT_GRID.gobo.wind;\n const tiltStrength = opts.tilt ?? MAT_GRID.gobo.tilt;\n const random = opts.random ?? Math.random;\n const tilt: SecondOrder = secondOrder();\n let time = 0;\n let goboTime = 0;\n let noise: readonly [number, number] = [0, 0];\n let goboMatrix = HERO_MATRIX;\n let touchedAt = Number.NEGATIVE_INFINITY;\n let pinned: AmbientPin | null = null;\n let speed = 0;\n let phase: AmbientPhase = \"still\";\n\n const effectiveMode = (): AmbientMode => (reducedMotion ? \"still\" : mode);\n /** The wind's speed at `now` under the policy: 1 within the idle window, easing to 0 over the settle, 0 past it. */\n const speedAt = (now: number): number => {\n const m = effectiveMode();\n if (m === \"still\") return 0;\n if (m === \"live\") return 1;\n const since = now - touchedAt;\n if (since <= idleMs) return 1;\n return 1 - smoothstep(0, settleMs, since - idleMs);\n };\n\n const pinnedFrame = (p: AmbientPin): MatFrame => ({ time: p.time ?? 0, goboTime: p.goboTime ?? 0, goboMatrix: HERO_MATRIX, noise: p.noise ?? [0, 0] });\n\n return {\n touch(now) { touchedAt = now; },\n step(dt, now, pointer) {\n if (pinned !== null) {\n phase = \"pinned\";\n speed = 0;\n return { frame: pinnedFrame(pinned), live: false };\n }\n speed = speedAt(now);\n let tiltLive = false;\n if (effectiveMode() === \"still\") {\n tilt.target = [0, 0]; tilt.prevTarget = [0, 0]; tilt.value = [0, 0]; tilt.velocity = [0, 0];\n goboMatrix = HERO_MATRIX;\n } else {\n // the tilt follows the live pointer through the second-order filter (before it was seen, untilted); it settles on its own\n tilt.target = pointer === null ? [0, 0] : [Math.min(Math.max(pointer[0], -1), 1), Math.min(Math.max(pointer[1], -1), 1)];\n stepSecondOrder(tilt, dt);\n const v = tilt.velocity;\n goboMatrix = tilted(HERO_MATRIX, tilt.value[0] * tiltStrength, tilt.value[1] * tiltStrength, (v[0] + v[1]) * 0.35 * tiltStrength);\n tiltLive = Math.abs(tilt.value[0] - tilt.target[0]) + Math.abs(tilt.value[1] - tilt.target[1]) + Math.abs(v[0]) + Math.abs(v[1]) > 1e-4;\n // The follower is part of the wind's clock: once the wind has eased to STILL (idle, past idleMs + settleMs — the\n // pointer has not moved for that long), the filter's tail is not a reason for a frame (ζ = 0.3 rings for seconds\n // under 1e-4 — B7's trap on the tilt): it SNAPS to its target and the desk idles at zero submits (§4.6, D-D9).\n if (speed <= 0 && tiltLive) {\n tilt.value = [tilt.target[0], tilt.target[1]]; tilt.velocity = [0, 0];\n goboMatrix = tilted(HERO_MATRIX, tilt.value[0] * tiltStrength, tilt.value[1] * tiltStrength, 0);\n tiltLive = false;\n }\n }\n if (speed > 0) {\n // the prototype's clocks at the wind's speed: the grain drifts, the gobo blows (a touch faster as the tilt swings), the noise re-rolls\n time += dt * speed;\n goboTime += dt * (wind + (tilt.velocity[0] + tilt.velocity[1]) * 0.5) * speed;\n noise = [random(), random()];\n }\n phase = speed >= 1 ? \"live\" : speed > 0 ? \"easing\" : \"still\";\n return { frame: { time, goboTime, goboMatrix, noise }, live: speed > 0 || tiltLive };\n },\n frame: () => (pinned !== null ? pinnedFrame(pinned) : { time, goboTime, goboMatrix, noise }),\n pin(frame) { pinned = frame; },\n configure(o) {\n if (o.mode !== undefined) mode = o.mode;\n if (o.idleMs !== undefined) idleMs = o.idleMs;\n if (o.settleMs !== undefined) settleMs = o.settleMs;\n if (o.reducedMotion !== undefined) reducedMotion = o.reducedMotion;\n },\n state: () => ({ mode, phase, speed, reducedMotion, pinned: pinned !== null }),\n clocks: () => ({ time, goboTime }),\n };\n}\n","// The WORLD half of a kind (design-015 §5.2's `ObjectKind`; D2a-world). D2a-render gave the\n// ground a kind's RENDER half — `KindProgram`: its name, its stratum, its pass made on the mat —\n// and left the world out of it. This is the rest: how an ENTITY of the kind becomes the record\n// its pass draws, on the same CPU mirror the pick reads (design-015 §4.5). The builder\n// (compose/builder.ts) hands every object of the current nav frame to its kind through an\n// `ObjectContext` — the entity's rect in world units, its props, the flux the builder stepped\n// for it, the theme's look for the kind, the lamp, the slot's view — and takes back a geometry\n// (`resolve`) and a record (`record`); the pick source asks the same geometry what part is under\n// a world point (`hit`). A kind never reads the world: what it needs arrives in the context, and\n// so the same kind draws for the Node oracle, a test's fake world and the app alike.\n//\n// COORDINATES (the brief's pinned detail): ICE's `Position` is the object's TOP-LEFT and `Size`\n// its extent; the prototype's objects — and every law under `resolve` — are CENTRED. The builder\n// converts in ONE place (`rectOf`): a kind sees `ObjectRect { cx, cy, w, h }` and nothing else.\n//\n// PICK ANSWERS (core's `FramePickSource`): `\"content\"` and `\"frame\"` are the widget ITSELF — a\n// tap selects it, a drag moves it; any other string is a PART (a tap writes `PartTap`, a drag\n// that starts on it is not a move); `null` is a miss (the source answers `outside`). So a note\n// answers `content`, a mini mat `content` (its face) or `frame` (its border) — both move and\n// select it, as in the prototype — and the real parts (a notebook's turn zone, a board's marker)\n// arrive with D3.\n\nimport type { Component, Entity, HeldToolDef, Relation, Tag, WidgetType, World } from \"@ice/core\";\nimport type { TypingDocs } from \"../docs\";\nimport type { RasterBudget } from \"../engine/budget\";\nimport type { RasterQueue } from \"../engine/rasters\";\nimport type { KindPass, KindProgram, StratumName } from \"../kind\";\nimport type { DeskEditor, TextPart } from \"../kit/editor\";\nimport type { ChildShape, FaceLaw, InsideView } from \"../kit/inside\";\nimport type { Lamp } from \"../kit/light\";\nimport type { LendHost, Lent, ServiceKey, Services } from \"../kit/services\";\nimport type { Rect } from \"../kit/nav\";\nimport type { GridConfig, View } from \"../kit/view\";\nimport type { MarkFrame } from \"../marks/layout\";\nimport type { GroundTheme, Palette, ThemeName } from \"../theme\";\n\n/**\n * What the builder hands a CONTAINER kind's `record` about its inside (D2b): the bounds of the\n * children's rects (`content`, null = empty — the arrival is the empty desk's), the inside's\n * embedding and camera under this slot's camera (`view`, from the kind's own `face` — the\n * flight's numbers, so the face's far LOD and the live inside agree to the bit), and the children\n * as their kinds chip them (`chips`, in the inside's own units — the kind maps them through `view.M`).\n */\nexport interface InsideContext {\n readonly content: Rect | null;\n readonly view: InsideView | null;\n readonly chips: readonly ChildShape[];\n}\n\n/** An object's rect on its desk, world units, CENTRED — converted from ICE's top-left `Position` + `Size` by the builder, once. */\nexport interface ObjectRect {\n readonly cx: number;\n readonly cy: number;\n readonly w: number;\n readonly h: number;\n}\n\n/**\n * What moves, per entity — the builder's springs, each 0..1 and SNAPPED to its target when settled\n * (the B7 trap: a spring that never quite lands keeps the desk awake forever). `lift` follows the\n * `Grab` fact (held), `hover` the local mouse pointer's exact hit (the B9 pairing — never the\n * dead-band `Targets`), `fade` the delete ghost (1 alive … 0 gone). `ring` is ALWAYS 0 from the\n * builder: the kinds' own selection ring retired at D4a (the marks draw the selection) and its\n * spring went at D6; the Node oracle alone hands a ring, for the baseline against the prototype.\n */\nexport interface ObjectFlux {\n readonly lift: number;\n readonly hover: number;\n readonly ring: number;\n readonly fade: number;\n}\n\n/** A kind's answer to \"what is under this world point\" — the widget itself (`content`/`frame`), a part, or nothing. */\nexport type ObjectHit = \"content\" | \"frame\" | (string & {});\n\n/**\n * A slot of the held bar for a kind in hand (design-015 §8 — \"the kind's tools take the middle\"): core's `HeldToolDef`\n * (D3t-a — widget/held-tools.ts), declared by the kind and carried onto its widget type by `defineObject`, so the one\n * keymap and the one bar reach it through the engine: a `mode` (the tool in hand, core's `HeldTool`), an `action` (an op),\n * or — no `kind` — declared only (dim; a later slice builds it). `glyph` names one of the bar's.\n */\nexport type { HeldToolDef } from \"@ice/core\";\n\n/**\n * The kind's OPENING (design-015 §8; D4b) — what \"pick it up\" means for this kind. `extent`: the OPEN rect in the object's\n * own desk units, centred as its rect is and UNTURNED (the builder turns it with the object): a notebook's spread (twice the\n * case's width, left of the spine), a board's face, a calendar's month — what the reading size fits into the view. `pose`: how\n * the reading size is reached — `camera` (a flat kind, the default: the held slot's camera maps the extent to the held rect\n * and the kind draws at rest) or `eye` (a thing with height: the camera keeps the desk's zoom and the kind RISES toward the\n * desk eye by `ctx.held.grow`). `openness`: how far the kind's own open motion has come (0 shut … 1 open) — the put-down\n * flies home once it is under 0.35 and lands once under 0.02 (absent: 0, a kind with no motion of its own). `spread`: a\n * two-page extent that opens one page at a time on a portrait phone (Q-p); `page`: which of its two is in view there — 0 the\n * right (the default) … 1 the left, flux the view glides by (D3t-b: the notebook reads page by page). `tools`: the held bar's\n * slots (D3t-a: live — a mode or an action each); `tool`: the mode in hand when it is picked up, from its props (default: the first mode);\n * `swatches`: the colour a slot shows instead of its glyph (the board's four inks — the product's palette, through the look).\n */\nexport interface OpenBinding {\n extent(ctx: Pick<ObjectContext, \"rect\" | \"props\">): ObjectRect;\n readonly pose?: \"camera\" | \"eye\";\n openness?(ctx: Pick<ObjectContext, \"entity\" | \"local\">): number;\n readonly spread?: boolean;\n page?(ctx: Pick<ObjectContext, \"entity\" | \"local\">): number;\n readonly tools?: readonly HeldToolDef[];\n tool?(props: Readonly<Record<string, unknown>>): string;\n swatches?(look: unknown): Readonly<Record<string, string>>;\n}\n\n/**\n * What the builder hands the object IN HAND (D4b, beside its flux): the carry amount `e` (0 on the desk … 1 in hand — the\n * lift's height, the focus behind), whether it should be OPEN (past 42 % of the pickup going up; never going down), the\n * factor an `eye` kind must reach by rising (1 for a flat kind — the camera did it), and `snap` (a still: the open motion\n * sits at its target, no spring).\n */\nexport interface HeldContext {\n readonly e: number;\n readonly open: boolean;\n readonly grow: number;\n readonly snap: boolean;\n}\n\n/**\n * Everything a kind is handed for one entity, one frame. The props are the widget type's group\n * fields as the builder cached them (refreshed from the change journal, never re-read per frame —\n * the 09-23 profile); `look` is what the kind's own `theme()` made of the palette in force.\n */\nexport interface ObjectContext {\n readonly entity: Entity;\n readonly rect: ObjectRect;\n readonly props: Readonly<Record<string, unknown>>;\n readonly flux: ObjectFlux;\n /** The kind's `theme(palette, name)` result for the theme in force; `undefined` when the kind declares none. */\n readonly look: unknown;\n readonly theme: GroundTheme;\n /** The desk's one lamp — the gobo projector on the desk plane (`lampOf`), world units. */\n readonly lamp: Lamp;\n /** The slot's camera and attachment (CSS px) with the device pixel ratio. */\n readonly view: View & { readonly dpr: number };\n /** The slot's grid: the mat's config (its vinyl, its gobo, its rulers) and the lattice's fade-in. */\n readonly grid: GridConfig;\n /** The frame's dt, SECONDS (the engine's clamped dt). */\n readonly dt: number;\n /**\n * A per-entity asset the HOST pinned through the builder (`DeskBuilder.pin`) — `undefined` = none.\n * Flux, never a world fact. (The note's committed raster moved into its kind's `local` at D2c.)\n */\n readonly asset?: unknown;\n /**\n * The kind's OWN state on this desk — what `ObjectKind.local()` made for it (the note's writing:\n * its layouts, its rasters' residency, the caret, the wipe — D2c); `undefined` when the kind keeps\n * none. Flux, never a world fact; the builder threads it and tells it when an entity is forgotten.\n */\n readonly local?: unknown;\n /** A container's inside, for its `record` (D2b): the content bounds, the view through its face, the children's chips. Absent = not a container, or `resolve`. */\n readonly inside?: InsideContext;\n /** The object is IN HAND (D4b): its carry amount, its open target, the eye kind's rise. Absent = on the desk. */\n readonly held?: HeldContext;\n}\n\n/** What a desk hands a kind's `local()` (D2c): its ROOT pass once the ground is made, the SERVICES lent on this desk, and the builder's doors. */\nexport interface KindHost {\n /** The kind's root pass on this desk's ground; `undefined` before `Ground.create` resolves and after the layer ends. */\n pass(): KindPass | undefined;\n /**\n * THE SERVICES (K8a, kit/services.ts — an open registry by key): what the host lends (its text raster `TEXT_RASTER`, the picture\n * decoder `PICTURE_DECODER`, the app's byte store `BLOB_STORE`, anything in `deskLayer({ services })`) and what any object's DOM\n * half lends (`ObjectHost.lend` — the desk calendar's `PRINT_RASTER`): `use(key)` answers it, or undefined when nothing on this\n * desk lends it (in Node the oracle pins committed rasters and tiles). Absent: a bare host (a test) — no services at all.\n * D-K8a.1: the desk's OWN doors stay fields of this host — `pass`, `children`, `drawn`, `budget`, `rasters`, `remake`, `wake`: the\n * builder's word, its budget, its queue and its loop, made by the desk for each kind and never lent, replaced or taken by a kind.\n */\n use?<T>(key: ServiceKey<T>): T | undefined;\n /** An object's DATA children (D3w, design-015 §5.1 — a board's strokes, a pad's events and pins); absent = none (a test, the oracle). */\n readonly children?: DataChildren | undefined;\n /**\n * The builder's word on what is DRAWN (D6, persistent records): the paint rank of `e` in the last build's root slot, undefined when it\n * was not drawn there. A kind's residency reads it instead of counting its own `record` calls — those come only when a record is\n * remade. Absent (a bare host, the oracle): the kind counts its own.\n */\n readonly drawn?: ((e: Entity) => number | undefined) | undefined;\n /**\n * THE RASTER BUDGET (D6, engine/budget.ts): one ledger for every raster a kind keeps as a cache of its data — a board's ink, a\n * notebook page's CPU raster, the calendar's tiles. A kind charges what it makes with a way to let it go and answers `keeps` for\n * what is on screen; the host trims the ledger once a tick. Absent: nothing is counted or evicted.\n */\n readonly budget?: RasterBudget | undefined;\n /**\n * THE FRAME'S RASTER QUEUE (K6b, engine/rasters.ts): a raster the zoom asks again (a new band, a new density) or an object come on\n * screen holding none is ASKED here, with a priority, and made in the queue's turn under the frame's budget — the kind draws what\n * it has meanwhile. Absent (a bare host, the oracle): a kind rasters in the frame that asks, as before.\n */\n readonly rasters?: RasterQueue | undefined;\n /** `e`'s record remade at the next build (K6b — a raster the queue laid: the record says where its ink is), the desk woken. */\n readonly remake?: ((e: Entity) => void) | undefined;\n /**\n * THE KIND'S WAKE (K7a — registered wakes): something arrived OUTSIDE a frame that changes how the kind draws (a picture\n * decoded, a tile printed, a detail fetched): the kind is ticked at the next frame, and a sleeping loop wakes for it. A\n * kind never polls for what an arrival can tell it. Absent (a bare host, the oracle): its tick is asked every frame.\n */\n readonly wake?: (() => void) | undefined;\n}\n\n/**\n * An object's DATA children as its kind reads them (D3w): entities `ChildOf` the object, never members of the desk's\n * paint order — the `stamp` turns over whenever the set or its order changes (strata's order stamp), and `rows` are the\n * children's values of one component, in sibling order (the oldest stroke first).\n */\nexport interface DataChildren {\n stamp(parent: Entity): number;\n rows<T>(parent: Entity, c: Component<T>): readonly T[];\n /** The children holding `c`, each with its value, in sibling order (D3t-c — a pad's events by entity: the line you point at is one). */\n entries?<T>(parent: Entity, c: Component<T>): readonly { readonly entity: Entity; readonly value: T }[];\n /** A child's one edge `r` — the entity it names (D3t-c — a pin's note), undefined when it names none. */\n target?(child: Entity, r: Relation): Entity | undefined;\n}\n\n/**\n * A kind's own state on ONE desk (D2c) — made once per desk by `ObjectKind.local`, threaded by the\n * builder into every context of the kind as `ctx.local`, and told the frame's clock and each entity's\n * end, so a kind can keep per-entity residency (a raster, a decoded picture) outside the world.\n */\nexport interface KindLocal {\n /** Once a tick, before the draw, with the frame's clock (ms): does the state want a frame now (a wipe, a blink, an asset landed)? */\n tick?(now: number): boolean;\n /**\n * WHEN THE KIND IS NEXT LIVE (K7a — registered wakes, design-015 §2.4): asked after each of its ticks, on the same clock —\n * `now` or before: the next frame (a motion runs: a wipe, a roll, a flight, ink drying); a later time: then (the caret's\n * next blink, a layer let go, midnight); `Infinity`: never on its own — only when the desk's facts move, an input comes, or\n * the kind calls `KindHost.wake`. A loop at rest ticks a kind only when it is due: nothing is polled. Absent while `tick`\n * is declared: due every frame — a kind that never said keeps the desk awake.\n */\n due?(now: number): number;\n /**\n * What has LANDED on `e` so far — a count the kind moves when something arrives that changes how the object looks with no fact\n * of its own moving (a picture decoded, ink replayed, a raster laid, tiles drawn, a wipe ended), never for a running motion (the\n * ink drying, a wipe running, a pen). The builder reads it after it remakes a restless kind's record: a desk object's that moved\n * remakes the blurred desk copy behind the hand (D7 — its stamp saw only the facts). Absent: nothing lands.\n */\n landed?(e: Entity): number;\n /** The entity left this desk for good — its ghost faded, it left the frame, the desk was reset: free what it held. */\n forget?(e: Entity): void;\n /**\n * The entity is drawn LIFTED off the desk's order and away from its facts (D3t-a — a print in a hand, flicked, gliding or\n * flying home): the builder paints it with the carried set, above its siblings, and the pick asks it first where it is drawn.\n */\n lifted?(e: Entity): boolean;\n /**\n * Entities this kind's state says are NOT drawn this frame, of any kind (D3t-c — a note stuck to a day of a month the calendar is\n * not showing): the builder draws none of them and the pick answers `outside` for them. Asked after `tick`, before the draw.\n */\n veils?(): ReadonlySet<Entity>;\n /** The kind's word on a raster it charged to the budget (D6): true = on screen this frame, never evicted now. */\n keeps?(key: string): boolean;\n dispose?(): void;\n}\n\n/** What a kind's `rung` reads (K6b): the object as the builder holds it, its SLOT's zoom (an inside's is its host's face's) and the dpr, and its kind's state on this desk. */\nexport interface RungContext {\n readonly entity: Entity;\n readonly rect: ObjectRect;\n readonly props: Readonly<Record<string, unknown>>;\n readonly zoom: number;\n readonly dpr: number;\n /** The kind's `local()` on this desk (`KindLocal`); undefined when it keeps none. */\n readonly local: unknown;\n /**\n * The object's distance from the view's centre, screen px — the ORDER of what a kind asks at the new zoom (a raster at another band,\n * of the frame raster queue: `KindHost.rasters`). The rung returned never reads it: it is where the camera is.\n */\n readonly px: number;\n}\n\n/**\n * A kind, whole: the render half the ground registers (`KindProgram` — name, stratum, the pass)\n * and the world half the builder and the pick source drive. `G` is the kind's resolved geometry,\n * `R` the record its pass draws, `L` its look (what `theme()` returns).\n */\nexport interface ObjectKind<G = unknown, R = unknown, L = unknown> extends KindProgram<R> {\n /**\n * How far the kind's drawing may reach PAST its rect, world units — its shadow, its lift, its\n * tilt's overhang: the builder's cull margin, and the pick source's pad (`FramePickSource.pad`).\n */\n readonly reach: number;\n /** Components and tags the kind reads beyond its own props (the builder adds them to its change journal). */\n readonly reads?: { readonly components?: readonly Component[]; readonly tags?: readonly Tag[] };\n /**\n * The record reads the view's ZOOM or dpr CONTINUOUSLY (a far-LOD lattice whose lines fade with every step of the zoom) and nothing\n * else of the camera (design-015 §4.3; D6): the builder remakes it whenever they move and reuses it across a pan. A record that\n * reads them only in steps says so with `rung` instead. Absent (and no `rung`) = the record is the facts' and the flux's alone. A\n * composite kind is remade every frame it is drawn whatever it says (its `resolve` steps its own motion).\n */\n readonly rezoom?: boolean;\n /**\n * The record reads the view's zoom or dpr ONLY THROUGH A RUNG (K6b, design-016 §6 — a raster's band): this object's rung under\n * its slot's zoom, and the builder remakes the record only when that moves — a zoom within a rung remakes and writes nothing.\n * Asked of a drawn object whenever its slot's zoom or the dpr moved since its rung was last read, never on a pan; it reads the\n * zoom, never where the camera is. Wins over `rezoom`. A kind whose raster the frame queue makes asks for it HERE (ordered by\n * `ctx.px`) and answers the rung of what it HOLDS — the record shows that until the queue lays the new one (`KindHost.remake`).\n */\n rung?(ctx: RungContext): number;\n /** A host's LIVE law (D5a — the dev panel's door, `handle.tuneLaw`): the kind resolves under it from the next build. Absent, its law is fixed. */\n tune?(law: unknown): void;\n /** The entity's geometry this frame, from its rect, its props and its flux — the prototype's `resolve*`. */\n resolve(ctx: ObjectContext): G;\n /** The record the kind's pass draws for that geometry — the prototype's instance. */\n record(geometry: G, ctx: ObjectContext): R;\n /** The CPU mirror on the SAME geometry the pass drew: the part under a world point, or null for a miss. */\n hit(geometry: G, wx: number, wy: number): ObjectHit | null;\n /**\n * A CONTAINER kind's FACE as drawn — the window its inside shows through, in the desk's units\n * (the mini mat: the sheet inset by its printed border, through its springs). The builder builds\n * the live inside through it and the nav geometry seam answers core's nav with it (design-015 §9).\n * Absent = the kind holds no desk.\n */\n face?(geometry: G): Rect | undefined;\n /**\n * A CONTAINER kind's face law (K8a, kit/inside.ts `FaceLaw`): its face's corner radius, the most chips its face draws and the\n * finishes it draws them in — the container's own numbers, never the kit's. Absent on a container: square, no chips.\n */\n readonly faceLaw?: FaceLaw;\n /**\n * The kind's CHIP — its far impostor inside a container's face (MINIMAT.md §5; K8a: any kind's): the child as a `ChildShape` in\n * ITS desk's units, in a finish the container draws — a note as paper with its writing greeked, a mini mat as vinyl with its\n * border, a plugin kind as either or a finish of a plugin container's; `null` = nothing to chip. Absent = the kind has no chip\n * (the oracle's prints): inside a far face it is not drawn.\n */\n chip?(geometry: G, ctx: ObjectContext): ChildShape | null;\n /** The grid a CONTAINER kind's inside draws with (the mini mat: the desk's fade-in, the mat in its vinyl, no rulers). Absent = the root's. */\n insideGrid?(ctx: Pick<ObjectContext, \"props\" | \"look\">, root: GridConfig): GridConfig;\n /**\n * The silhouette the desk's MARKS go around (D4a — the brackets, a member's ticks, several's union, the tape):\n * the geometry's centre, half extents AS DRAWN (the lift's scale in), turn and corner, world units. Absent =\n * the rect, square to the mat (`rectFrame`).\n */\n frame?(geometry: G): MarkFrame;\n /** The kind's colours from the host's palette, per theme — the look `record` reads (`ctx.look`). */\n theme?(palette: Palette, name: ThemeName): L;\n /** The kind's own state on one desk (`ctx.local`) — made by the host once per desk; absent = none (D2c). */\n local?(host: KindHost): KindLocal;\n /** The kind's OPENING (design-015 §8, D4b): what picking it up means. Absent = the object never opens (`ops.open` refuses it). */\n readonly open?: OpenBinding;\n}\n\n/**\n * What the host lends a kind's DRIVERS (D7 #5, D-D7-A.3 — the hand onto the kind's state: a pen, a carry, a leaf, the\n * calendar's writing and marks). A kind declares them in `defineObject` (`ObjectDef.drivers`); the host makes them once per\n * desk, generically, and ticks them before the kinds' clocks — a third-party openable kind with held tools gets its driver\n * the same way. Everything a driver needs comes through here: the world, the document's doors (docs.ts), the kind's own\n * local and look, the builder's word (geometry as drawn, a held point into the world, the hand), the builder's give.\n */\nexport interface KindDriverHost {\n readonly world: World;\n /** The document's doors — `current()`, the writer's gate, the commit door, the history doors (docs.ts). */\n readonly docs: TypingDocs;\n /** This kind's own local (`ObjectKind.local`), if it declared one. */\n readonly local: KindLocal | undefined;\n /** This kind's look as the desk composed it (the swatches a pen draws in). */\n readonly look: () => unknown;\n /** Is `e` an object of this kind? */\n readonly isKind: (e: Entity) => boolean;\n /** Is `e` an object of the kind named — undefined when that kind is not on this desk. */\n readonly kind: (name: string) => ((e: Entity) => boolean) | undefined;\n /**\n * Does `e`'s object type PROVIDE the key (K8a — `defineObject({ provides })`: the calendar asks after what is `PINNABLE`)? Undefined\n * when no object type on this desk provides it. A kind asks after a capability, never after another kind's name.\n */\n readonly provides: (key: string) => ((e: Entity) => boolean) | undefined;\n /** The builder's word: an object's geometry as drawn (the kind's `G`), a held-screen point into its world, the hand. */\n readonly geometryOf: (e: Entity) => unknown;\n readonly heldToWorld: (e: Entity, x: number, y: number) => readonly [number, number] | undefined;\n readonly hand: () => { readonly entity: Entity; readonly landing: boolean; readonly frame: { readonly cx: number; readonly cy: number; readonly s: number } } | undefined;\n /** The builder's give for a drag the kind refuses (a taped print meets the tape — D4a). */\n readonly refused: (e: Entity) => void;\n /** Ask the desk for a frame (something landed, a mark moved). */\n readonly wake: () => void;\n}\n\n/** A kind's driver on one desk: ticked once a frame before the kinds' clocks; idle when it has nothing to follow (D7 #14). */\nexport interface KindDriver {\n follow(now: number): void;\n /** Nothing to follow this frame — nothing in hand, no press, no rest or roll owed: the host may skip `follow` (the idle-tick budget). Absent: never skipped. */\n idle?(): boolean;\n dispose?(): void;\n}\n\n/**\n * An object's DOM HALF (K4b, design-016 §5 · K-L2) — what its kind needs of the browser, DECLARED with the object as its drivers\n * are (`defineObject({ host })`): the desk layer builds what the registered objects declare and never finds a half by type or\n * names a kind. Three moments, in the layer's order:\n * - `lend`, before any kind's local: SERVICES only a browser can make, each under its key (K8a, kit/services.ts — the desk\n * calendar lends `PRINT_RASTER`, in the host's hand, none without a text raster), handed what is lent so far (the host's, then\n * the objects' before it) and the desk's wake for a service whose work lands later (`LendHost.wake` — K7a's sleeping loop steps);\n * any kind's world half `use`s them (`KindHost.use`), a DOM half too (`ObjectDomHost.use`);\n * - `text`, once the drivers are made: the object's TEXT PARTS (K8a, kit/editor.ts `TextPart`) — the parts of its objects that\n * LEASE the desk's ONE editor: a part with a `tap` the desk routes every tap to (the note's body), a part without one its own\n * half leases at event time (the desk calendar's day line). The editor is the DESK's (desk/host/editor.ts): no kind makes it;\n * - `mount`, after that: a screen-space half, handed the editor like every half (the desk calendar's days and pen lease it). A\n * mounted half is ended by what it joins — the calendar's by the calendar's driver.\n */\nexport interface ObjectHost {\n readonly lend?: (host: LendHost) => readonly Lent[];\n readonly text?: (host: ObjectDomHost) => readonly TextPart[] | undefined;\n readonly mount?: (host: ObjectDomHost) => void;\n}\n\n/**\n * What the host lends an object's DOM half (K4b): the screen-space container, the object the half was declared on and ITS\n * driver, its kind's look, and the builder's word — a driver host's fields, and the few a browser half adds.\n */\nexport interface ObjectDomHost {\n /** The host's container (screen space): a half's elements go in it, its taps are read on it. */\n readonly container: HTMLElement;\n readonly world: World;\n /** The document's doors (docs.ts) — a half that writes, writes through them. */\n readonly docs: TypingDocs;\n /** The services lent on this desk (K8a — `KindHost.use`'s registry): a DOM half uses them by key as a world half does. */\n readonly use: Services[\"use\"];\n /** The desk's ONE focused editor (K8a — the desk makes it; every kind leases it: kit/editor.ts `EditorLease`). */\n readonly editor: DeskEditor;\n /** The object the half was declared on — its compiled widget type (its props' groups). */\n readonly object: WidgetType;\n /** The object's own driver (`defineObject({ drivers })`), if it declared one. */\n readonly driver: KindDriver | undefined;\n /** The object's kind's look as the desk composed it. */\n readonly look: () => unknown;\n /** The builder's word: an object's geometry as drawn, the hand, a held-screen point into its world. */\n readonly geometryOf: KindDriverHost[\"geometryOf\"];\n readonly hand: KindDriverHost[\"hand\"];\n readonly heldToWorld: KindDriverHost[\"heldToWorld\"];\n /** Ask the desk for a frame. */\n readonly wake: () => void;\n /** A writing session ends after this long without input, ms (`DeskLayerOptions.idleMs`); absent: the half's own. */\n readonly idleMs?: number | undefined;\n}\n\n/** The strata a kind may declare — re-exported beside the contract for a kind's author. */\nexport type { StratumName };\n\n/** ICE's top-left `Position` + `Size` → the centred rect every law reads: the ONE conversion. */\nexport function rectOf(pos: { readonly x: number; readonly y: number }, size: { readonly w: number; readonly h: number }): ObjectRect {\n return { cx: pos.x + size.w / 2, cy: pos.y + size.h / 2, w: size.w, h: size.h };\n}\n\n/** An object's marks' silhouette when its kind draws none of its own: the rect, square to the mat, no corner. */\nexport const rectFrame = (r: ObjectRect): MarkFrame => ({ cx: r.cx, cy: r.cy, hx: r.w / 2, hy: r.h / 2, angle: 0, r: 0 });\n\n/** The flux of an object at rest: down, unhovered, unselected, whole. */\nexport const FLUX_REST: ObjectFlux = { lift: 0, hover: 0, ring: 0, fade: 1 };\n\n/** A prop read with a type and a default — the kinds' one door to `ctx.props`. */\nexport const numberProp = (props: Readonly<Record<string, unknown>>, name: string, fallback: number): number => {\n const v = props[name];\n return typeof v === \"number\" && Number.isFinite(v) ? v : fallback;\n};\nexport const stringProp = (props: Readonly<Record<string, unknown>>, name: string, fallback: string): string => {\n const v = props[name];\n return typeof v === \"string\" ? v : fallback;\n};\n\n/** Is this opaque widget binding a desk kind — the world half present beside the program? */\nexport function isObjectKind(binding: unknown): binding is ObjectKind {\n if (typeof binding !== \"object\" || binding === null) return false;\n const k = binding as Partial<ObjectKind>;\n return typeof k.name === \"string\" && typeof k.stratum === \"string\" && typeof k.create === \"function\" && typeof k.resolve === \"function\" && typeof k.record === \"function\" && typeof k.hit === \"function\" && typeof k.reach === \"number\";\n}\n","// The LASER from the snap's facts (design-015 §7, *Marks on the Mat* Q-c; D4a) — pure. The snap law is\n// the kernel's (`computeSnapGuides`, run by core's snap system, which writes each guide as a `GuideLine\n// { axis, at }` and each equal gap as a `SpacingBar { axis, from, to, perp, gap }`, world units); what the\n// laser DRAWS is desk.js `setGuides`, number for number: a guide is bright over the objects that align on\n// it — every rect whose edge or centre lies on its line, and the dragged set — 14 px past them, with a\n// flare at each aligned corner (a centre's flare at the middle of each object); a centre guide is dotted.\n// Whether a guide is a centre is read off the dragged set (the kernel's `center` pair is the one that\n// aligns the dragged set's CENTRE; every other pair aligns an edge of it), so a GuideLine needs no type.\n\nimport type { MarkBar, MarkGuide } from \"./layout\";\n\n/** A world rect, top-left to bottom-right. */\nexport interface WorldBox { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number }\n/** A guide as the world states it: a line along `axis` at world `at` (kernel `SnapGuide.position`); its type when the caller knows it. */\nexport interface WorldGuide { readonly axis: \"x\" | \"y\"; readonly at: number; readonly type?: \"edge\" | \"center\" }\n/** An equal gap as the world states it (core `SpacingBar`): world units. */\nexport interface WorldBar { readonly axis: \"x\" | \"y\"; readonly from: number; readonly to: number; readonly perp: number; readonly gap: number }\nexport interface LaserCamera { readonly x: number; readonly y: number; readonly zoom: number }\n\n/** desk.js `setGuides`: the span a guide is bright over reaches this far (CSS px) past the objects it aligns. */\nexport const LASER_PAST = 14;\n\n/**\n * The laser on screen: each guide's line, type, bright span and flares; each gap's bar. `others` are the rects the\n * snap aligned against (the objects not dragged), `dragged` the dragged set's union (null: none — a guide with nothing\n * dragged is still drawn, over what lies on it). An object lies on a line when its edge or centre is within half a\n * screen px of it (desk.js's 0.05 world units at zoom 1 — relative here, so it holds at every zoom).\n */\nexport function laserOf(guides: readonly WorldGuide[], bars: readonly WorldBar[], others: readonly WorldBox[], dragged: WorldBox | null, cam: LaserCamera, past = LASER_PAST): { readonly guides: MarkGuide[]; readonly bars: MarkBar[] } {\n const z = cam.zoom;\n const eps = 0.5 / z;\n const sx = (x: number): number => (x - cam.x) * z;\n const sy = (y: number): number => (y - cam.y) * z;\n const out: MarkGuide[] = [];\n for (const g of guides) {\n const isX = g.axis === \"x\";\n const lo = (b: WorldBox): number => (isX ? b.x0 : b.y0);\n const hi = (b: WorldBox): number => (isX ? b.x1 : b.y1);\n const near = (v: number): boolean => Math.abs(v - g.at) < eps;\n const on = (b: WorldBox): boolean => near(lo(b)) || near(hi(b)) || near((lo(b) + hi(b)) / 2);\n const type = g.type ?? (dragged !== null && near((lo(dragged) + hi(dragged)) / 2) ? \"center\" : \"edge\");\n const boxes = others.filter(on);\n if (dragged !== null) boxes.push(dragged);\n let s0 = Number.POSITIVE_INFINITY;\n let s1 = Number.NEGATIVE_INFINITY;\n const points: [number, number][] = [];\n for (const b of boxes) {\n const a0 = isX ? b.y0 : b.x0;\n const a1 = isX ? b.y1 : b.x1;\n s0 = Math.min(s0, a0);\n s1 = Math.max(s1, a1);\n if (type === \"center\") points.push(isX ? [g.at, (a0 + a1) / 2] : [(a0 + a1) / 2, g.at]);\n else points.push(isX ? [g.at, a0] : [a0, g.at], isX ? [g.at, a1] : [a1, g.at]);\n }\n if (boxes.length === 0) { s0 = 0; s1 = 0; }\n const toScreen = (p: readonly [number, number]): readonly [number, number] => [sx(p[0]), sy(p[1])];\n const span: readonly [number, number] = isX ? [sy(s0) - past, sy(s1) + past] : [sx(s0) - past, sx(s1) + past];\n out.push({ axis: g.axis, at: isX ? sx(g.at) : sy(g.at), type, span: boxes.length === 0 ? [0, 0] : span, points: points.map(toScreen) });\n }\n const outBars: MarkBar[] = bars.map((b) => (b.axis === \"x\"\n ? { axis: \"x\", from: sx(b.from), to: sx(b.to), perp: sy(b.perp), gap: b.gap }\n : { axis: \"y\", from: sy(b.from), to: sy(b.to), perp: sx(b.perp), gap: b.gap }));\n return { guides: out, bars: outBars };\n}\n\n/** The key a guide set strikes on (desk.js: a NEW alignment flashes) — the axes and positions, then the gaps, at 0.1 (desk.js ran the two lists together; a `#` keeps them apart). */\nexport function laserKey(guides: readonly WorldGuide[], bars: readonly WorldBar[]): string {\n return `${guides.map((g) => `${g.axis}${g.at.toFixed(1)}`).join(\"|\")}#${bars.map((b) => b.gap.toFixed(1)).join(\"|\")}`;\n}\n","// ASSEMBLE the frame's marks — pure (design-015 §7; D4a): the one place the desk's STATE becomes what\n// its chrome draws, shared by the builder (compose/marks.ts, from the world) and the Node oracle (from a\n// scene's still), so the two draw the same marks for the same state by construction. The rules are\n// desk.js's `drawChrome`, number for number: one selected object wears the brackets (its lock-on and\n// presence the caller's clocks; an object that has just left keeps its fading brackets while no several\n// is selected); several wear member ticks under ONE union square to the mat; what the vellum touches is\n// ticked at once (never the tape — Q-g), the count riding the cursor; released, the vellum folds onto\n// the union on the island ease (onto the one object, fading, when it gathered one); knobs only where an\n// object resizes, is not taped and nothing moves it; the laser from the snap's facts (marks/laser.ts); a\n// taped object's tape; your extent on the rulers while something is selected and no vellum is drawn.\n\nimport { easeIsland } from \"./ease\";\nimport { type LaserCamera, laserOf, type WorldBar, type WorldBox, type WorldGuide } from \"./laser\";\nimport { frameOnScreen, framesBox, type MarkBox, type MarkFrame, type MarkObject, type MarkRuler, type MarksInput, type MarkTape, type MarkUnion } from \"./layout\";\nimport { MARKS } from \"../theme\";\n\n/** One object as its marks need it — the builder's cached facts and flux, or a still's. */\nexport interface MarkedObject {\n /** Its silhouette AS DRAWN, world units (the kind's `frame` on this frame's geometry). */\n readonly frame: MarkFrame;\n /** ICE's rect (Position + Size), unturned, world units — what the snap aligned and the vellum touches. */\n readonly rect: WorldBox;\n readonly selected: boolean;\n /** Taped down (`Locked`): no knobs, and the vellum passes over it. */\n readonly locked: boolean;\n /** Carried (`Grab`): its knobs hide, and it is the laser's dragged set. */\n readonly moving: boolean;\n readonly resizable: boolean;\n /** The selection's clocks: the lock-on's LINEAR progress and the presence (1 at rest; the leave fades it). */\n readonly lock: { readonly t: number; readonly a: number };\n /** The tape's clocks: each strip's press (0..1, linear) and the tape's presence (0 = none drawn). */\n readonly tape: { readonly press: readonly [number, number]; readonly a: number };\n}\n\nexport interface MarksState {\n readonly view: MarksInput[\"view\"];\n /** The ROOT slot's camera (`Camera.x/y` = the view's world top-left). */\n readonly cam: LaserCamera;\n readonly night: boolean;\n /** The desk's objects in paint order. */\n readonly objects: readonly MarkedObject[];\n /** Several's union: its lock-on (linear) and presence. */\n readonly union: { readonly t: number; readonly a: number };\n /** The vellum being drawn: its WORLD rect (core's `MarqueeBuffer.rect`) and the cursor on screen. */\n readonly marquee: { readonly rect: WorldBox; readonly pointer: { readonly x: number; readonly y: number } | null } | null;\n /** The vellum released: its last rect ON SCREEN and the fold's linear progress. */\n readonly fold: { readonly rect: MarkBox; readonly t: number } | null;\n /** The snap's facts, world units (core's `GuideLine` / `SpacingBar`). */\n readonly guides: readonly WorldGuide[];\n readonly bars: readonly WorldBar[];\n readonly strike: number;\n /** The rulers printed on this desk (their margin and band, CSS px), or null. */\n readonly ruler: { readonly margin: number; readonly band: number } | null;\n}\n\nconst clamp01 = (x: number): number => Math.min(Math.max(x, 0), 1);\nconst lerpBox = (a: MarkBox, b: MarkBox, e: number): MarkBox => ({ x0: a.x0 + (b.x0 - a.x0) * e, y0: a.y0 + (b.y0 - a.y0) * e, x1: a.x1 + (b.x1 - a.x1) * e, y1: a.y1 + (b.y1 - a.y1) * e });\nconst touches = (a: WorldBox, b: WorldBox): boolean => a.x0 <= b.x1 && a.x1 >= b.x0 && a.y0 <= b.y1 && a.y1 >= b.y0;\n\n/** The vellum's world rect, normalised (a drag may run any way). */\nexport const normalBox = (b: WorldBox): WorldBox => ({ x0: Math.min(b.x0, b.x1), y0: Math.min(b.y0, b.y1), x1: Math.max(b.x0, b.x1), y1: Math.max(b.y0, b.y1) });\n\n/** What the vellum touches — never the tape (Q-g); core's `queryHits` on the same rects. */\nexport function vellumHits(objects: readonly MarkedObject[], rect: WorldBox): MarkedObject[] {\n const r = normalBox(rect);\n return objects.filter((o) => !o.locked && touches(o.rect, r));\n}\n\nexport function assembleMarks(s: MarksState): MarksInput {\n const cam = s.cam;\n const z = cam.zoom;\n const on = (f: MarkFrame): MarkFrame => frameOnScreen(f, cam);\n const sel = s.objects.filter((o) => o.selected);\n const several = sel.length > 1;\n // the vellum, mid-drag: what it touches is ticked at once, the count by the cursor\n let marquee: MarksInput[\"marquee\"] = null;\n const touched = new Set<MarkedObject>();\n if (s.marquee !== null) {\n for (const o of vellumHits(s.objects, s.marquee.rect)) touched.add(o);\n const q = s.marquee.rect;\n marquee = { rect: { x0: (q.x0 - cam.x) * z, y0: (q.y0 - cam.y) * z, x1: (q.x1 - cam.x) * z, y1: (q.y1 - cam.y) * z }, count: touched.size, pointer: s.marquee.pointer };\n }\n const objects: MarkObject[] = [];\n const tape: MarkTape[] = [];\n for (const o of s.objects) {\n const f = on(o.frame);\n if (o.tape.a > 0) {\n const half = (o.rect.x1 - o.rect.x0) / 2;\n tape.push({ frame: f, units: z * (half > 0 ? o.frame.hx / half : 1), press: o.tape.press, alpha: o.tape.a });\n }\n if (touched.has(o) && !o.selected) { objects.push({ frame: f, style: \"member\", t: 1, alpha: 1, knobs: false }); continue; }\n if (several) { if (o.selected) objects.push({ frame: f, style: \"member\", t: 1, alpha: o.lock.a, knobs: false }); continue; }\n if (o.selected || o.lock.a > 0) objects.push({ frame: f, style: \"brackets\", t: o.lock.t, alpha: o.lock.a, knobs: o.selected && o.resizable && !o.locked && !o.moving });\n }\n // several's union — or, released, the vellum folding onto it (onto the one object it gathered, fading as it lands)\n let union: MarkUnion | null = null;\n const selBox = framesBox(sel.map((o) => on(o.frame)));\n if (several && selBox !== null && s.union.a > 0) {\n let box = selBox;\n if (s.fold !== null) box = lerpBox(s.fold.rect, selBox, easeIsland(clamp01(s.fold.t)));\n union = { box, t: s.fold !== null ? 1 : s.union.t, alpha: s.union.a };\n } else if (s.fold !== null && sel.length === 1 && selBox !== null) {\n const e = easeIsland(clamp01(s.fold.t));\n const g = MARKS.select.gap;\n const to: MarkBox = { x0: selBox.x0 - g, y0: selBox.y0 - g, x1: selBox.x1 + g, y1: selBox.y1 + g };\n if (e < 0.98) union = { box: lerpBox(s.fold.rect, to, e), t: 1, alpha: 1 - e * 0.9 };\n }\n // the laser: the carried set is what the snap dragged; everything else is what it aligned against\n const moving = s.objects.filter((o) => o.moving);\n let dragged: WorldBox | null = null;\n for (const o of moving) dragged = dragged === null ? o.rect : { x0: Math.min(dragged.x0, o.rect.x0), y0: Math.min(dragged.y0, o.rect.y0), x1: Math.max(dragged.x1, o.rect.x1), y1: Math.max(dragged.y1, o.rect.y1) };\n const laser = s.guides.length > 0 || s.bars.length > 0 ? laserOf(s.guides, s.bars, s.objects.filter((o) => !o.moving).map((o) => o.rect), dragged, cam) : { guides: [], bars: [] };\n // your extent on the rulers: while something is selected and no vellum is being drawn\n let ruler: MarkRuler | null = null;\n if (s.ruler !== null && selBox !== null && s.marquee === null) {\n const world = framesBox(sel.map((o) => o.frame));\n if (world !== null) ruler = { sel: selBox, world, margin: s.ruler.margin, band: s.ruler.band };\n }\n return { view: s.view, night: s.night, tape, objects, union, marquee, guides: laser.guides, bars: laser.bars, strike: s.strike, ruler };\n}\n","// The desk's MARKS from the world (design-015 §7, stratum 5; D4a) — the builder's chrome half. FACTS are\n// the world's, read and never written: `Selected`, `Locked`, `Grab`, `Resizable` (the builder caches\n// them per entity), core's snap chrome (`GuideLine { axis, at }` · `SpacingBar`, pooled runtime entities\n// the snap system keeps), the marquee's out-of-ECS preview (`MarqueeBuffer`, handed in by the host), the\n// mouse pointer's screen point, the gestures (`Camera.gesturing`, an active `Drag`). FLUX is here, per\n// entity and for the desk, stepped by the frame's dt and snapped at its ends (B7's trap): each object's\n// lock-on (180 ms, eased on `--vf-ease-lift` by the layout) and presence (in and out over 120 ms); several's\n// union (220 ms) and presence (120 ms); the vellum's fold onto the union (240 ms, island ease) when the\n// marquee lets go; the laser's strike (160 ms) on a NEW alignment; the tape pressed (240 ms, the second\n// strip 60 ms later) and lifted (160 ms); and the tape's GIVE — a drag that meets a taped object shivers\n// it 2.2 px for 360 ms and settles (*Marks on the Mat*: \"a taped object refuses a drag with a 2 px give\";\n// D2a-core already refuses the move itself): core's move meets the tape here, and a kind that carries itself\n// (the print, D3w) tells the collector of the drag it refused (`refused`). `assembleMarks` (marks/assemble.ts)\n// turns it all into the frame's marks — the oracle's stills run through the same rule. Nothing here writes\n// the world.\n\nimport {\n Camera,\n Captures,\n defineQuery,\n Drag,\n Editing,\n GestureActive,\n GuideLine,\n type HeldGlyph,\n LocalPointer,\n type MenuActionDef,\n menuActionsFor,\n Locked,\n type MarqueeBuffer,\n Pointer,\n PointerScreen,\n RoutedMove,\n Selected,\n SpacingBar,\n type Entity,\n type World,\n} from \"@ice/core\";\nimport { assembleMarks, type MarkedObject } from \"../marks/assemble\";\nimport type { HeldToolDef } from \"../kinds/world\";\nimport { laserKey, type WorldBar, type WorldGuide } from \"../marks/laser\";\nimport { type MarkBox, type MarkFrame, type MarksInput, selectionBox } from \"../marks/layout\";\nimport { MARKS } from \"../theme\";\n\n/** One object as the builder hands it to the marks: its drawn frame and rect (world), the facts it cached. */\nexport interface MarkRow {\n readonly entity: Entity;\n readonly frame: MarkFrame;\n /** ICE's rect: Position (top-left) + Size, world units. */\n readonly rect: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number };\n readonly selected: boolean;\n readonly locked: boolean;\n readonly grabbed: boolean;\n readonly resizable: boolean;\n}\n\n/** What the selection menu is placed from (the desk handle publishes it): the marks' box around the selection ON SCREEN, CSS px. */\nexport interface SelectionAnchor {\n /** The brackets' box (6 out) for one object, the union's (10 out) for several — null when nothing is selected. */\n readonly box: MarkBox | null;\n readonly count: number;\n /** Every selected object is taped (the menu offers \"Lift the tape\"). */\n readonly locked: boolean;\n /** A gesture is on (a drag, a vellum, a pan, a pinch): the menu steps aside. */\n readonly gesturing: boolean;\n /** A note is being written (core's `Editing` — the one focused editor, D2c): the menu steps aside as for a gesture; the brackets stay. */\n readonly editing: boolean;\n /** The view it was placed in, CSS px, and whether the rulers are printed (the menu flips below their band). */\n readonly view: { readonly width: number; readonly height: number };\n readonly rulers: { readonly margin: number; readonly band: number } | null;\n /** An object is IN HAND (design-015 §8, D4b): the menu travels to the foot and becomes the held bar — Send · the kind's tools · Done. Absent = nothing held. */\n readonly held?: HeldAnchor;\n /**\n * The selection's KIND ACTS (K8a — its types' `defineObject({ menu })`): those every selected object's type declares, as plain data\n * (the op stays on the type — the menu runs one through `ops.runMenuAction`). Absent: none (nothing selected declares any).\n */\n readonly menu?: readonly MenuSlot[];\n}\n\n/**\n * The hand as the menu takes it (D4b): the kind's tools that take a slot in the bar (its `open.tools`, D3t-a: live), the mode\n * in hand (core's `HeldTool` — the one slot marked), whether the object is flying home (the bar hides) and whether the pickup\n * has settled.\n */\nexport interface HeldAnchor {\n readonly tools: readonly HeldSlot[];\n readonly active: string;\n readonly landing: boolean;\n readonly settled: boolean;\n}\n\n/** A kind's act as the selection menu shows it (K8a): plain data — the op stays on the widget type (`ops.runMenuAction`). */\nexport interface MenuSlot {\n readonly id: string;\n readonly label: string;\n readonly glyph?: HeldGlyph;\n readonly keys?: string;\n}\n\n/** A selection's kind acts as the menu's slots (K8a): every act its types all declare (core's `menuActionsFor`), as plain data. */\nexport function menuSlots(acts: readonly MenuActionDef[]): MenuSlot[] {\n return acts.map((a) => ({ id: a.id, label: a.label, ...(a.glyph !== undefined ? { glyph: a.glyph } : {}), ...(a.keys !== undefined ? { keys: a.keys } : {}) }));\n}\n\n/**\n * The anchor with the selection's KIND ACTS (K8a): every act all the selected objects' types declare (`menuOf` reads an object's\n * type's `menu`), as the menu's slots — the anchor unchanged when nothing is selected or no act is shared.\n */\nexport function withKindActs(a: SelectionAnchor, selected: readonly Entity[], menuOf: (e: Entity) => readonly MenuActionDef[]): SelectionAnchor {\n if (a.count === 0) return a;\n const menu = menuSlots(menuActionsFor(selected, menuOf));\n return menu.length === 0 ? a : { ...a, menu };\n}\n\n/** A tool's slot as the bar shows it: plain data (the op stays on the widget type — the bar uses a tool through `ops.useHeldTool`). */\nexport interface HeldSlot {\n readonly id: string;\n readonly label: string;\n /** `mode` · `action`; absent = declared only (dim). */\n readonly kind?: \"mode\" | \"action\";\n readonly hint?: string;\n /** Its glyph (core's `HeldGlyph`, K8a): a name of the bar's set, or the tool's own drawing (`{ path }`) — plain data either way. */\n readonly glyph?: HeldGlyph;\n /** A colour the slot shows instead of its glyph (a marker's ink), CSS. */\n readonly swatch?: string;\n}\n\n/** The slots a kind's tools take in the bar: every tool not keys-only, as plain data, its swatch from the kind's look. */\nexport function heldSlots(tools: readonly HeldToolDef[], swatches: Readonly<Record<string, string>> = {}): HeldSlot[] {\n return tools.filter((t) => t.bar !== false).map((t) => ({\n id: t.id, label: t.label,\n ...(t.kind !== undefined ? { kind: t.kind } : {}),\n ...(t.hint !== undefined ? { hint: t.hint } : {}),\n ...(t.glyph !== undefined ? { glyph: t.glyph } : {}),\n ...(swatches[t.id] !== undefined ? { swatch: swatches[t.id] as string } : {}),\n }));\n}\n\nexport interface MarksFrameInput {\n readonly rows: readonly MarkRow[];\n readonly cam: { readonly x: number; readonly y: number; readonly zoom: number };\n readonly view: { readonly width: number; readonly height: number; readonly dpr: number };\n readonly dt: number;\n readonly night: boolean;\n readonly rulers: { readonly margin: number; readonly band: number } | null;\n}\n\nexport interface MarksCollector {\n /** PULL what the marks read outside the builder's journal — the snap's chrome, the vellum, a drag meeting tape, the gestures; true when any changed (a wake). */\n changed(): boolean;\n /** This frame's marks: the clocks stepped by `dt`, the state assembled. */\n frame(input: MarksFrameInput): MarksInput;\n /** A clock still moves: the next frame paints too. */\n live(): boolean;\n /** The tape's give on an entity this frame, CSS px along x (0 at rest) — the builder shifts the object by it. */\n giveOf(e: Entity): number;\n /**\n * A drag refused on `e` outside core's move — a print's own carry (D3w: a print is not core-movable, so no core drag of\n * it ever meets the tape here): a taped `e` gives, as a core drag meeting tape makes it give. The next `changed()` wakes.\n */\n refused(e: Entity): void;\n /** The selection menu's anchor, as of the last frame. */\n anchor(): SelectionAnchor;\n dispose(): void;\n}\n\ninterface Clocks { lockT: number; lockA: number; selected: boolean; tapeT: number; tapeA: number; locked: boolean; give: number }\n\nconst guidesQ = defineQuery([GuideLine]);\nconst barsQ = defineQuery([SpacingBar]);\nconst dragsQ = defineQuery([Drag, GestureActive]);\nconst movesQ = defineQuery([Drag, GestureActive, RoutedMove]);\nconst pointersQ = defineQuery([Pointer, LocalPointer, PointerScreen]);\nconst selectedQ = defineQuery([Selected]);\nconst editingQ = defineQuery([Editing]);\n\nconst NO_ANCHOR: SelectionAnchor = { box: null, count: 0, locked: false, gesturing: false, editing: false, view: { width: 0, height: 0 }, rulers: null };\nconst step = (x: number, to: number, dt: number, ms: number): number => (to > x ? Math.min(to, x + (dt * 1000) / ms) : Math.max(to, x - (dt * 1000) / ms));\n\nexport function createMarksCollector(world: World, opts: { readonly marquee?: () => MarqueeBuffer | undefined } = {}): MarksCollector {\n const C = MARKS.clocks;\n const clocks = new Map<Entity, Clocks>();\n let unionT = 1;\n let unionA = 0;\n let several = false;\n let fold: { rect: MarkBox; t: number } | null = null;\n let strike = 0;\n let key = \"\";\n let lastMarquee: MarkBox | null = null; // the vellum's last rect on screen (what a fold starts from)\n let snapshot = \"\";\n let live = false;\n let anchor: SelectionAnchor = NO_ANCHOR;\n const seenDrags = new Set<Entity>();\n let mouse: Entity | undefined;\n\n const pointerScreen = (): { x: number; y: number } | null => {\n if (mouse === undefined || !world.isAlive(mouse)) {\n mouse = undefined;\n world.query(pointersQ).each((b) => { for (const r of b) { const p = b.entity(r); if (world.read(p, Pointer).device === \"mouse\") mouse = p; } });\n }\n const s = mouse === undefined ? undefined : world.get(mouse, PointerScreen);\n return s === undefined ? null : { x: s.x, y: s.y };\n };\n const readGuides = (): { guides: WorldGuide[]; bars: WorldBar[] } => {\n const guides: WorldGuide[] = [];\n const bars: WorldBar[] = [];\n world.query(guidesQ).each((b) => { for (const r of b) { const g = world.read(b.entity(r), GuideLine); guides.push({ axis: g.axis, at: g.at }); } });\n world.query(barsQ).each((b) => { for (const r of b) { const s = world.read(b.entity(r), SpacingBar); bars.push({ axis: s.axis, from: s.from, to: s.to, perp: s.perp, gap: s.gap }); } });\n return { guides, bars };\n };\n const clockOf = (e: Entity): Clocks => {\n let c = clocks.get(e);\n if (c === undefined) { c = { lockT: 0, lockA: 0, selected: false, tapeT: 0, tapeA: 0, locked: false, give: -1 }; clocks.set(e, c); }\n return c;\n };\n /** A taped object met by a drag gives: its clock from 0. */\n const give = (e: Entity): void => { if (!world.hasTag(e, Locked)) return; clockOf(e).give = 0; live = true; };\n /** A refusal a host told of since the last `changed()` (a print's carry). */\n let told = false;\n /** A drag that meets tape: every taped object it would carry — the one it grabbed, and the selection it grabbed into — gives. */\n const meetTape = (rec: Entity): void => {\n const grabbed = world.getRelation(rec, Captures);\n if (grabbed === undefined || !world.isAlive(grabbed)) return;\n if (world.hasTag(grabbed, Selected)) {\n world.query(selectedQ).each((b) => { for (const r of b) give(b.entity(r)); });\n } else give(grabbed);\n };\n\n return {\n changed() {\n const { guides, bars } = readGuides();\n const m = opts.marquee?.();\n const rect = m?.rect ?? null;\n const cam = world.getResource(Camera);\n let drags = 0;\n world.query(dragsQ).each((b) => { drags += b.count; });\n let editing = 0;\n world.query(editingQ).each((b) => { editing += b.count; });\n // a drag that has just started meets the tape it would carry\n const now = new Set<Entity>();\n world.query(movesQ).each((b) => { for (const r of b) now.add(b.entity(r)); });\n let met = false;\n for (const rec of now) if (!seenDrags.has(rec)) { meetTape(rec); met = true; }\n seenDrags.clear();\n for (const rec of now) seenDrags.add(rec);\n const p = rect === null ? null : pointerScreen();\n const next = `${laserKey(guides, bars)}|${rect === null ? \"\" : `${rect.x},${rect.y},${rect.w},${rect.h},${m?.hits.length ?? 0},${p?.x ?? \"\"},${p?.y ?? \"\"}`}|${drags}|${cam?.gesturing === true ? 1 : 0}|${editing}`;\n const any = next !== snapshot || met || told;\n told = false;\n snapshot = next;\n return any;\n },\n frame(input) {\n const { cam, dt } = input;\n const z = cam.zoom;\n live = false;\n // the snap's facts, and a NEW alignment's strike\n const { guides, bars } = readGuides();\n const k = laserKey(guides, bars);\n if (k !== key) { if (guides.length + bars.length > 0) strike = 1; key = k; }\n if (strike > 0) { strike = step(strike, 0, dt, C.strike); live ||= strike > 0; }\n // the vellum: its world rect while drawn; when it lets go, the fold begins from where it was on screen\n const m = opts.marquee?.();\n const q = m?.rect ?? null;\n const marquee = q === null ? null : { rect: { x0: q.x, y0: q.y, x1: q.x + q.w, y1: q.y + q.h }, pointer: pointerScreen() };\n if (q !== null) { lastMarquee = { x0: (q.x - cam.x) * z, y0: (q.y - cam.y) * z, x1: (q.x + q.w - cam.x) * z, y1: (q.y + q.h - cam.y) * z }; fold = null; }\n else if (lastMarquee !== null) { fold = { rect: lastMarquee, t: 0 }; lastMarquee = null; }\n else if (fold !== null) { fold.t = step(fold.t, 1, dt, C.fold); if (fold.t >= 1) fold = null; }\n live ||= fold !== null;\n // each object's clocks: the lock-on and its presence, the tape's press and lift, the give\n const seen = new Set<Entity>();\n const objects: MarkedObject[] = [];\n let count = 0;\n let allTaped = true;\n for (const row of input.rows) {\n seen.add(row.entity);\n const c = clockOf(row.entity);\n if (row.selected && !c.selected) c.lockT = 0;\n c.selected = row.selected;\n if (row.selected) { c.lockT = step(c.lockT, 1, dt, C.lockOn); c.lockA = step(c.lockA, 1, dt, C.leave); }\n else c.lockA = step(c.lockA, 0, dt, C.leave);\n if (row.locked && !c.locked) c.tapeT = 0;\n c.locked = row.locked;\n const pressEnd = (C.tapePress + C.tapeStagger) / 1000;\n if (row.locked) { c.tapeT = Math.min(c.tapeT + dt, pressEnd); c.tapeA = 1; }\n else c.tapeA = step(c.tapeA, 0, dt, C.tapeLift);\n // the give ends: one more frame, so the object is drawn at rest (its geometry was resolved with this frame's give)\n if (c.give >= 0) { c.give += dt; if (c.give >= C.give / 1000) { c.give = -1; live = true; } }\n live ||= (row.selected && (c.lockT < 1 || c.lockA < 1)) || (!row.selected && c.lockA > 0) || (row.locked && c.tapeT < pressEnd) || (!row.locked && c.tapeA > 0) || c.give >= 0;\n if (row.selected) { count += 1; allTaped &&= row.locked; }\n const press = (row.locked ? [c.tapeT * 1000 / C.tapePress, (c.tapeT * 1000 - C.tapeStagger) / C.tapePress] : [1, 1]) as [number, number];\n objects.push({\n frame: row.frame, rect: row.rect, selected: row.selected, locked: row.locked, moving: row.grabbed, resizable: row.resizable,\n lock: { t: c.lockT, a: c.lockA }, tape: { press: [Math.min(1, Math.max(0, press[0])), Math.min(1, Math.max(0, press[1]))], a: c.tapeA },\n });\n }\n for (const e of clocks.keys()) if (!seen.has(e)) clocks.delete(e);\n // several's union: its lock-on from the moment there are several, its presence in and out\n if (count > 1 && !several) unionT = 0;\n several = count > 1;\n unionT = step(unionT, 1, dt, C.union);\n unionA = step(unionA, several ? 1 : 0, dt, C.unionFade);\n live ||= (several && unionT < 1) || (several ? unionA < 1 : unionA > 0);\n const marks = assembleMarks({ view: input.view, cam, night: input.night, objects, union: { t: unionT, a: unionA }, marquee, fold, guides, bars, strike, ruler: input.rulers });\n // the menu's anchor: the marks' box around the selection as drawn\n let drags = 0;\n world.query(dragsQ).each((b) => { drags += b.count; });\n const frames = objects.filter((o) => o.selected).map((o) => ({ ...o.frame, cx: (o.frame.cx - cam.x) * z, cy: (o.frame.cy - cam.y) * z, hx: o.frame.hx * z, hy: o.frame.hy * z, r: o.frame.r * z }));\n anchor = {\n box: selectionBox(frames), count, locked: count > 0 && allTaped,\n gesturing: drags > 0 || marquee !== null || world.getResource(Camera)?.gesturing === true,\n editing: world.firstOf(editingQ) !== undefined,\n view: { width: input.view.width, height: input.view.height }, rulers: input.rulers,\n };\n return marks;\n },\n live: () => live,\n giveOf(e) {\n const c = clocks.get(e);\n if (c === undefined || c.give < 0) return 0;\n const t = c.give;\n return Math.sin(t * MARKS.give.rate) * MARKS.give.px * (1 - (t * 1000) / C.give);\n },\n refused(e) {\n if (!world.isAlive(e) || !world.hasTag(e, Locked)) return;\n give(e);\n told = true;\n },\n anchor: () => anchor,\n dispose() { clocks.clear(); seenDrags.clear(); },\n };\n}\n","// `defineObject` — the desk's typed door (design-015 §5.2, D-D7 · D-D16; D2a-world): sugar over\n// core's `defineWidget`, which stays the ONE compiler. An object is a widget whose face is its\n// kind — the opaque `object` binding (since design-015 D5b the only face a widget has; a widget\n// without one draws nothing) — with the kind's stratum; the\n// catalog, placement, containers, `spawnWidget`, migrations, the gate markers and every\n// `widgetTypeFor` reader work untouched — and the desk's renderer finds the kind again through\n// `objectKindOf(widgetTypeFor(world, PrefabId.id))`, never a second registry.\n\nimport { defineWidget, type WidgetContainerDef, type WidgetDef, type WidgetType } from \"@ice/core\";\nimport { isObjectKind, type KindDriver, type KindDriverHost, type ObjectHost, type ObjectKind } from \"./kinds/world\";\n\n// THE DESK'S PROVIDES-KEYS (design-016 §5 · K-L2, K8a): what an object PROVIDES (`defineObject({ provides })` — a container's\n// `container.provides`) is what the desk and its containers place it by — never a list of types that names a kind. The keys are the\n// SDK's, so a plugin in its own package declares them as a built-in does; core matches them (`CanvasPlacementDef.accepts`, a\n// container's `accepts`).\n\n/** An object that PROVIDES this lies on the desk: the desk canvas places what provides it (K5b's D-K5b.2, folded into the SDK). */\nexport const DESK_OBJECT = \"desk.object\";\n/**\n * An object that PROVIDES this may be held in a container's desk — the mini mat accepts it (K8a: D-K4a.3's type names retired). It\n * declares its CHIP (`ObjectKind.chip` — its far impostor in the container's face), or it vanishes there when the face is far.\n */\nexport const CONTAINABLE = \"desk.containable\";\n/** An object that PROVIDES this may be pinned to another's part — a note stuck to a desk calendar's day (`KindDriverHost.provides`). */\nexport const PINNABLE = \"desk.pinnable\";\n\n/** A kind's drivers on one desk, made by the host from what it lends (D7 #5, D-D7-A.3). Undefined: the kind has none. */\nexport type DriverFactory = (host: KindDriverHost) => KindDriver | undefined;\n\n/** What an object declares: a widget definition without a view, plus its KIND. */\nexport interface ObjectDef extends Omit<WidgetDef, \"object\" | \"stratum\" | \"openable\" | \"defaultSize\" | \"container\" | \"heldTools\" | \"heldTool\"> {\n /** The kind: its program (the ground registers it) and its world half (the builder and the pick source drive it). */\n readonly kind: ObjectKind;\n /** The size a new one spawns at, world units (`defaultSize`). */\n readonly size?: { readonly w: number; readonly h: number };\n /** A container object — the mini mat: what it accepts and the FACE its inside shows through (`portal` insets). */\n readonly container?: WidgetContainerDef;\n /**\n * The kind's DRIVERS (D7 #5): the hand onto its state — a pen, a carry, a leaf, a writing session — made once per desk by\n * the host from what it lends (`KindDriverHost`) and ticked before the kinds' clocks. The object hands its own components to\n * its driver here, so no driver need import its object back. Absent: the kind is looked at and moved, never worked in.\n */\n readonly drivers?: DriverFactory;\n /**\n * The object's DOM HALF (K4b, `ObjectHost`): what its kind needs of the browser — services lent by key (K8a: the calendar's print\n * raster), its TEXT PARTS that lease the desk's one editor (the note's body, the calendar's day line), a screen-space half (the\n * calendar's days and pen) — declared here as its drivers are, so the host builds it without naming the kind. Absent: the object\n * needs nothing of the browser.\n */\n readonly host?: ObjectHost;\n}\n\n/** The drivers behind each compiled object — read back by the host through `driversOf`, never a second registry of kinds. */\nconst DRIVERS = new WeakMap<WidgetType, DriverFactory>();\n/** …and the DOM halves (K4b), read back through `hostOf`. */\nconst HOSTS = new WeakMap<WidgetType, ObjectHost>();\n\n/** Compile an object through `defineWidget` — one door, one registry. */\nexport function defineObject(def: ObjectDef): WidgetType {\n const { kind, size, container, drivers, host, ...rest } = def;\n if (!isObjectKind(kind)) throw new Error(`desk: defineObject(\"${def.type}\") — \\`kind\\` is not a desk kind (kinds/world.ts \\`ObjectKind\\`: a program with resolve · record · hit · reach)`);\n const widget = defineWidget({\n ...rest,\n object: kind,\n stratum: kind.stratum,\n // the kind that declares an opening is what `ops.open` may pick up (design-015 §8, D4b) — the ONE place the word is set\n openable: kind.open !== undefined,\n // …and its held bar's tools ride the widget type (D3t-a), so the keymap and the bar reach them through the engine\n ...(kind.open?.tools !== undefined ? { heldTools: kind.open.tools } : {}),\n ...(kind.open?.tool !== undefined ? { heldTool: kind.open.tool } : {}),\n ...(size !== undefined ? { defaultSize: size } : {}),\n ...(container !== undefined ? { container } : {}),\n });\n if (drivers !== undefined) DRIVERS.set(widget, drivers);\n if (host !== undefined) HOSTS.set(widget, host);\n return widget;\n}\n\n/** The kind behind a widget type, or undefined: not an object, or a binding that is not a desk kind. */\nexport function objectKindOf(widget: WidgetType | undefined): ObjectKind | undefined {\n if (widget === undefined || widget.object === undefined) return undefined;\n return isObjectKind(widget.object) ? widget.object : undefined;\n}\n\n/** The drivers an object declared (`ObjectDef.drivers`), or undefined: none, or not an object of this desk. */\nexport function driversOf(widget: WidgetType | undefined): DriverFactory | undefined {\n return widget === undefined ? undefined : DRIVERS.get(widget);\n}\n\n/** The DOM half an object declared (`ObjectDef.host`), or undefined: none, or not an object of this desk. */\nexport function hostOf(widget: WidgetType | undefined): ObjectHost | undefined {\n return widget === undefined ? undefined : HOSTS.get(widget);\n}\n","// The DESK BUILDER — the world's objects as the ground's records (design-015 §4.4; D2a-world, D2b).\n// B3a's frame builder re-aimed: one call per frame the reflector paints, every OBJECT Active in\n// the current nav frame, in paint order, becomes the record its kind's pass draws — through the\n// kind's own world half (kinds/world.ts): the builder hands each entity to its kind as an\n// `ObjectContext` and takes back a geometry and a record; the geometry is kept per entity for the\n// pick source (compose/pick.ts), so what is clicked is what was drawn (§4.5).\n//\n// FACTS vs FLUX (design-013 §3, design-015 §2.3). The facts are the world's, read and never\n// written: `Position`/`Size` (ICE's top-left, converted to the centred rect every law reads —\n// `rectOf`, the one place), the widget type's prop groups, `Selected`, `Grab` (THE lift signal),\n// the sibling order, `Active`. They are CACHED per entity and refreshed from the change journal\n// (`changed()` pulls it): an unchanged entity costs the world no read on a frame (the 09-23\n// profile's lesson — never a whole-component read in the hot loop). The flux is here, per entity,\n// outside the world: the prototype's springs (`SPRINGS` — the hold's lift, the hover's rise, the\n// selection ring), advanced by the frame's dt and SNAPPED when settled (B7's trap: every spring\n// snaps, or the desk never idles); and the DELETE GHOST — an entity the journal reports removed\n// keeps its last rect, props and flux and fades over `ghostMs` in its last paint position, then is\n// forgotten. No ECS machinery for any of it: a board at rest carries no per-entity state. An INSERT GHOST (core's tray adoption,\n// K5b) is in a hand from birth: born lifted, its lift held until it lands; it leaves with no delete fade — promoted, its twin\n// takes its place in the same flush and lands with its lift; flown home, it has shrunk to nothing — and while another presenter\n// draws it (the tray's carry: its grow out of the lifted copy, its shrink home — `presented`) it is none of the root's rows.\n//\n// PAINT ORDER: `compareStackOrder` (the stratum first — D2a-core — then the sibling sequence), the\n// `Grab` set LAST (S1's rule: a carried object paints over what it crosses; the ground draws strata\n// in order whatever the list says, so a held sheet still lies under every thing). The hover comes\n// from the local MOUSE pointer's `TouchesExact` edge — the exact hit, never the dead-band `Targets`\n// (the B9 pairing) — compared per tick. Dirt is PULLED: a `coarse: false` collector over the facts\n// above plus every object kind's props components and the tags; the sibling order's stamp; the\n// hover target. The camera and the viewport are the reflector's to poll (`resourceStamp`).\n//\n// THE NESTED DESKS (D2b; MINIMAT.md §3–§5, the prototype's `deskInputs` line for line): a\n// container drawn in a slot gets its INSIDE — its `ChildOf` children, their rects' bounds as the\n// content, the view through the kind's `face` (`insideViewOfFace`: the flight's own numbers, so\n// the far LOD and the live inside agree to the bit), the children as their kinds chip them — and,\n// past the gate (`presence > 0`, depth < 4, the `PORTAL_CAP` largest faces first), a LIVE slot:\n// the children built under the inside's camera, recursing. Inside members lie at REST (nothing\n// inside is hovered, held or selected; a note put in lands flat, as the prototype's did). THE\n// FLIGHT (design-006; `NavTransition`): the departed desk — the frame's `Retained` widgets in\n// their sibling order — under `departedCameraOf`, an ENTER as one tree through the face (`at` =\n// the container's index among the departed objects), an EXIT and a FROZEN flight as two whole\n// slots, the opacities and the lamp HANDOVER `flightPresent`/`flightLights`, the dressing\n// (`lodZoom`: the arriving desk for its landing, the departed for the cut). THE RE-DRESSING\n// (`NavRedress`, a zoom-through's cut): 320 ms in log space, smoothstep, the lamp on the same\n// ramp. THE CUT FRAME (D-D2b.7): while the flight holds at p = 0 no spring advances — the\n// departed desk IS its pre-cut frame to the bit (B7 extended to the flux). And THE SEAM\n// (`navFace`, design-015 §9): a container's face AS DRAWN this frame — at rest when it is not in\n// the frame — with the inside's arrival, embedding, camera, presence and cover test, for core's nav.\n//\n// The builder is pure with respect to the GPU: it makes records; the reflector hands them to\n// `Ground.render`. PAN IS O(1) in the world: nothing here is stored per object in the ECS.\n\nimport {\n Active,\n BoardRoot,\n ChildOf,\n Container,\n compareStackOrder,\n createSiblingOrderIndex,\n currentNavFrame,\n DEFAULT_STRATUM_BAND,\n defineQuery,\n departedCameraOf,\n Grab,\n Held,\n HeldTool,\n InsertGhost,\n HeldView,\n heldEntity,\n LocalPointer,\n Locked,\n type MarqueeBuffer,\n type NavFace,\n NavRedress,\n NavTransition,\n NO_ENTITY,\n Pointer,\n Position,\n PrefabId,\n Resizable,\n Retained,\n Selected,\n Size,\n type StackOrderReader,\n Stratum,\n TouchesExact,\n Viewport,\n WidgetEquipped,\n widgetTypeFor,\n type Component,\n type Entity,\n type Tag,\n type WidgetType,\n type World,\n} from \"@ice/core\";\nimport type { HeldFrameInputs, OutgoingInputs, PortalInputs, SlotObject } from \"../ground\";\nimport { carryOf, HELD_USER_REST, heldCamera, heldFocus, heldFrame, heldPose, HOLD, homePose, progressOf, readingTarget } from \"../hold/pose\";\nimport { FLUX_REST, type InsideContext, type KindLocal, numberProp, type ObjectContext, type ObjectFlux, type ObjectKind, type ObjectRect, rectFrame, rectOf, type RungContext } from \"../kinds/world\";\nimport type { MarksInput } from \"../marks/layout\";\nimport { createMarksCollector, type MarkRow, type SelectionAnchor } from \"./marks\";\nimport type { GridConfig } from \"../mat/grid\";\nimport type { MatFrame, SlotLight } from \"../mat/layout\";\nimport { type ChildShape, finishOf, flightLights, flightPresent, insidePresent, type InsideView, insideViewOfFace } from \"../kit/inside\";\nimport { boundsOf, type CameraState, FIT, type Rect, solveFlightStart } from \"../nav/flight\";\nimport { clipOf, faceCovers, PORTAL_CAP, PORTAL_GATE, type Presentation } from \"../nav/portal\";\nimport { type Lamp, lampOf } from \"../mat/lamp\";\nimport { objectKindOf } from \"../object\";\nimport { type ObjectSprings, SPRINGS, settled, spring } from \"../kit/springs\";\nimport type { GroundTheme } from \"../theme\";\n\n/** The view a frame is built for: CSS px and the dpr the canvas is at. */\nexport interface BuildViewport { readonly width: number; readonly height: number; readonly dpr: number }\n\nexport interface DeskBuilderOptions {\n /**\n * The OBJECT widget types this desk may hold: their prop groups join the change journal and\n * their kinds' `reach` the pick pad. An object of a type not listed still draws (its kind is found\n * off the widget type) but its props are refreshed only on a Position/Size/tag change.\n */\n readonly objects: readonly WidgetType[];\n /** The objects' springs (springs.ts `SPRINGS`). */\n readonly springs?: ObjectSprings;\n /** A deleted object's fade, ms (the prototype's 0.22 s). */\n readonly ghostMs?: number;\n /** The cull margin past the view, CSS px (the prototype's 200). */\n readonly marginPx?: number;\n /** The re-dressing after a zoom-through cut, ms (PORTAL.md §9's 320). */\n readonly redressMs?: number;\n /**\n * The kinds' own state on this desk by kind name (kinds/world.ts `KindLocal` — the note's writing,\n * D2c): threaded into every context of the kind as `ctx.local`, and told when an entity is FORGOTTEN\n * (its ghost faded, it left the frame, it died unseen) so what it held — a raster's rect — goes back.\n */\n readonly locals?: ReadonlyMap<string, KindLocal>;\n /** The interaction stack's marquee preview (out of the ECS — design-003 §5.7): the vellum the marks draw (D4a). */\n readonly marquee?: () => MarqueeBuffer | undefined;\n /**\n * The engine's spatial index (design-015 §2.5; D6): the cull's broad phase — the frame's objects within the view, its margin and the\n * kinds' reach, asked with a hysteresis band so a pan asks it again only when the view leaves the last answer. Absent (a test, a bare\n * host), every member is tested.\n */\n readonly spatial?: SpatialSource;\n}\n\n/**\n * What the builder asks of the spatial index: the entries whose rects meet a world AABB (kernel's `SpatialIndex.search`), and how\n * many it holds — core clears it at a nav cut and refills it on the NEXT tick's `spatialSync` (design-004 §7), so a build in which it\n * holds fewer entries than the frame has members culls linearly and asks again next build.\n */\nexport interface SpatialSource {\n search(bounds: { readonly minX: number; readonly minY: number; readonly maxX: number; readonly maxY: number }): readonly { readonly id: Entity }[];\n readonly size?: number;\n}\n\n/**\n * The builder's PER-ENTITY WORK in a build — the O(1)-pan witness (design-015 §2.5, §11.4: \"no per-entity work — a counter\n * proves it\"; D6). A camera move over a settled desk must leave every count at 0 but the cull's `visited`, which is the\n * spatial index's answer, never the desk's population.\n */\nexport interface BuildWork {\n /** Entities the membership query yielded (the frame's objects walked). */\n readonly queried: number;\n /** Members the cull walked, every slot. */\n readonly visited: number;\n /** Members sorted into paint order (0 = the last order stood). */\n readonly sorted: number;\n /** A kind's `resolve` — every slot's rows, the chips, the ghosts, the hand and its riders. */\n readonly resolved: number;\n /** A kind's `record`. */\n readonly recorded: number;\n /** Records REUSED from the last build — nothing about them changed (D6). */\n readonly reused: number;\n /** A kind's `rung` read (K6b): of each drawn object of a kind with one, on a frame its slot's zoom or the dpr moved — a remake only when it moved. */\n readonly rungs: number;\n /**\n * Why records were remade (K6b, a rig's witness — the zoom's): the object had none (it came on screen), its RUNG moved, a `rezoom`\n * kind's zoom moved, its kind's own state was restless (a board's density raised). Counted per cause: one remake may count twice.\n */\n readonly fresh: number;\n readonly rerung: number;\n readonly rezoomed: number;\n readonly restless: number;\n /** Chips a container's face could not draw (K8a): the child's chip named no finish of the container's `faceLaw` — left out, never redressed. */\n readonly unchipped: number;\n}\ntype MutableWork = { -readonly [K in keyof BuildWork]: number };\nconst ZERO_WORK: BuildWork = { queried: 0, visited: 0, sorted: 0, resolved: 0, recorded: 0, reused: 0, rungs: 0, fresh: 0, rerung: 0, rezoomed: 0, restless: 0, unchipped: 0 };\n\nexport interface DeskBuilderStats {\n /** Objects Active in the frame this build saw. */\n readonly active: number;\n /** Objects drawn in the root slot — within the view and its margin, plus the ghosts. */\n readonly objects: number;\n /** Objects off screen this build (the root slot). */\n readonly culled: number;\n /** Deleted objects still fading. */\n readonly ghosts: number;\n /** Live insides built this frame, every depth (the departed desk's included). */\n readonly portals: number;\n /** True after a build while any spring or ghost is still moving, or a re-dressing ramp runs. */\n readonly live: boolean;\n /** This build's per-entity work (D6). */\n readonly work: BuildWork;\n /** The work of every build since the builder was made — a rig diffs two readings. */\n readonly totals: BuildWork;\n /** Under `verify(true)`: reused records that a fresh resolve would NOT have made — the persistent path's own witness; 0 or a bug. */\n readonly mismatches: number;\n}\n\n/** What can dirty the builder: a journaled world write, a despawn, a document reset, the sibling order, the hover target, the marks' own facts (the snap's chrome, the vellum, a drag meeting tape, the gestures — D4a). */\nexport type DeskWakeReason = \"world\" | \"removed\" | \"reset\" | \"order\" | \"hover\" | \"marks\";\nconst WAKE_REASONS: readonly DeskWakeReason[] = [\"world\", \"removed\", \"reset\", \"order\", \"hover\", \"marks\"];\n\n/** The springs a host may pin: each present key holds that spring at the value. */\nexport type FluxPin = Partial<Pick<ObjectFlux, \"lift\" | \"hover\">>;\n\n/** What a build may be told beyond the camera (a harness's pins, the reflector's clocks). */\nexport interface BuildOptions {\n /** The frame's clock, ms (`FrameInfo.now`) — the re-dressing ramp's. */\n readonly now?: number;\n /** The mat's clocks and tilt for every slot this frame (the reflector's ambient frame). */\n readonly mat?: MatFrame;\n /** Live insides on (the default). Off, every face draws its far LOD alone (the oracle's `portals: false`). */\n readonly portals?: boolean;\n /** A pinned root dressing (the oracle's `lodZoom`). */\n readonly lodZoom?: number;\n /** Hold every spring and ghost where it is — a still of a moving frame (a rig's flight pin). */\n readonly freeze?: boolean;\n /** Hold the re-dressing ramp at its start (the prototype harness's `redressPinned`). */\n readonly holdRedress?: boolean;\n /** THE HAND PINNED (D4b — a still of the opening): the carry amount held at `e`, the kind's open motion snapped to `open` (default: open past 42 %). */\n readonly hold?: HoldPin;\n /** The kinds whose own state moved this tick (their `local.tick` wanted a frame — a print gliding, ink drying): their records are remade (D6). */\n readonly restless?: ReadonlySet<string>;\n /** Objects another presenter draws this frame (K5b — the tray's carry: an insert ghost growing out of the lifted copy, or shrinking home): none of the root's rows, no marks, their springs still run. */\n readonly presented?: ReadonlySet<Entity>;\n}\n\nexport interface HoldPin { readonly e: number; readonly open?: boolean }\n\n/**\n * The object IN HAND as the last build made it (design-015 §8; D4b): the entity, whether the pickup has settled and whether\n * it is flying home (the fact already gone), the frame the pose seam publishes (core's `HeldScreenFrame`, CSS px), what the\n * ground draws (`GroundFrameInputs.held` less its `stamp` — the reflector adds the camera's and the viewport's stamps), and the\n * desk's own change count `deskSeq` — everything the desk copy depends on, never the held object's own facts.\n */\nexport interface HeldBuild {\n readonly entity: Entity;\n /** The carry amount this frame, 0 on the desk … 1 in hand (also `inputs.e` — here for the witnesses). */\n readonly e: number;\n readonly settled: boolean;\n readonly landing: boolean;\n readonly frame: { readonly cx: number; readonly cy: number; readonly hx: number; readonly hy: number; readonly s: number; readonly settled: boolean };\n readonly inputs: Omit<HeldFrameInputs, \"stamp\">;\n readonly deskSeq: number;\n}\n\nexport interface BuiltDesk {\n /** The root slot's objects in paint order — what `SlotInputs.objects` takes. */\n readonly objects: readonly SlotObject[];\n /** The root slot's live insides (MINIMAT.md §3). */\n readonly portals: readonly PortalInputs[];\n /** The current frame's grid: the root's, or the entered mini mat's inside grid. */\n readonly grid: GridConfig;\n /** The root's dressing: a flight's landing, a re-dressing's ramp, a pin — absent = its own zoom. */\n readonly lodZoom?: number;\n /** The root's presentation while a flight is on. */\n readonly present?: Presentation;\n /** The root's lamp while it is handed over (a flight, a re-dressing after a cut in). */\n readonly light?: SlotLight;\n /** The departed desk while a flight is on. */\n readonly outgoing?: OutgoingInputs;\n /** The desk's chrome this frame (stratum 5 — `GroundFrameInputs.marks`, D4a): the root slot's, the current frame's desk. */\n readonly marks: MarksInput;\n /** The object in hand, or flying home (D4b): out of `objects` and of the marks, drawn as a slot of its own over the desk out of focus. */\n readonly held?: HeldBuild;\n readonly stats: DeskBuilderStats;\n}\n\nexport interface DeskBuilder {\n /**\n * Advance every on-screen object's springs by `dt` SECONDS and build this frame's records under\n * `cam` and `vp`: `theme` and `grid` are the root's; `looks` is each kind's `theme()` result by\n * kind name (the reflector keeps them per theme); `opts` the clocks and a harness's pins.\n */\n build(cam: CameraState, vp: BuildViewport, dt: number, theme: GroundTheme, grid: GridConfig, looks: ReadonlyMap<string, unknown>, opts?: BuildOptions): BuiltDesk;\n /** True while a spring, a ghost or a re-dressing ramp still moves after the last build — the reflector paints again. */\n live(): boolean;\n /**\n * PULL the world's dirt: did any fact a build reads change since the last pull — an object's\n * position, size or props, its Grab, its selection, the Active set, a despawn, a document reset,\n * the sibling order, the hover target? Call it every tick (it drains the journal); `wakes()` names\n * what changed.\n */\n changed(): boolean;\n /** How many times each fact has dirtied the builder since creation. */\n wakes(): Readonly<Record<DeskWakeReason, number>>;\n /** The last build's geometry for an entity — the pick source's mirror; `undefined` = not drawn (unseen, culled, gone). */\n geometryOf(e: Entity): unknown | undefined;\n /** The kind an entity draws by, once the builder has met it. */\n kindOf(e: Entity): ObjectKind | undefined;\n /** The last build's flux for an entity (the rig's witness). */\n fluxOf(e: Entity): ObjectFlux | undefined;\n /** The last build's view of a container's inside — its camera, presence and clip under the slot it was drawn in (a rig's witness). */\n insideViewOf(e: Entity): InsideView | undefined;\n /**\n * THE SEAM's answer (design-015 §9): the container's face under the host camera `cam` — AS DRAWN\n * when it was built in the current frame this frame, at REST otherwise (the frame's own container,\n * an exit's) — with the inside's arrival, embedding, camera, presence and cover test. `undefined`:\n * not a container kind, or a face with no area.\n */\n navFace(container: Entity, cam: CameraState): NavFace | undefined;\n /**\n * A per-entity asset the host pins — a committed raster, a note's greeked writing (`ObjectContext.asset`);\n * `undefined` unpins. Kept BY ENTITY, met or not: a pin made in the same task as the spawn (the parity\n * scene's ink, before the entity's facts are readable) waits for the first build. Dirties the builder.\n */\n pin(e: Entity, asset: unknown): void;\n /**\n * Pin an object's springs for a STILL (a parity scene's `held` = `{ lift: 1 }` — never a `Grab`,\n * which would also carry it to the top of the paint order): each pinned spring SITS at its\n * target, snapped, whatever the facts say; the unpinned ones keep following them. `undefined`\n * unpins. Dirties the builder. Flux, never a world fact.\n */\n pinFlux(e: Entity, targets: FluxPin | undefined): void;\n /** Every flux pin lifted. */\n clearFlux(): void;\n /** The widest `reach` among the desk's kinds, world units — the pick source's pad. */\n reach(): number;\n /** The selection menu's anchor as of the last build: the marks' box around the selection on screen, whether a gesture is on (D4a). */\n anchor(): SelectionAnchor;\n /**\n * A drag a host refused on `e` outside core's move — a print's own carry (D3w): a taped object gives, as a core drag that\n * meets the tape makes it give (D4a). The next `changed()` reports it.\n */\n meetTape(e: Entity): void;\n /** The object in hand as of the last build (D4b) — what the pose seam answers from; undefined = nothing held or flying home. */\n hand(): HeldBuild | undefined;\n /**\n * A point of the held object's own frame (core's `HeldPointer`: its open extent's units, centred) as a DESK point, through the\n * pose the last build drew (the frame on screen, then the held slot's camera) — undefined unless `e` is in hand (D3t-a).\n */\n heldToWorld(e: Entity, x: number, y: number): readonly [number, number] | undefined;\n /**\n * A DESK point into the held slot's world for the object in hand or FLYING HOME (D7 #11): the pose the last build drew, through\n * the desk camera of that build. The pick asks the kind's mirror there — the held geometry is resolved under the held slot's own\n * camera, so a desk point tested against it raw picked nothing where the object is drawn. Undefined unless `e` is the hand's.\n */\n heldPoint(e: Entity, wx: number, wy: number): readonly [number, number] | undefined;\n /** The held kind's part under such a point — its `hit` on the geometry it was drawn with in hand; null over nothing (the pose seam's `part`, D3t-a). */\n heldPart(e: Entity, x: number, y: number): string | null;\n /** The objects the last build painted LIFTED by their kind's own state (D3t-a — a print carried or in the air): above their siblings, asked first by the pick. */\n lifted(): readonly Entity[];\n /** An entity a kind's state veiled in the last build (D3t-c — a note gone with its month): not drawn, never picked. */\n veiled(e: Entity): boolean;\n /** The last build's paint rank of `e` in the ROOT slot (D6 — a kind's residency asks it); undefined = not drawn there. */\n rankOf(e: Entity): number | undefined;\n /** Was `e` drawn in the last build — its record made or reused in ANY slot, the root's, an inside's, the hand's (K6b: the raster queue lets go of an ask whose object is not)? */\n shows(e: Entity): boolean;\n /** `e`'s record remade at the next build, and the desk woken (K6b — a raster LANDED on it: its record says where its ink is). */\n remake(e: Entity): void;\n /** Every record remade at the next build (a kind's law changed under them — `tuneLaw`). */\n invalidate(): void;\n /** Check every reused record against a fresh resolve each build (`stats().mismatches`) — a rig's witness, dear per frame. */\n verify(on: boolean): void;\n stats(): DeskBuilderStats;\n dispose(): void;\n}\n\ninterface ObjectState {\n readonly kind: ObjectKind;\n readonly widget: WidgetType;\n /** The cached facts — refreshed on the journal's word, never per frame. */\n rect: ObjectRect;\n props: Record<string, unknown>;\n selected: boolean;\n grabbed: boolean;\n /** Taped down (`Locked`) and resizable (`Resizable`) — what the marks read (D4a). */\n locked: boolean;\n resizable: boolean;\n band: number;\n dirty: boolean;\n /** The springs: value and velocity (the ring's is gone — D6; the kinds are handed ring 0 since D4a). */\n lift: number;\n liftV: number;\n hover: number;\n hoverV: number;\n /** The last build's geometry and record; null when not drawn (culled, unseen). */\n geometry: unknown | null;\n record: unknown | null;\n /** The last build's view of its inside (a container), null when none. */\n inside: InsideView | null;\n /** Where it was drawn last: the current frame's root slot, a live inside, the departed desk. */\n slot: \"root\" | \"inside\" | \"departed\";\n /** The object painted right after it in the last build — where a ghost of it keeps its place (the indices shift when it leaves; a neighbour does not). */\n next: Entity | undefined;\n /** The build that last saw it in the frame. */\n seen: number;\n /** PERSISTENT RECORDS (design-015 §4.3; D6): its rank in the frame's paint order (−1 = not a member), its membership and its tier as last read. */\n rank: number;\n active: boolean;\n lifted: boolean;\n /** The record must be remade: its facts were refreshed, a child or its container changed, an asset or a flux pin moved, a law changed. */\n stale: boolean;\n /**\n * What the record was made with beyond the facts: the tape's give, the container's content bounds, and — a `rezoom` kind — its\n * SLOT's zoom (an inside's is its host's face's, not the root camera's); a `rung` kind's (K6b): the rung it was made at, and the\n * zoom that rung was last read at.\n */\n give: number;\n content: Rect | null;\n zoom: number;\n rung: number;\n /** Its kind's word on what has landed on it, as its record was last made (`KindLocal.landed`; D7). */\n landed: number;\n /** An insert ghost (K5b): in a hand from birth — lifted until it lands — and gone without a delete fade. */\n readonly insert: boolean;\n /** The marks' row for the record as made (the root slot). */\n markRow: MarkRow | null;\n}\n\ninterface Ghost {\n readonly kind: ObjectKind;\n readonly rect: ObjectRect;\n readonly props: Readonly<Record<string, unknown>>;\n readonly flux: ObjectFlux;\n readonly band: number;\n /** The object it was painted just before; absent = it was its band's last. */\n readonly next: Entity | undefined;\n readonly asset: unknown;\n /** The fade's progress, 0 … 1 gone. */\n del: number;\n}\n\ninterface Row {\n readonly entity: Entity | undefined;\n readonly kind: string;\n readonly record: unknown;\n readonly band: number;\n /** A ghost's row: the entity it fades for (its record's key is that entity negated — D6). */\n readonly ghostOf?: Entity;\n}\n\n/** One slot's build: its rows in paint order, its live insides, its containers' geometry by entity. */\ninterface SlotBuild {\n readonly rows: Row[];\n readonly portals: PortalInputs[];\n readonly culled: number;\n}\n\nconst EMPTY_STATS: DeskBuilderStats = { active: 0, objects: 0, culled: 0, ghosts: 0, portals: 0, live: false, work: ZERO_WORK, totals: ZERO_WORK, mismatches: 0 };\nconst GHOST_MS = 220;\nconst MARGIN_PX = 200;\nconst REDRESS_MS = 320;\n/** The host belt: a live inside's insides show live to this depth (the prototype's `depth < 4`). */\nconst PORTAL_DEPTH = 4;\n\n// An object: a widget (PrefabId, Position, Size) Active in the current nav frame — the same membership the cull and the pick use.\nconst membersQ = defineQuery([Position, Size, PrefabId, Active]);\n// The departed frame's widgets while a flight is on (nav-flight.ts `retainDeparted`).\nconst retainedQ = defineQuery([Position, Size, PrefabId, Retained]);\n// The local pointers; the MOUSE one's exact hit is the hover.\nconst localPointersQ = defineQuery([Pointer, LocalPointer]);\n\n/** The prop groups of the object types, deduplicated — what joins the journal. */\nfunction propComponents(objects: readonly WidgetType[]): Component[] {\n const out = new Set<Component>();\n for (const w of objects) for (const g of w.groups) out.add(g.component);\n return [...out];\n}\n\n/** One spring's frame: pinned = it sits at its target (a still); else advanced by `dt` and SNAPPED when settled. Returns [x, v, still moving]. */\nfunction advance(x: number, v: number, target: number, hz: number, damp: number, dt: number, pinned: boolean): [number, number, boolean] {\n if (pinned) return [target, 0, false];\n const [nx, nv] = spring(x, v, target, hz, damp, dt);\n return settled(nx, nv, target) ? [target, 0, false] : [nx, nv, true];\n}\n\n/** Smooth at both ends; exactly 0 at or below `a` and 1 at or above `b`. */\nconst smoothstep = (a: number, b: number, x: number): number => { const t = Math.min(1, Math.max(0, (x - a) / (b - a))); return t * t * (3 - 2 * t); };\n\n/**\n * Two records the same, value for value (D6's `verify`): plain objects and arrays by their entries, typed arrays by their elements,\n * numbers with NaN equal to NaN, anything else — a picture's texture, a class instance — by identity.\n */\nexport function sameRecord(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (typeof a === \"number\" && typeof b === \"number\") return Number.isNaN(a) && Number.isNaN(b);\n if (typeof a !== \"object\" || typeof b !== \"object\" || a === null || b === null) return false;\n if (ArrayBuffer.isView(a) || ArrayBuffer.isView(b)) {\n if (!ArrayBuffer.isView(a) || !ArrayBuffer.isView(b) || a.constructor !== b.constructor) return false;\n const x = a as unknown as ArrayLike<number>;\n const y = b as unknown as ArrayLike<number>;\n if (x.length !== y.length) return false;\n for (let i = 0; i < x.length; i++) if (x[i] !== y[i] && !(Number.isNaN(x[i]) && Number.isNaN(y[i]))) return false;\n return true;\n }\n if (Array.isArray(a) || Array.isArray(b)) {\n if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) if (!sameRecord(a[i], b[i])) return false;\n return true;\n }\n const pa = Object.getPrototypeOf(a);\n if (pa !== Object.prototype && pa !== null) return false; // a class instance: identity alone\n if (Object.getPrototypeOf(b) !== pa) return false;\n const ka = Object.keys(a);\n const kb = Object.keys(b);\n if (ka.length !== kb.length) return false;\n for (const k of ka) if (!Object.hasOwn(b, k) || !sameRecord((a as Record<string, unknown>)[k], (b as Record<string, unknown>)[k])) return false;\n return true;\n}\n/** `from` → `to` in log space at `u` (PORTAL.md §9: the re-dressing eases the dressing's ZOOM, so it looks like a zoom). */\nconst lodEase = (from: number, to: number, u: number): number => (u >= 1 ? to : u <= 0 ? from : Math.exp(Math.log(from) + (Math.log(to) - Math.log(from)) * u));\n\nexport function createDeskBuilder(world: World, opts: DeskBuilderOptions): DeskBuilder {\n const S = opts.springs ?? SPRINGS;\n /** The one context every `rung` read is handed (K6b): filled afresh before each read, never kept by a kind. */\n const rungCtx: { -readonly [K in keyof RungContext]: RungContext[K] } = { entity: NO_ENTITY, rect: { cx: 0, cy: 0, w: 0, h: 0 }, props: {}, zoom: 1, dpr: 1, local: undefined, px: 0 };\n const locals = opts.locals;\n /** The entity is gone from this desk for good: its kind's own state lets go of it (D2c). */\n const forget = (kind: ObjectKind, e: Entity): void => { locals?.get(kind.name)?.forget?.(e); };\n const ghostS = (opts.ghostMs ?? GHOST_MS) / 1000;\n const marginPx = opts.marginPx ?? MARGIN_PX;\n const redressMs = opts.redressMs ?? REDRESS_MS;\n const order = createSiblingOrderIndex(world);\n const states = new Map<Entity, ObjectState>();\n const ghosts = new Map<Entity, Ghost>();\n const pins = new Map<Entity, FluxPin>();\n /** The hosts' pinned assets by entity (a committed raster) — outside the state, so a pin outlives a state the builder has not made yet. */\n const assets = new Map<Entity, unknown>();\n /** Each parent's children in sibling order, cached against the parent's order stamp (strata's per-parent `orderStamp`). */\n const kids = new Map<Entity, { stamp: number; list: Entity[] }>();\n const wakes = Object.fromEntries(WAKE_REASONS.map((r) => [r, 0])) as Record<DeskWakeReason, number>;\n let stats: DeskBuilderStats = EMPTY_STATS;\n /** This build's work and every build's (D6) — counted at the call sites, snapshotted into `stats`. */\n const work: MutableWork = { ...ZERO_WORK };\n const totals: MutableWork = { ...ZERO_WORK };\n /**\n * PERSISTENT RECORDS (design-015 §4.3; D6). The frame's paint-ordered `list` stands until the membership or the order moves\n * (`listDirty`: a spawn, a despawn, an Active flip, a reset; `orderDirty`: the sibling order, a stratum, a Grab, a kind lifting\n * an object); the cull's `candidates` — the spatial index's answer inside `queryRect`, in rank order — stand until the view leaves\n * the rect or the world moves (`worldGen`); a row's record stands until its facts, its flux, its children, its look or its zoom\n * rung move. `remakeAll` for a build: the theme, the grid, the looks or the frame changed, or a law was tuned (`invalidate`).\n */\n let listDirty = true;\n let orderDirty = false;\n /** The states the journal marked since the last build — re-read at the build's start, before the list is decided. */\n const dirtyStates = new Set<Entity>();\n let list: Entity[] = [];\n let candidates: Entity[] | null = null;\n let queryRect: { minX: number; minY: number; maxX: number; maxY: number } | null = null;\n let worldGen = 0;\n let candGen = -1;\n let invalidated = true;\n let lastDpr = Number.NaN;\n let verifying = false;\n let mismatches = 0;\n let disposed = false;\n let seq = 0;\n const spatial = opts.spatial;\n /** A wake the world does not carry (a pin): `changed()` reports it once. */\n let woke = false;\n let lastHover: Entity | undefined;\n let mouse: Entity | undefined;\n /** The widest reach: the listed types' kinds, and any kind met since. */\n let reach = 0;\n /** The re-dressing ramp: the epoch seen and the clock it started at. */\n let redressEpoch = 0;\n let redressStart = 0;\n /** The nav frame of the last build: a change drops the ghosts (they belong to the desk they died in). */\n let lastFrame: Entity | undefined;\n /** The last build's root grid, looks and theme — what a container resolves at REST with when the seam asks between builds. */\n let lastGrid: GridConfig | undefined;\n let lastLooks: ReadonlyMap<string, unknown> | undefined;\n let lastTheme: GroundTheme | undefined;\n const kindsSeen = new Set<ObjectKind>();\n const meet = (kind: ObjectKind): void => {\n if (kindsSeen.has(kind)) return;\n kindsSeen.add(kind);\n if (kind.reach > reach) reach = kind.reach;\n };\n for (const w of opts.objects) { const k = objectKindOf(w); if (k !== undefined) meet(k); }\n // The journal of every fact a build reads — value writes, adds, removals and despawns of the components, membership flips\n // of the tags. `coarse: false`: every writer of these goes through the store (core's attestation, the ground's precedent).\n const readsC: Component[] = [];\n const readsT: Tag[] = [];\n for (const k of kindsSeen) { readsC.push(...(k.reads?.components ?? [])); readsT.push(...(k.reads?.tags ?? [])); }\n const marks = createMarksCollector(world, opts.marquee !== undefined ? { marquee: opts.marquee } : {});\n const collector = world.changes.collect({\n components: [Position, Size, PrefabId, Grab, HeldView, HeldTool, ...propComponents(opts.objects), ...readsC],\n tags: [Selected, Active, Container, Locked, WidgetEquipped, Retained, Held, ...readsT],\n coarse: false,\n });\n /**\n * THE HAND (design-015 §8; D4b): the one object in hand or flying home — its clock (`p` over 560 ms up, 440 ms home after a\n * 140 ms close lead), its carry `e` (the island ease of `p`; home from `e0` where the put-down caught it), and the kind's\n * openness as of the last build (the flight home starts once it is under 0.35, the landing once under 0.02). Flux — the FACT\n * is core's `Held`; this outlives it by the flight home.\n */\n let hand: { entity: Entity; dir: 1 | -1; p: number; e: number; e0: number; closeT: number; openness: number } | null = null;\n let lastHand: HeldBuild | undefined;\n /** The desk camera of the last build — what `heldPoint` maps a desk point to the screen through (D7 #11). */\n let lastCam: CameraState | undefined;\n /** What the last build painted lifted by its kind's own word (D3t-a) — the pick asks these first. */\n let liftedList: readonly Entity[] = [];\n /** What the kinds' states veiled in the last build (D3t-c) — the pick answers `outside` for them. */\n let veiledList: ReadonlySet<Entity> = new Set();\n /**\n * The held object's own frame → the screen (the frame the pose seam published) → the desk (the held slot's camera): the pose\n * the last build DREW, as core mapped the pointer through it (D3t-a). Undefined unless `e` is in hand.\n */\n const heldToWorld = (e: Entity, x: number, y: number): readonly [number, number] | undefined => {\n const h = lastHand;\n if (h === undefined || h.entity !== e || h.landing) return undefined;\n const v = h.inputs.view;\n return [v.camX + (h.frame.cx + x * h.frame.s) / v.zoom, v.camY + (h.frame.cy + y * h.frame.s) / v.zoom];\n };\n /** A desk point → the screen (the last build's desk camera) → the held slot's world (its view): where the hand's object is DRAWN, held or flying home. */\n const heldPoint = (e: Entity, wx: number, wy: number): readonly [number, number] | undefined => {\n const h = lastHand;\n const cam = lastCam;\n if (h === undefined || h.entity !== e || cam === undefined) return undefined;\n const v = h.inputs.view;\n return [v.camX + ((wx - cam.x) * cam.zoom) / v.zoom, v.camY + ((wy - cam.y) * cam.zoom) / v.zoom];\n };\n /** The desk's change count — everything the blurred copy behind the hand depends on; a change to the held object alone never bumps it. */\n let deskSeq = 0;\n /** The desk's own flux moved in the last build (a ghost, a row's spring, a ramp, a flight): the frame it settles on bumps the count too. */\n let deskWasMoving = false;\n const inverseCarry = progressOf;\n // The comparator's reader: the stratum from the cache (stamped at equip, cached at first sight), the rest the world's.\n const reader: StackOrderReader = {\n get<T>(e: Entity, c: Component<T>): T | undefined {\n if ((c as Component) === (Stratum as Component)) { const st = states.get(e); return st === undefined ? world.get(e, c) : ({ band: st.band } as unknown as T); }\n return world.get(e, c);\n },\n };\n\n /** The local mouse pointer's exact hit, if it is one of ours — none while something is in hand (the desk behind is inert, D4b). */\n const hoverTarget = (): Entity | undefined => {\n if (hand !== null) return undefined;\n if (mouse === undefined || !world.isAlive(mouse)) {\n mouse = undefined;\n world.query(localPointersQ).each((b) => { for (const r of b) { const p = b.entity(r); if (world.read(p, Pointer).device === \"mouse\") mouse = p; } });\n }\n if (mouse === undefined) return undefined;\n const t = world.getRelation(mouse, TouchesExact);\n return t !== undefined && states.has(t) ? t : undefined;\n };\n\n /** Read the facts into the cache; the record is stale after. A membership or tier fact that moved (Active, Grab, the stratum) dirties the frame's list or its order (D6). */\n const refresh = (e: Entity, st: ObjectState): void => {\n const x = world.readField(e, Position, \"x\") ?? 0;\n const y = world.readField(e, Position, \"y\") ?? 0;\n const w = world.readField(e, Size, \"w\") ?? 0;\n const h = world.readField(e, Size, \"h\") ?? 0;\n st.rect = rectOf({ x, y }, { w, h });\n const props: Record<string, unknown> = {};\n for (const g of st.widget.groups) {\n const v = world.get(e, g.component) as Record<string, unknown> | undefined;\n if (v !== undefined) for (const name of Object.keys(g.fields)) props[name] = v[name];\n }\n st.props = props;\n st.selected = world.hasTag(e, Selected);\n const grabbed = world.has(e, Grab);\n if (grabbed !== st.grabbed) orderDirty = true;\n st.grabbed = grabbed;\n st.locked = world.hasTag(e, Locked);\n st.resizable = world.hasTag(e, Resizable);\n const band = world.get(e, Stratum)?.band ?? DEFAULT_STRATUM_BAND;\n if (band !== st.band) orderDirty = true;\n st.band = band;\n const active = world.hasTag(e, Active);\n if (active !== st.active) listDirty = true;\n st.active = active;\n st.dirty = false;\n st.stale = true;\n };\n\n /** Meet an entity: its widget type through the engine's catalog, its kind off the binding; not an object = nothing. */\n const enter = (e: Entity): ObjectState | undefined => {\n if (!world.isAlive(e)) return undefined;\n const id = world.get(e, PrefabId)?.id;\n if (typeof id !== \"string\") return undefined;\n const widget = widgetTypeFor(world, id);\n const kind = objectKindOf(widget);\n if (widget === undefined || kind === undefined) return undefined;\n meet(kind);\n const insert = world.has(e, InsertGhost);\n const st: ObjectState = {\n kind, widget, rect: { cx: 0, cy: 0, w: 0, h: 0 }, props: {}, selected: false, grabbed: false, locked: false, resizable: false, band: DEFAULT_STRATUM_BAND, dirty: true,\n lift: insert ? 1 : 0, liftV: 0, hover: 0, hoverV: 0, geometry: null, record: null, inside: null, slot: \"root\", next: undefined, seen: 0,\n rank: -1, active: false, lifted: false, stale: true, give: 0, content: null, zoom: Number.NaN, rung: 0, landed: 0, markRow: null, insert,\n };\n states.set(e, st);\n return st;\n };\n\n /**\n * Insert ghosts that left this tick (K5b), by type and rect with their lift: the twin a promotion projects in the same flush, met\n * where its ghost was, LANDS with that lift — the drop settles as any release does, never a snap to the mat. Kept for the tick's\n * build alone (cleared as the next pull begins).\n */\n const landing: { readonly type: string; readonly rect: ObjectRect; readonly lift: number; readonly liftV: number }[] = [];\n\n /** The state for an entity, met and fresh — or undefined when it is not an object. */\n const stateOf = (e: Entity): ObjectState | undefined => {\n const had = states.get(e);\n const st = had ?? enter(e);\n if (st === undefined) return undefined;\n if (st.dirty) refresh(e, st);\n if (had === undefined && landing.length > 0 && !st.insert) {\n const i = landing.findIndex((l) => l.type === st.widget.type && Math.abs(l.rect.cx - st.rect.cx) < 0.5 && Math.abs(l.rect.cy - st.rect.cy) < 0.5);\n const l = landing[i];\n if (l !== undefined) { st.lift = l.lift; st.liftV = l.liftV; landing.splice(i, 1); }\n }\n return st;\n };\n\n /** An entity the journal reports gone: a ghost at its last paint, if it was ever drawn in the root slot. */\n const ghostOf = (e: Entity, st: ObjectState): void => {\n if (st.geometry === null || st.slot !== \"root\") return;\n ghosts.set(e, { kind: st.kind, rect: st.rect, props: st.props, flux: { lift: st.lift, hover: st.hover, ring: 0, fade: 1 }, band: st.band, next: st.next, asset: assets.get(e), del: 0 });\n };\n\n /** An object's flux as the kinds are handed it: its springs, the ring 0 (retired at D4a — the marks draw the selection; its spring gone at D6). */\n const fluxOf = (st: ObjectState): ObjectFlux => ({ lift: st.lift, hover: st.hover, ring: 0, fade: 1 });\n\n /**\n * A parent's children that are objects, in sibling order (strata's ordered `ChildOf`), the strata\n * bands ascending within — the inside's paint order (sheets under things) — cached against the\n * parent's order stamp; every cache is dropped when the journal reports a removal or a reset.\n */\n const childrenOf = (parent: Entity): Entity[] => {\n const stamp = world.orderStamp(parent, ChildOf);\n const hit = kids.get(parent);\n if (hit !== undefined && hit.stamp === stamp) return hit.list;\n const list: Entity[] = [];\n for (const c of world.getReverse(parent, ChildOf)) if (stateOf(c) !== undefined) list.push(c);\n const band = (e: Entity): number => states.get(e)?.band ?? DEFAULT_STRATUM_BAND;\n list.sort((a, b) => band(a) - band(b)); // stable: the sibling sequence within a band\n kids.set(parent, { stamp, list });\n return list;\n };\n\n /** The bounds of a container's children — the inside's content (`contentOf`); null = empty. */\n const contentOf = (container: Entity): Rect | null => {\n const rects: Rect[] = [];\n for (const c of childrenOf(container)) {\n const st = stateOf(c);\n if (st === undefined) continue;\n rects.push({ x: st.rect.cx - st.rect.w / 2, y: st.rect.cy - st.rect.h / 2, width: st.rect.w, height: st.rect.h });\n }\n return boundsOf(rects);\n };\n\n const viewportOf = (): { readonly width: number; readonly height: number } => {\n const vp = world.getResource(Viewport);\n return { width: vp?.w ?? 0, height: vp?.h ?? 0 };\n };\n\n /** The frame's grid: the root's for the board root, a container kind's `insideGrid` for a mini mat entered. */\n const frameGridOf = (frame: Entity | undefined, root: GridConfig, looks: ReadonlyMap<string, unknown>): GridConfig => {\n if (frame === undefined || !world.isAlive(frame) || !world.hasTag(frame, Container)) return root;\n const st = stateOf(frame);\n if (st === undefined || st.kind.insideGrid === undefined) return root;\n return st.kind.insideGrid({ props: st.props, look: looks.get(st.kind.name) }, root);\n };\n\n /** THE SEAM's answer (design-015 §9) — see `DeskBuilder.navFace`. */\n const navFace = (container: Entity, cam: CameraState): NavFace | undefined => {\n const st = stateOf(container);\n if (st === undefined || st.kind.face === undefined) return undefined;\n // as DRAWN when it was built in the current frame this frame; at REST otherwise (the frame's own container, an exit's)\n let G: unknown;\n if (st.seen === seq && st.geometry !== null && st.slot === \"root\") G = st.geometry;\n else {\n const grid = lastGrid;\n const theme = lastTheme;\n if (grid === undefined || theme === undefined) return undefined;\n const vp = world.getResource(Viewport);\n const view: ObjectContext[\"view\"] = { camX: cam.x, camY: cam.y, zoom: cam.zoom, width: vp?.w ?? 0, height: vp?.h ?? 0, dpr: vp?.dpr ?? 1 };\n const local = locals?.get(st.kind.name);\n const ctx: ObjectContext = { entity: container, rect: st.rect, props: st.props, flux: FLUX_REST, look: lastLooks?.get(st.kind.name), theme, lamp: lampOf(grid.mat.plane), view, grid, dt: 0, ...(local !== undefined ? { local } : {}) };\n G = st.kind.resolve(ctx);\n }\n const face = st.kind.face(G);\n if (face === undefined) return undefined;\n const vpSize = viewportOf();\n const view = insideViewOfFace(face, st.kind.faceLaw?.radius ?? 0, contentOf(container), cam, vpSize, FIT, PORTAL_GATE);\n if (view === null) return undefined;\n return { face, arrival: view.arrival, affine: view.M, camera: view.cam, presence: view.presence, covers: (marginPx: number) => faceCovers(view.clip, vpSize, marginPx) };\n };\n\n return {\n build(cam, vp, dt0, theme, grid, looks, bopts = {}) {\n if (disposed) return { objects: [], portals: [], grid, marks: marks.frame({ rows: [], cam, view: vp, dt: 0, night: false, rulers: null }), stats: EMPTY_STATS };\n seq += 1;\n lastCam = cam;\n work.queried = 0; work.visited = 0; work.sorted = 0; work.resolved = 0; work.recorded = 0; work.reused = 0; work.rungs = 0; work.fresh = 0; work.rerung = 0; work.rezoomed = 0; work.restless = 0; work.unchipped = 0;\n const now = bopts.now ?? 0;\n const portalsOn = bopts.portals !== false;\n const restless = bopts.restless;\n const presented = bopts.presented;\n const nav = world.getResource(NavTransition);\n const flying = nav?.active === true;\n /**\n * THE DESK ITSELF MOVING this frame (D4b): a row's spring, a ghost fading, a re-dressing ramp, a flight — anything the blurred\n * copy behind the hand would show. It bumps `deskSeq` at the end of the build, so the copy follows the desk while it moves\n * and is reused only once it stands still (the spec's \"rendered once when the pick-up settles\"). Found by the world rig: a\n * copy made while a cleared scene's ghosts were still fading kept them for the whole hold.\n */\n let deskMoving = flying;\n /** Something landed on a desk object this build (`KindLocal.landed`; D7): the copy behind the hand is made again, once. */\n let deskLanded = false;\n // the cut frame (D-D2b.7) and a harness's freeze: no spring advances — the departed desk IS its pre-cut frame\n const dt = bopts.freeze === true || (flying && nav.p === 0) ? 0 : dt0;\n const lamp: Lamp = lampOf(grid.mat.plane);\n const vpSize = { width: vp.width, height: vp.height };\n const ordinals = order.ordinals();\n const hover = hoverTarget();\n const frame = currentNavFrame(world);\n // a nav cut changes the desk under the camera: a ghost of the desk left would fade in the wrong desk's units (the prototype has\n // no ghost across desks) — the ghosts go with the frame, and so does every record (D6: another desk's records are another desk's)\n const frameChanged = frame !== lastFrame;\n if (frameChanged) { ghosts.clear(); lastFrame = frame; listDirty = true; }\n // REMAKE ALL (D6): the theme, the grid or the looks are other objects than the last build's (the reflector remakes them on a\n // change), a law was tuned (`invalidate`), the frame changed — inputs beyond a record's own facts and flux moved\n const remakeAll = invalidated || frameChanged || theme !== lastTheme || grid !== lastGrid || looks !== lastLooks;\n invalidated = false;\n lastGrid = grid;\n lastLooks = looks;\n lastTheme = theme;\n // the zoom rung (D6): a kind whose record reads the view's zoom or dpr (`rezoom`) is remade when they move; a pan moves neither. The\n // zoom is the SLOT's (an inside's camera is its host's face's, which a lift or the content moves with the root camera still) — each\n // record keeps the zoom it was made at; the dpr is the frame's\n const redpr = vp.dpr !== lastDpr;\n /** A `rung` kind's word on `e` under its slot's camera (K6b), through the one scratch context — a zoom asks it of every drawn object. */\n const rungOf = (kind: ObjectKind, e: Entity, st: ObjectState, cam: CameraState): number => {\n work.rungs += 1;\n const r = st.rect;\n rungCtx.entity = e; rungCtx.rect = r; rungCtx.props = st.props; rungCtx.zoom = cam.zoom; rungCtx.dpr = vp.dpr; rungCtx.local = locals?.get(kind.name);\n rungCtx.px = Math.hypot(r.cx - (cam.x + vp.width / (2 * cam.zoom)), r.cy - (cam.y + vp.height / (2 * cam.zoom))) * cam.zoom;\n return kind.rung?.(rungCtx) ?? 0;\n };\n lastDpr = vp.dpr;\n const frameGrid = frameGridOf(frame, grid, looks);\n let portalsCount = 0;\n let live = false;\n /** The root slot's objects as the marks go around them (D4a) — the inside and departed slots add none. */\n const markRows: MarkRow[] = [];\n\n /**\n * One object's springs advanced by `dt` — the hold's lift (Grab), the hover's rise (the exact hit, never while held) — each\n * snapped when settled; a host's pin (`pinFlux`) holds a spring AT its value, a still. The selection's ring has no spring\n * (D6): the marks draw the selection since D4a, and a spring feeding a retired zero kept the desk live after every selection.\n * Returns whether a VALUE moved this frame: the record was made with the old one and is remade.\n */\n const stepSprings = (e: Entity, st: ObjectState): boolean => {\n const pin = pins.get(e);\n const lift0 = st.lift;\n const hover0 = st.hover;\n let moving: boolean;\n // a spring AT REST on its target is advanced to itself, still (K7a): it is left as it stands — no step, no tuple — so a pan\n // over a thousand objects at rest steps none of their springs\n const liftTo = pin?.lift ?? (st.grabbed || st.insert ? 1 : 0);\n if (st.lift !== liftTo || st.liftV !== 0) {\n [st.lift, st.liftV, moving] = advance(st.lift, st.liftV, liftTo, S.liftHz, S.liftDamp, dt, pin?.lift !== undefined);\n if (moving) { live = true; deskMoving = true; }\n }\n const hoverTo = pin?.hover ?? (hover === e && !st.grabbed ? 1 : 0);\n if (st.hover !== hoverTo || st.hoverV !== 0) {\n [st.hover, st.hoverV, moving] = advance(st.hover, st.hoverV, hoverTo, S.liftHz, S.liftDamp, dt, pin?.hover !== undefined);\n if (moving) { live = true; deskMoving = true; }\n }\n return st.lift !== lift0 || st.hover !== hover0;\n };\n\n /** One object's context for a slot: its springs as stepped this frame (`springs`) or at rest (an inside's members, a chip, the hand). */\n const contextOf = (e: Entity, st: ObjectState, view: ObjectContext[\"view\"], slotGrid: GridConfig, slotLamp: Lamp, springs: boolean, rect: ObjectRect = st.rect): ObjectContext => {\n // the kinds' own selection ring is retired — the marks draw the selection (D4a): they are handed ring 0, so a selected\n // object's pixels are the unselected object's\n const flux: ObjectFlux = springs ? fluxOf(st) : FLUX_REST;\n const asset = assets.get(e);\n const local = locals?.get(st.kind.name);\n return { entity: e, rect, props: st.props, flux, look: looks.get(st.kind.name), theme, lamp: slotLamp, view, grid: slotGrid, dt, ...(asset !== undefined ? { asset } : {}), ...(local !== undefined ? { local } : {}) };\n };\n\n /** A container's children as chips (each resolved at rest in the inside's own units) under the inside's camera. */\n const chipsOf = (e: Entity, st: ObjectState, ctx: ObjectContext, view: InsideView | null, slotGrid: GridConfig): ChildShape[] => {\n const chips: ChildShape[] = [];\n if (view === null) return chips;\n // this container's face law (K8a — its own `faceLaw`): at most its `chips`, in the finishes it draws — a chip in none of them\n // is not drawn, and counted; a container that declares none draws no chips\n const cap = st.kind.faceLaw?.chips ?? 0;\n const finishes = st.kind.faceLaw?.finishes ?? [];\n const insideGrid = st.kind.insideGrid?.({ props: st.props, look: ctx.look }, slotGrid) ?? slotGrid;\n const insideLamp = lampOf(insideGrid.mat.plane);\n const insideView: ObjectContext[\"view\"] = { camX: view.cam.x, camY: view.cam.y, zoom: view.cam.zoom, width: vp.width, height: vp.height, dpr: vp.dpr };\n for (const c of childrenOf(e)) {\n if (chips.length >= cap) break;\n const cst = stateOf(c);\n if (cst === undefined || cst.kind.chip === undefined) continue;\n const cctx = contextOf(c, cst, insideView, insideGrid, insideLamp, false);\n work.resolved += 1;\n const chip = cst.kind.chip(cst.kind.resolve(cctx), cctx);\n if (chip === null) continue;\n const finish = finishOf(chip.finish, finishes);\n if (finish === undefined) { work.unchipped += 1; continue; }\n chips.push(finish === chip.finish ? chip : { ...chip, finish });\n }\n return chips;\n };\n\n /**\n * A container's inside for its record (D2b): its content, its view through its face under the slot's camera, its children as\n * chips — and the candidate for a live slot when the gate lets it through. Kept on the state (D6): the content the record was\n * made with, and the view, which a pan moves even when the record stands (`insideViewOf`).\n */\n const insideOf = (e: Entity, st: ObjectState, G: unknown, ctx: ObjectContext, slotCam: CameraState, slotGrid: GridConfig): InsideContext | undefined => {\n const face = st.kind.face?.(G);\n if (face === undefined) { st.inside = null; st.content = null; return undefined; }\n const content = contentOf(e);\n const view = insideViewOfFace(face, st.kind.faceLaw?.radius ?? 0, content, slotCam, vpSize, FIT, PORTAL_GATE);\n st.inside = view;\n st.content = content;\n return { content, view, chips: chipsOf(e, st, ctx, view, slotGrid) };\n };\n\n /** Under `verify`: a reused record against a fresh resolve of the same state — a difference is a staleness the law above missed. */\n const checkReuse = (e: Entity, st: ObjectState, view: ObjectContext[\"view\"], slotGrid: GridConfig, slotLamp: Lamp, springs: boolean, give: number, slotCam: CameraState): void => {\n const r = st.rect;\n const drawn = give === 0 ? r : { ...r, cx: r.cx + give / slotCam.zoom };\n const ctx = contextOf(e, st, view, slotGrid, slotLamp, springs, drawn);\n const G = st.kind.resolve(ctx);\n const face = st.kind.face?.(G);\n const inside: InsideContext | undefined = face === undefined ? undefined : { content: st.content, view: st.inside, chips: chipsOf(e, st, ctx, st.inside, slotGrid) };\n const R = st.kind.record(G, inside === undefined ? ctx : { ...ctx, inside });\n if (!sameRecord(R, st.record)) mismatches += 1;\n };\n\n /**\n * Build one slot: `members` in paint order under `slotCam`, culled against the view and its margin (plus each kind's reach);\n * each container gets its inside, and the live insides that pass the gate — depth < 4, `presence > 0`, not the flight's `skip`\n * — are built through their faces, the largest first up to the cap, recursing. A row's RECORD is reused while nothing that made\n * it moved (D6): its facts (`stale`), its flux (a spring this frame), a law or a look (`remakeAll`), its zoom rung (a kind that\n * reads it), a kind whose own state is restless, a composite (its resolve steps its own motion), the tape's give, its slot.\n */\n const buildSlot = (members: readonly Entity[], slotCam: CameraState, slotGrid: GridConfig, slot: ObjectState[\"slot\"], depth: number, skip: Entity | undefined, redressOut: { frame: Entity; from: number; u: number } | undefined): SlotBuild => {\n const slotLamp = lampOf(slotGrid.mat.plane);\n const view: ObjectContext[\"view\"] = { camX: slotCam.x, camY: slotCam.y, zoom: slotCam.zoom, width: vp.width, height: vp.height, dpr: vp.dpr };\n const m = marginPx / slotCam.zoom;\n const x0 = slotCam.x - m;\n const y0 = slotCam.y - m;\n const x1 = slotCam.x + vp.width / slotCam.zoom + m;\n const y1 = slotCam.y + vp.height / slotCam.zoom + m;\n const rows: Row[] = [];\n const cands: { at: number; e: Entity; view: InsideView; grid: GridConfig }[] = [];\n let culled = 0;\n // the root's and the departed desk's objects run their springs; an inside's members lie at rest\n const springs = slot !== \"inside\";\n for (let i = 0; i < members.length; i++) {\n const e = members[i] as Entity;\n work.visited += 1;\n const st = stateOf(e);\n if (st === undefined) continue;\n const prevSlot = st.slot;\n st.seen = seq;\n st.slot = slot;\n st.next = slot === \"root\" ? members[i + 1] : undefined;\n // the object in hand (or flying home) is drawn as a slot of its own over the desk, never among the desk's rows nor its marks (D4b)\n if (hand !== null && hand.e > 0 && (e === hand.entity || handRiders.has(e)) && slot === \"root\") continue;\n // another presenter draws it this frame (K5b — the tray's carry): none of the root's rows nor its marks; its springs run on,\n // so it rejoins the desk at the lift it has\n if (slot === \"root\" && presented?.has(e) === true) { stepSprings(e, st); st.geometry = null; st.record = null; st.inside = null; continue; }\n // veiled by a kind's own state (D3t-c — a stuck note whose month the calendar is not showing): not drawn, never picked, no marks\n if (veiledNow.has(e) && !st.grabbed) { st.geometry = null; st.record = null; st.inside = null; continue; }\n const r = st.rect;\n const hx = r.w / 2 + st.kind.reach;\n const hy = r.h / 2 + st.kind.reach;\n if (r.cx + hx < x0 || r.cx - hx > x1 || r.cy + hy < y0 || r.cy - hy > y1) { st.geometry = null; st.record = null; st.inside = null; culled += 1; continue; }\n // a drag that met the tape shivers the object by its give (CSS px → world) — in the root slot alone, where the marks are (D4a)\n const give = slot === \"root\" ? marks.giveOf(e) : 0;\n const fluxMoved = springs ? stepSprings(e, st) : false;\n const kind = st.kind;\n const fresh = st.record === null || st.geometry === null;\n let remake = fresh || st.stale || remakeAll || fluxMoved || prevSlot !== slot || give !== st.give\n || kind.composite === true || restless?.has(kind.name) === true;\n if (fresh) work.fresh += 1;\n if (restless?.has(kind.name) === true) work.restless += 1;\n // the zoom (D6; K6b): a `rung` kind is remade only when its rung moved — a zoom within the rung remakes and writes nothing, the\n // zoom it was read at kept — and a `rezoom` kind (it reads the zoom continuously) on any move\n if (!remake && (redpr || slotCam.zoom !== st.zoom)) {\n if (kind.rung !== undefined) {\n if (rungOf(kind, e, st, slotCam) !== st.rung) { remake = true; work.rerung += 1; }\n else st.zoom = slotCam.zoom;\n } else if (kind.rezoom === true) { remake = true; work.rezoomed += 1; }\n }\n let G: unknown;\n let R: unknown;\n if (!remake) {\n G = st.geometry;\n R = st.record;\n work.reused += 1;\n // a container's inside this frame: its view under the slot camera moves with a pan even when its record stands\n if (kind.face !== undefined) {\n const face = kind.face(G);\n st.inside = face === undefined ? null : insideViewOfFace(face, st.kind.faceLaw?.radius ?? 0, st.content, slotCam, vpSize, FIT, PORTAL_GATE);\n }\n if (verifying) checkReuse(e, st, view, slotGrid, slotLamp, springs, give, slotCam);\n } else {\n const drawn = give === 0 ? r : { ...r, cx: r.cx + give / slotCam.zoom };\n const ctx = contextOf(e, st, view, slotGrid, slotLamp, springs, drawn);\n work.resolved += 1;\n G = kind.resolve(ctx);\n const inside = insideOf(e, st, G, ctx, slotCam, slotGrid);\n work.recorded += 1;\n R = kind.record(G, inside === undefined ? ctx : { ...ctx, inside });\n // something LANDED on it since its record was last made (a picture, a replay, tiles — not a running motion): the desk behind\n // the hand looks different though no fact moved, and its blurred copy must be made again (D7)\n const landed = locals?.get(kind.name)?.landed?.(e) ?? 0;\n if (landed !== st.landed) { st.landed = landed; deskLanded = true; }\n st.geometry = G;\n st.record = R;\n st.stale = false;\n st.give = give;\n st.zoom = slotCam.zoom;\n st.rung = kind.rung === undefined ? 0 : rungOf(kind, e, st, slotCam);\n // the marks go around what was drawn: the kind's frame on the geometry just resolved, ICE's rect (D4a) — kept with the record\n st.markRow = slot === \"root\"\n ? { entity: e, frame: kind.frame?.(G) ?? rectFrame(drawn), rect: { x0: r.cx - r.w / 2, y0: r.cy - r.h / 2, x1: r.cx + r.w / 2, y1: r.cy + r.h / 2 }, selected: st.selected, locked: st.locked, grabbed: st.grabbed, resizable: st.resizable }\n : null;\n }\n const at = rows.length;\n rows.push({ entity: e, kind: kind.name, record: R, band: st.band });\n if (slot === \"root\" && st.markRow !== null) markRows.push(st.markRow);\n const iv = st.inside;\n if (iv !== null && portalsOn && depth < PORTAL_DEPTH && e !== skip && iv.presence > 0) {\n cands.push({ at, e, view: iv, grid: kind.insideGrid?.({ props: st.props, look: looks.get(kind.name) }, slotGrid) ?? slotGrid });\n }\n }\n // the live insides: the largest faces first, up to the cap (MINIMAT.md §3), each a slot of its own through its face\n cands.sort((a, b) => b.view.clip.hx * b.view.clip.hy - a.view.clip.hx * a.view.clip.hy);\n const portals: PortalInputs[] = [];\n for (const c of cands.slice(0, PORTAL_CAP)) {\n const sub = buildSlot(childrenOf(c.e), c.view.cam, c.grid, \"inside\", depth + 1, undefined, undefined);\n portalsCount += 1;\n // a desk cut out of by a zoom-through is still dressed and lit as it left itself, handing both to this desk over the ramp (MINIMAT.md §4)\n const redress = redressOut !== undefined && redressOut.frame === c.e ? redressOut : undefined;\n portals.push({\n view: { camX: c.view.cam.x, camY: c.view.cam.y, zoom: c.view.cam.zoom, width: vp.width, height: vp.height, dpr: vp.dpr, box: c.view.box },\n ...(bopts.mat !== undefined ? { mat: bopts.mat } : {}),\n lodZoom: redress === undefined ? c.view.arrival.zoom : lodEase(redress.from, c.view.arrival.zoom, redress.u),\n present: insidePresent(c.view),\n ...(redress !== undefined ? { light: { a: c.view.cam, b: slotCam, t: redress.u } } : {}),\n grid: c.grid,\n objects: sub.rows.map((r) => ({ kind: r.kind, record: r.record, ...(r.entity !== undefined ? { key: r.entity as number } : {}) })),\n ...(sub.portals.length ? { portals: sub.portals } : {}),\n at: c.at,\n });\n }\n return { rows, portals, culled };\n };\n\n // THE RE-DRESSING (a zoom-through cut): its ramp from the clock it was first seen at; a harness may hold it at 0\n const redress = world.getResource(NavRedress);\n let redressIn: { from: number; u: number; frame: Entity } | undefined;\n let redressOut: { frame: Entity; from: number; u: number } | undefined;\n if (redress !== undefined && redress.epoch > 0 && !flying) {\n if (redress.epoch !== redressEpoch) { redressEpoch = redress.epoch; redressStart = now; }\n const u = bopts.holdRedress === true ? 0 : smoothstep(0, 1, Math.min(1, (now - redressStart) / Math.max(redressMs, 1)));\n if (u < 1) {\n live = true;\n deskMoving = true;\n if (redress.kind === \"in\") redressIn = { from: redress.from, u, frame: redress.frame };\n else redressOut = { frame: redress.frame, from: redress.from, u };\n }\n }\n\n // THE HAND (design-015 §8; D4b): the fact is `Held` — picked up, the clock starts (or resumes from where a put-down caught it);\n // let go, it flies home from where it is. A harness pins the carry for a still. The object is resolved ONCE, in its own slot\n // under the pose's camera (its extent to the reading size, no dapple, the day's light by night as the carry rises), never\n // among the desk's rows; landed — home and shut — it is the desk's again this very frame, and the brackets lock back on.\n // what the kinds' own states veil (D3t-c — a note stuck to a day of a month its calendar is not showing): asked row by row, so a\n // pad drawn earlier in this very build (the pads stratum paints first) has already said which of its notes go with its month\n // (the kinds that veil at all, gathered once a build: a row asks each by index — no iterator a row, K7a)\n const veilers: KindLocal[] = [];\n if (locals !== undefined) for (const local of locals.values()) if (local.veils !== undefined) veilers.push(local);\n const veiledNow = { has: (e: Entity): boolean => { for (let i = 0; i < veilers.length; i++) if ((veilers[i] as KindLocal).veils?.().has(e) === true) return true; return false; } };\n /** What rides with the object in hand (D3t-c — its stuck notes): drawn in the hand's slot, never on the desk behind. */\n const handRiders = new Set<Entity>();\n const heldNow = heldEntity(world);\n if (heldNow !== undefined) {\n if (hand === null || hand.entity !== heldNow) hand = { entity: heldNow, dir: 1, p: 0, e: 0, e0: 0, closeT: 0, openness: 0 };\n else if (hand.dir < 0) { hand.dir = 1; hand.p = inverseCarry(hand.e); hand.closeT = 0; }\n } else if (hand !== null && hand.dir > 0) { hand.dir = -1; hand.p = 0; hand.e0 = hand.e; hand.closeT = 0; }\n let heldBuild: HeldBuild | undefined;\n if (hand !== null) {\n const hst = world.isAlive(hand.entity) ? stateOf(hand.entity) : undefined;\n const binding = hst?.kind.open;\n if (hst === undefined || binding === undefined) hand = null; // gone (deleted, undone) or no opening after all: nothing is in the hand\n else {\n const pin = bopts.hold;\n const hdt = bopts.freeze === true ? 0 : dt0;\n let openTarget: boolean;\n if (pin !== undefined) { hand.dir = 1; hand.e = Math.min(Math.max(pin.e, 0), 1); hand.p = inverseCarry(hand.e); openTarget = pin.open ?? hand.p >= HOLD.openAt; }\n else if (hand.dir > 0) { hand.p = Math.min(1, hand.p + hdt / (HOLD.inMs / 1000)); hand.e = carryOf(hand.p); openTarget = hand.p >= HOLD.openAt; }\n else {\n // putting it down: it shuts first (the lead, or once the cover is under 0.35), then flies home and lands softly\n hand.closeT += hdt;\n if (hand.closeT >= HOLD.closeLead || hand.openness < 0.35) { hand.p = Math.min(1, hand.p + hdt / (HOLD.outMs / 1000)); hand.e = (1 - carryOf(hand.p)) * hand.e0; }\n openTarget = false;\n }\n // LANDED once home (p ≥ 1, the carry at 0): the cover's last hundredth shuts on the desk (D-D4b); a carry pinned at 0 is\n // the rest frame — the object rides the desk's rows this frame, byte for byte\n if (hand.dir < 0 && hand.p >= 1) hand = null;\n else if (hand.e > 0) {\n const extentLocal = binding.extent({ rect: hst.rect, props: hst.props });\n const angle = numberProp(hst.props, \"angle\", 0);\n // the extent turned with the object about its centre — where it lies on the desk (the home pose); in hand the turn lets go\n const ox = extentLocal.cx - hst.rect.cx;\n const oy = extentLocal.cy - hst.rect.cy;\n const ca = Math.cos(angle);\n const sa = Math.sin(angle);\n const extentWorld: ObjectRect = { cx: hst.rect.cx + ca * ox - sa * oy, cy: hst.rect.cy + sa * ox + ca * oy, w: extentLocal.w, h: extentLocal.h };\n // a spread read one page at a time on a phone: the page in view is the kind's (D3t-b — flux, the view glides)\n const face = binding.spread === true ? (binding.page?.({ entity: hand.entity, local: locals?.get(hst.kind.name) }) ?? 0) : 0;\n const target = readingTarget(extentLocal, vpSize, binding.spread === true, face);\n const user = world.get(hand.entity, HeldView) ?? HELD_USER_REST;\n const pose = heldPose(homePose(extentWorld, angle, cam), target, user, hand.e);\n const { cam: heldCam, grow } = heldCamera(pose, hst.rect, extentLocal, cam.zoom, binding.pose === \"eye\", vpSize);\n const heldView: ObjectContext[\"view\"] = { camX: heldCam.x, camY: heldCam.y, zoom: heldCam.zoom, width: vp.width, height: vp.height, dpr: vp.dpr };\n const heldGrid: GridConfig = { ...frameGrid, mat: { ...frameGrid.mat, gobo: { ...frameGrid.mat.gobo, opacity: 0 } } }; // dapple 0 in hand\n const base = contextOf(hand.entity, hst, heldView, heldGrid, lampOf(heldGrid.mat.plane), false);\n const props = typeof hst.props.angle === \"number\" ? { ...hst.props, angle: pose.angle } : hst.props;\n const snap = pin !== undefined || bopts.freeze === true;\n const hctx: ObjectContext = { ...base, props, held: { e: hand.e, open: openTarget, grow, snap } };\n work.resolved += 1; work.recorded += 1;\n const G = hst.kind.resolve(hctx);\n const R = hst.kind.record(G, hctx);\n hst.geometry = G;\n hst.record = R;\n hst.stale = true; // made under the hand's camera and openness: the desk's record of it is made afresh when it lands\n hst.inside = null;\n hst.slot = \"root\";\n hst.seen = seq;\n // a kind with no cover (the whiteboard, the desk calendar — no `openness`) has nothing of its own to open: its carry is its\n // whole motion, and it reads shut (0) for the flight home's lead. Only a kind that declares the motion can keep it live (D7)\n const openness = binding.openness?.(hctx);\n hand.openness = openness ?? 0;\n const settledNow = pin !== undefined ? hand.e >= 1 : hand.dir > 0 && hand.p >= 1;\n const coverMoving = openness !== undefined && (openTarget ? openness < 1 - 1e-3 : openness > 1e-3);\n if (pin === undefined && (hand.dir < 0 || hand.p < 1 || coverMoving)) live = true;\n // what rides with it (D3t-c — `riders`: a calendar's stuck notes, \"they ride along, as when you carry the pad\"): each drawn in\n // the hand's slot under the same camera, at rest, over it — and out of the desk behind while it is in hand\n const riders: SlotObject[] = [];\n const typeId = world.get(hand.entity, PrefabId)?.id;\n for (const rider of typeof typeId === \"string\" ? (widgetTypeFor(world, typeId)?.riders?.(world, hand.entity) ?? []) : []) {\n const rst = veiledNow.has(rider) ? undefined : stateOf(rider);\n if (rst === undefined) continue;\n const rctx = contextOf(rider, rst, heldView, heldGrid, lampOf(heldGrid.mat.plane), false);\n work.resolved += 1; work.recorded += 1;\n riders.push({ kind: rst.kind.name, record: rst.kind.record(rst.kind.resolve(rctx), rctx), key: rider as number });\n handRiders.add(rider);\n }\n heldBuild = {\n entity: hand.entity, e: hand.e, settled: settledNow, landing: hand.dir < 0,\n frame: { ...heldFrame(pose, extentLocal, target.single, face), settled: settledNow },\n inputs: { object: { kind: hst.kind.name, record: R, key: hand.entity as number }, ...(riders.length > 0 ? { riders } : {}), view: heldView, grid: heldGrid, e: hand.e, ...heldFocus(hand.e, vpSize, theme) },\n deskSeq,\n };\n }\n }\n }\n\n // THE DIRT, first (D6): every state the journal marked is re-read now, so a membership or tier fact that moved — Active, a Grab,\n // the stratum — dirties the frame's list or its order BEFORE this build decides them (a Grab added this tick paints last this frame)\n for (const e of dirtyStates) { const st = states.get(e); if (st?.dirty === true) refresh(e, st); }\n dirtyStates.clear();\n // THE LIFTED TIER (D3t-a — what a kind's own state draws LIFTED: a print in a hand, in the air, flying home): the kind's word,\n // asked of what was lifted last build and, while a kind's state is restless, of every object of that kind (D6 — never of every\n // object every frame); a host that gives no word on restlessness (a test, a bare host) has every object asked. A change re-sorts.\n if (locals !== undefined) {\n const check = (e: Entity, st: ObjectState): void => {\n const v = !st.grabbed && locals.get(st.kind.name)?.lifted?.(e) === true;\n if (v !== st.lifted) { st.lifted = v; orderDirty = true; }\n };\n if (restless === undefined) { for (const [e, st] of states) if (st.rank >= 0) check(e, st); }\n else {\n for (const e of liftedList) { const st = states.get(e); if (st !== undefined) check(e, st); }\n if (restless.size > 0) for (const [e, st] of states) if (restless.has(st.kind.name) && !st.lifted && st.rank >= 0) check(e, st);\n }\n }\n // THE LIST (D6): every object Active in the frame in paint order — the carried set last (a core drag's `Grab`, the lifted) —\n // rebuilt only when the membership moved, re-sorted only when the order did; a camera move walks none of it\n let listRebuilt = false;\n if (listDirty) {\n const tiers: [Entity[], Entity[]] = [[], []];\n world.query(membersQ).each((b) => {\n for (const r of b) {\n const e = b.entity(r);\n work.queried += 1;\n const st = stateOf(e);\n if (st === undefined) continue;\n st.active = true;\n st.lifted = !st.grabbed && locals?.get(st.kind.name)?.lifted?.(e) === true;\n (st.grabbed || st.lifted ? tiers[1] : tiers[0]).push(e);\n }\n });\n for (const t of tiers) { work.sorted += t.length; t.sort((a, b) => compareStackOrder(reader, ordinals, a, b)); }\n list = [...tiers[0], ...tiers[1]];\n listDirty = false;\n orderDirty = false;\n for (const st of states.values()) st.rank = -1;\n list.forEach((e, i) => { (states.get(e) as ObjectState).rank = i; });\n candidates = null;\n listRebuilt = true;\n } else if (orderDirty) {\n const tiers: [Entity[], Entity[]] = [[], []];\n for (const e of list) { const st = states.get(e); if (st !== undefined) (st.grabbed || st.lifted ? tiers[1] : tiers[0]).push(e); }\n for (const t of tiers) { work.sorted += t.length; t.sort((a, b) => compareStackOrder(reader, ordinals, a, b)); }\n list = [...tiers[0], ...tiers[1]];\n orderDirty = false;\n list.forEach((e, i) => { (states.get(e) as ObjectState).rank = i; });\n candidates?.sort((a, b) => (states.get(a) as ObjectState).rank - (states.get(b) as ObjectState).rank);\n }\n liftedList = list.filter((e) => states.get(e)?.lifted === true);\n // THE CULL (design-015 §2.5; D6): the frame's objects within the view, its margin and the kinds' reach — asked of the spatial\n // index with a hysteresis band (the margin again), so a pan asks again only when the view leaves the last answer or the world\n // moved; the exact test per candidate is `buildSlot`'s. Without an index, every member is a candidate (a test, a bare host).\n let rootMembers: readonly Entity[] = list;\n // the index lags the world by a tick after a nav cut (cleared, refilled next `spatialSync`): fewer entries than members = not this build\n if (spatial !== undefined && spatial.size !== undefined && spatial.size < list.length) candidates = null;\n else if (spatial !== undefined) {\n const m = marginPx / cam.zoom;\n const need = { minX: cam.x - m - reach, minY: cam.y - m - reach, maxX: cam.x + vp.width / cam.zoom + m + reach, maxY: cam.y + vp.height / cam.zoom + m + reach };\n const q = queryRect;\n if (candidates === null || candGen !== worldGen || q === null || need.minX < q.minX || need.minY < q.minY || need.maxX > q.maxX || need.maxY > q.maxY) {\n queryRect = { minX: need.minX - m, minY: need.minY - m, maxX: need.maxX + m, maxY: need.maxY + m };\n const found: Entity[] = [];\n for (const hit of spatial.search(queryRect)) { const st = states.get(hit.id); if (st !== undefined && st.rank >= 0) found.push(hit.id); }\n found.sort((a, b) => (states.get(a) as ObjectState).rank - (states.get(b) as ObjectState).rank);\n candidates = found;\n candGen = worldGen;\n }\n rootMembers = candidates;\n }\n // the root slot: the current frame's desk under the camera\n const root = buildSlot(rootMembers, cam, frameGrid, \"root\", 0, undefined, redressOut);\n const rows = root.rows;\n const drawnRows = rows.length;\n // the ghosts: each fades where it was — just before the object that followed it, else at its band's end — then is forgotten\n const rootView: ObjectContext[\"view\"] = { camX: cam.x, camY: cam.y, zoom: cam.zoom, width: vp.width, height: vp.height, dpr: vp.dpr };\n const rootLamp = lampOf(frameGrid.mat.plane);\n for (const [e, g] of ghosts) {\n // a ghost fades on the frame's own clock, held or not: a held clock (a pinned flight) must not keep a deleted object on the desk\n g.del = Math.min(g.del + dt0 / ghostS, 1);\n if (g.del >= 1) { ghosts.delete(e); forget(g.kind, e); continue; }\n live = true;\n deskMoving = true;\n const local = locals?.get(g.kind.name);\n const ctx: ObjectContext = { entity: e, rect: g.rect, props: g.props, flux: { ...g.flux, ring: 0, fade: 1 - g.del }, look: looks.get(g.kind.name), theme, lamp: rootLamp, view: rootView, grid: frameGrid, dt, ...(g.asset !== undefined ? { asset: g.asset } : {}), ...(local !== undefined ? { local } : {}) };\n work.resolved += 1; work.recorded += 1;\n const G = g.kind.resolve(ctx);\n const row: Row = { entity: undefined, kind: g.kind.name, record: g.kind.record(G, ctx), band: g.band, ghostOf: e };\n let at = g.next === undefined ? -1 : rows.findIndex((q) => q.entity === g.next);\n if (at < 0) { at = rows.length; for (let i = 0; i < rows.length; i++) { if ((rows[i] as Row).band > row.band) { at = i; break; } } }\n rows.splice(at, 0, row);\n // a ghost before a live inside's mini mat shifts that inside's `at`\n for (let i = 0; i < root.portals.length; i++) { const p = root.portals[i] as PortalInputs; if (p.at >= at) root.portals[i] = { ...p, at: p.at + 1 }; }\n }\n\n // THE FLIGHT: the departed desk beside the arriving one\n let present: Presentation | undefined;\n let light: SlotLight | undefined;\n let lodZoom: number | undefined = bopts.lodZoom;\n let outgoing: OutgoingInputs | undefined;\n if (flying) {\n const entering = nav.kind === \"enter\";\n const outCam = departedCameraOf(nav, cam);\n // the departed frame's desk: its Retained widgets in their sibling order (the frame's parent: the board root, or the container left)\n const departedFrame = nav.fromFrame;\n const root0 = world.getResource(BoardRoot)?.root;\n const parent = departedFrame !== (0 as Entity) && world.isAlive(departedFrame) ? departedFrame : root0;\n let members: Entity[];\n if (parent !== undefined && world.isAlive(parent)) members = childrenOf(parent).filter((e) => world.hasTag(e, Retained));\n else { members = []; world.query(retainedQ).each((b) => { for (const r of b) members.push(b.entity(r)); }); }\n const departedGrid = frameGridOf(parent !== undefined && world.hasTag(parent, Container) ? parent : undefined, grid, looks);\n // the container the flight is through: entered (its inside is the arriving desk) or left (the arriving desk's live inside shows the same pixels)\n const container = entering ? nav.toFrame : nav.fromFrame;\n const departed = buildSlot(members, outCam, departedGrid, \"departed\", 0, entering ? container : undefined, undefined);\n // the face lives in the PARENT desk: the departed one on enter, the arriving one on exit. A frozen flight has none — it is a dissolve.\n let clip: Presentation[\"portal\"] | undefined;\n let at = -1;\n if (!nav.frozen) {\n const cst = states.get(container);\n const face = cst !== undefined && cst.geometry !== null && cst.seen === seq ? cst.kind.face?.(cst.geometry) : undefined;\n if (face !== undefined) clip = clipOf(face, cst?.kind.faceLaw?.radius ?? 0, entering ? outCam : cam);\n if (entering) at = departed.rows.findIndex((r) => r.entity === container);\n }\n const f = { kind: nav.kind, p: nav.p, frozen: nav.frozen };\n const pres = flightPresent(f, clip, PORTAL_GATE);\n const lights = flightLights(f, cam, outCam);\n present = pres.incoming;\n light = lights.incoming;\n lodZoom = nav.c1z; // the arriving desk is dressed for its landing (PORTAL.md §9)\n outgoing = {\n view: { camX: outCam.x, camY: outCam.y, zoom: outCam.zoom, width: vp.width, height: vp.height, dpr: vp.dpr },\n ...(bopts.mat !== undefined ? { mat: bopts.mat } : {}),\n lodZoom: nav.fromZ, // the departed desk keeps the dressing it had at the cut\n present: pres.outgoing,\n ...(lights.outgoing !== undefined ? { light: lights.outgoing } : {}),\n grid: departedGrid,\n objects: departed.rows.map((r) => ({ kind: r.kind, record: r.record, ...(r.entity !== undefined ? { key: r.entity as number } : {}) })),\n ...(departed.portals.length ? { portals: departed.portals } : {}),\n order: entering ? \"under\" : \"over\",\n ...(at >= 0 && clip !== undefined ? { at } : {}),\n };\n } else if (redressIn !== undefined) {\n // cut INTO by a zoom-through: the desk is dressed as its face showed it and lit by the desk it was cut from, easing to its own (MINIMAT.md §4)\n lodZoom = lodEase(redressIn.from, cam.zoom, redressIn.u);\n const face = navFace(redressIn.frame, cam);\n if (face !== undefined) light = { a: solveFlightStart(face.affine, cam), b: cam, t: redressIn.u };\n }\n\n // an object that left the frame without dying (a nav cut) is forgotten, no ghost: it was not deleted — its kind lets go of it (D2c).\n // Asked only when the membership moved this build (D6): a state not drawn this build and not a member of the frame — nor under\n // one to the portal depth (an inside's objects), nor kept by a flight (the departed desk's Retained members are drawn) — goes\n if (listRebuilt) {\n const kept = new Set<Entity>(list);\n const under = (e: Entity): boolean => { let p: Entity | undefined = e; for (let d = 0; d <= PORTAL_DEPTH && p !== undefined; d++) { if (kept.has(p)) return true; p = world.isAlive(p) ? world.getRelation(p, ChildOf) : undefined; } return false; };\n for (const [e, st] of states) if (st.seen !== seq && !under(e)) { states.delete(e); forget(st.kind, e); }\n }\n // the records with their keys (D6, design-015 §4.3): an object's entity, a ghost's entity negated — what the passes keep a slot by\n const objects: SlotObject[] = rows.map((r) => ({ kind: r.kind, record: r.record, key: r.entity !== undefined ? (r.entity as number) : -(r.ghostOf as number) }));\n // the pick's word on what was veiled, as this build left it\n const veiledSet = new Set<Entity>();\n for (const local of locals?.values() ?? []) for (const e of local.veils?.() ?? []) veiledSet.add(e);\n veiledList = veiledSet;\n // the marks: the root slot's rows under the root camera — the current frame's desk — and its grid's rulers (an entered mini mat prints none) (D4a)\n const ruler = frameGrid.mat.ruler;\n const marked = marks.frame({ rows: markRows, cam, view: vp, dt, night: theme.name === \"dark\", rulers: ruler.on ? { margin: ruler.margin, band: ruler.band } : null });\n live ||= marks.live();\n // the desk moved under the hand, this frame or the last: the blurred copy's count moves with it (the hand's own motion never\n // does). The last frame too — a ghost leaves, a spring snaps to its target, a ramp ends — on a frame that reads still, and the\n // copy must take that frame, not the one before it.\n if (deskMoving || deskWasMoving || deskLanded) { deskSeq += 1; if (heldBuild !== undefined) heldBuild = { ...heldBuild, deskSeq }; }\n deskWasMoving = deskMoving;\n lastHand = heldBuild;\n totals.queried += work.queried; totals.visited += work.visited; totals.sorted += work.sorted; totals.resolved += work.resolved; totals.recorded += work.recorded; totals.reused += work.reused; totals.rungs += work.rungs; totals.fresh += work.fresh; totals.rerung += work.rerung; totals.rezoomed += work.rezoomed; totals.restless += work.restless; totals.unchipped += work.unchipped;\n stats = { active: list.length, objects: objects.length, culled: list.length - drawnRows, ghosts: ghosts.size, portals: portalsCount, live, work: { ...work }, totals: { ...totals }, mismatches };\n return {\n objects,\n portals: root.portals,\n grid: frameGrid,\n ...(lodZoom !== undefined ? { lodZoom } : {}),\n ...(present !== undefined ? { present } : {}),\n ...(light !== undefined ? { light } : {}),\n ...(outgoing !== undefined ? { outgoing } : {}),\n marks: marked,\n ...(heldBuild !== undefined ? { held: heldBuild } : {}),\n stats,\n };\n },\n live: () => stats.live,\n changed() {\n if (disposed) return false;\n landing.length = 0; // the last tick's promoted ghosts: their twins were met in its build, or never will be\n const delta = collector.drain();\n const wokeNow = woke;\n let any = woke;\n woke = false;\n // the desk copy behind the hand (D4b) stands while the only change is the held object's own (its HeldView, its tool, its\n // facts — and, D3t-a, its DATA children: a stroke laid on the board in hand): every other dirt below bumps `deskSeq`\n const heldE = hand?.entity ?? heldEntity(world);\n const ownOfHeld = (e: Entity): boolean => e === heldE || (heldE !== undefined && world.isAlive(e) && world.getRelation(e, ChildOf) === heldE && !states.has(e));\n let deskDirt = wokeNow;\n /** Every fact re-read at the next build (a reset, a coarse write): every state dirty, the frame's list rebuilt (D6). */\n const dirtyAll = (): void => { for (const [e, st] of states) { st.dirty = true; dirtyStates.add(e); } listDirty = true; };\n if (delta.reset) { wakes.reset += 1; dirtyAll(); kids.clear(); any = true; deskDirt = true; }\n if (delta.changed.length > 0 || delta.coarse.length > 0) {\n wakes.world += 1;\n any = true;\n for (const e of delta.changed) {\n const st = states.get(e);\n if (st !== undefined) { st.dirty = true; dirtyStates.add(e); }\n // a newcomer to the frame (a spawn, an Active flip): the frame's list is rebuilt (D6)\n else if (world.isAlive(e) && (world.hasTag(e, Active) || world.hasTag(e, Retained))) listDirty = true;\n // its container's inside moved with it (D6): the container's record — its chips, its content — is made afresh\n const p = world.isAlive(e) ? world.getRelation(e, ChildOf) : undefined;\n if (p !== undefined) { const ps = states.get(p); if (ps !== undefined) ps.stale = true; }\n if (!ownOfHeld(e)) deskDirt = true;\n }\n if (delta.coarse.length > 0) { dirtyAll(); deskDirt = true; }\n }\n if (delta.removed.length > 0) {\n kids.clear();\n listDirty = true;\n for (const e of delta.removed) {\n const st = states.get(e);\n if (st === undefined) continue;\n if (st.insert) {\n // an insert ghost leaves without a delete fade (K5b): promoted, its twin lands in its place with its lift; flown home, it has shrunk to nothing\n landing.push({ type: st.widget.type, rect: st.rect, lift: st.lift, liftV: st.liftV });\n forget(st.kind, e);\n } else {\n ghostOf(e, st); // the ghost takes the asset with it\n if (!ghosts.has(e)) forget(st.kind, e); // never drawn in the root: nothing fades, the kind lets go now (D2c)\n }\n states.delete(e);\n pins.delete(e);\n assets.delete(e);\n wakes.removed += 1;\n any = true;\n deskDirt = true;\n }\n }\n if (order.stale()) { wakes.order += 1; orderDirty = true; any = true; deskDirt = true; }\n const h = hoverTarget();\n if (h !== lastHover) { lastHover = h; wakes.hover += 1; any = true; deskDirt = true; }\n if (marks.changed()) { wakes.marks += 1; any = true; deskDirt = true; }\n if (deskDirt) deskSeq += 1;\n if (any) worldGen += 1;\n return any;\n },\n wakes: () => ({ ...wakes }),\n geometryOf: (e) => states.get(e)?.geometry ?? undefined,\n kindOf: (e) => states.get(e)?.kind,\n fluxOf: (e) => { const st = states.get(e); return st === undefined ? undefined : fluxOf(st); },\n insideViewOf: (e) => states.get(e)?.inside ?? undefined,\n navFace,\n pin(e, asset) {\n if (asset === undefined) { if (!assets.delete(e)) return; } else assets.set(e, asset);\n const st = states.get(e);\n if (st !== undefined) st.stale = true; // its record is remade at the next build; the facts need no re-read\n woke = true;\n wakes.world += 1;\n },\n pinFlux(e, targets) {\n if (targets === undefined) { if (!pins.delete(e)) return; } else pins.set(e, targets);\n const st = states.get(e);\n if (st !== undefined) st.stale = true;\n woke = true;\n wakes.world += 1;\n },\n clearFlux() {\n if (pins.size === 0) return;\n for (const e of pins.keys()) { const st = states.get(e); if (st !== undefined) st.stale = true; }\n pins.clear();\n woke = true;\n wakes.world += 1;\n },\n reach: () => reach,\n anchor: () => marks.anchor(),\n meetTape: (e) => marks.refused(e),\n hand: () => lastHand,\n heldToWorld: (e, x, y) => heldToWorld(e, x, y),\n heldPoint: (e, wx, wy) => heldPoint(e, wx, wy),\n lifted: () => liftedList,\n veiled: (e) => veiledList.has(e),\n rankOf(e) {\n const st = states.get(e);\n return st !== undefined && st.seen === seq && st.record !== null && st.slot === \"root\" && st.rank >= 0 ? st.rank : undefined;\n },\n shows(e) {\n const st = states.get(e);\n return st !== undefined && st.seen === seq && st.record !== null;\n },\n remake(e) {\n const st = states.get(e);\n if (st === undefined) return;\n st.stale = true;\n woke = true;\n wakes.world += 1;\n },\n invalidate() { invalidated = true; woke = true; wakes.world += 1; },\n verify(on) { verifying = on; },\n heldPart(e, x, y) {\n const w = heldToWorld(e, x, y);\n const st = states.get(e);\n if (w === undefined || st === undefined || st.geometry === null) return null;\n return st.kind.hit(st.geometry, w[0], w[1]);\n },\n stats: () => stats,\n dispose() {\n disposed = true;\n marks.dispose();\n collector.dispose();\n states.clear();\n ghosts.clear();\n pins.clear();\n assets.clear();\n kids.clear();\n },\n };\n}\n\n/** The flux of an object nobody has met: at rest. */\nexport { FLUX_REST };\n","// THE RASTER BUDGET (design-015 §11.4, plan D6 — \"the memory budget: only resident boards keep a raster (evict to their\n// strokes, replay on return — they are a cache); notebook ink layers and calendar tiles under ONE budget with LRU\"). One\n// ledger for every raster a kind keeps as a CACHE of its data: a whiteboard's ink (its strokes are the truth — design-015\n// §5.1), a notebook page's CPU raster (its strokes), the calendar's print tiles. Each owner CHARGES what it made with a way to\n// EVICT it, TOUCHES it when it is used, RELEASES it when it lets go itself; the ledger evicts the least recently used entries\n// beyond its cap — never one the owner says to keep this frame (what is on screen) — and the owner remakes an evicted raster\n// from its data when it is next drawn. The numbers are the ledger's own (`stats`): the desk's rig reads them; nothing here\n// touches the device.\n//\n// RESIDENT charges (K9 R2, design-016 K-L4 \"thumbnails always\"): what an owner keeps WHOLE — the pictures' and the boards'\n// thumbnail arrays — RESIDES: it is never evicted and never in the LRU's way. Before K9 the arrays were charged like caches\n// (kept by `keep`, but counted against the cap): past ~128 pictures or boards they alone filled the cap, so the LRU evicted\n// every other owner's off-screen raster each tick and the pictures could afford no detail at all. Now the caches' ROOM is what\n// the resident charges leave of the cap, never under a FLOOR (a quarter of it — a few details, a board raster or two — however\n// many thumbnails stand), and `used` reads the whole honestly: resident and caches together, over the cap when the thumbnails\n// alone are (the rig's memory row says so rather than the desk hiding it).\n\nexport interface BudgetStats {\n readonly cap: number;\n /** Bytes charged across every owner — the resident arrays and the caches together. */\n readonly used: number;\n /** Bytes that reside (never evicted): the thumbnail arrays. */\n readonly resident: number;\n /** What the caches may hold beside what resides: `cap − resident`, never under the floor. */\n readonly room: number;\n readonly entries: number;\n /** Evictions since the ledger was made. */\n readonly evictions: number;\n readonly byOwner: Readonly<Record<string, { readonly bytes: number; readonly entries: number }>>;\n}\n\nexport interface RasterBudget {\n readonly cap: number;\n /** The caches' room this moment: `cap − resident`, never under the floor. */\n room(): number;\n /** An owner's raster `key` of `bytes`, and how to let it go; a second charge of the same key re-sizes it (the old bytes released). Touches it. */\n charge(owner: string, key: string, bytes: number, evict: () => void): void;\n /** An owner's `key` kept WHOLE (a thumbnail array): never evicted, outside the caches' room; a second call re-sizes it. */\n reside(owner: string, key: string, bytes: number): void;\n /** The raster was used (drawn, written): it is the most recently used now. */\n touch(owner: string, key: string): void;\n /** The owner let the raster (or the resident array) go itself (no eviction). */\n release(owner: string, key: string): void;\n /**\n * Evict least-recently-used caches until they are within their room — never one `keep` says to hold (an owner's word on\n * what is on screen this frame; absent, every cache may go), never a resident charge. Returns the bytes freed.\n */\n trim(keep?: (owner: string, key: string) => boolean): number;\n stats(): BudgetStats;\n}\n\ninterface Entry { readonly owner: string; readonly key: string; bytes: number; used: number; readonly resident: boolean; readonly evict: () => void }\n\nconst id = (owner: string, key: string): string => `${owner}\\u0000${key}`;\n\n/** The caches' floor as a share of the cap: what they may always hold, however much resides (D-K9-d.1). */\nexport const BUDGET_FLOOR = 1 / 4;\n\nexport function createRasterBudget(cap: number, floor: number = Math.floor(cap * BUDGET_FLOOR)): RasterBudget {\n const entries = new Map<string, Entry>();\n let cached = 0;\n let resident = 0;\n let clock = 0;\n let evictions = 0;\n const drop = (k: string, ent: Entry): void => { entries.delete(k); if (ent.resident) resident -= ent.bytes; else cached -= ent.bytes; };\n const room = (): number => Math.max(floor, cap - resident);\n return {\n cap,\n room,\n charge(owner, key, bytes, evict) {\n const k = id(owner, key);\n const had = entries.get(k);\n if (had !== undefined) drop(k, had);\n clock += 1;\n entries.set(k, { owner, key, bytes, used: clock, resident: false, evict });\n cached += bytes;\n },\n reside(owner, key, bytes) {\n const k = id(owner, key);\n const had = entries.get(k);\n if (had !== undefined) drop(k, had);\n clock += 1;\n entries.set(k, { owner, key, bytes, used: clock, resident: true, evict: () => {} });\n resident += bytes;\n },\n touch(owner, key) {\n const ent = entries.get(id(owner, key));\n if (ent !== undefined) { clock += 1; ent.used = clock; }\n },\n release(owner, key) {\n const k = id(owner, key);\n const ent = entries.get(k);\n if (ent !== undefined) drop(k, ent);\n },\n trim(keep) {\n const limit = room();\n if (cached <= limit) return 0;\n // the candidates, least recently used first\n const order = [...entries.entries()].filter(([, e]) => !e.resident && (keep === undefined || !keep(e.owner, e.key))).sort((a, b) => a[1].used - b[1].used);\n let freed = 0;\n for (const [k, ent] of order) {\n if (cached <= limit) break;\n drop(k, ent);\n freed += ent.bytes;\n evictions += 1;\n ent.evict();\n }\n return freed;\n },\n stats() {\n const byOwner: Record<string, { bytes: number; entries: number }> = {};\n for (const e of entries.values()) {\n let o = byOwner[e.owner];\n if (o === undefined) { o = { bytes: 0, entries: 0 }; byOwner[e.owner] = o; }\n o.bytes += e.bytes;\n o.entries += 1;\n }\n return { cap, used: resident + cached, resident, room: room(), entries: entries.size, evictions, byOwner };\n },\n };\n}\n","// THE FRAME'S RASTER QUEUE (K6b, design-016 §6 — \"re-rasters capped per frame; the old raster stands meanwhile\"). A kind whose\n// objects keep a raster as a cache of their data makes it again when the zoom asks another density (a note's ink at a new band, a\n// board's strokes at a new density) and when an object comes on screen holding none. Done in the frame that asked, a zoom across\n// a rung re-rastered every object near the view in ONE frame — the stall design-016 §1.3 measured (193 ms: 108 notes in a frame).\n// Instead the kind ASKS here and keeps drawing what it has (its old raster, scaled; a thumbnail; blank paper); the host gives the\n// queue its turn once a tick, BEFORE the build (a raster laid and its record remade reach the same frame): the asks run lowest\n// priority first while the frame's budget lasts — a run starts only while the ms spent this turn plus its owner's measured cost of\n// a run fits `budgetMs`, and the turn's first always runs, so every ask is served in finitely many frames. An ask whose object was\n// not drawn in the last build is let go unrun (it asks again when it is). A run that finds no room is HELD, out of the count that\n// keeps the desk awake — and so are its owner's later asks of that turn, unrun (the pages are as full for them) — until room may\n// have been made: its owner let a raster go (`wake(owner)`), or the host drew a frame (`wake()` — what is drawn moved, and a\n// raster no longer drawn may be evicted). The desk idles at zero submits with asks held. Nothing here touches the device: the\n// runs do.\n\nimport type { Entity } from \"@ice/core\";\n\n/** What a run says: `done` — the raster is laid (or no longer owed); `wait` — no room for it now: held until its owner `wake`s. */\nexport type RasterRun = () => \"done\" | \"wait\";\n\nexport interface RasterQueueStats {\n /** The frame's budget, ms. */\n readonly budgetMs: number;\n /** Asks waiting for their turn, and those held for room. */\n readonly waiting: number;\n readonly held: number;\n /** Runs since the queue was made, the turns that ran any, and their ms. */\n readonly ran: number;\n readonly turns: number;\n readonly ms: number;\n /** Asks let go unrun: their object was not drawn when their turn came. */\n readonly dropped: number;\n /** The most runs one turn made, the most ms one turn spent, and the most one run took — a turn overshoots its budget by at most its last run. */\n readonly peakRuns: number;\n readonly peakMs: number;\n readonly dearest: number;\n}\n\nexport interface RasterQueue {\n /** The frame's budget, ms (the turn's first run excepted). */\n readonly budgetMs: number;\n /**\n * Ask for `owner`'s raster of `key` (a kind and its object): `priority` orders the turn (lower first — a kind puts what shows\n * nothing before what shows a stand-in, and the nearest the view's centre first); `run` lays it when its turn comes. A second ask\n * for the same key replaces the first — its priority and its run, and a held ask is waiting again.\n */\n ask(owner: string, key: Entity, priority: number, run: RasterRun): void;\n /** The ask is withdrawn: the object's need went away before its turn (the zoom came back to the band it holds), or it left. */\n drop(owner: string, key: Entity): void;\n has(owner: string, key: Entity): boolean;\n /** Room may have been made — `owner` let a raster go, or (no owner) the host drew a frame: the held asks wait for their turn again. */\n wake(owner?: string): void;\n /** Every ask of `owner` withdrawn (its state reset), or every ask. */\n clear(owner?: string): void;\n /** The host's turn, once a tick before the build: the runs, lowest priority first, while the budget lasts. Returns how many ran. */\n drain(): number;\n /** Asks waiting for their turn — the host keeps the desk awake while there are any (held asks are not counted). */\n readonly size: number;\n stats(): RasterQueueStats;\n}\n\nexport interface RasterQueueOptions {\n /** The frame's budget, ms (default `RASTER_BUDGET_MS`). */\n readonly budgetMs?: number;\n /** The clock the budget is kept on (default `performance.now`). */\n readonly clock?: () => number;\n /** Was the object drawn in the last build (the builder's word, `DeskBuilder.shows`)? Absent: every ask is run. */\n readonly shows?: (key: Entity) => boolean;\n}\n\n/**\n * The frame's raster budget, ms: a zoom's frame keeps its other work (≈ 1 ms of JS on the stress desk) inside design-016 §6's\n * 8 ms with a raster's worth to spare — a note's ink at band 2 costs ≈ 2 ms on this Mac, and the turn's first always runs.\n */\nexport const RASTER_BUDGET_MS = 4;\n\n/**\n * What an object shows while its raster waits its turn (K6b): NOTHING (a blank sheet, a bare board), its old raster MAGNIFIED (a\n * band or a density short of the screen's — soft), or its old raster MINIFIED (past it — only the pages' room is at stake).\n */\nexport type RasterWait = \"nothing\" | \"magnified\" | \"minified\";\n\nconst TIERS: Readonly<Record<RasterWait, number>> = { nothing: 0, magnified: 1, minified: 2 };\n\n/**\n * The priority every kind asks with, so one turn orders them all alike (K6b): what shows nothing first, then a stand-in magnified,\n * then one minified — the nearest the view's centre (`px`, screen px) first within each.\n */\nexport function rasterPriority(shows: RasterWait, px: number): number {\n return TIERS[shows] * 1e7 + Math.min(Math.max(px, 0), 1e7 - 1);\n}\n\ninterface Ask {\n readonly owner: string;\n readonly key: Entity;\n readonly priority: number;\n readonly run: RasterRun;\n held: boolean;\n /** Its order of arrival (kept across re-asks): equal priorities run first come, first served. */\n readonly seq: number;\n}\n\nconst id = (owner: string, key: Entity): string => `${owner}\\u0000${key as number}`;\n\nexport function createRasterQueue(opts: RasterQueueOptions = {}): RasterQueue {\n const budgetMs = opts.budgetMs ?? RASTER_BUDGET_MS;\n const clock = opts.clock ?? (() => performance.now());\n const shows = opts.shows;\n const asks = new Map<string, Ask>();\n /** Each owner's measured ms a run — its runs' running mean and its last run's; unknown before its first. */\n const cost = new Map<string, { mean: number; last: number }>();\n /** What the next run of `owner` is expected to cost: the dearer of its mean and its last (a raster's cost jumps with its band). */\n const expect = (owner: string): number => { const c = cost.get(owner); return c === undefined ? 0 : Math.max(c.mean, c.last); };\n let waiting = 0;\n let seq = 0;\n let ran = 0;\n let turns = 0;\n let ms = 0;\n let dropped = 0;\n let peakRuns = 0;\n let peakMs = 0;\n let dearest = 0;\n const remove = (k: string, a: Ask): void => { asks.delete(k); if (!a.held) waiting -= 1; };\n return {\n budgetMs,\n ask(owner, key, priority, run) {\n const k = id(owner, key);\n const had = asks.get(k);\n // a new entry, never the old one changed: a turn running the old one sees it replaced and keeps the newer need\n asks.set(k, { owner, key, priority, run, held: false, seq: had?.seq ?? seq++ });\n if (had === undefined || had.held) waiting += 1;\n },\n drop(owner, key) {\n const k = id(owner, key);\n const a = asks.get(k);\n if (a !== undefined) remove(k, a);\n },\n has: (owner, key) => asks.has(id(owner, key)),\n wake(owner) {\n for (const a of asks.values()) if (a.held && (owner === undefined || a.owner === owner)) { a.held = false; waiting += 1; }\n },\n clear(owner) {\n for (const [k, a] of asks) if (owner === undefined || a.owner === owner) remove(k, a);\n },\n drain() {\n if (waiting === 0) return 0;\n const turn = [...asks.values()].filter((a) => !a.held).sort((a, b) => a.priority - b.priority || a.seq - b.seq);\n const t0 = clock();\n let n = 0;\n /** The owners a run of this turn found no room for: their later asks are held unrun — the pages are as full for them. */\n const full = new Set<string>();\n for (const a of turn) {\n const k = id(a.owner, a.key);\n if (asks.get(k) !== a || a.held) continue; // withdrawn, or replaced\n if (shows !== undefined && !shows(a.key)) { remove(k, a); dropped += 1; continue; }\n if (full.has(a.owner)) { a.held = true; waiting -= 1; continue; }\n const spent = clock() - t0;\n if (n > 0 && spent + expect(a.owner) > budgetMs) break;\n const r0 = clock();\n const verdict = a.run();\n const took = clock() - r0;\n if (took > dearest) dearest = took;\n const c = cost.get(a.owner);\n cost.set(a.owner, { mean: c === undefined ? took : 0.7 * c.mean + 0.3 * took, last: took });\n n += 1;\n // a run may have asked again for its own key (a newer need): that ask stands; else the verdict decides\n if (asks.get(k) !== a) continue;\n if (verdict === \"done\") remove(k, a);\n else {\n if (!a.held) { a.held = true; waiting -= 1; }\n full.add(a.owner);\n }\n }\n const spent = clock() - t0;\n if (n > 0) { ran += n; turns += 1; ms += spent; peakRuns = Math.max(peakRuns, n); peakMs = Math.max(peakMs, spent); }\n return n;\n },\n get size() { return waiting; },\n stats: () => ({ budgetMs, waiting, held: asks.size - waiting, ran, turns, ms, dropped, peakRuns, peakMs, dearest }),\n };\n}\n","// The desk's PICK SOURCE (design-015 §4.5; core's `FramePickSource`, the B3b seam): the router\n// asks what is under a world point on an object, and the answer comes from the kind's CPU mirror\n// on the SAME geometry the builder resolved and the pass drew this frame — springs included,\n// topmost first in paint order (core takes the max by `compareStackOrder`, the same comparator\n// the builder sorts with). `content`/`frame` are the object itself, another string a PART, and a\n// kind's miss (`null`) is `outside` — the box tier falls through and the next object down is\n// asked. An object the builder has NO GEOMETRY for — before the first build, culled, or never\n// met — answers `undefined`, never `outside` (B9's first blocker: a source that said `outside`\n// there made every card unclickable until the first frame). `pad` is the widest kind reach:\n// the spatial index holds rects, and a kind's drawing may reach past its rect. `live` while a\n// spring moves — or a kind's own body (a print in the air, D3t-a): the part under a still pointer is the part that is\n// there now. `lifted` (D3t-a): what the builder painted lifted by its kind's word, asked first where it is drawn.\n\nimport type { Entity, FramePickSource } from \"@ice/core\";\nimport type { DeskBuilder } from \"./builder\";\n\nexport function createPickSource(builder: Pick<DeskBuilder, \"geometryOf\" | \"kindOf\" | \"live\" | \"reach\" | \"lifted\"> & Partial<Pick<DeskBuilder, \"veiled\" | \"heldPoint\" | \"hand\">>, opts: { readonly moving?: () => boolean } = {}): FramePickSource {\n return {\n pad: () => builder.reach(),\n // what a kind draws lifted (D3t-a — a print carried or gliding) is asked first, where it is drawn, not where its facts are —\n // and the hand's object too (D7 #11): flying home its facts still say its rest while it is drawn along the way\n lifted: () => { const h = builder.hand?.(); return h === undefined ? builder.lifted() : [h.entity, ...builder.lifted()]; },\n hit(e: Entity, wx: number, wy: number): string | undefined {\n if (builder.veiled?.(e) === true) return \"outside\"; // veiled by a kind's state (D3t-c — a note gone with its month): never picked\n const G = builder.geometryOf(e);\n const kind = builder.kindOf(e);\n if (G === undefined || kind === undefined) return undefined;\n // the hand's object (held, or flying home — D7 #11): its geometry was resolved under the held slot's camera, so the desk point\n // goes through the pose the last build drew; anywhere else it is picked where it is drawn, its rest rect answers nothing\n const hp = builder.heldPoint?.(e, wx, wy);\n const [x, y] = hp ?? [wx, wy];\n return kind.hit(G, x, y) ?? \"outside\";\n },\n live: () => builder.live() || opts.moving?.() === true,\n };\n}\n","// THE TRAY'S FLUX (design-017 §3; K3) — the pegboard drawer's motion, which lives in the renderer and nowhere else: the SLIDE (a tween\n// on widgetlab rev 1's curve from wherever the drawer is to where the fact says, on the frame's clock — a reversal starts again from\n// where it is, as a CSS transition does), the specimens' hover lifts (K5a), and the BAND's settle (the shown band tracks the fact's\n// pull exactly while there is one; when the fact lets go a spring carries it home). `live()` while any of them moves; a drawer at rest\n// is not live, so the desk sleeps. The facts are core's `Tray` (read, never written here); the flux publishes the drawer AS DRAWN —\n// its rect, its slide, the layout's scroll range — for core's input to hit-test (the pose seam). Pins hold it for a still: the slide,\n// the band, or the whole tray hidden (a scene that is not about it). (The lip and its lift spring retired — design-018 §5.)\n\nimport type { TrayScreenFrame } from \"@ice/core\";\nimport { settled, spring } from \"../kit/springs\";\nimport { band, DRAWER, drawerRect, scrollRange, slideEase } from \"./drawer\";\nimport type { TrayFrameInputs } from \"./pass\";\n\n/** The facts the flux follows (core's `Tray` and `TrayContent`, as read). */\nexport interface TrayFacts {\n readonly open: boolean;\n readonly scroll: number;\n readonly stretch: number;\n /** K5a: the specimen under the mouse (\"\" none) — its hover lifts it. */\n readonly hover?: string;\n /** K5a: the laid content's foot (board px) — the scroll's range — and the lay count (the specimens moved when it does). */\n readonly bottom?: number;\n readonly laid?: number;\n}\n\n/** A still's pins (a rig's, the oracle's): the slide, the band's shown pull; `hidden` — no tray at all; `bare` — the board without its specimens (K5a). Absent keys follow the facts. */\nexport interface TrayPin {\n readonly p?: number;\n readonly band?: number;\n readonly hidden?: boolean;\n readonly bare?: boolean;\n}\n\n/** What the flux holds, for a rig: the facts it last read, the slide and when (frame clock, ms) its tween began (−1: not yet stepped), the shown band, the specimens' hover lifts by type (K5a), whether it moves. */\nexport interface TrayFluxState {\n readonly facts: TrayFacts | null;\n readonly p: number;\n readonly since: number;\n readonly band: number;\n readonly hovers: Readonly<Record<string, number>>;\n readonly live: boolean;\n}\n\nexport interface TrayFlux {\n /** Read the world's facts (undefined: no tray); true when they changed since the last read — a frame is due. */\n read(facts: TrayFacts | undefined): boolean;\n /** Step the motion to `now` (the frame's clock, ms) for a view `vw × vh` and return the frame's tray — undefined when hidden or absent. */\n step(now: number, vw: number, vh: number): TrayFrameInputs | undefined;\n /** Something still moves: the next frame paints too. */\n live(): boolean;\n /** The drawer as the last step laid it (the pose seam's answer). */\n frame(): TrayScreenFrame | undefined;\n /** A specimen's hover lift this frame, 0 … 1 (K5a). */\n lift(type: string): number;\n /** The pins in force (null: none). */\n pinned(): TrayPin | null;\n pin(pin: TrayPin | null): void;\n state(): TrayFluxState;\n}\n\nconst EPS = 1e-4;\n\nexport function createTrayFlux(): TrayFlux {\n let facts: TrayFacts | null = null;\n // the slide's tween: from `from` toward `to`, started at `t0` (−1: not yet stepped since the fact moved)\n let p = 0;\n let from = 0;\n let to = 0;\n let t0 = -1;\n let shown = 0;\n let shownV = 0;\n let last = -1;\n let pinned: TrayPin | null = null;\n let drawn: TrayScreenFrame | undefined;\n let moving = false;\n // the specimens' hover (K5a): a critically damped spring per type toward 1 under the mouse, 0 elsewhere — a type at rest at 0 is dropped\n const hovers = new Map<string, { v: number; dv: number }>();\n\n return {\n read(f) {\n if (f === undefined) { const had = facts !== null; facts = null; return had; }\n const was = facts;\n if (was !== null && was.open === f.open && was.scroll === f.scroll && was.stretch === f.stretch && was.hover === (f.hover ?? \"\") && was.bottom === (f.bottom ?? 0) && was.laid === (f.laid ?? 0)) return false;\n facts = { open: f.open, scroll: f.scroll, stretch: f.stretch, hover: f.hover ?? \"\", bottom: f.bottom ?? 0, laid: f.laid ?? 0 };\n const target = f.open ? 1 : 0;\n if (target !== to) { from = p; to = target; t0 = -1; }\n return true;\n },\n\n step(now, vw, vh) {\n const f = facts;\n if (f === null || pinned?.hidden === true) { drawn = undefined; moving = false; return undefined; }\n const dt = last < 0 ? 0 : Math.min(Math.max(now - last, 0), 50) / 1000;\n last = now;\n // the slide, on the drawer's curve\n if (t0 < 0) t0 = now;\n const k = Math.min(Math.max((now - t0) / DRAWER.slideMs, 0), 1);\n p = from + (to - from) * slideEase(k);\n const sliding = from !== to && k < 1;\n if (k >= 1) from = to; // a finished tween is at rest where it ended\n // the band: tracks the pull exactly while the fact holds one; carried home by its spring when it lets go\n let settling = false;\n if (f.stretch !== 0) { shown = band(f.stretch); shownV = 0; }\n else if (shown !== 0) {\n [shown, shownV] = spring(shown, shownV, 0, DRAWER.band.hz, 1, dt);\n settling = !settled(shown, shownV, 0, EPS);\n if (!settling) { shown = 0; shownV = 0; }\n }\n // the specimens' hover: the one under the mouse lifts, the rest settle down\n let hovering = false;\n const under = f.open ? (f.hover ?? \"\") : \"\";\n if (under !== \"\" && !hovers.has(under)) hovers.set(under, { v: 0, dv: 0 });\n for (const [type, h] of hovers) {\n const to = type === under ? 1 : 0;\n [h.v, h.dv] = spring(h.v, h.dv, to, DRAWER.hoverHz, 1, dt);\n if (settled(h.v, h.dv, to, EPS)) { h.v = to; h.dv = 0; if (to === 0) hovers.delete(type); }\n else hovering = true;\n }\n moving = sliding || settling || hovering;\n const P = pinned;\n const pp = P?.p ?? p;\n const pb = P?.band ?? shown;\n const rect = drawerRect(vw, vh, pp);\n // `face` (K9): the board's height — its face runs to the outline (design-018 §2) — `scrollRange`'s own, so core's clamp and this range are one law;\n // `head` (design-018 R4): the edge and the clear header under it, where nothing of the content shows — core never picks a specimen there\n drawn = { x: rect.x, y: rect.y, w: rect.w, h: rect.h, p: pp, max: scrollRange(vw, vh, f.bottom ?? 0), pitch: DRAWER.pitch, scroll: f.scroll + pb, face: rect.h, head: DRAWER.arris + DRAWER.header };\n return { p: pp, scroll: f.scroll + pb };\n },\n\n live: () => moving && pinned === null,\n frame: () => drawn,\n lift: (type) => hovers.get(type)?.v ?? 0,\n pinned: () => pinned,\n pin(pin) { pinned = pin; },\n state: () => ({ facts, p, since: t0, band: shown, hovers: Object.fromEntries([...hovers].map(([k, h]) => [k, h.v])), live: moving }),\n };\n}\n","// The desk's REFLECTOR — `desk/compose` (design-015 §4.4, §2.4; D2a-world): post-notify,\n// output-only, `always: true` with a private dirty union, and an early-out when clean that\n// touches neither the swap chain nor the queue: a quiet desk submits NOTHING (idle-zero by\n// construction; `instrumentSubmits` is the witness). What dirties a frame: the builder's pulled\n// dirt (a journaled world write, a despawn, a reset, the sibling order, the hover — `changed()`,\n// drained every tick whether or not a frame follows), the camera, the viewport or the nav flight\n// (polled by `resourceStamp` — no observers, the 09-07 lesson), a theme or a look, a pin, a live\n// spring or ghost (`live()`), and the AMBIENT (compose/ambient.ts) while it wants a frame — the\n// wind's clock is a frame, and the policy is what lets it stop. A pointer move, a gesture or a\n// flight is a TOUCH that keeps the ambient awake.\n//\n// The reflector reads the world's Camera, Viewport, FrameInfo and the local mouse pointer's screen\n// point; it writes nothing to the ECS and reads no layout — the viewport is the resource the facade's\n// ResizeObserver writes; the frame's dt is `FrameInfo`'s (clamped by the engine), never a clock of\n// its own. It is DOM-free: the host (host/layer.ts) owns the canvas and sizes it on request\n// (`attach.resize`), hands the Ground in when `Ground.create` resolves (`ground()`), and registers\n// this reflector where the ground layer has always gone (right after the plane transform).\n\nimport {\n Camera,\n defineQuery,\n FrameInfo,\n GhostRetiring,\n InsertGhost,\n LocalPointer,\n NavRedress,\n NavTransition,\n Pointer,\n PointerScreen,\n PointerVersion,\n type Entity,\n Position,\n PrefabId,\n type ReflectorDef,\n Size,\n specimensOf,\n Tray,\n TrayContent,\n TransformTween,\n trayTakeProps,\n Viewport,\n widgetSpawnInits,\n widgetTypeFor,\n type WidgetType,\n type World,\n} from \"@ice/core\";\nimport type { Ground, GroundFrameInputs, GroundStats } from \"../ground\";\nimport { type KindLocal, type ObjectKind, rectOf } from \"../kinds/world\";\nimport { lampOf } from \"../mat/lamp\";\nimport { LAYER_IDLE_MS } from \"../kit/layer\";\nimport { DEFAULT_GRID, type GridConfig } from \"../mat/grid\";\nimport type { GroundTheme, Palette } from \"../theme\";\nimport { objectKindOf } from \"../object\";\nimport { drawerRect } from \"../tray/drawer\";\nimport { createTrayFlux, type TrayFlux } from \"../tray/flux\";\nimport { type CarryGhost, type CarrySpecimen, createTrayCarry, type TrayCarry } from \"../tray/carry\";\nimport { carriedFrame, carrySlot, specimenFrames, type TrayCarriedFrame, type TraySpecimen, type TraySpecimenFrame } from \"../tray/specimens\";\nimport type { Ambient, AmbientState } from \"./ambient\";\nimport type { DeskBuilder, DeskBuilderStats, DeskWakeReason, HoldPin } from \"./builder\";\n\nexport interface DeskReflectorOptions {\n readonly world: World;\n readonly builder: DeskBuilder;\n /** The kinds whose `theme()` makes a look — every object kind the ground registers. */\n readonly kinds: readonly ObjectKind[];\n readonly ambient: Ambient;\n /** The ground once `Ground.create` resolved, null before and after the layer ends. */\n readonly ground: () => Ground | null;\n /** The host sizes its canvas to `width × height` DEVICE px (the swap chain follows). */\n readonly attach: { resize(width: number, height: number): void };\n readonly theme: GroundTheme;\n /** The host's palette — what each kind's `theme()` reads its look from. */\n readonly palette: Palette;\n /** The root's grid: the lattice's fade-in and the mat's config (its gobo, its rulers). */\n readonly grid?: GridConfig;\n /** The device pixel ratio the canvas is capped at (2). */\n readonly maxDpr?: number;\n readonly name?: string;\n /** Called after every frame drawn — the layer publishes the selection menu's anchor from it (D4a). */\n readonly onFrame?: () => void;\n /** The kinds' own state on this desk (`KindLocal`, by kind name): what the tray's carried objects are drawn with, as the builder's are (K5b). */\n readonly locals?: ReadonlyMap<string, KindLocal>;\n /**\n * Called when a frame is asked for from OUTSIDE the flush — a wake (a pin, an ink landing, the ambient's policy), the ground\n * arriving, a theme, a grid, a harness's pin (K7a): the host wakes a sleeping loop with it.\n */\n readonly onWake?: (reason: string) => void;\n}\n\n/** What woke a frame, counted since the mount — the builder's reasons and the reflector's own. */\nexport type DeskWakes = Readonly<Record<DeskWakeReason | \"camera\" | \"viewport\" | \"nav\" | \"theme\" | \"grid\" | \"pin\" | \"ambient\" | \"live\" | \"ink\" | \"tray\", number>>;\n\nexport interface DeskReflectorStats extends DeskBuilderStats {\n /** Whole-frame renders so far — the churn instrument (0 on an idle desk). */\n readonly redraws: number;\n /** The ground's stats for the last frame drawn (null before the first). */\n readonly frame: GroundStats | null;\n readonly ambient: AmbientState;\n}\n\nexport interface DeskReflector {\n /** The drawing reflector (`always: true`): register it where the ground layer goes. */\n readonly reflector: ReflectorDef & { available(): boolean };\n /** The ground is here (or gone): the next tick paints. */\n ready(): void;\n /** The host's projection changed (a theme switch): the looks are remade, the next frame re-renders. */\n setTheme(theme: GroundTheme, palette?: Palette): void;\n /** The root's grid (the mat's config, the fade-in) as a whole. */\n configureGrid(grid: GridConfig): void;\n /** Wake a frame for a reason the world does not carry (a pin, an asset, the writing's flux — D2c's `ink`). */\n wake(reason: \"pin\" | \"ambient\" | \"ink\"): void;\n /**\n * A harness's pins on the build (D2b): live insides on or off (the oracle's `portals: false`), a pinned root\n * dressing (`lodZoom`), every spring and ghost held where it is (`freeze` — a still of a moving frame), the\n * re-dressing ramp held at its start (`holdRedress`). Each present key is set; the next frame paints.\n */\n pinBuild(pins: { readonly portals?: boolean; readonly lodZoom?: number | null; readonly freeze?: boolean; readonly holdRedress?: boolean; readonly hold?: HoldPin | null }): void;\n /** The kinds whose own state moved this tick (their `local.tick` wanted a frame): the builder remakes their records this build (D6). */\n restless(kinds: ReadonlySet<string>): void;\n /** The frame dirty and not yet drawn (a rig's witness). */\n dirty(): boolean;\n /**\n * WHEN THE REFLECTOR IS NEXT DUE (K7a — its registered wake): `now` while a frame is owed (dirt, a live spring or ghost, the\n * drawer on its way) or the ambient still moves (the wind's clock is a frame); `Infinity` otherwise — and while it cannot\n * draw (no ground yet, no viewport): the ground's arrival and the viewport's write wake it.\n */\n due(now: number): number;\n redraws(): number;\n stats(): DeskReflectorStats;\n wakes(): DeskWakes;\n /** The inputs of the last render, as handed to `Ground.render`. */\n lastInputs(): GroundFrameInputs | null;\n grid(): GridConfig;\n theme(): GroundTheme;\n /** A kind's look for the theme in force (its `theme()` of the palette) — the held bar's swatches read it (D3t-a). */\n look(kind: string): unknown;\n /** The pegboard drawer's flux (design-017 §3): its motion, the drawer as drawn (the pose seam's answer), the pins for a still. */\n readonly tray: TrayFlux;\n /** The tray's specimens as the last frame drew them (K5a) — a rig's witness; empty while the drawer is shut or bare. */\n traySpecimens(): readonly TraySpecimenFrame[];\n /**\n * Did the last frame's TRAY draw `e` — a specimen, a lifted copy's key, an insert ghost it presented (K5b over K6b)? The frame raster\n * queue's word on what shows is the builder's and this: an ask a specimen's writing made (its word, `tray.local`) is run, not let go.\n */\n trayShows(e: Entity): boolean;\n /** The take's motion (K5b — tray/carry.ts): the lifted copy, the ghost's grow and its flight home. */\n readonly carry: TrayCarry;\n /** What the tray carried in the last frame drawn (K5b) — a rig's witness: each pose's slot, phase, ghost and rect on screen. */\n trayCarried(): readonly TrayCarriedFrame[];\n dispose(): void;\n}\n\nconst localPointersQ = defineQuery([Pointer, LocalPointer, PointerScreen]);\nconst trayQ = defineQuery([Tray]);\nconst insertQ = defineQuery([InsertGhost, Position, Size]);\n\nexport function createDeskReflector(opts: DeskReflectorOptions): DeskReflector {\n const { world, builder, ambient } = opts;\n const maxDpr = opts.maxDpr ?? 2;\n let theme = opts.theme;\n let palette = opts.palette;\n let grid = opts.grid ?? DEFAULT_GRID;\n let looks = looksOf(opts.kinds, palette, theme);\n let dirty = true;\n let disposed = false;\n let redraws = 0;\n let lastInputs: GroundFrameInputs | null = null;\n let lastFrame: GroundStats | null = null;\n let builtTick = -1;\n /** The ambient wanted the last frame (the wind blows or eases): the next is owed too (K7a). */\n let ambientLive = false;\n /** The last flush could not draw (no ground, no viewport): nothing is owed until they come (K7a). */\n let blocked = true;\n let camStamp = -1;\n let vpStamp = -1;\n let navStamp = -1;\n let redressStamp = -1;\n let pointerStamp = -1;\n let mouse: ReturnType<World[\"firstOf\"]>;\n /** The harness's pins on the build (D2b). */\n let portalsOn = true;\n let lodPin: number | undefined;\n let freeze = false;\n let holdRedress = false;\n /** The hand pinned for a still (D4b). */\n let holdPin: HoldPin | undefined;\n /** The kinds restless this tick (D6) — set by the host before the flush, spent by the build. */\n let restless: ReadonlySet<string> | undefined;\n /** What the desk copy behind the hand depends on beyond the builder's count and the camera's and viewport's stamps (D4b). */\n let themeGen = 0;\n let gridGen = 0;\n let pinGen = 0;\n const wakes: Record<keyof DeskWakes, number> = { world: 0, removed: 0, reset: 0, order: 0, hover: 0, marks: 0, camera: 0, viewport: 0, nav: 0, theme: 0, grid: 0, pin: 0, ambient: 0, live: 0, ink: 0, tray: 0 };\n /** The pegboard drawer's motion (design-017 §3): the facts are core's `Tray`, polled each tick; the slide and the band are here. */\n const tray = createTrayFlux();\n // the tray's specimens (K5a): read from the world each frame the drawer shows (a handful of facts — a lay, a reset or a prop moves them)\n let drawnSpecimens: readonly TraySpecimenFrame[] = [];\n /** The take's motion (K5b): the copy, the ghost's grow, its flight home — and what it drew last. */\n const carry = createTrayCarry();\n let drawnCarried: readonly TrayCarriedFrame[] = [];\n /** The keys the tray drew in the last frame (specimens, carried copies and ghosts) — the raster queue's `shows` beside the builder's. */\n let trayDrawn: ReadonlySet<number> = new Set();\n /** The keys drawn with a kind's desk state from the tray (K5b — a specimen's entity, a copy's key): let go of as each goes. */\n const faced = new Map<number, KindLocal>();\n /** When the drawer last showed (frame clock, ms): its specimens' desk state is let go once it has been shut `LAYER_IDLE_MS`. */\n let trayShownAt = Number.NEGATIVE_INFINITY;\n /** When the specimens' desk state is let go (K7a — a registered time: the loop may sleep since the drawer shut); ∞ — none held. */\n let facedAt = Number.POSITIVE_INFINITY;\n let builderWakes = builder.wakes();\n\n /** The local mouse pointer's screen point as NDC (x right, y up), or null before one was seen. */\n const pointerNdc = (vp: { readonly w: number; readonly h: number }): readonly [number, number] | null => {\n if (mouse === undefined || !world.isAlive(mouse)) {\n mouse = undefined;\n world.query(localPointersQ).each((b) => { for (const r of b) { const p = b.entity(r); if (world.read(p, Pointer).device === \"mouse\") mouse = p; } });\n }\n if (mouse === undefined || vp.w <= 0 || vp.h <= 0) return null;\n const s = world.get(mouse, PointerScreen);\n if (s === undefined) return null;\n return [(s.x / vp.w) * 2 - 1, -((s.y / vp.h) * 2 - 1)];\n };\n\n const reflector: ReflectorDef & { available(): boolean } = {\n name: opts.name ?? \"desk/compose\",\n always: true,\n available: () => opts.ground() !== null,\n flush(w) {\n if (disposed) return;\n const info = w.getResource(FrameInfo);\n const tick = info?.tick ?? -1;\n if (tick >= 0 && builtTick === tick) return; // once per tick\n builtTick = tick;\n const now = info?.now ?? 0;\n // THE PULLS, every tick, above the pre-ready return: the journal drains once per frame, whether a frame follows or not.\n if (builder.changed()) {\n dirty = true;\n const bw = builder.wakes();\n for (const k of [\"world\", \"removed\", \"reset\", \"order\", \"hover\", \"marks\"] as const) wakes[k] += bw[k] - builderWakes[k];\n builderWakes = bw;\n }\n const cs = w.resourceStamp(Camera);\n if (cs !== camStamp) { if (camStamp !== -1) { dirty = true; wakes.camera += 1; ambient.touch(now); } camStamp = cs; }\n const vs = w.resourceStamp(Viewport);\n if (vs !== vpStamp) { if (vpStamp !== -1) { dirty = true; wakes.viewport += 1; } vpStamp = vs; }\n const ns = w.resourceStamp(NavTransition);\n if (ns !== navStamp) { if (navStamp !== -1) { dirty = true; wakes.nav += 1; ambient.touch(now); } navStamp = ns; }\n // a zoom-through cut: the desk re-dresses over its ramp (the builder keeps the frame live while it runs)\n const rs = w.resourceStamp(NavRedress);\n if (rs !== redressStamp) { if (redressStamp !== -1) { dirty = true; wakes.nav += 1; ambient.touch(now); } redressStamp = rs; }\n // the pointer moved (a wheel, a down, a move): the ambient stays awake; the hover itself is the builder's dirt — but not\n // while something is in hand (D4b): the desk behind stands still, so its blurred copy is made once and reused\n const inHand = builder.hand() !== undefined;\n const ps = w.resourceStamp(PointerVersion);\n if (ps !== pointerStamp) { if (pointerStamp !== -1 && !inHand) ambient.touch(now); pointerStamp = ps; }\n if (w.getResource(Camera)?.gesturing === true) ambient.touch(now);\n // THE TRAY (design-017 §3): its facts polled as the camera's stamp is — a change is a frame (one entity, a handful of fields)\n const te = w.firstOf(trayQ);\n const tf = te === undefined ? undefined : w.get(te, Tray);\n const tc = te === undefined ? undefined : w.get(te, TrayContent);\n if (tray.read(tf === undefined ? undefined : { ...tf, hover: tf.hover ?? \"\", bottom: tc?.bottom ?? 0, laid: tc?.laid ?? 0 })) { dirty = true; wakes.tray += 1; }\n // the specimens drawn with their kinds' desk state let go of it once the drawer has been shut a while, as the tray's layers do (K5b;\n // D-K6a.3 — a pad's print keeps the desk's tiles while it has a pad): no frame is asked for; the next open makes it again\n const pinned = tray.pinned();\n const showing = pinned !== null ? pinned.hidden !== true && (pinned.p ?? 1) > 0 : tf?.open === true || (tray.frame()?.p ?? 0) > 0;\n if (showing) trayShownAt = now;\n else if (faced.size > 0 && now - trayShownAt > LAYER_IDLE_MS) {\n for (const [key, local] of faced) if (key > 0) { local.forget?.(key as Entity); faced.delete(key); }\n }\n // …at a registered TIME (K7a): with the drawer shut the loop sleeps and no tick comes to poll it — the desk is due when it lets go\n facedAt = Number.POSITIVE_INFINITY;\n if (!showing) for (const key of faced.keys()) if (key > 0) { facedAt = trayShownAt + LAYER_IDLE_MS + 1; break; }\n const ground = opts.ground();\n blocked = true;\n if (ground === null) return; // pre-ready: the dirt is kept\n const cam = w.getResource(Camera);\n const vp = w.getResource(Viewport);\n if (cam === undefined || vp === undefined || vp.w <= 0 || vp.h <= 0) return; // no viewport yet: stay dirty, paint when it exists\n blocked = false;\n // the ambient's clocks: stepped every tick the ground is here — a frame is wanted while the wind blows or the tilt moves\n const dtMs = info?.dt ?? 16;\n // in hand the desk behind the hand STANDS STILL (§8): the clocks are not stepped — the wind holds its breath, the tilt lets\n // go of nothing — so under the default `idle` ambient too the blurred copy is made once and no frame is the wind's (D7)\n const amb = inHand ? { frame: ambient.frame(), live: false } : ambient.step(dtMs / 1000, now, pointerNdc(vp));\n ambientLive = amb.live;\n if (amb.live) { dirty = true; wakes.ambient += 1; }\n if (!dirty) return; // IDLE-ZERO: no getCurrentTexture, no submit\n dirty = false;\n const dpr = Math.min(vp.dpr > 0 ? vp.dpr : 1, maxDpr);\n opts.attach.resize(Math.max(1, Math.round(vp.w * dpr)), Math.max(1, Math.round(vp.h * dpr)));\n const camera = { x: cam.x, y: cam.y, zoom: cam.zoom };\n // the drawer over it all, as its flux has it this frame (design-017 §3)\n let trayed = tray.step(now, vp.w, vp.h);\n // …and the specimens on it (K5a), while it shows (a still's `bare` pin leaves the board alone): each kind's composite pass made\n // the first time the tray shows one (a frame is asked for when it is), the frames recorded by their own kinds\n drawnSpecimens = [];\n if (trayed !== undefined && trayed.p > 0 && tray.pinned()?.bare !== true) {\n const specimens = readSpecimens(w, te, opts.locals);\n if (specimens.length > 0) {\n ground.warmTray(specimens.map((q) => [q.type, q.kind.name] as const), trayLanded);\n for (const q of specimens) if (q.local !== undefined) faced.set(q.key, q.local as KindLocal);\n drawnSpecimens = specimenFrames(specimens, { rect: drawerRect(vp.w, vp.h, trayed.p), scroll: trayed.scroll }, { view: { width: vp.w, height: vp.h, dpr }, theme, grid, looks, lift: (t) => tray.lift(t) });\n trayed = { ...trayed, specimens: drawnSpecimens };\n }\n }\n // THE TAKE (K5b): its motion stepped on the facts — the take, the specimens as drawn, the insert ghosts — before the desk is built,\n // so a ghost the carry draws this frame (its grow, its flight home) is none of the desk's rows\n const poses = carry.step(\n now,\n tf === undefined ? undefined : { take: tf.take ?? \"\", u: tf.takeU, v: tf.takeV, x: tf.takeX, y: tf.takeY, handed: tf.handed },\n drawnSpecimens.map((f): CarrySpecimen => ({ type: f.type, zoom: f.view.zoom, ...f.object })),\n readGhosts(w),\n camera,\n trayed?.p ?? 0,\n );\n const built = builder.build(camera, { width: vp.w, height: vp.h, dpr }, dtMs / 1000, theme, grid, looks, {\n now, mat: amb.frame, portals: portalsOn, freeze, holdRedress, ...(lodPin !== undefined ? { lodZoom: lodPin } : {}), ...(holdPin !== undefined ? { hold: holdPin } : {}),\n // the host's word as told — an EMPTY set included: none restless is a word, and no word has the builder ask every object (K7a)\n ...(restless !== undefined ? { restless } : {}),\n ...(carry.presented().size > 0 ? { presented: carry.presented() as ReadonlySet<Entity> } : {}),\n });\n restless = undefined;\n // the hand (D4b): the desk copy's stamp is everything the copy depends on — the builder's desk count (never the held\n // object's own facts), the camera, the viewport, the theme, the grid, the pins, the mat's clocks and tilt this frame\n const held = built.held === undefined ? undefined : {\n ...built.held.inputs,\n stamp: `${built.held.deskSeq}|${camStamp}|${vpStamp}|${themeGen}|${gridGen}|${pinGen}|${amb.frame === undefined ? \"still\" : `${amb.frame.time},${amb.frame.goboTime},${amb.frame.noise[0]},${amb.frame.noise[1]},${amb.frame.goboMatrix.join(\",\")}`}`,\n };\n // what the tray carries (K5b), recorded by the kinds under their poses — the lifted copy with what one taken is made with, a ghost\n // with its own props and rect; each lit by the desk's lamp where it is (a copy: where the ghost it becomes will be)\n drawnCarried = [];\n if (trayed !== undefined && poses.length > 0) {\n const L = lampOf(built.grid.mat.plane);\n const env = { view: { width: vp.w, height: vp.h, dpr }, theme, grid, looks };\n const made: TrayCarriedFrame[] = [];\n for (const pose of poses) {\n const widget = widgetTypeFor(w, pose.type);\n const kind = objectKindOf(widget);\n if (widget === undefined || kind === undefined) continue;\n const local = opts.locals?.get(kind.name);\n if (pose.ghost !== undefined) {\n const g = pose.ghost as Entity;\n const at = w.get(g, Position);\n const size = w.get(g, Size);\n if (at === undefined || size === undefined) continue;\n const r = rectOf(at, size);\n made.push(carriedFrame(pose, { kind, rect: { x: r.cx - r.w / 2, y: r.cy - r.h / 2, w: r.w, h: r.h }, props: propsOf(w, g, widget), key: g as number, lamp: L, ...(local !== undefined ? { local } : {}) }, env));\n continue;\n }\n const n = widget.defaultSize;\n const copyLocal = widget.tray?.local === true ? local : undefined;\n const cx = cam.x + pose.px / cam.zoom - (pose.u - 0.5) * n.w;\n const cy = cam.y + pose.py / cam.zoom - (pose.v - 0.5) * n.h;\n const key = -(0x40000000 + pose.id);\n if (copyLocal !== undefined) faced.set(key, copyLocal as KindLocal);\n made.push(carriedFrame(pose, { kind, rect: { x: -n.w / 2, y: -n.h / 2, w: n.w, h: n.h }, props: takenProps(widget), key, lamp: { x: L.x - cx, y: L.y - cy, h: L.h }, ...(copyLocal !== undefined ? { local: copyLocal } : {}) }, env));\n }\n // a composite kind's pass is made async: made ahead, from the lift, so the hand-off never waits a frame for it\n ground.warmTray(carry.types().flatMap((t) => { const k = objectKindOf(widgetTypeFor(w, t)); return k === undefined ? [] : [[carrySlot(t), k.name] as const]; }), trayLanded);\n drawnCarried = made;\n if (made.length > 0) trayed = { ...trayed, carried: made };\n }\n trayDrawn = new Set([...drawnSpecimens.map((f) => f.key), ...drawnCarried.map((f) => f.key)]);\n // what was drawn with a kind's desk state and is gone — a specimen re-laid away, a copy put back or handed — its records let go\n for (const [key, local] of faced) {\n const gone = key < 0 ? !poses.some((q) => q.ghost === undefined && -(0x40000000 + q.id) === key) : !w.isAlive(key as Entity);\n if (gone) { local.forget?.(key as Entity); faced.delete(key); }\n }\n // the frame: the current desk (the root's grid, or the entered mini mat's), its live insides, and while a flight is on the\n // departed desk beside it — exactly the inputs the prototype's lab hands `ground.render()` (D2b)\n const inputs: GroundFrameInputs = {\n view: { camX: cam.x, camY: cam.y, zoom: cam.zoom, width: vp.w, height: vp.h, dpr },\n mat: amb.frame,\n grid: built.grid,\n objects: built.objects,\n ...(built.portals.length ? { portals: built.portals } : {}),\n ...(built.lodZoom !== undefined ? { lodZoom: built.lodZoom } : {}),\n ...(built.present !== undefined ? { present: built.present } : {}),\n ...(built.light !== undefined ? { light: built.light } : {}),\n ...(built.outgoing !== undefined ? { outgoing: built.outgoing } : {}),\n theme,\n marks: built.marks,\n ...(held !== undefined ? { held } : {}),\n ...(trayed !== undefined ? { tray: trayed } : {}),\n };\n lastInputs = inputs;\n lastFrame = ground.render(inputs);\n redraws += 1;\n opts.onFrame?.();\n if (builder.live()) { dirty = true; wakes.live += 1; } // a spring, a ghost or a re-dressing ramp still moves: the next frame paints too\n if (tray.live()) { dirty = true; wakes.tray += 1; } // …and so does a drawer on its way, a band letting go\n if (carry.live()) { dirty = true; wakes.tray += 1; } // …and a copy lifting, gliding back, a ghost growing or flying home\n },\n };\n\n const outside = (reason: string): void => { opts.onWake?.(reason); };\n /** A tray pass made BETWEEN frames — a specimen's slot, a carried copy's (composite kinds' passes are made async): a frame is owed, and\n * the loop may sleep since the drawer rested — a door from outside (K7a). */\n const trayLanded = (): void => { dirty = true; wakes.tray += 1; outside(\"tray\"); };\n return {\n reflector,\n ready() { dirty = true; outside(\"ready\"); },\n setTheme(t, p) {\n theme = t;\n if (p !== undefined) palette = p;\n looks = looksOf(opts.kinds, palette, theme);\n dirty = true;\n wakes.theme += 1;\n themeGen += 1;\n outside(\"theme\");\n },\n configureGrid(g) { grid = g; dirty = true; wakes.grid += 1; gridGen += 1; outside(\"grid\"); },\n wake(reason) { dirty = true; wakes[reason] += 1; if (reason === \"pin\") pinGen += 1; outside(reason); },\n pinBuild(pins) {\n if (pins.portals !== undefined) portalsOn = pins.portals;\n if (pins.lodZoom !== undefined) lodPin = pins.lodZoom === null ? undefined : pins.lodZoom;\n if (pins.freeze !== undefined) freeze = pins.freeze;\n if (pins.holdRedress !== undefined) holdRedress = pins.holdRedress;\n if (pins.hold !== undefined) holdPin = pins.hold === null ? undefined : pins.hold;\n dirty = true;\n wakes.pin += 1;\n pinGen += 1;\n outside(\"pin\");\n },\n restless(kinds) { restless = kinds; },\n dirty: () => dirty,\n due: (now) => (blocked || disposed ? Number.POSITIVE_INFINITY : dirty || ambientLive ? now : facedAt),\n redraws: () => redraws,\n stats: () => ({ ...builder.stats(), redraws, frame: lastFrame, ambient: ambient.state() }),\n wakes: () => ({ ...wakes }),\n lastInputs: () => lastInputs,\n grid: () => grid,\n theme: () => theme,\n look: (kind) => looks.get(kind),\n tray,\n traySpecimens: () => drawnSpecimens,\n trayShows: (e) => trayDrawn.has(e as number),\n carry,\n trayCarried: () => drawnCarried,\n dispose() { disposed = true; },\n };\n}\n\n/** The tray's specimens as the renderer reads them (K5a): the tray entity's `Specimen` children — each's object type, its kind, where it hangs, its props, its entry's hang and label — and its kind's desk state when its entry asks for it (K5b). */\nfunction readSpecimens(w: World, tray: Entity | undefined, locals: ReadonlyMap<string, KindLocal> | undefined): TraySpecimen[] {\n if (tray === undefined) return [];\n const out: TraySpecimen[] = [];\n for (const e of specimensOf(w, tray)) {\n const type = w.get(e, PrefabId)?.id;\n if (typeof type !== \"string\") continue;\n const widget = widgetTypeFor(w, type);\n const kind = objectKindOf(widget);\n const entry = widget?.tray;\n const at = w.get(e, Position);\n const size = w.get(e, Size);\n if (widget === undefined || kind === undefined || entry === undefined || at === undefined || size === undefined) continue;\n const props: Record<string, unknown> = {};\n for (const g of widget.groups) {\n const v = w.get(e, g.component) as Record<string, unknown> | undefined;\n if (v !== undefined) for (const name of Object.keys(g.fields)) props[name] = v[name];\n }\n const local = entry.local === true ? locals?.get(kind.name) : undefined;\n out.push({ key: e as number, type, kind, natural: widget.defaultSize, rect: { x: at.x, y: at.y, w: size.w, h: size.h }, props, accessory: entry.hang.accessory, pegs: entry.hang.pegs, label: entry.label, ...(local !== undefined ? { local } : {}) });\n }\n return out;\n}\n\n/** An object's props as the world holds them: each prop group's fields. */\nfunction propsOf(w: World, e: Entity, widget: WidgetType): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n for (const g of widget.groups) {\n const v = w.get(e, g.component) as Record<string, unknown> | undefined;\n if (v !== undefined) for (const name of Object.keys(g.fields)) props[name] = v[name];\n }\n return props;\n}\n\n/** What one taken off the tray is made with, as props (K5b): the widget's defaults with its entry's `take` folded in — the insert ghost's. */\nfunction takenProps(widget: WidgetType): Record<string, unknown> {\n const cells = new Map<unknown, Record<string, unknown>>();\n for (const [c, v] of widget.prefab.components) cells.set(c, v as Record<string, unknown>);\n const take = widget.tray === undefined ? undefined : trayTakeProps(widget.tray);\n if (take !== undefined) for (const [c, v] of widgetSpawnInits(widget.type, { x: 0, y: 0, props: take }, widget).overrides) cells.set(c, v as Record<string, unknown>);\n const props: Record<string, unknown> = {};\n for (const g of widget.groups) {\n const v = cells.get(g.component);\n if (v !== undefined) for (const name of Object.keys(g.fields)) props[name] = v[name];\n }\n return props;\n}\n\n/** The insert ghosts in the world (K5b): each's rect, and — flying home — how far its tween has run. */\nfunction readGhosts(w: World): CarryGhost[] {\n const out: CarryGhost[] = [];\n w.query(insertQ).each((b) => {\n for (const r of b) {\n const e = b.entity(r);\n const at = w.read(e, Position);\n const size = w.read(e, Size);\n const retiring = w.hasTag(e, GhostRetiring);\n const tw = retiring ? w.get(e, TransformTween) : undefined;\n out.push({ entity: e as number, type: w.read(e, InsertGhost).type ?? \"\", x: at.x, y: at.y, w: size.w, h: size.h, retiring, progress: tw === undefined ? (retiring ? 1 : 0) : tw.durationMs > 0 ? tw.elapsedMs / tw.durationMs : 1 });\n }\n });\n return out;\n}\n\n/** Each kind's look for a theme, by kind name — what `ObjectContext.look` carries. */\nexport function looksOf(kinds: readonly ObjectKind[], palette: Palette, theme: GroundTheme): Map<string, unknown> {\n const out = new Map<string, unknown>();\n for (const k of kinds) if (k.theme !== undefined) out.set(k.name, k.theme(palette, theme.name));\n return out;\n}\n","// GENERATED by tools/noise-to-ts.mjs from assets/blue-noise.rgba — do not edit.\n// `pnpm --filter @ice/desk gen:noise` regenerates it; `gen:check` fails the gate when it is stale.\n// The .rgba file is the source; this module is how it reaches a published bundle\n// (the package ships `dist/` only, and the mat pack needs the tile at runtime).\n\n/** The tile is square and rgba8: 128 × 128 × 4 = 65536 bytes. */\nexport const BLUE_NOISE_SIZE = 128;\n\nconst B64 =\n \"0r0H/2JS+/83Pn7/s4jI/x1hqv9c+/f/Rai5/wKCjP+e8D7/JcLK/6ucWv+Iekj/7VZp/5jnxv/dG/v/Ap16/+kGNf+Oq0X/TrsJ/34RoP8Ejlb/pW9w/0RL\" +\n \"AP95E73/vqUr/00sqP/kU07/p9l2/1rHIv99Fdn/5jtX/0vP8P/uvZv/CO1H/1Os1P/8nCT/L8UV/5mE/f9SCIX/i8rQ/+HXm/8ZIDD/z+1o/5JTw/+0KD//\" +\n \"2frq/2y1M/+/pJz/4+xF/w4Wxv9LsOb/s4kT/4FLhP+/Z57/I+fL/44M7////Kn/PM2M/1AB2P8n3lr/0xm3/+SVEP++Qf///edR/8tPn/8Evl//jjuN/+b7\" +\n \"b/8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+\n \"7/+1JgT/cEQw/0aLXP+CaSH/wO2T/xFZzv/x1uf/0WV+/y6jJf/e5fL/E7lL/+p7g/+w1V3/hwn0/xizD/9zRcf/9YGX/waQQ//TWoP/oQ8Z/2BPcv+Ef+H/\" +\n \"PAFm/3TUk/8TYsb/1Txt/wSoKf/wk7L/t1sc/0izyv96AUr/MWqn/2GSdP8L3NH/RUta/5WEsP/SxPn/JS8s/3Tkef/2BLb/N/gy/1SicP/Vwgv/pHlR/3dQ\" +\n \"dv/bLCT/iEa8//LsnP9drj7/ecVk/wxs4f8rJTP/m9HZ/2FzGP+tmAz/MlXe/1e5sP9t3xv/JDl7/+CWvf9gGir/zSiK/wWrs//xDAj/w77s/3OEwf8KRWL/\" +\n \"vMxB/9tSkv/q2Cr/sOcb/yyzbP9MlOj/aikH/92nef99/qP/0lNi/0vY8v/qXzz/WKgp/64N0f83NP3/j9oe/2LBOv+qEHr/5uIm/4ihtf/6vxT/2iRx/yuQ\" +\n \"Af9e+dX/HoO2/7Qp6v9NHKD/Ek7i/59oOP9oktf/tfKz//QW5P/UV6b/ez+F/967A/8iM+j/jK8y/9CIiv8+Sg3/YOee/09gGf+Fc+P/2K1W/7WBQ/8XM7T/\" +\n \"DLTH/4MMS/+amX3/Af3r/w==\";\n\nlet decoded: Uint8Array<ArrayBuffer> | null = null;\n\n/**\n * The 128×128 rgba8 blue-noise tile the cutting mat samples, decoded once.\n *\n * Hand it to the pack's injection point — `matPass.setNoise(blueNoise())` — the\n * same seam a lab feeds from a `?url` fetch. Decoding is lazy so a board that\n * never registers the mat pays nothing for it.\n */\nexport function blueNoise(): Uint8Array<ArrayBuffer> {\n if (decoded !== null) return decoded;\n const bin = atob(B64);\n const out = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i);\n decoded = out;\n return out;\n}\n","// The host's PICTURE DECODER (D3w; photo/blobs.ts `PictureDecoder`) — the one image decode in the desk,\n// and so a host file (design-015 §3's `desk-dom-free` wall): an encoded blob (a pasted or dropped PNG,\n// JPEG, WebP…) through `createImageBitmap`, its EXIF orientation honoured and its long side scaled to\n// at most `max` texels (PICTURE_MAX, 4096) — the prototype's photo lab's `addBlob`, verbatim. The\n// photo pass copies the bitmap to a texture (`pictureFrom`), then it is closed. Raw RGBA never comes\n// here: the photo kind makes those pictures itself.\n\nimport type { DecodedPicture, PictureDecoder } from \"../kit/blobs\";\n\nexport const decodePicture: PictureDecoder = async (blob, max): Promise<DecodedPicture | undefined> => {\n if (typeof createImageBitmap !== \"function\") return undefined;\n const file = new Blob([blob.bytes], { type: blob.type });\n const probe = await createImageBitmap(file, { imageOrientation: \"from-image\" });\n let { width, height } = probe;\n let bmp = probe;\n const s = Math.min(1, max / Math.max(width, height));\n if (s < 1) {\n width = Math.max(1, Math.round(width * s));\n height = Math.max(1, Math.round(height * s));\n bmp = await createImageBitmap(file, { imageOrientation: \"from-image\", resizeWidth: width, resizeHeight: height, resizeQuality: \"high\" });\n probe.close();\n }\n return { kind: \"source\", source: bmp, width, height, close: () => bmp.close() };\n};\n","// THE DOCUMENT'S DOORS (D7 #1 · #2 · #9; D-D7-A.3): what a desk driver holds of the facade's `engine.docs`. One module, no\n// kind in it, so the host wires a document into every kind's drivers without naming one — and every write surface asks the\n// same gate. `current()` is the session (store + live writer + the gate's verdict); `writable()` is THE WRITER'S GATE;\n// `extendCommits` is the door into a gesture's own transaction; `undo`/`redo` are the facade's history (historyStep: the tween\n// retarget, the read-only posture). A bare store (a test's) has the first and none of the rest.\n\nimport { type CommitExtender, type DocSession, gateVerdict } from \"@ice/core\";\n\n/** The document a driver writes into — the facade's `engine.docs` (its `current()` session: store + live writer + the gate's verdict). */\nexport interface TypingDocs {\n current(): Pick<DocSession, \"store\" | \"liveWriter\" | \"readOnly\" | \"versionReport\"> | undefined;\n /** The facade's door into a gesture's own transaction (`docs.extendCommits`, D7 #2): a landing's writes in the gesture's undo step. Absent (a bare store), a driver has no such door. */\n extendCommits?(extend: CommitExtender): () => void;\n /** The facade's history doors (`docs.undo`/`docs.redo` — historyStep: the tween retarget, the read-only posture; D7 #9). Absent (a bare store), a driver moves no history. */\n undo?(): boolean;\n redo?(): boolean;\n}\n\n/** What a desk writer holds while it commits: the session's store and live writer. */\nexport type WritableSession = Pick<DocSession, \"store\" | \"liveWriter\">;\n\n/**\n * THE WRITER'S GATE (D7 #1): the session a desk gesture may commit into — none without a document, and none when the\n * version gate's verdict is read-only (a doc a newer build wrote, a pack this build does not compile, a root that does not\n * agree). `readOnly` is the verdict at open; the report is asked again because a peer's pack can move it after. This is\n * the facade's `requireWritable` law at the desk's own write surfaces: strata's store has no read-only mode, and every desk\n * writer commits through it directly (guardedTransaction, setWidgetProps), never through the doc kit's commit sink, so a\n * gate that lived only in the sink never reached them. A refused writer does what \"no document\" means to it: nothing lands.\n */\nexport function writable(docs: TypingDocs): WritableSession | undefined {\n const s = docs.current();\n return s === undefined || s.readOnly || gateVerdict(s.versionReport()) !== \"ok\" ? undefined : s;\n}\n\n/** No document at all: the runtime is all there is (a desk without a facade, a catalog harness). */\nexport const NO_DOCS: TypingDocs = { current: () => undefined };\n","// THE TAP'S OBJECT (D7 #4; generic since design-016 K8a — it was the note's `tapNote`): the object a tap by the local pointer `pid`\n// lands on — the interaction stack's exact hit for that pointer — or none. NONE while any object is in hand: a tap in hand is the\n// hand's (a put-down, a held tool) — and the pointer's hit is LIVE under the hand (the hold's `HandledByWidget` is a same-phase\n// structural stamp l1-pick never sees; K9 law #1), so without this guard it would name whatever lies under the hand's frame. NONE\n// while the pegboard drawer is out (design-017 §4: the desk is inert — l1-pick answers the bare canvas then, and this refuses\n// outright, so a click on a specimen over a note under the drawer lends nothing). NONE over DOM CHROME (design-018 §5): a pointer\n// the ingest marked `OverInteractive` — its target a `[data-canvas-interactive]` island (the selection menu, the tray's bar at the\n// view's foot) or a native control — taps the chrome, never the object under it (the halves listen on the container in the\n// capture phase, before any handler of the chrome's could stop them). `found` says whether the pointer is known at\n// all (a touch that has lifted is gone: a text part may look for itself — the note asks the notes it drew).\nimport { defineQuery, type Entity, heldEntity, LocalPointer, OverInteractive, Pointer, TouchesExact, trayOpen, type World } from \"@ice/core\";\n\nconst tapPointersQ = defineQuery([Pointer, LocalPointer]);\n\nexport function tapHit(world: World, pid: string): { readonly found: boolean; readonly hit: Entity | undefined } {\n if (heldEntity(world) !== undefined || trayOpen(world)) return { found: true, hit: undefined };\n let found = false;\n let hit: Entity | undefined;\n world.query(tapPointersQ).each((b) => {\n for (const r of b) {\n const p = b.entity(r);\n if (world.read(p, Pointer).id !== pid) continue;\n found = true;\n hit = world.hasTag(p, OverInteractive) ? undefined : world.getRelation(p, TouchesExact);\n }\n });\n return { found, hit: found ? hit : undefined };\n}\n","// THE ONE FOCUSED EDITOR (design-015 §6.1, §2.2; design-016 §5 · K-L2, K8a) — the DESK's, not a kind's: the platform's own\n// `<textarea>`, in SCREEN space over the part being written, invisible: transparent text, transparent caret, no pointer events, a\n// transparent `::selection`. It takes what the platform does best — the keys, key repeat, the IME, dictation, the caret's index\n// and the selection — and the desk draws the rest from the world. One element, one plain transform (translate · rotate ·\n// translate — never a `scale(`, never a matrix): each frame it is re-placed where the lease says, its box and font the part's.\n//\n// Until K8a this was the NOTE's DOM half (objects/paper/host/editor.ts, made by the note's `host.editor`), and a desk with no note\n// kind had no editor — the calendar borrowed the note's, and no plugin kind could take text. Now the desk makes it at the mount and\n// every kind LEASES it the same way (kit/editor.ts): a kind declares its TEXT PARTS (`defineObject({ host: { text } })`) — a part\n// the desk routes a TAP to (the note's body) or one its own DOM half leases at event time (the calendar's day line).\n//\n// The TAP (DOM-at-event-time, design-007 §2 — the focus that makes typing write must be taken in the event; a phone's keyboard opens\n// only so): a press and release within the drag slop, the primary button, no modifier, on the container. The object under it is\n// the interaction stack's own exact hit for that pointer (`tapHit` — none while an object is in hand); each declared part with a\n// `tap` is asked in registration order and the first lease is lent, the caret where the part put it. The editor carries\n// design-007's claim marker, so every keymap entry cedes while it has focus. A lease ends on a blur (a press anywhere else moves\n// the browser's focus), on another lease, on `release`, and when its `live()` says its object is gone (a delete, a nav cut).\n\nimport { Camera, type Entity, GestureSettings, Grab, type World } from \"@ice/core\";\nimport { tapHit } from \"../compose/tap\";\nimport type { DeskEditor, EditorLease, TextPart } from \"../kit/editor\";\nimport { PEN_FACES } from \"../kit/text\";\n\n/** design-007's claim marker (`@ice/dom` KEYBOARD_CLAIM_ATTR — the desk may not import dom): the keymap cedes to a focused claim. */\nexport const KEYBOARD_CLAIM_ATTR = \"data-canvas-keyboard\";\n/** The editor's own marker — the one element the desk puts in screen space for text. */\nexport const EDITOR_ATTR = \"data-desk-editor\";\n/** The face the editor lays text in unless a part says (the desk's hand — kit/text.ts `PEN_FACES`). */\nconst DEFAULT_FONT = PEN_FACES.caveat ?? { family: \"Caveat\", weight: 500 };\n\nexport interface DeskEditorOptions {\n /** The host's container (screen space): the editor goes in it, the taps are read on it. */\n readonly container: HTMLElement;\n readonly world: World;\n /** The text parts the registered objects declared, in registration order (asked at each tap — the layer fills them after the drivers). */\n readonly parts: () => readonly TextPart[];\n /** A session ends after this long without input, ms (1000). */\n readonly idleMs?: number;\n /** Ask the desk for a frame. */\n readonly wake: () => void;\n}\n\nexport function createDeskEditor(opts: DeskEditorOptions): DeskEditor {\n const { container, world } = opts;\n const doc = container.ownerDocument;\n const idleMs = opts.idleMs ?? 1000;\n const el = doc.createElement(\"textarea\");\n el.hidden = true;\n el.setAttribute(EDITOR_ATTR, \"\");\n el.setAttribute(KEYBOARD_CLAIM_ATTR, \"\");\n el.setAttribute(\"autocapitalize\", \"off\");\n el.setAttribute(\"autocorrect\", \"off\");\n el.setAttribute(\"aria-label\", \"write\");\n el.spellcheck = false;\n el.wrap = \"soft\";\n const st = el.style;\n st.position = \"absolute\";\n st.left = \"0\";\n st.top = \"0\";\n st.transformOrigin = \"0 0\";\n st.margin = \"0\";\n st.border = \"0\";\n st.outline = \"0\";\n st.resize = \"none\";\n st.overflow = \"hidden\";\n st.background = \"transparent\";\n st.color = \"transparent\";\n st.caretColor = \"transparent\";\n st.pointerEvents = \"none\";\n st.boxSizing = \"border-box\";\n st.whiteSpace = \"pre-wrap\";\n st.overflowWrap = \"anywhere\";\n st.zIndex = \"2\";\n const sheet = doc.createElement(\"style\");\n sheet.textContent = `textarea[${EDITOR_ATTR}]::selection { background: transparent; } textarea[${EDITOR_ATTR}][hidden] { display: none; }`;\n container.appendChild(sheet);\n container.appendChild(el);\n\n /** The lease holding the editor, or undefined. */\n let lent: EditorLease | undefined;\n let idle: ReturnType<typeof setTimeout> | undefined;\n let composing = false;\n let down: { id: number; type: string; x: number; y: number } | null = null;\n let lastTransform = \"\";\n let lastBox = \"\";\n let placed: { cx: number; cy: number; w: number; h: number; angle: number } | null = null;\n\n const arm = (): void => {\n if (idle !== undefined) clearTimeout(idle);\n idle = setTimeout(() => {\n idle = undefined;\n if (composing) { arm(); return; } // an IME candidate being chosen is not a pause\n lent?.idle();\n opts.wake();\n }, idleMs);\n };\n\n /** The textarea where the lease says: one plain transform, its box and its text's size and flow only when they change. */\n const place = (): void => {\n const p = lent?.place();\n if (p === undefined || p === null) return;\n const angle = p.angle;\n placed = { cx: p.x + p.w / 2, cy: p.y + p.h / 2, w: p.w, h: p.h, angle: angle ?? 0 };\n const transform = angle === undefined ? `translate(${p.x}px, ${p.y}px)` : `translate(${p.x + p.w / 2}px, ${p.y + p.h / 2}px) rotate(${angle}rad) translate(${-p.w / 2}px, ${-p.h / 2}px)`;\n if (transform !== lastTransform) { st.transform = transform; lastTransform = transform; }\n const font = p.font ?? DEFAULT_FONT;\n const box = `${p.w}|${p.h}|${p.pad ?? 0}|${p.fontPx}|${p.lineHeight ?? p.h}|${font.family}|${font.weight}|${p.wrap === true}`;\n if (box !== lastBox) {\n lastBox = box;\n st.width = `${p.w}px`;\n st.height = `${p.h}px`;\n st.padding = p.pad === undefined ? \"0\" : `${p.pad}px`;\n st.font = `${font.weight} ${p.fontPx}px \"${font.family}\"`;\n st.lineHeight = `${p.lineHeight ?? p.h}px`;\n st.whiteSpace = p.wrap === true ? \"pre-wrap\" : \"pre\";\n }\n };\n\n /**\n * The lease is over: its holder told, the textarea hidden and blurred (a blur that ended it has already moved the focus) — unless\n * another lease takes the editor at once (`handover`): then the focus stays where it is, so a phone's keyboard never drops between\n * two parts (a tap on the next note).\n */\n const end = (handover = false): void => {\n const l = lent;\n if (l === undefined) return;\n lent = undefined;\n if (idle !== undefined) { clearTimeout(idle); idle = undefined; }\n composing = false;\n placed = null;\n lastTransform = \"\";\n lastBox = \"\";\n if (!handover) {\n el.hidden = true;\n el.setAttribute(\"aria-label\", \"write\");\n if (doc.activeElement === el) el.blur();\n }\n l.ended();\n opts.wake();\n };\n\n const lend = (lease: EditorLease, caret?: number): void => {\n if (lent === lease) {\n if (doc.activeElement !== el) el.focus({ preventScroll: true });\n if (caret !== undefined) { const i = Math.min(Math.max(caret, 0), el.value.length); el.setSelectionRange(i, i); lease.caret(i); opts.wake(); }\n return;\n }\n end(true);\n lent = lease;\n lastTransform = \"\";\n lastBox = \"\";\n el.setAttribute(\"aria-label\", lease.label ?? \"write\");\n el.value = lease.value() ?? \"\";\n el.hidden = false;\n place();\n el.focus({ preventScroll: true });\n const i = Math.min(Math.max(caret ?? el.value.length, 0), el.value.length);\n el.setSelectionRange(i, i);\n lease.caret(i);\n opts.wake();\n };\n\n // ---- the platform's events, the lease's while it holds the editor\n const onInput = (): void => {\n const l = lent;\n if (l === undefined) return;\n l.input(el.value);\n arm();\n opts.wake();\n };\n const onKeyDown = (ev: KeyboardEvent): void => {\n const l = lent;\n if (l === undefined || ev.isComposing) return;\n if (l.keydown(ev)) { ev.preventDefault(); opts.wake(); } // the keymap's gate 1 stands down; the key was the lease's\n // a Tab the lease declines goes NOWHERE (K9 S4): the platform would move focus down the page's order — to the selection menu's first\n // button — which ends the lease, and the next letters would be the desk's shortcuts; while a lease holds the editor, Tab is typing's\n else if (ev.key === \"Tab\") ev.preventDefault();\n };\n const onBlur = (): void => { end(); }; // a press anywhere else: the lease ends (its holder keeps what it wrote)\n const onCompositionStart = (): void => { composing = true; };\n const onCompositionEnd = (): void => { composing = false; arm(); };\n const onSelection = (): void => {\n if (doc.activeElement !== el || lent === undefined) return;\n lent.caret(el.selectionStart);\n opts.wake();\n };\n el.addEventListener(\"input\", onInput);\n el.addEventListener(\"keydown\", onKeyDown);\n el.addEventListener(\"blur\", onBlur);\n el.addEventListener(\"compositionstart\", onCompositionStart);\n el.addEventListener(\"compositionend\", onCompositionEnd);\n doc.addEventListener(\"selectionchange\", onSelection);\n\n // ---- the tap (DOM-at-event-time): a press and release within the slop, the primary button, no modifier — routed to the parts\n const onDown = (ev: PointerEvent): void => {\n down = ev.isPrimary && ev.button === 0 ? { id: ev.pointerId, type: ev.pointerType, x: ev.clientX, y: ev.clientY } : null;\n };\n const onClick = (ev: MouseEvent): void => {\n const d = down;\n down = null;\n if (d === null || ev.button !== 0 || ev.shiftKey || ev.metaKey || ev.ctrlKey || ev.altKey) return;\n const slop = world.getResource(GestureSettings)?.dragSlopPx ?? 10;\n if (Math.hypot(ev.clientX - d.x, ev.clientY - d.y) > slop) return;\n const cam = world.getResource(Camera);\n if (cam === undefined) return;\n const r = container.getBoundingClientRect();\n const wx = cam.x + (ev.clientX - r.left) / cam.zoom;\n const wy = cam.y + (ev.clientY - r.top) / cam.zoom;\n const t = tapHit(world, d.type === \"touch\" ? `touch:${d.id}` : \"mouse\");\n // a carried object takes no text (the tap ends a carry); a part asked with the pointer gone looks for itself\n const hit: Entity | undefined = t.hit !== undefined && world.has(t.hit, Grab) ? undefined : t.hit;\n if (t.found && t.hit !== undefined && hit === undefined) return;\n for (const part of opts.parts()) {\n const taken = part.tap?.({ wx, wy, found: t.found, hit });\n if (taken !== undefined) { lend(taken.lease, taken.caret); return; }\n }\n };\n container.addEventListener(\"pointerdown\", onDown, { capture: true });\n container.addEventListener(\"click\", onClick, { capture: true });\n\n return {\n element: el,\n lend,\n release(lease) { if (lent !== undefined && (lease === undefined || lease === lent)) end(); },\n lease: () => lent,\n blur: () => { end(); },\n follow() {\n const l = lent;\n if (l === undefined) return;\n // a delete or a nav cut ends the lease — outside the frame: reflectors never write the world\n if (l.live?.() === false) { queueMicrotask(() => { if (lent === l) end(); }); return; }\n // a value the world moved between sessions (a peer, an undo) reaches the platform's field; then the textarea follows the part\n if (!composing) {\n const v = l.value();\n if (v !== null && v !== el.value) { const i = Math.min(el.selectionStart, v.length); el.value = v; el.setSelectionRange(i, i); l.caret(i); }\n }\n place();\n },\n placement: () => placed,\n dispose() {\n if (idle !== undefined) clearTimeout(idle);\n lent = undefined;\n el.removeEventListener(\"input\", onInput);\n el.removeEventListener(\"keydown\", onKeyDown);\n el.removeEventListener(\"blur\", onBlur);\n el.removeEventListener(\"compositionstart\", onCompositionStart);\n el.removeEventListener(\"compositionend\", onCompositionEnd);\n doc.removeEventListener(\"selectionchange\", onSelection);\n container.removeEventListener(\"pointerdown\", onDown, { capture: true });\n container.removeEventListener(\"click\", onClick, { capture: true });\n el.remove();\n sheet.remove();\n },\n };\n}\n","// What the GPU instruments share (design-016 §4, K2): how a method is wrapped so that removing the wrapper leaves NOTHING\n// behind, and how a resource's label names its kind.\n\n/**\n * Replace `obj[key]` with `value`; the undo puts back exactly what was there — the own property it had, or no own property at all\n * (the prototype's method shows through again, so \"the wrappers are gone\" is literal). Wrapped over since, the undo leaves\n * ours beneath theirs: the caller's wrapper must then pass through.\n */\nexport function swapMethod<T extends object, K extends keyof T>(obj: T, key: K, value: T[K]): () => void {\n const own = Object.getOwnPropertyDescriptor(obj, key);\n obj[key] = value;\n return () => {\n if (obj[key] !== value) return;\n if (own !== undefined) Object.defineProperty(obj, key, own);\n else Reflect.deleteProperty(obj, key);\n };\n}\n\n/** A resource's label prefix — its kind: `paper/notes` → `paper`; no label → `?`. */\nexport const prefixOf = (label: string | undefined): string => {\n if (label === undefined || label.length === 0) return \"?\";\n const slash = label.indexOf(\"/\");\n return slash < 0 ? label : label.slice(0, slash);\n};\n","// THE MEMORY LEDGER (design-016 §4.2, K2): live GPU bytes by label, kept through `createTexture` / `createBuffer` and each\n// resource's `destroy` — the desk names every resource `<kind>/<what>`, so the kinds' memory falls out of the names, as their\n// uploads do (submit-instrument.ts). A resource the garbage collector takes without a `destroy()` leaves the ledger then\n// (`collected`); the ledger holds no resource alive. What it cannot see: the swap chain (the canvas's, not made through\n// `createTexture`) and anything made before it was installed — WebGPU has no enumeration, so a ledger armed late would\n// lie. It is therefore the ONE instrument installed with the device, and only where the host asks (`deskLayer({\n// gpuLedger: true })`, D-K2.2): its cost is a map entry and a closure per resource MADE — at boot, a resize, a raster's\n// birth — and nothing per frame.\n//\n// What a texture's texels weigh (design-016 §4, K2) — the byte rule the profiler states, shared by the upload count\n// (`copyExternalImageToTexture` carries no byte length: its bytes are the copy's texels in the destination's format) and\n// the memory ledger. THE FORMULA: Σ over mips l of ⌈w_l / bw⌉ × ⌈h_l / bh⌉ × blockBytes × layers_l, × sampleCount — w_l =\n// max(1, w >> l) and h_l likewise (1 for a 1d texture), layers_l = the array layers (a 3d texture's depth halves per mip\n// like its width), and (bw × bh, blockBytes) the format's block: 1 × 1 and the texel's size for every uncompressed format,\n// 4 × 4 for BC/ETC2/EAC, the named footprint for ASTC. It is the LOGICAL size — what the texels need, never what the driver\n// allocates: tiling, row alignment, lossless compression, a depth24plus stored as 32 bits, a tiler's memoryless MSAA\n// attachment all differ from it, both ways.\n\nimport { prefixOf, swapMethod } from \"./gpu-wrap\";\n\n/** A format's block: its footprint in texels and its bytes. `guessed` — a format this table does not know, weighed as 4 bytes a texel. */\nexport interface FormatBlock { readonly w: number; readonly h: number; readonly bytes: number; readonly guessed?: boolean }\n\n/** The formats no channel-and-width pattern reads. The depth-stencil pairs are their logical bits (24 + 8, 32 + 8). */\nconst SPECIAL: Readonly<Record<string, number>> = {\n \"rgb10a2uint\": 4, \"rgb10a2unorm\": 4, \"rg11b10ufloat\": 4, \"rgb9e5ufloat\": 4,\n \"stencil8\": 1, \"depth16unorm\": 2, \"depth24plus\": 4, \"depth24plus-stencil8\": 4, \"depth32float\": 4, \"depth32float-stencil8\": 5,\n};\n\nexport function formatBlock(format: string): FormatBlock {\n const special = SPECIAL[format];\n if (special !== undefined) return { w: 1, h: 1, bytes: special };\n const plain = /^(r|rg|rgba|bgra)(8|16|32)(unorm|snorm|uint|sint|float)(-srgb)?$/.exec(format);\n if (plain !== null) return { w: 1, h: 1, bytes: ((plain[1] as string).length * Number(plain[2])) / 8 };\n const astc = /^astc-(\\d+)x(\\d+)-/.exec(format);\n if (astc !== null) return { w: Number(astc[1]), h: Number(astc[2]), bytes: 16 };\n if (/^(bc1-|bc4-|etc2-rgb8unorm|etc2-rgb8a1unorm|eac-r11)/.test(format)) return { w: 4, h: 4, bytes: 8 };\n if (/^(bc[2356]-|bc6h-|bc7-|etc2-rgba8unorm|eac-rg11)/.test(format)) return { w: 4, h: 4, bytes: 16 };\n return { w: 1, h: 1, bytes: 4, guessed: true };\n}\n\n/** An extent's width, height and depth-or-layers — the list form (`[w, h?, d?]`) or the dictionary form. */\nexport function extentOf(size: GPUExtent3DStrict): [number, number, number] {\n if (Symbol.iterator in Object(size)) {\n const [w = 1, h = 1, d = 1] = [...(size as Iterable<number>)];\n return [w, h, d];\n }\n const s = size as GPUExtent3DDictStrict;\n return [s.width, s.height ?? 1, s.depthOrArrayLayers ?? 1];\n}\n\n/** The bytes of `size` texels of `format` in one mip (a copy's weight): ⌈w / bw⌉ × ⌈h / bh⌉ × blockBytes × depth. */\nexport function regionBytes(format: string, size: GPUExtent3DStrict): number {\n const [w, h, d] = extentOf(size);\n const b = formatBlock(format);\n return Math.ceil(w / b.w) * Math.ceil(h / b.h) * b.bytes * d;\n}\n\n/** A texture's logical bytes by the formula above. */\nexport function textureBytes(d: { readonly size: GPUExtent3DStrict; readonly format: string; readonly mipLevelCount?: number; readonly sampleCount?: number; readonly dimension?: GPUTextureDimension }): number {\n const [w, h, layers] = extentOf(d.size);\n const b = formatBlock(d.format);\n let total = 0;\n for (let l = 0; l < (d.mipLevelCount ?? 1); l++) {\n const lw = Math.max(1, w >> l);\n const lh = d.dimension === \"1d\" ? 1 : Math.max(1, h >> l);\n const ld = d.dimension === \"3d\" ? Math.max(1, layers >> l) : layers;\n total += Math.ceil(lw / b.w) * Math.ceil(lh / b.h) * b.bytes * ld;\n }\n return total * (d.sampleCount ?? 1);\n}\n\n/** One ledger row: the live bytes, and how many textures and buffers make them. */\nexport interface GpuMemoryRow { readonly bytes: number; readonly textures: number; readonly buffers: number }\n\n/** The ledger's reading: live bytes by label prefix (the kind), textures and buffers apart, the total; and its turnover. */\nexport interface GpuMemory {\n /** Live bytes by the resource's label prefix — `paper`, `board`, `photo` …; `?` for an unlabelled one. */\n readonly byLabel: Readonly<Record<string, GpuMemoryRow>>;\n readonly textures: number;\n readonly buffers: number;\n readonly total: number;\n /** Resources made since the install (a make every frame is a finding), destroyed, and taken by the collector undestroyed. */\n readonly made: number;\n readonly destroyed: number;\n readonly collected: number;\n /** Textures whose format the byte table does not know (weighed as 4 bytes a texel). */\n readonly guessed: number;\n}\n\nexport interface MemoryLedger {\n /** The ledger as of now (a fresh copy). */\n read(): GpuMemory;\n /** The `n` heaviest live labels, full label (`board/ink 12` — every board's raster its own row), heaviest first. */\n top(n?: number): readonly { readonly label: string; readonly bytes: number; readonly count: number }[];\n /** Restore the device's own `createTexture` / `createBuffer`. What it made meanwhile still reports its `destroy` to nobody. Idempotent. */\n detach(): void;\n}\n\ninterface Entry { readonly label: string; readonly prefix: string; readonly bytes: number; readonly texture: boolean; live: boolean }\ninterface Row { bytes: number; textures: number; buffers: number }\n\nconst ledgers = new WeakMap<GPUDevice, MemoryLedger>();\n\n/** Keep a ledger of `device`'s live textures and buffers from now on. One per device: asking twice returns the one. */\nexport function instrumentMemory(device: GPUDevice): MemoryLedger {\n const existing = ledgers.get(device);\n if (existing !== undefined) return existing;\n const byPrefix = new Map<string, Row>();\n const byLabel = new Map<string, { bytes: number; count: number }>();\n let textures = 0;\n let buffers = 0;\n let made = 0;\n let destroyed = 0;\n let collected = 0;\n let guessed = 0;\n let attached = true;\n\n const add = (e: Entry, sign: 1 | -1): void => {\n const row = byPrefix.get(e.prefix) ?? { bytes: 0, textures: 0, buffers: 0 };\n row.bytes += sign * e.bytes;\n if (e.texture) row.textures += sign; else row.buffers += sign;\n if (row.textures === 0 && row.buffers === 0) byPrefix.delete(e.prefix); else byPrefix.set(e.prefix, row);\n const l = byLabel.get(e.label) ?? { bytes: 0, count: 0 };\n l.bytes += sign * e.bytes;\n l.count += sign;\n if (l.count === 0) byLabel.delete(e.label); else byLabel.set(e.label, l);\n if (e.texture) textures += sign * e.bytes; else buffers += sign * e.bytes;\n };\n // the collector's word on a resource dropped without `destroy()` — its memory went with it\n const gone = new FinalizationRegistry<Entry>((e) => { if (e.live) { e.live = false; add(e, -1); collected += 1; } });\n const keep = <R extends GPUTexture | GPUBuffer>(resource: R, label: string | undefined, bytes: number, texture: boolean): R => {\n const name = label ?? \"\";\n const entry: Entry = { label: name.length > 0 ? name : \"?\", prefix: prefixOf(name), bytes, texture, live: true };\n made += 1;\n add(entry, 1);\n gone.register(resource, entry, entry);\n const destroy = resource.destroy;\n resource.destroy = () => {\n if (entry.live) { entry.live = false; add(entry, -1); destroyed += 1; gone.unregister(entry); }\n return destroy.call(resource);\n };\n return resource;\n };\n\n const originalTexture = device.createTexture;\n const originalBuffer = device.createBuffer;\n const undo = [\n swapMethod(device, \"createTexture\", ((d: GPUTextureDescriptor) => {\n const t = originalTexture.call(device, d);\n if (formatBlock(d.format).guessed === true) guessed += 1;\n return attached ? keep(t, d.label, textureBytes(d), true) : t;\n }) as GPUDevice[\"createTexture\"]),\n swapMethod(device, \"createBuffer\", ((d: GPUBufferDescriptor) => {\n const b = originalBuffer.call(device, d);\n return attached ? keep(b, d.label, d.size, false) : b;\n }) as GPUDevice[\"createBuffer\"]),\n ];\n\n const ledger: MemoryLedger = {\n read() {\n const rows: Record<string, GpuMemoryRow> = {};\n for (const [k, r] of byPrefix) rows[k] = { bytes: r.bytes, textures: r.textures, buffers: r.buffers };\n return { byLabel: rows, textures, buffers, total: textures + buffers, made, destroyed, collected, guessed };\n },\n top(n = 8) {\n return [...byLabel].map(([label, l]) => ({ label, bytes: l.bytes, count: l.count })).sort((a, b) => b.bytes - a.bytes).slice(0, n);\n },\n detach() {\n if (!attached) return;\n attached = false;\n for (const u of undo) u();\n ledgers.delete(device);\n },\n };\n ledgers.set(device, ledger);\n return ledger;\n}\n","// The submit instrument — the idle-zero witness (design-012 §1.2's law, design-015 §2.4;\n// `packages/ground/src/submit-instrument.ts`, ported to the desk at D2a-world: the two legs share\n// no code, so a copy). Idle-zero is a LAW — no dirt ⇒ return before `getCurrentTexture()` ⇒ zero\n// submits — and a law nobody measures is folklore. The only place that sees EVERY submission is\n// `device.queue.submit` itself, so this wraps it. A count covers what was submitted after the\n// install, so a \"0 submits over 240 frames\" claim needs the instrument armed before its window\n// opens — which asking for it does (below). One instrument per queue: asking twice returns the one.\n//\n// D6 — THE UPLOADS TOO (design-015 §4.3, §11.4: \"records written, bytes uploaded per kind per\n// frame\"): the same wrapper takes `queue.writeBuffer` and `queue.writeTexture`, counting calls and\n// bytes, attributed by the LABEL of the buffer or texture written — every one of the desk's is\n// named `<kind>/<what>` (`paper/notes`, `minimat/chips`, `board/boards`, `mat/uniforms`,\n// `marks/records`, `notebook/ink` …), so a per-kind upload tally falls out of the names the\n// passes already give their resources, and no pass is touched to be measured. A camera move that\n// writes NOTHING per record is proven here: the `paper` bucket's bytes stand still over a pan.\n//\n// K2 (design-016 §4) — ARMED ON DEMAND, AND THE PICTURES. Until K2 the layer installed this at boot\n// on every desk, though this header said \"dev-only by intent\": a product paid an array push and a\n// wrapper call per submit and per write for a witness nobody read. Now nothing wraps the queue until\n// something asks — the layer's `submits()` (the rigs' door) installs it on first ask, the GPU\n// profiler holds it while armed — and `detach()` puts back EXACTLY what was there: the queue's own\n// property if it had one, else none (the prototype's method shows through again), so an unarmed\n// queue carries no wrapper at all (D-K2.1). Submits are shared through ONE tap per queue\n// (`tapSubmits`): every instrument that listens to submits hooks the same wrapper, so any of them\n// can leave in any order and the last one out restores the native. And `copyExternalImageToTexture`\n// — a print's picture (photo/photo-pass.ts), the calendar's printed tiles (calendar/pass.ts) — is an\n// upload: it carries no byte length, so its bytes are its texels in the destination's format\n// (gpu-memory.ts `regionBytes`); counted with the writes and on its own (`externals`).\n\nimport { regionBytes } from \"./gpu-memory\";\nimport { prefixOf, swapMethod } from \"./gpu-wrap\";\n\nexport interface UploadTally {\n /** `writeBuffer` + `writeTexture` + `copyExternalImageToTexture` calls. */\n readonly writes: number;\n /** The bytes those calls carried (a texture write counts what was handed to it; an external copy its texels). */\n readonly bytes: number;\n}\n\nexport interface SubmitInstrument {\n /** Every `queue.submit` since install or the last `reset`, whoever made it. */\n total(): number;\n /** Command buffers passed across all those submits. */\n buffers(): number;\n /** Submits in the trailing `windowMs`, from the stamp ring. */\n inWindow(windowMs: number): number;\n /** Timestamps of the retained submits (newest last), for tail inspection. */\n stamps(): readonly number[];\n /** Every upload since install or the last `reset` — `writeBuffer`, `writeTexture`, `copyExternalImageToTexture` — and the bytes they carried. */\n uploads(): UploadTally;\n /** The uploads by the written resource's label prefix (the text before its `/`; `?` for an unlabelled one). A fresh copy. */\n uploadsByLabel(): Readonly<Record<string, UploadTally>>;\n /** The `copyExternalImageToTexture` uploads alone (a picture decoded onto the GPU, a calendar tile printed) — also inside `uploads`. */\n externals(): UploadTally;\n reset(): void;\n /** Put back what the queue had before the install — its own `writeBuffer`/`writeTexture`/`copyExternalImageToTexture`, and its `submit` once no other listener taps it. Idempotent. */\n detach(): void;\n}\n\n/** One listener on a queue's submits: `before` sees the list as handed in (materialised once), `after` runs once the native submit returned. */\nexport interface SubmitHook {\n before?(list: readonly GPUCommandBuffer[]): void;\n after?(list: readonly GPUCommandBuffer[]): void;\n}\n\ninterface Tap { readonly hooks: SubmitHook[]; readonly undo: () => void }\nconst taps = new WeakMap<GPUQueue, Tap>();\n\n/**\n * THE SUBMIT TAP (K2): ONE wrapper on `queue.submit`, shared by every instrument that listens to submits — installed with the first\n * hook, removed with the last (the queue's own `submit` back). Returns the hook's removal; idempotent.\n */\nexport function tapSubmits(queue: GPUQueue, hook: SubmitHook): () => void {\n let tap = taps.get(queue);\n if (tap === undefined) {\n const native = queue.submit; // called with the queue as its receiver: a native method checks it\n const hooks: SubmitHook[] = [];\n const wrapper = (list: Iterable<GPUCommandBuffer>): undefined => {\n // Iterables are single-pass: materialise ONCE and hand the array on.\n const array = Array.from(list);\n for (const h of hooks) h.before?.(array);\n native.call(queue, array);\n for (const h of hooks) h.after?.(array);\n };\n tap = { hooks, undo: swapMethod(queue, \"submit\", wrapper as GPUQueue[\"submit\"]) };\n taps.set(queue, tap);\n }\n const t = tap;\n t.hooks.push(hook);\n let on = true;\n return () => {\n if (!on) return;\n on = false;\n const i = t.hooks.indexOf(hook);\n if (i >= 0) t.hooks.splice(i, 1);\n if (t.hooks.length === 0 && taps.get(queue) === t) { taps.delete(queue); t.undo(); }\n };\n}\n\nconst installed = new WeakMap<GPUQueue, SubmitInstrument>();\n\nconst RING = 512;\n\n/** The byte count a `writeBuffer` call carries: `size` is in ELEMENTS of a typed view and in bytes of a bare buffer (the WebGPU rule). */\nfunction writeBufferBytes(data: BufferSource | SharedArrayBuffer, dataOffset: number | undefined, size: number | undefined): number {\n if (ArrayBuffer.isView(data)) {\n const elem = (data as { BYTES_PER_ELEMENT?: number }).BYTES_PER_ELEMENT ?? 1;\n return size !== undefined ? size * elem : data.byteLength - (dataOffset ?? 0) * elem;\n }\n return size ?? data.byteLength - (dataOffset ?? 0);\n}\n\nexport function instrumentSubmits(device: GPUDevice): SubmitInstrument {\n const queue = device.queue;\n const existing = installed.get(queue);\n if (existing !== undefined) return existing;\n\n // Called with the queue as receiver: `writeBuffer` & co. are native methods with a receiver check.\n const originalWriteBuffer = queue.writeBuffer;\n const originalWriteTexture = queue.writeTexture;\n const originalCopyExternal = queue.copyExternalImageToTexture as GPUQueue[\"copyExternalImageToTexture\"] | undefined;\n let total = 0;\n let buffers = 0;\n let stamps: number[] = [];\n let writes = 0;\n let bytes = 0;\n let externals = { writes: 0, bytes: 0 };\n let byLabel = new Map<string, { writes: number; bytes: number }>();\n let attached = true;\n\n const now = (): number => (typeof performance !== \"undefined\" && typeof performance.now === \"function\" ? performance.now() : 0);\n const tally = (label: string | undefined, n: number): void => {\n if (!attached) return; // detached beneath another's wrapper: a pass-through, counting nothing\n writes += 1;\n bytes += n;\n const key = prefixOf(label);\n const t = byLabel.get(key);\n if (t === undefined) byLabel.set(key, { writes: 1, bytes: n });\n else { t.writes += 1; t.bytes += n; }\n };\n\n const untap = tapSubmits(queue, {\n before(list) {\n total++;\n buffers += list.length;\n stamps.push(now());\n if (stamps.length > RING) stamps.splice(0, RING / 2);\n },\n });\n const undo = [\n swapMethod(queue, \"writeBuffer\", ((buffer: GPUBuffer, bufferOffset: number, data: BufferSource | SharedArrayBuffer, dataOffset?: number, size?: number) => {\n tally(buffer.label, writeBufferBytes(data, dataOffset, size));\n // the arguments as given: an explicit `undefined` in a trailing slot is not the same call to the native method\n if (dataOffset === undefined) return originalWriteBuffer.call(queue, buffer, bufferOffset, data);\n if (size === undefined) return originalWriteBuffer.call(queue, buffer, bufferOffset, data, dataOffset);\n return originalWriteBuffer.call(queue, buffer, bufferOffset, data, dataOffset, size);\n }) as GPUQueue[\"writeBuffer\"]),\n swapMethod(queue, \"writeTexture\", ((destination: GPUTexelCopyTextureInfo, data: BufferSource | SharedArrayBuffer, dataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3DStrict) => {\n tally(destination.texture.label, data.byteLength - (dataLayout.offset ?? 0));\n return originalWriteTexture.call(queue, destination, data, dataLayout, size);\n }) as GPUQueue[\"writeTexture\"]),\n ];\n // (a queue without it — a test's stub — has nothing to count)\n if (typeof originalCopyExternal === \"function\") {\n undo.push(swapMethod(queue, \"copyExternalImageToTexture\", ((source: GPUCopyExternalImageSourceInfo, destination: GPUCopyExternalImageDestInfo, copySize: GPUExtent3DStrict) => {\n const n = regionBytes(destination.texture.format ?? \"rgba8unorm\", copySize);\n tally(destination.texture.label, n);\n if (attached) externals = { writes: externals.writes + 1, bytes: externals.bytes + n };\n return originalCopyExternal.call(queue, source, destination, copySize);\n }) as GPUQueue[\"copyExternalImageToTexture\"]));\n }\n\n const instrument: SubmitInstrument = {\n total: () => total,\n buffers: () => buffers,\n inWindow(windowMs) {\n const cutoff = now() - windowMs;\n let n = 0;\n for (let i = stamps.length - 1; i >= 0; i--) {\n if ((stamps[i] ?? 0) < cutoff) break;\n n++;\n }\n return n;\n },\n stamps: () => stamps,\n uploads: () => ({ writes, bytes }),\n uploadsByLabel() {\n const out: Record<string, UploadTally> = {};\n for (const [k, t] of byLabel) out[k] = { writes: t.writes, bytes: t.bytes };\n return out;\n },\n externals: () => externals,\n reset() { total = 0; buffers = 0; stamps = []; writes = 0; bytes = 0; externals = { writes: 0, bytes: 0 }; byLabel = new Map(); },\n detach() {\n if (!attached) return;\n attached = false;\n untap();\n for (const u of undo) u();\n installed.delete(queue);\n },\n };\n installed.set(queue, instrument);\n return instrument;\n}\n","// The pass instrument — what the GPU was asked to do in a frame, and how long it took (design-016 §4.2, K2; K-L5 \"measured\n// on real frames\"). Beside the submit instrument (which sees the QUEUE: submits, writes, uploads), this sees the ENCODERS:\n// it wraps `device.createCommandEncoder`, and every encoder and pass it makes, so the desk's passes are measured without\n// one of them being touched.\n//\n// COUNTS render and compute passes, draws (direct and indirect) and the instances they asked for, `setPipeline`,\n// `setBindGroup`, dispatches — per frame, and draws by the KIND that drew (the pipeline's label prefix:\n// `paper/notes` → `paper`), so \"one instanced draw for a run of notes\" is a count, not a claim.\n// TIMING every LABELLED pass gets `timestampWrites` (unless it brought its own): a begin and an end timestamp in one\n// query set. The encoder resolves its own queries in its OWN command buffer at `finish()` — so the resolve rides\n// the frame's own submits and the submit count (the idle witness) is unchanged — each run resolved into offset 0\n// of a scratch buffer (`resolveQuerySet`'s destination offset must be a multiple of 256) and copied to its place\n// in the frame's readback slot. The frame closes at the submit of its own encoder (`frameEncoders`: the ground's\n// `ground` and `hold`) — or at a boundary its host cuts (`cut()`, the layer's flush: GPU work between frames, a\n// \"loose\" frame) — and its slot is mapped then. THE RING: three readback slots; a frame that finds all three\n// still in flight is not timed (`dropped`) — the instrument never waits, never stalls, never submits, never\n// wakes anything: a readback lands in a later task and only reports.\n// THE TRAPS it names rather than hides: the Apple tiler keeps passes in flight together, so a pass's begin/end do not\n// isolate it, and the GPU may wait between passes — the frame's SPAN (first begin → last end) is the headline, never a sum\n// (gpu-profiler.ts, D-K2.4); and Dawn rounds timestamps to 100 µs unless\n// Chrome runs with `--disable-dawn-features=timestamp_quantization` — a frame whose every delta is a whole multiple of\n// 100 µs says `quantised`.\n//\n// Armed, it costs a closure per wrapped method per encoder and pass, and a counter per call; unarmed (detached) it is\n// gone — `createCommandEncoder` is the device's own again and the submit tap has one listener fewer.\n\nimport { prefixOf, swapMethod } from \"./gpu-wrap\";\nimport { tapSubmits } from \"./submit-instrument\";\n\n/** Dawn's timestamp quantum when quantisation is on: 100 µs, in the nanoseconds a timestamp query reads. */\nexport const TIMESTAMP_QUANTUM_NS = 100_000n;\n/** The Chrome switch that turns the quantisation off (the rigs pass it — scripts/cdp.mjs). */\nexport const UNQUANTISED_TIMESTAMPS_FLAG = \"--disable-dawn-features=timestamp_quantization\";\n\nexport interface PassCounts {\n /** Command encoders made. */\n readonly encoders: number;\n /** Render and compute passes begun, and how many of them were timed. */\n readonly passes: number;\n readonly timed: number;\n /** `draw` + `drawIndexed` + `drawIndirect` + `drawIndexedIndirect`. */\n readonly draws: number;\n /** The instances the direct draws asked for (an indirect draw's count is the GPU's: counted in `indirect`, not here). */\n readonly instances: number;\n readonly indirect: number;\n readonly dispatches: number;\n /** `setPipeline` / `setBindGroup` calls — every call is a command, a rebind of the same object included. */\n readonly pipelines: number;\n readonly bindGroups: number;\n /** `executeBundles` calls (their draws are the bundles', unseen here). */\n readonly bundles: number;\n}\n\nexport interface KindDraws { readonly draws: number; readonly instances: number }\n\n/** A timed pass: its label, and its begin and end in ms from the frame's earliest timestamp. */\nexport interface PassTime { readonly label: string; readonly begin: number; readonly end: number }\n\nexport type PassTiming = \"timed\" | \"unsupported\" | \"dropped\" | \"untimed\" | \"lost\";\n\nexport interface PassFrame {\n readonly serial: number;\n /** \"frame\": closed by the submit of a frame's own encoder — a frame drawn; \"loose\": GPU work a boundary closed with no frame in it. */\n readonly kind: \"frame\" | \"loose\";\n /** `performance.now()` at the frame's first command encoder, at its first submit, and at its close. */\n readonly t0: number;\n readonly firstSubmit: number;\n readonly t1: number;\n readonly counts: PassCounts;\n /** Draws and instances by the pipeline's label prefix — the kind that drew (`paper`, `photo`, `mat` …; `?` before any pipeline). */\n readonly byKind: Readonly<Record<string, KindDraws>>;\n /** The timed passes in the order begun. Empty unless `timing` is \"timed\". */\n readonly passes: readonly PassTime[];\n /**\n * \"timed\" — read back; \"unsupported\" — the device has no timestamp-query; \"dropped\" — every readback slot was still in flight\n * (never a stall); \"untimed\" — no labelled pass; \"lost\" — the readback failed (a lost device).\n */\n readonly timing: PassTiming;\n /** Every delta between the frame's timestamps is a whole multiple of 100 µs (Dawn's quantisation); null with fewer than two. */\n readonly quantised: boolean | null;\n}\n\nexport interface PassInstrumentOptions {\n /** The labels of the encoders whose submit CLOSES a frame — the frame's last command buffer. Default: the ground's, `ground` and `hold`. */\n readonly frameEncoders?: readonly string[];\n /** Timed passes a frame may hold (64); the rest are counted, not timed. */\n readonly capacity?: number;\n /** Readback slots (3). */\n readonly ring?: number;\n /** At a frame's close, synchronously — before its timing is read (a reader of other counters diffs them here). */\n readonly onClose?: (serial: number, kind: \"frame\" | \"loose\") => void;\n /** A frame complete: its counts, and its timing once read back — always a later task than its close. */\n readonly onFrame?: (frame: PassFrame) => void;\n}\n\nexport interface PassInstrument {\n /** The device has timestamp-query: labelled passes are timed. */\n readonly supported: boolean;\n /** Close the open frame now (the host's boundary — the layer's flush): whatever was encoded since the last close is a \"loose\" frame. */\n cut(): void;\n /** Frames closed, readbacks in flight, samples dropped for a full ring. */\n stats(): { readonly frames: number; readonly inFlight: number; readonly dropped: number };\n /** Put `createCommandEncoder` back and leave the submit tap; the query set and buffers go a task later (no encoder of this task then holds them). Idempotent. */\n detach(): void;\n}\n\ntype Mutable<T> = { -readonly [K in keyof T]: T[K] };\nconst zeroCounts = (): Mutable<PassCounts> => ({ encoders: 0, passes: 0, timed: 0, draws: 0, instances: 0, indirect: 0, dispatches: 0, pipelines: 0, bindGroups: 0, bundles: 0 });\n\ninterface Open {\n readonly serial: number;\n readonly t0: number;\n firstSubmit: number;\n readonly counts: Mutable<PassCounts>;\n readonly byKind: Map<string, { draws: number; instances: number }>;\n /** The readback slot: undefined until the first timed pass; −1 when the ring was full (the frame is not timed). */\n slot: number | undefined;\n next: number;\n readonly timed: { readonly label: string; readonly q: number; readonly enc: Enc }[];\n closed: boolean;\n}\ninterface Enc { readonly frame: Open; readonly closes: boolean; readonly queries: number[]; submitted: boolean }\n\nconst FREE = 0;\nconst USED = 1;\n\n/** A frame's timestamps → its passes and whether they are quantised. Passes with an unwritten (zero) stamp are left out. */\nexport function readTimestamps(stamps: BigUint64Array, timed: readonly { readonly label: string; readonly q: number }[]): { passes: PassTime[]; quantised: boolean | null } {\n const rows: { label: string; b: bigint; e: bigint }[] = [];\n for (const t of timed) {\n const b = stamps[t.q] ?? 0n;\n const e = stamps[t.q + 1] ?? 0n;\n if (b !== 0n && e !== 0n) rows.push({ label: t.label, b, e });\n }\n if (rows.length === 0) return { passes: [], quantised: null };\n let min = rows[0]?.b ?? 0n;\n for (const r of rows) { if (r.b < min) min = r.b; if (r.e < min) min = r.e; }\n let quantised = true;\n for (const r of rows) if ((r.b - min) % TIMESTAMP_QUANTUM_NS !== 0n || (r.e - min) % TIMESTAMP_QUANTUM_NS !== 0n) quantised = false;\n return { passes: rows.map((r) => ({ label: r.label, begin: Number(r.b - min) / 1e6, end: Number(r.e - min) / 1e6 })), quantised };\n}\n\nexport function instrumentPasses(device: GPUDevice, opts: PassInstrumentOptions = {}): PassInstrument {\n const frameEncoders = new Set(opts.frameEncoders ?? [\"ground\", \"hold\"]);\n const capacity = 2 * (opts.capacity ?? 64);\n const ringSize = opts.ring ?? 3;\n const flags = globalThis as unknown as { GPUBufferUsage?: Record<string, number>; GPUMapMode?: Record<string, number> };\n const usage = (name: string, bit: number): number => flags.GPUBufferUsage?.[name] ?? bit;\n const supported = device.features?.has(\"timestamp-query\") === true && typeof device.createQuerySet === \"function\";\n const querySet = supported ? device.createQuerySet({ label: \"profiler/timestamps\", type: \"timestamp\", count: capacity }) : null;\n const resolve = supported ? device.createBuffer({ label: \"profiler/resolve\", size: capacity * 8, usage: usage(\"QUERY_RESOLVE\", 0x200) | usage(\"COPY_SRC\", 0x4) }) : null;\n const readback = supported ? Array.from({ length: ringSize }, (_, i) => device.createBuffer({ label: `profiler/readback ${i}`, size: capacity * 8, usage: usage(\"MAP_READ\", 0x1) | usage(\"COPY_DST\", 0x8) })) : [];\n const slots = readback.map(() => FREE);\n const now = (): number => (typeof performance !== \"undefined\" ? performance.now() : 0);\n\n let attached = true;\n let serial = 0;\n let frames = 0;\n let inFlight = 0;\n let dropped = 0;\n let open: Open | null = null;\n const commands = new WeakMap<GPUCommandBuffer, Enc>();\n\n const frame = (): Open => {\n if (open === null) open = { serial: ++serial, t0: now(), firstSubmit: Number.NaN, counts: zeroCounts(), byKind: new Map(), slot: undefined, next: 0, timed: [], closed: false };\n return open;\n };\n const emit = (f: Open, kind: \"frame\" | \"loose\", t1: number, timing: PassTiming, passes: PassTime[] = [], quantised: boolean | null = null): void => {\n const byKind: Record<string, KindDraws> = {};\n for (const [k, v] of f.byKind) byKind[k] = { draws: v.draws, instances: v.instances };\n opts.onFrame?.({ serial: f.serial, kind, t0: f.t0, firstSubmit: Number.isNaN(f.firstSubmit) ? t1 : f.firstSubmit, t1, counts: { ...f.counts }, byKind, passes, timing, quantised });\n };\n const close = (f: Open, kind: \"frame\" | \"loose\"): void => {\n if (f.closed) return;\n f.closed = true;\n if (open === f) open = null;\n frames += 1;\n opts.onClose?.(f.serial, kind);\n const t1 = now();\n const slot = f.slot;\n // only a pass whose command buffer reached the queue was written and resolved\n const timed = f.timed.filter((t) => t.enc.submitted);\n if (slot !== undefined && slot >= 0 && timed.length > 0) {\n const buf = readback[slot] as GPUBuffer;\n inFlight += 1;\n buf.mapAsync(flags.GPUMapMode?.READ ?? 1, 0, f.next * 8).then(\n () => {\n const stamps = new BigUint64Array(buf.getMappedRange(0, f.next * 8).slice(0));\n buf.unmap();\n slots[slot] = FREE;\n inFlight -= 1;\n const r = readTimestamps(stamps, timed);\n emit(f, kind, t1, \"timed\", r.passes, r.quantised);\n },\n () => { slots[slot] = FREE; inFlight -= 1; emit(f, kind, t1, \"lost\"); },\n );\n return;\n }\n if (slot !== undefined && slot >= 0) slots[slot] = FREE; // a slot taken by passes that never reached the queue\n const why: PassTiming = !supported ? \"unsupported\" : slot === -1 ? \"dropped\" : \"untimed\";\n queueMicrotask(() => emit(f, kind, t1, why)); // never before the close's own task ends (the host's word on the frame lands first)\n };\n\n const kindOf = (f: Open, k: string): { draws: number; instances: number } => {\n let row = f.byKind.get(k);\n if (row === undefined) { row = { draws: 0, instances: 0 }; f.byKind.set(k, row); }\n return row;\n };\n /** The pass's draw calls counted, by the kind of the pipeline set last. */\n const wrapRender = (pass: GPURenderPassEncoder, f: Open): GPURenderPassEncoder => {\n // the kind drawing: the prefix of the pipeline set last — its row made at its first draw (`?` for a draw before any pipeline)\n let name = \"?\";\n let row: { draws: number; instances: number } | undefined;\n const drew = (instances: number): void => { row ??= kindOf(f, name); row.draws += 1; row.instances += instances; };\n const c = f.counts;\n const { setPipeline, setBindGroup, draw, drawIndexed, drawIndirect, drawIndexedIndirect, executeBundles } = pass;\n pass.setPipeline = (p) => { c.pipelines += 1; name = prefixOf(p.label); row = undefined; return setPipeline.call(pass, p); };\n pass.setBindGroup = ((...a: Parameters<GPURenderPassEncoder[\"setBindGroup\"]>) => { c.bindGroups += 1; return (setBindGroup as (...x: unknown[]) => undefined).apply(pass, a); }) as GPURenderPassEncoder[\"setBindGroup\"];\n pass.draw = (...a: Parameters<GPURenderPassEncoder[\"draw\"]>) => { const n = a[1] ?? 1; c.draws += 1; c.instances += n; drew(n); return draw.apply(pass, a); };\n pass.drawIndexed = (...a: Parameters<GPURenderPassEncoder[\"drawIndexed\"]>) => { const n = a[1] ?? 1; c.draws += 1; c.instances += n; drew(n); return drawIndexed.apply(pass, a); };\n if (typeof drawIndirect === \"function\") pass.drawIndirect = (...a: Parameters<GPURenderPassEncoder[\"drawIndirect\"]>) => { c.draws += 1; c.indirect += 1; drew(0); return drawIndirect.apply(pass, a); };\n if (typeof drawIndexedIndirect === \"function\") pass.drawIndexedIndirect = (...a: Parameters<GPURenderPassEncoder[\"drawIndexedIndirect\"]>) => { c.draws += 1; c.indirect += 1; drew(0); return drawIndexedIndirect.apply(pass, a); };\n if (typeof executeBundles === \"function\") pass.executeBundles = (...a: Parameters<GPURenderPassEncoder[\"executeBundles\"]>) => { c.bundles += 1; return executeBundles.apply(pass, a); };\n return pass;\n };\n const wrapCompute = (pass: GPUComputePassEncoder, f: Open): GPUComputePassEncoder => {\n const c = f.counts;\n const { setPipeline, setBindGroup, dispatchWorkgroups, dispatchWorkgroupsIndirect } = pass;\n pass.setPipeline = (p) => { c.pipelines += 1; return setPipeline.call(pass, p); };\n pass.setBindGroup = ((...a: Parameters<GPUComputePassEncoder[\"setBindGroup\"]>) => { c.bindGroups += 1; return (setBindGroup as (...x: unknown[]) => undefined).apply(pass, a); }) as GPUComputePassEncoder[\"setBindGroup\"];\n pass.dispatchWorkgroups = (...a: Parameters<GPUComputePassEncoder[\"dispatchWorkgroups\"]>) => { c.dispatches += 1; return dispatchWorkgroups.apply(pass, a); };\n if (typeof dispatchWorkgroupsIndirect === \"function\") pass.dispatchWorkgroupsIndirect = (...a: Parameters<GPUComputePassEncoder[\"dispatchWorkgroupsIndirect\"]>) => { c.dispatches += 1; c.indirect += 1; return dispatchWorkgroupsIndirect.apply(pass, a); };\n return pass;\n };\n /** A labelled pass's timestamp writes — a query pair in the frame's set — or none (unsupported, a full ring, a full set, its own). */\n const stampsFor = (d: { readonly label?: string; readonly timestampWrites?: unknown }, enc: Enc): GPURenderPassTimestampWrites | undefined => {\n const f = enc.frame;\n if (querySet === null || f.closed || d.label === undefined || d.label.length === 0 || d.timestampWrites !== undefined) return undefined;\n if (f.slot === undefined) {\n const free = slots.indexOf(FREE);\n if (free < 0) { f.slot = -1; dropped += 1; }\n else { f.slot = free; slots[free] = USED; }\n }\n if (f.slot === -1 || f.next + 2 > capacity) return undefined;\n const q = f.next;\n f.next += 2;\n f.timed.push({ label: d.label, q, enc });\n enc.queries.push(q);\n f.counts.timed += 1;\n return { querySet, beginningOfPassWriteIndex: q, endOfPassWriteIndex: q + 1 };\n };\n /** At `finish()`: this encoder's queries resolved and copied into the frame's slot, in ITS command buffer — run by run. */\n const resolveInto = (encoder: GPUCommandEncoder, enc: Enc): void => {\n const f = enc.frame;\n if (enc.queries.length === 0 || resolve === null || f.closed || f.slot === undefined || f.slot < 0) return;\n const dst = readback[f.slot] as GPUBuffer;\n const qs = [...enc.queries].sort((a, b) => a - b);\n let first = qs[0] as number;\n let end = first + 2;\n const flush = (): void => {\n encoder.resolveQuerySet(querySet as GPUQuerySet, first, end - first, resolve, 0);\n encoder.copyBufferToBuffer(resolve, 0, dst, first * 8, (end - first) * 8);\n };\n for (let i = 1; i < qs.length; i++) {\n const q = qs[i] as number;\n if (q === end) { end += 2; continue; }\n flush();\n first = q;\n end = q + 2;\n }\n flush();\n };\n\n const originalCreate = device.createCommandEncoder;\n const undoCreate = swapMethod(device, \"createCommandEncoder\", ((d?: GPUCommandEncoderDescriptor) => {\n const encoder = originalCreate.call(device, d);\n if (!attached) return encoder;\n const f = frame();\n f.counts.encoders += 1;\n const enc: Enc = { frame: f, closes: frameEncoders.has(d?.label ?? \"\"), queries: [], submitted: false };\n const { beginRenderPass, beginComputePass, finish } = encoder;\n encoder.beginRenderPass = (pd) => {\n f.counts.passes += 1;\n const tw = stampsFor(pd, enc);\n return wrapRender(beginRenderPass.call(encoder, tw !== undefined ? { ...pd, timestampWrites: tw } : pd), f);\n };\n if (typeof beginComputePass === \"function\") {\n encoder.beginComputePass = (pd) => {\n f.counts.passes += 1;\n const tw = pd !== undefined ? stampsFor(pd, enc) : undefined;\n return wrapCompute(beginComputePass.call(encoder, tw !== undefined ? { ...pd, timestampWrites: tw } : pd), f);\n };\n }\n encoder.finish = (fd) => {\n resolveInto(encoder, enc);\n const cb = finish.call(encoder, fd);\n commands.set(cb, enc);\n return cb;\n };\n return encoder;\n }) as GPUDevice[\"createCommandEncoder\"]);\n // after the native submit: the frame's command buffers are on the queue; its own encoder's closes it (its slot mapped then)\n const untap = tapSubmits(device.queue, {\n after(list) {\n let closing: Open | null = null;\n for (const cb of list) {\n const enc = commands.get(cb);\n if (enc === undefined) continue;\n enc.submitted = true;\n if (Number.isNaN(enc.frame.firstSubmit)) enc.frame.firstSubmit = now();\n if (enc.closes) closing = enc.frame;\n }\n if (closing !== null) close(closing, \"frame\");\n // K9 R7 — work submitted with no frame encoder of its own while the loop sleeps (a decode's mips, a raster's fill, an\n // array's grow) opened a frame that the next tick's `ground` encoder then JOINED: the frame read the decode's t0 and counted\n // its passes. The tick is one synchronous task — its own small submits (a board's stamps, a new raster) are followed by the\n // frame's closing submit before any microtask runs — so a frame still open at the microtask after such a submit is\n // between-frame work: closed here as a LOOSE frame, and the next drawn frame opens its own.\n else if (open !== null) {\n const f = open;\n queueMicrotask(() => { if (open === f && !f.closed) close(f, \"loose\"); });\n }\n },\n });\n\n return {\n supported,\n cut() { if (open !== null) close(open, \"loose\"); },\n stats: () => ({ frames, inFlight, dropped }),\n detach() {\n if (!attached) return;\n attached = false;\n undoCreate();\n untap();\n // a task later no encoder of this one can still reference them (a pending map is rejected by the destroy: its frame reads \"lost\")\n setTimeout(() => { querySet?.destroy(); resolve?.destroy(); for (const b of readback) b.destroy(); }, 0);\n },\n };\n}\n","// THE GPU PROFILER (design-016 §4, K2; K-L5 \"measured on real frames\") — the desk's frames as the GPU saw them, armed on\n// demand. It holds the three instruments together: the submit instrument (the queue: submits, writes, upload bytes by\n// label), the pass instrument (the encoders: passes, draws by kind, pipelines, bind groups, every labelled pass timed) and,\n// where the host kept one, the memory ledger (live bytes by label) — and turns each closed frame into ONE report:\n//\n// { frame, span, sum, busy, passes[{ label, begin, end }], counts{ draws, instances, pipelines, bindGroups, passes, submits,\n// writes, uploadBytes … }, byKind, uploads, cpu{ encode, flush }, memory, quantised }\n//\n// with rolling p50 / p95 / max over a window. THE HEADLINE IS THE SPAN — first begin → last end of the frame's timed passes,\n// the GPU time the frame took. A SUM of passes misleads both ways (`sum` is reported beside it to show it — D-K2.4, measured\n// on this Mac at K2): the Apple tiler keeps passes in flight together, so a pass's own begin/end does not isolate it and the\n// sum overstates (52 of 60 frames); and the GPU waits between passes — for the drawable the ground pass draws into — so the\n// sum understates (8 of 60 — the gaps printed were 0.4, 1.4 and 3.6 ms). `busy` — the union of the passes' intervals — is the work without the waits:\n// `span − busy` is what the frame waited. A frame whose every timestamp delta is a whole multiple of 100 µs is `quantised`:\n// Dawn rounds timestamps unless Chrome runs with `--disable-dawn-features=timestamp_quantization`.\n//\n// THE FRAME (D-K2.3): a frame closes at the submit of its own encoder (`ground`, `hold` — the pass instrument); the host's\n// boundary (`flushed`, the layer's flush) closes whatever GPU work came without one (a raster made between frames: a\n// \"loose\" frame, reported but kept out of the rolling window) and gives the frame its `flush` ms. `encode` is the CPU from\n// the frame's first command encoder to its close. K-L5: UNARMED it costs nothing (no instrument installed: the device and\n// the queue are the natives; `flushed` returns at its first line); ARMED it adds no submit (the resolve rides the frame's\n// own command buffers), never waits (a full readback ring drops the sample) and never schedules a frame — a report lands\n// in a later task and only reports.\n//\n// `capture(n)` turns the next n frames into a Chrome trace-event JSON (Perfetto and chrome://tracing load it): the CPU\n// spans (`desk flush`, `encode` — also as `performance.measure` entries, for the Performance panel's Timings track), the\n// GPU passes each on a track of its own (overlapping passes cannot nest on one), the frame's span, and counters for draws,\n// uploads and memory. The GPU spans are placed at the frame's first submit: the GPU's clock and `performance.now()` are not\n// correlated, so their DURATIONS and relative offsets are the GPU's own, their placement the CPU's.\n\nimport type { GpuMemory, MemoryLedger } from \"./gpu-memory\";\nimport { instrumentPasses, type KindDraws, type PassCounts, type PassFrame, type PassInstrument, type PassTime, type PassTiming, UNQUANTISED_TIMESTAMPS_FLAG } from \"./pass-instrument\";\nimport type { SubmitInstrument, UploadTally } from \"./submit-instrument\";\n\nexport interface GpuFrameCounts extends PassCounts {\n /** `queue.submit` calls in the frame. */\n readonly submits: number;\n /** Uploads (`writeBuffer` + `writeTexture` + `copyExternalImageToTexture`) and their bytes. */\n readonly writes: number;\n readonly uploadBytes: number;\n /** The `copyExternalImageToTexture` uploads alone (a picture, a calendar tile). */\n readonly externals: number;\n}\n\nexport interface GpuFrameReport {\n /** The profiler's frame number (monotonic across arms). */\n readonly frame: number;\n /** \"frame\": one the desk drew; \"loose\": GPU work the host's boundary closed with no frame in it — reported, never in the window. */\n readonly kind: \"frame\" | \"loose\";\n /** `performance.now()` at the frame's first command encoder. */\n readonly at: number;\n /** THE HEADLINE: GPU ms from the first timed pass's begin to the last one's end; null when untimed. */\n readonly span: number | null;\n /** The passes' own durations summed — NOT the frame's time: overlapping passes count twice, the GPU's waits between them not at all. */\n readonly sum: number | null;\n /** The GPU BUSY in the frame: the union of its passes' intervals — overlaps once, waits not at all; `span − busy` is what it waited (the drawable). */\n readonly busy: number | null;\n /** The timed passes, ms from the frame's earliest timestamp. */\n readonly passes: readonly PassTime[];\n readonly counts: GpuFrameCounts;\n /** Draws and instances by the kind that drew (the pipeline's label prefix). */\n readonly byKind: Readonly<Record<string, KindDraws>>;\n /** The frame's uploads by the written resource's label prefix. */\n readonly uploads: Readonly<Record<string, UploadTally>>;\n /** CPU ms: `encode` — the frame's first command encoder to its close; `flush` — the host's flush that held it (null: none, a tool's frame). */\n readonly cpu: { readonly encode: number; readonly flush: number | null };\n /** The ledger's live GPU memory as the frame completed; null when the host keeps no ledger. */\n readonly memory: GpuMemory | null;\n readonly timing: PassTiming;\n /** Every timestamp delta a whole multiple of 100 µs — Dawn's quantisation (`UNQUANTISED_TIMESTAMPS_FLAG` turns it off); null untimed. */\n readonly quantised: boolean | null;\n}\n\n/** Rolling percentiles over the window: nearest rank. */\nexport interface Rolling { readonly n: number; readonly p50: number; readonly p95: number; readonly max: number }\n\nexport interface GpuProfileStats {\n readonly armed: boolean;\n /** Drawn frames in the window (loose work never enters it). */\n readonly frames: number;\n /** The GPU span; null while no frame in the window was timed. */\n readonly span: Rolling | null;\n /** The GPU busy (the span less the waits). */\n readonly busy: Rolling | null;\n readonly encode: Rolling | null;\n readonly flush: Rolling | null;\n readonly draws: Rolling | null;\n readonly instances: Rolling | null;\n readonly pipelines: Rolling | null;\n readonly bindGroups: Rolling | null;\n readonly passes: Rolling | null;\n readonly submits: Rolling | null;\n readonly uploadBytes: Rolling | null;\n /** Most timed frames in the window read quantised → true (a real delta lands on a 100 µs multiple now and then, by chance — one frame is not the clock); else false; nothing timed → null. */\n readonly quantised: boolean | null;\n /** The switch that unquantises timestamps — what the dock says when `quantised`. */\n readonly unquantise: string;\n /** Samples dropped for a full readback ring, and readbacks in flight (this arming). */\n readonly dropped: number;\n readonly inFlight: number;\n}\n\nexport interface TraceEvent {\n readonly name: string;\n readonly ph: \"X\" | \"C\" | \"M\";\n readonly ts: number;\n readonly dur?: number;\n readonly pid: number;\n readonly tid: number;\n readonly cat?: string;\n readonly args?: Readonly<Record<string, unknown>>;\n}\n\n/** A Chrome trace-event file (the JSON object format): Perfetto's and chrome://tracing's. */\nexport interface TraceJson {\n readonly traceEvents: readonly TraceEvent[];\n readonly displayTimeUnit: \"ms\";\n readonly metadata: Readonly<Record<string, unknown>>;\n}\n\nexport interface GpuProfiler {\n /** The device has timestamp-query: frames are timed. */\n readonly supported: boolean;\n armed(): boolean;\n /** Arm — refcounted: the first arm installs the instruments; returns this arm's release (the last release takes them all off). */\n arm(): () => void;\n /** The frames completed since the last take (drained, oldest first) — a rig's reading. */\n take(): GpuFrameReport[];\n /** The last frame completed. */\n last(): GpuFrameReport | null;\n /** Rolling p50 / p95 / max over the window's drawn frames. */\n stats(): GpuProfileStats;\n /** Called with every frame completed while armed; returns the unsubscribe. */\n subscribe(listener: (report: GpuFrameReport) => void): () => void;\n /** The host's boundary — its flush ended after `ms`: work with no frame is closed as loose, and the frames it held are given its ms. */\n flushed(ms: number): void;\n /** The next `n` frames as a trace-event JSON (arming for as long as it takes); at `timeoutMs` (10 s) it answers with what came. */\n capture(n: number, opts?: { readonly timeoutMs?: number; readonly measure?: boolean }): Promise<TraceJson>;\n /** Disarm whatever holds it and stop. */\n dispose(): void;\n}\n\nexport interface GpuProfilerOptions {\n readonly device: GPUDevice;\n /** The submit instrument, held while armed and released after — the host's (the layer's `submits()` may hold it for good). */\n readonly submits: { hold(): SubmitInstrument; release(): void };\n /** The host's memory ledger, if it keeps one. */\n readonly ledger?: () => MemoryLedger | undefined;\n /** Drawn frames in the rolling window (120). */\n readonly window?: number;\n /** The encoders whose submit closes a frame (the pass instrument's default: `ground`, `hold`). */\n readonly frameEncoders?: readonly string[];\n}\n\n/** Nearest-rank percentiles of `values`; null when empty. */\nexport function rolling(values: readonly number[]): Rolling | null {\n if (values.length === 0) return null;\n const s = [...values].sort((a, b) => a - b);\n const at = (q: number): number => s[Math.min(s.length - 1, Math.max(0, Math.ceil(q * s.length) - 1))] as number;\n return { n: s.length, p50: at(0.5), p95: at(0.95), max: s[s.length - 1] as number };\n}\n\n/** The GPU's busy time in `passes`: the union of their intervals — overlapping passes counted once, the gaps between them not at all. */\nexport function busyOf(passes: readonly PassTime[]): number | null {\n if (passes.length === 0) return null;\n const s = [...passes].sort((a, b) => a.begin - b.begin);\n let total = 0;\n let b = (s[0] as PassTime).begin;\n let e = (s[0] as PassTime).end;\n for (const p of s) {\n if (p.begin > e) { total += e - b; b = p.begin; e = p.end; }\n else if (p.end > e) e = p.end;\n }\n return total + (e - b);\n}\n\n/** The span of `passes`: first begin → last end; null when there are none. */\nexport function spanOf(passes: readonly PassTime[]): number | null {\n if (passes.length === 0) return null;\n let b = Number.POSITIVE_INFINITY;\n let e = Number.NEGATIVE_INFINITY;\n for (const p of passes) { if (p.begin < b) b = p.begin; if (p.end > e) e = p.end; }\n return e - b;\n}\n\ninterface Snapshot { readonly submits: number; readonly writes: number; readonly bytes: number; readonly externals: number; readonly byLabel: Readonly<Record<string, UploadTally>> }\n\nconst snapshotOf = (s: SubmitInstrument): Snapshot => ({ submits: s.total(), writes: s.uploads().writes, bytes: s.uploads().bytes, externals: s.externals().writes, byLabel: s.uploadsByLabel() });\n\n/** `now − before`, clamped at 0 (a `reset()` between the two reads starts the count again). */\nfunction diff(now: Snapshot, before: Snapshot): Omit<Snapshot, \"byLabel\"> & { byLabel: Record<string, UploadTally> } {\n const byLabel: Record<string, UploadTally> = {};\n for (const [k, t] of Object.entries(now.byLabel)) {\n const b = before.byLabel[k];\n const writes = t.writes - (b?.writes ?? 0);\n const bytes = t.bytes - (b?.bytes ?? 0);\n if (writes > 0) byLabel[k] = { writes, bytes: Math.max(0, bytes) };\n }\n return {\n submits: Math.max(0, now.submits - before.submits), writes: Math.max(0, now.writes - before.writes),\n bytes: Math.max(0, now.bytes - before.bytes), externals: Math.max(0, now.externals - before.externals), byLabel,\n };\n}\n\nexport function createGpuProfiler(opts: GpuProfilerOptions): GpuProfiler {\n const { device } = opts;\n const windowSize = opts.window ?? 120;\n const now = (): number => (typeof performance !== \"undefined\" ? performance.now() : 0);\n const supported = device.features?.has(\"timestamp-query\") === true;\n let holds = 0;\n let pass: PassInstrument | null = null;\n let submits: SubmitInstrument | null = null;\n let base = 0; // frame numbers stay monotonic across arms\n let highest = 0;\n let epoch = 0; // an arming's frames: a readback landing after its disarm is dropped\n let before: Snapshot | null = null;\n const closed = new Map<number, { uploads: ReturnType<typeof diff>; closedAt: number; flush: number | null; flushAt: number | null }>();\n let unflushed: number[] = [];\n const recent: GpuFrameReport[] = [];\n let taken: GpuFrameReport[] = [];\n let last: GpuFrameReport | null = null;\n const listeners = new Set<(r: GpuFrameReport) => void>();\n let disposed = false;\n\n // where each frame sat on the CPU clock, for a capture: its flush's start, its first submit\n const trace = new Map<number, { flushAt: number | null; firstSubmit: number }>();\n const report = (f: PassFrame, b: number, e: number): void => {\n if (e !== epoch || pass === null) return;\n const at = closed.get(f.serial);\n closed.delete(f.serial);\n const up = at?.uploads ?? { submits: 0, writes: 0, bytes: 0, externals: 0, byLabel: {} };\n const span = spanOf(f.passes);\n const r: GpuFrameReport = {\n frame: b + f.serial, kind: f.kind, at: f.t0, span,\n sum: f.passes.length > 0 ? f.passes.reduce((s, p) => s + (p.end - p.begin), 0) : null,\n busy: busyOf(f.passes),\n passes: f.passes,\n counts: { ...f.counts, submits: up.submits, writes: up.writes, uploadBytes: up.bytes, externals: up.externals },\n byKind: f.byKind, uploads: up.byLabel,\n cpu: { encode: f.t1 - f.t0, flush: at?.flush ?? null },\n memory: opts.ledger?.()?.read() ?? null,\n timing: f.timing, quantised: f.quantised,\n };\n if (r.kind === \"frame\") { recent.push(r); if (recent.length > windowSize) recent.shift(); }\n taken.push(r);\n if (taken.length > 4 * windowSize) taken.splice(0, taken.length - 4 * windowSize); // an untaken reading never grows without bound\n last = r;\n trace.set(r.frame, { flushAt: at?.flushAt ?? null, firstSubmit: f.firstSubmit });\n if (trace.size > 4 * windowSize) trace.delete(trace.keys().next().value as number);\n for (const l of [...listeners]) l(r);\n };\n\n const install = (): void => {\n submits = opts.submits.hold();\n before = snapshotOf(submits);\n const b = base;\n const e = ++epoch;\n pass = instrumentPasses(device, {\n ...(opts.frameEncoders !== undefined ? { frameEncoders: opts.frameEncoders } : {}),\n onClose(serial) {\n highest = Math.max(highest, serial);\n const s = submits;\n if (s === null || before === null) return;\n const snap = snapshotOf(s);\n closed.set(serial, { uploads: diff(snap, before), closedAt: now(), flush: null, flushAt: null });\n before = snap;\n unflushed.push(serial);\n if (unflushed.length > 4 * windowSize) unflushed.shift();\n },\n onFrame: (f) => report(f, b, e),\n });\n };\n const uninstall = (): void => {\n pass?.detach();\n pass = null;\n epoch += 1;\n if (submits !== null) { submits = null; opts.submits.release(); }\n base += highest;\n highest = 0;\n before = null;\n unflushed = [];\n closed.clear();\n };\n\n const profiler: GpuProfiler = {\n supported,\n armed: () => pass !== null,\n arm() {\n if (disposed) return () => {};\n holds += 1;\n if (holds === 1) install();\n let held = true;\n return () => {\n if (!held) return;\n held = false;\n holds -= 1;\n if (holds === 0) uninstall();\n };\n },\n take() { const out = taken; taken = []; return out; },\n last: () => last,\n stats() {\n const timed = recent.filter((r) => r.span !== null);\n const pick = (f: (r: GpuFrameReport) => number): Rolling | null => rolling(recent.map(f));\n const flushes = recent.flatMap((r) => (r.cpu.flush !== null ? [r.cpu.flush] : []));\n const q = timed.filter((r) => r.quantised !== null);\n const st = pass?.stats();\n return {\n armed: pass !== null, frames: recent.length,\n span: rolling(timed.map((r) => r.span as number)),\n busy: rolling(timed.map((r) => r.busy as number)),\n encode: pick((r) => r.cpu.encode), flush: rolling(flushes),\n draws: pick((r) => r.counts.draws), instances: pick((r) => r.counts.instances), pipelines: pick((r) => r.counts.pipelines),\n bindGroups: pick((r) => r.counts.bindGroups), passes: pick((r) => r.counts.passes), submits: pick((r) => r.counts.submits),\n uploadBytes: pick((r) => r.counts.uploadBytes),\n quantised: q.length === 0 ? null : 2 * q.filter((r) => r.quantised === true).length > q.length,\n unquantise: UNQUANTISED_TIMESTAMPS_FLAG,\n dropped: st?.dropped ?? 0, inFlight: st?.inFlight ?? 0,\n };\n },\n subscribe(listener) { listeners.add(listener); return () => { listeners.delete(listener); }; },\n flushed(ms) {\n if (pass === null) return;\n pass.cut(); // work with no frame of its own: a loose frame, closed here\n if (unflushed.length === 0) return;\n const start = now() - ms;\n // the frames this flush held — closed inside it (a tool's batch renders outside any flush: no flush ms)\n for (const serial of unflushed) { const c = closed.get(serial); if (c !== undefined && c.closedAt >= start) { c.flush = ms; c.flushAt = start; } }\n unflushed = [];\n },\n capture(n, o = {}) {\n const release = profiler.arm();\n const frames: GpuFrameReport[] = [];\n const measure = o.measure !== false && typeof performance !== \"undefined\" && typeof performance.measure === \"function\";\n return new Promise<TraceJson>((resolve) => {\n let done = false;\n const finish = (): void => {\n if (done) return;\n done = true;\n off();\n clearTimeout(timer);\n release();\n resolve(traceOf(frames, trace, { requested: n, supported }));\n };\n const off = profiler.subscribe((r) => {\n frames.push(r);\n if (measure) {\n const t = trace.get(r.frame);\n try {\n if (t?.flushAt != null && r.cpu.flush !== null) performance.measure(`desk flush #${r.frame}`, { start: t.flushAt, end: t.flushAt + r.cpu.flush });\n performance.measure(`encode #${r.frame}`, { start: r.at, end: r.at + r.cpu.encode });\n } catch { /* a clock the entry types refuse: the trace still has it */ }\n }\n if (frames.length >= n) finish();\n });\n const timer = setTimeout(finish, o.timeoutMs ?? 10_000);\n });\n },\n dispose() {\n if (disposed) return;\n disposed = true;\n holds = 0;\n if (pass !== null) uninstall();\n listeners.clear();\n },\n };\n return profiler;\n}\n\n/** Frames → a trace-event JSON: CPU spans on the main thread, each GPU pass on a track of its own, the span, counters. µs throughout. */\nexport function traceOf(frames: readonly GpuFrameReport[], where: ReadonlyMap<number, { readonly flushAt: number | null; readonly firstSubmit: number }>, meta: Readonly<Record<string, unknown>> = {}): TraceJson {\n const us = (ms: number): number => Math.round(ms * 1000);\n const CPU = 1;\n const GPU = 2;\n const events: TraceEvent[] = [\n { name: \"process_name\", ph: \"M\", ts: 0, pid: CPU, tid: 0, args: { name: \"desk — CPU\" } },\n { name: \"thread_name\", ph: \"M\", ts: 0, pid: CPU, tid: 1, args: { name: \"main thread\" } },\n { name: \"process_name\", ph: \"M\", ts: 0, pid: GPU, tid: 0, args: { name: \"desk — GPU (timestamp queries)\" } },\n { name: \"thread_name\", ph: \"M\", ts: 0, pid: GPU, tid: 1, args: { name: \"frame span\" } },\n ];\n const tracks = new Map<string, number>();\n const trackOf = (label: string): number => {\n let tid = tracks.get(label);\n if (tid === undefined) {\n tid = 2 + tracks.size;\n tracks.set(label, tid);\n events.push({ name: \"thread_name\", ph: \"M\", ts: 0, pid: GPU, tid, args: { name: label } });\n }\n return tid;\n };\n for (const r of [...frames].sort((a, b) => a.frame - b.frame)) {\n const w = where.get(r.frame);\n if (w?.flushAt != null && r.cpu.flush !== null) events.push({ name: \"desk flush\", cat: \"cpu\", ph: \"X\", ts: us(w.flushAt), dur: us(r.cpu.flush), pid: CPU, tid: 1, args: { frame: r.frame } });\n events.push({ name: \"encode\", cat: \"cpu\", ph: \"X\", ts: us(r.at), dur: us(r.cpu.encode), pid: CPU, tid: 1, args: { frame: r.frame, kind: r.kind } });\n const anchor = w?.firstSubmit ?? r.at;\n if (r.span !== null) events.push({ name: `frame ${r.frame}`, cat: \"gpu\", ph: \"X\", ts: us(anchor), dur: us(r.span), pid: GPU, tid: 1, args: { span: r.span, busy: r.busy, sum: r.sum, quantised: r.quantised } });\n for (const p of r.passes) events.push({ name: p.label, cat: \"gpu\", ph: \"X\", ts: us(anchor + p.begin), dur: us(p.end - p.begin), pid: GPU, tid: trackOf(p.label), args: { frame: r.frame } });\n events.push({ name: \"draws\", ph: \"C\", ts: us(r.at), pid: CPU, tid: 1, args: { draws: r.counts.draws, instances: r.counts.instances, pipelines: r.counts.pipelines, bindGroups: r.counts.bindGroups } });\n events.push({ name: \"uploads\", ph: \"C\", ts: us(r.at), pid: CPU, tid: 1, args: { bytes: r.counts.uploadBytes, writes: r.counts.writes } });\n if (r.memory !== null) events.push({ name: \"gpu memory\", ph: \"C\", ts: us(r.at), pid: GPU, tid: 1, args: { textures: r.memory.textures, buffers: r.memory.buffers } });\n }\n return {\n traceEvents: events,\n displayTimeUnit: \"ms\",\n metadata: { source: \"@ice/desk GPU profiler (design-016 §4)\", frames: frames.length, clock: \"CPU spans on performance.now(); GPU spans placed at each frame's first submit — their durations and offsets are the GPU's own\", ...meta },\n };\n}\n","// The swap chain — the one place the engine touches a canvas (design-015 §3 `desk-dom-free`:\n// `desk/src/host/*` is where the DOM may be named; nothing else under src/ may). Moved here\n// from engine/device.ts at D2a-world: `acquire()` stayed host-agnostic (a `GPU` is handed in —\n// `navigator.gpu` in a browser, Dawn's in Node), and the Node oracle never needed a surface at\n// all, it draws into a readable Target. A host makes one of these and hands it to\n// `Ground.create` (ground.ts); `test/dom-free.test.ts` keeps the rest of src/ DOM-free.\n\nimport type { Surface } from \"../engine/device\";\n\nexport type { Surface } from \"../engine/device\";\n\nexport function surface(device: GPUDevice, canvas: HTMLCanvasElement, opts: { alphaMode?: GPUCanvasAlphaMode } = {}): Surface {\n const context = canvas.getContext(\"webgpu\");\n if (!context) throw new Error(\"canvas.getContext('webgpu') returned null\");\n const format = navigator.gpu.getPreferredCanvasFormat();\n context.configure({ device, format, alphaMode: opts.alphaMode ?? \"opaque\" });\n let last = { w: 0, h: 0 };\n return {\n context, format,\n fit(maxDpr = 2) {\n const dpr = Math.min(window.devicePixelRatio || 1, maxDpr);\n const cssWidth = Math.max(1, canvas.clientWidth);\n const cssHeight = Math.max(1, canvas.clientHeight);\n const width = Math.max(1, Math.round(cssWidth * dpr));\n const height = Math.max(1, Math.round(cssHeight * dpr));\n const changed = width !== last.w || height !== last.h;\n if (changed) { canvas.width = width; canvas.height = height; last = { w: width, h: height }; }\n return { changed, width, height, cssWidth, cssHeight, dpr };\n },\n view() { return context.getCurrentTexture().createView(); },\n size() { return { w: Math.max(1, canvas.width), h: Math.max(1, canvas.height) }; },\n };\n}\n","// The hand's shader set (hold/hold.wgsl): the focus behind the object in hand and the object over it — as\n// the mat's and the marks' sets are composed (mat/shaders.ts, marks/shaders.ts): the file map a host's\n// `ShaderText` fills, the set the pass compiles.\nimport type { ShaderPart } from \"../engine/shader\";\n\nexport interface HoldShaders {\n readonly entry: ShaderPart; // hold/hold.wgsl\n}\n\nexport interface HoldShaderText {\n readonly hold: string;\n}\n\nexport const HOLD_SHADER_FILES: Record<keyof HoldShaderText, string> = {\n hold: \"hold/hold.wgsl\",\n};\n\nexport function holdShaders(t: HoldShaderText): HoldShaders {\n return { entry: { label: \"hold/hold.wgsl\", text: t.hold } };\n}\n","// Assemble the mat's shader parts from raw text — the browser with `?raw`\n// imports, the Node oracle with readFileSync; byte-identical either way.\n\nimport type { ShaderPart } from \"../engine/shader\";\n\nexport interface MatShaders {\n readonly modules: readonly ShaderPart[]; // portal.wgsl, mat.wgsl, ruler.wgsl\n readonly wind: ShaderPart; // wind.wgsl — the plate → silhouette pass\n readonly entry: ShaderPart; // mat-pass.wgsl — the fullscreen mat\n}\n\nexport interface MatShaderText {\n /** shaders/portal.wgsl — the portal clip every pass includes. */\n readonly portal: string;\n readonly mat: string;\n /** shaders/mat/ruler.wgsl — the rulers' print (RULER.md). */\n readonly ruler: string;\n readonly wind: string;\n readonly matPass: string;\n}\n\nexport const MAT_SHADER_FILES: Record<keyof MatShaderText, string> = {\n portal: \"portal.wgsl\",\n mat: \"mat/mat.wgsl\",\n ruler: \"mat/ruler.wgsl\",\n wind: \"mat/wind.wgsl\",\n matPass: \"mat/mat-pass.wgsl\",\n};\n\nexport function matShaders(t: MatShaderText): MatShaders {\n const part = (label: string, text: string): ShaderPart => ({ label, text });\n return {\n modules: [part(\"portal.wgsl\", t.portal), part(\"mat/mat.wgsl\", t.mat), part(\"mat/ruler.wgsl\", t.ruler)],\n wind: part(\"mat/wind.wgsl\", t.wind),\n entry: part(\"mat/mat-pass.wgsl\", t.matPass),\n };\n}\n","// An object's DATA children read from the world (design-015 §5.1; D3w) — the host's half of the\n// kinds' `DataChildren` seam (kinds/world.ts): a kind never reads the world, the desk layer hands its\n// `local()` this. The stamp is strata's order stamp of the object's `ChildOf` sequence — it turns over\n// when a child is added, removed or moved (a stroke laid, undone, redone, a remote peer's) — and the\n// rows are the children's values of one component in sibling order (D3t-c: with their entities, and a child's one edge — a\n// pin's note). A dead object has neither.\n\nimport { ChildOf, type Component, type Entity, type Relation, type World } from \"@ice/core\";\nimport type { DataChildren } from \"../kinds/world\";\n\nexport function worldChildren(world: World): DataChildren {\n return {\n stamp: (e) => (world.isAlive(e) ? world.orderStamp(e, ChildOf) : 0),\n rows<T>(e: Entity, c: Component<T>): readonly T[] {\n if (!world.isAlive(e)) return [];\n const out: T[] = [];\n for (const k of world.getReverse(e, ChildOf)) { const v = world.get(k, c); if (v !== undefined) out.push(v); }\n return out;\n },\n entries<T>(e: Entity, c: Component<T>): readonly { readonly entity: Entity; readonly value: T }[] {\n if (!world.isAlive(e)) return [];\n const out: { entity: Entity; value: T }[] = [];\n for (const k of world.getReverse(e, ChildOf)) { const v = world.get(k, c); if (v !== undefined) out.push({ entity: k, value: v }); }\n return out;\n },\n target: (k: Entity, r: Relation) => (world.isAlive(k) ? world.getRelation(k, r) : undefined),\n };\n}\n","// The DESK LAYER — what a host mounts (design-015 §3, plan D-D0.6; D2a-world): `deskLayer(opts)`\n// returns a factory structurally assignable to `@ice/dom`'s `LayerFactory` (D5b: `createDeskHost`,\n// wrapped by `@ice/react`'s `<Desk layer={deskLayer({ … })}>`, mounts the desk exactly as\n// `<InfiniteCanvas ground={…}>` mounted the ground until D5 turned the host into `<Desk>` by\n// deletion). This is the host half — the one module beside host/surface.ts that may touch the DOM:\n// it prepends its canvas to the container, draws with the ENGINE's device when the context carries one (D7: one device\n// per engine) and otherwise acquires its OWN (`navigator.gpu`, or the `gpu` handed in),\n// makes the swap chain (the submit instrument waits to be asked for — K2), compiles the\n// ground from the app's object kinds (`Ground.create` — `available()` is false until it resolves),\n// reads the OS's reduced-motion preference into the ambient, and hands the DOM-free reflector\n// (compose/reflector.ts) what it needs: a `ground()` slot, a canvas sizer. It registers ONE\n// reflector, sets the interaction stack's pick source (`framePick.current`) over the kinds' mirrors\n// and clears it at dispose, and registers the `ground` transition plane so a nav flight can prepare.\n//\n// The parity hooks live on the HANDLE, never in durable props (the brief's pinned detail):\n// `pinMat` (the clocks, the plate, the gobo's opacity, the wind), `pinAsset` (a kind's own asset on one\n// object — a note's greeked writing; K8a: the kind's shape, never the desk's), `setPlate` / `setNoise` / `setGlyphs` (the product never\n// fed the mat before — the render map's finding #2; the blue noise is the desk's own, the plates\n// are the app's generated ones), `configureMat` (the rulers as the app's mat config). Instruments:\n// `submits()`, `stats()`, `wakes()`, `geometryOf`, `fluxOf`, `lastInputs`.\n//\n// The TEXT (D2c, design-015 §6.1): each object kind's own state on this desk (`kind.local(host)` —\n// the note's WRITING, over the root paper pass's pages and the app's text raster, `opts.text`) is made\n// here and threaded through the builder; the ONE focused editor — the DESK's since K8a (host/editor.ts), made whatever kinds\n// are registered — sits in the container and is LEASED by the text parts the objects declare (`defineObject({ host: { text } })`:\n// the note's body writes through the note's typing session into `opts.docs`; the layer names no kind). The\n// drawing reflector is wrapped, not changed: before it, every kind's local is ticked on ONE clock\n// (`performance.now()` — the rAF clock lags wall time headless) and may wake an `ink` frame (a wipe,\n// a blink, a face landing); after it, the editor follows the part it is lent to. A committed raster is\n// pinned through the writing, so a note that leaves the desk gives its rect back (the page-slot leak).\n//\n// And the desk's chrome (D4a): the ground is made with the marks pass, the builder reads the interaction\n// stack's marquee preview through the context's `readMarquee`, and the handle's `selection` is the one\n// source a screen-space selection menu is placed from — the marks' box around the selection as drawn,\n// published after every frame it changed.\n\nimport { Camera, closeTray, type Entity, InsertGhost, type FramePickSlot, type HeldPoseSlot, type HeldPoseSource, HeldTool, type MarqueeBuffer, type MenuActionDef, type NavFace, type NavGeometrySlot, NavTransition, openTray, PrefabId, type PresentationTransitionAdapter, type ReflectorDef, scrollTray, selectedEntities, setTrayCategory, toggleTray, Tray, trayCategories, trayCategory, type TrayCategory, trayEntity, trayEntryCount, trayOpen, type TrayPoseSlot, type TrayPoseSource, type TrayScreenFrame, Viewport, type WidgetType, type World } from \"@ice/core\";\nimport { flightCamera } from \"../nav/flight\";\nimport { type Ambient, type AmbientMode, type AmbientPin, createAmbient } from \"../compose/ambient\";\nimport { createDeskBuilder, type DeskBuilder, type HeldBuild, type HoldPin, type SpatialSource } from \"../compose/builder\";\nimport { type BudgetStats, createRasterBudget } from \"../engine/budget\";\nimport { createRasterQueue, type RasterQueueStats } from \"../engine/rasters\";\nimport type { RecordStoreStats } from \"../engine/records\";\nimport { HOLD_SHADER_FILES, holdShaders } from \"../hold/shaders\";\nimport { heldSlots, type SelectionAnchor, withKindActs } from \"../compose/marks\";\nimport { createPickSource } from \"../compose/pick\";\nimport { createDeskReflector, type DeskReflector, type DeskReflectorStats, type DeskWakes, looksOf } from \"../compose/reflector\";\nimport { acquire, adopt, type Gpu, type GpuOptions } from \"../engine/device\";\nimport { Ground, type GroundFrameInputs } from \"../ground\";\nimport type { KindProgram } from \"../kind\";\nimport type { ObjectFlux, ObjectKind } from \"../kinds/world\";\nimport { DEFAULT_GRID, type GridConfig } from \"../mat/grid\";\nimport type { GlyphAtlasMeta, MatConfig, PlateName } from \"../mat/layout\";\nimport { MAT_SHADER_FILES, matShaders } from \"../mat/shaders\";\nimport { MARKS_SHADER_FILES, marksShaders } from \"../marks/shaders\";\nimport { driversOf, hostOf, objectKindOf } from \"../object\";\nimport type { ObjectSprings } from \"../kit/springs\";\nimport { blueNoise } from \"../assets/blue-noise.gen\";\nimport type { KindDriver, KindLocal, ObjectDomHost } from \"../kinds/world\";\nimport { worldChildren } from \"../compose/children\";\nimport { BLOB_STORE, type BlobStore, PICTURE_DECODER } from \"../kit/blobs\";\nimport { createServices, type Lent, service } from \"../kit/services\";\nimport { decodePicture } from \"./picture\";\nimport { NO_DOCS, type TypingDocs } from \"../docs\";\nimport { TEXT_RASTER, type TextRaster } from \"../kit/raster\";\nimport type { DeskEditor, TextPart } from \"../kit/editor\";\nimport { createDeskEditor } from \"./editor\";\nimport type { InsideView } from \"../kit/inside\";\nimport { shaderText } from \"../shaders\";\nimport { instrumentMemory, type MemoryLedger } from \"../gpu-memory\";\nimport { createGpuProfiler, type GpuProfiler } from \"../gpu-profiler\";\nimport { instrumentSubmits, type SubmitInstrument } from \"../submit-instrument\";\nimport type { GroundTheme, Palette } from \"../theme\";\nimport { surface } from \"./surface\";\nimport { DRAWER } from \"../tray/drawer\";\nimport type { TrayFluxState, TrayPin } from \"../tray/flux\";\nimport type { TrayLaid } from \"../tray/pass\";\nimport { trayShaders } from \"../tray/shaders\";\n\nexport interface DeskLayerOptions {\n /** The theme in force at the mount (the app's `themeFrom(name, palette)`). */\n readonly theme: GroundTheme;\n /** The app's palette — what each kind's `theme()` reads its look from (`PaperPalette`, `MiniMatPalette`). */\n readonly palette: Palette;\n /**\n * The OBJECT widget types this desk draws, beyond the engine catalog's own: their kinds are registered\n * with the ground and join the builder's journal. The catalog's object types are always included.\n */\n readonly objects?: readonly WidgetType[];\n /** Render-only kinds to register beside the objects' (a program with no world half yet). */\n readonly kinds?: readonly KindProgram[];\n /** The ambient policy (design-015 §4.6): `idle` by default. */\n readonly ambient?: AmbientMode;\n /** How long after the last touch the wind blows, ms (20 000). */\n readonly ambientIdleMs?: number;\n /** The root's grid at the mount: the mat's config (its gobo, its rulers) and the lattice's fade-in. */\n readonly grid?: GridConfig;\n /** The objects' springs (springs.ts `SPRINGS`): the builder reads these numbers every frame, so a host that keeps the object may tune them live (the dev panel — D5a). */\n readonly springs?: ObjectSprings;\n /** The device pixel ratio the canvas is capped at (2). */\n readonly maxDpr?: number;\n /** Where the layer acquires its OWN device when the engine has none (`engine.compositorDevice` — then it draws with that): `navigator.gpu` unless a host hands another. */\n readonly gpu?: GPU;\n /** Called once with the layer's OWN device, before anything submits. */\n readonly onDevice?: (device: GPUDevice) => void;\n /** The layer's name in the reflector roster. */\n readonly name?: string;\n /** The app's text raster (`inkRaster({ faces: penFaces({ … }) })`, D2c): absent, no note is written live — the pinned rasters only. */\n readonly text?: TextRaster;\n /** The document a note's typing session commits into — the facade's `engine.docs` (D2c); absent, typing stays runtime-only. */\n readonly docs?: TypingDocs;\n /** A typing session ends after this long without input, ms (1000). */\n readonly idleMs?: number;\n /** The app's byte store (D3w, D-D12): a print's picture by the hash its `blob` prop names; absent, prints draw their paper alone. */\n readonly blobs?: BlobStore;\n /**\n * More SERVICES the host lends its kinds (K8a, kit/services.ts), each under its key — `service(KEY, value)` — beside the three it\n * lends by name (`text` → `TEXT_RASTER`, `blobs` → `BLOB_STORE`, and `PICTURE_DECODER`, the desk's own decode). A plugin kind\n * `use`s one by its key; a name lent twice (here, or by an object's DOM half) is a mount error.\n */\n readonly services?: readonly Lent[];\n /**\n * THE RASTER BUDGET (D6, design-015 §11.4), bytes: what every kind's raster caches may hold together — a board's ink (its strokes\n * are the truth; evicted, it replays when next drawn), a notebook page's CPU raster, the calendar's tiles. The least recently used\n * off-screen raster goes first. Default 192 MB.\n */\n readonly rasterBudget?: number;\n /**\n * THE FRAME'S RASTER BUDGET (K6b, design-016 §6), ms: what one frame spends making the rasters the kinds asked of the queue\n * (engine/rasters.ts — a note's ink at a new band, a board's strokes on coming on screen); the rest wait their turn, their old\n * raster standing. Default `RASTER_BUDGET_MS` (4).\n */\n readonly rasterMs?: number;\n /**\n * Keep the device's LIVE GPU MEMORY by label from the boot on (gpu-memory.ts, design-016 §4 — the profiler's memory table): a\n * map entry per texture or buffer MADE, nothing per frame. Off by default (D-K2.2): a resource made before the ledger cannot be\n * found after it (WebGPU has no enumeration), so it is the one instrument a host decides on at the mount.\n */\n readonly gpuLedger?: boolean;\n}\n\n/**\n * The raster budget a host does not size: 256 MB — D6's 192 (about ten whiteboards' ink at the law's density, the notebook's\n * eight page rasters and the calendar's tiles beside them) and 64 more since the PICTURES joined it (K6a, K-L4): their\n * thumbnail array (1.4 MB a picture, always kept) and the details a frame binds — each its print's chain from the finest level\n * it samples, so together at most about four texels a device pixel of the prints on screen (≈ 82 MB were prints to tile a\n * 2400 × 1600 screen), where before every picture's whole chain stood outside any budget.\n */\nexport const DEFAULT_RASTER_BUDGET = 256 * 1024 * 1024;\n\n/** The pinned still a parity scene states: the clocks, the plate and the gobo's opacity, the wind (0 = a still). */\nexport interface MatPin extends AmbientPin {\n readonly plate?: PlateName;\n readonly opacity?: number;\n readonly wind?: number;\n}\n\n/**\n * The layer's honest state: `pending` until the device and the pipelines are here; `ready`; `degraded` — the device reported an error\n * nobody captured (out of memory, a validation or an internal error): the desk still draws what it can, but a frame — or every frame,\n * an attachment left invalid — may be lost, and the state never reads `ready` again on its own (D7); `failed` — no desk (refused, or\n * the device lost). `message` names the cause.\n */\nexport interface DeskLayerStatus { readonly state: \"pending\" | \"ready\" | \"degraded\" | \"failed\"; readonly message?: string }\n\n/** The mount context — the fields of `@ice/dom`'s `LayerContext` this layer reads, mirrored structurally (dom never imports the desk). */\nexport interface DeskLayerContext {\n readonly host: { readonly container: HTMLElement };\n readonly world: World;\n readonly framePick?: FramePickSlot;\n /** The nav geometry seam (design-015 §9, D2b): the desk sets its word on its containers' drawn faces here, clears it at dispose. */\n readonly navGeometry?: NavGeometrySlot;\n /** The held pose seam (design-015 §8, D4b): the desk publishes where the object in hand is ON SCREEN as it drew it; core's held input maps every pointer through it. */\n readonly heldPose?: HeldPoseSlot;\n /** The tray pose seam (design-017 §4, K3): the desk publishes where the pegboard drawer is ON SCREEN as it drew it; core's tray input hit-tests through it. */\n readonly trayPose?: TrayPoseSlot;\n readonly transitions?: { register(adapter: PresentationTransitionAdapter): () => void };\n readonly catalog?: { widgetTypes(): readonly WidgetType[] };\n /** The interaction stack's marquee preview (`stack.marqueeBuffer`, out of the ECS): the vellum the marks draw (D4a). */\n readonly readMarquee?: () => MarqueeBuffer;\n /** The engine's spatial index (`stack.index`; design-015 §2.5, D6): the cull's broad phase. Absent, every member is tested. */\n readonly spatial?: SpatialSource;\n /** The engine's device (`engine.compositorDevice`, D7): the layer draws with it and never acquires its own — ONE device per engine. */\n readonly gpu?: { readonly adapter: GPUAdapter; readonly device: GPUDevice };\n /**\n * The engine's frame gate (K7a — the SLEEP, `@ice/core` frame-control.ts): the layer registers the desk's wake (when its reflector,\n * its kinds and its drivers are next due), wakes a sleeping loop for what arrives outside a step, and on a step a registered time\n * alone started (`settled`) asks only what is due. Absent (a headless host): every part is asked every step, as before.\n */\n readonly frame?: {\n wake(reason: string): void;\n wakeWhen(name: string, due: (now: number) => number): () => void;\n settled(): boolean;\n };\n}\n\n/** The selection menu's source (D4a): the marks' anchor as of the last frame, and a subscription that fires when it changes. */\nexport interface SelectionSource {\n anchor(): SelectionAnchor;\n subscribe(listener: () => void): () => void;\n}\n\n\n/**\n * The desk's MAIN-THREAD time (D6): every flush of the layer's reflector — the kinds' ticks, the pull, the build and the\n * render when a frame is due — counted and timed since the mount; `frames` are the flushes that drew, `frameMs` their share.\n * At rest a tick that draws nothing must cost next to nothing (design-015 §11.4: ≤ 0.1 ms of main thread per second).\n */\nexport interface DeskLayerPerf {\n readonly ticks: number;\n readonly ms: number;\n readonly frames: number;\n readonly frameMs: number;\n /** Each kind's `tick`, asked (K7a): at rest a kind is asked only when it is due — the registered-wake witness. */\n readonly kindTicks: Readonly<Record<string, number>>;\n /** The drivers asked (`idle`, then `follow`): none on a step a registered time alone started (K7a). */\n readonly driverAsks: number;\n}\n\n/**\n * The pegboard tray's door (design-017; K3) — the app's `a` and a rig's hand: the facts through core's tray ops (the one writer beside\n * the tray's input), the flux's pins and its state.\n */\n/** A specimen as the last frame drew it (K5a — the tray door's witness): its type, kind, tag and accessory, its rect and pegs on screen (CSS px), the scale its kind drew it at. */\nexport interface TraySpecimenSeen {\n readonly type: string;\n readonly kind: string;\n readonly label: string;\n readonly accessory: string;\n readonly screen: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number };\n readonly pegs: readonly (readonly [number, number])[];\n readonly zoom: number;\n /** K5b: its object as drawn on screen (the fit inside the hang). */\n readonly object: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number };\n}\n\n/** What the tray carried in the last frame drawn (K5b — the door's witness): its type and phase, the ghost it presents (absent: the copy), its object's rect on screen, its scale. */\nexport interface TrayCarriedSeen {\n readonly type: string;\n readonly phase: string;\n readonly ghost?: number;\n readonly screen: { readonly x0: number; readonly y0: number; readonly x1: number; readonly y1: number };\n readonly zoom: number;\n}\n\n/**\n * Where the tray's BAR is placed from (design-018 §5 — `<TrayBar>`, @ice/react, reads it structurally): the drawer as the last frame\n * DREW it — its outline's top-left and width, its slide, its HEADER (R4) — the view, the hand, the category model its chips show, and\n * the theme's night. A fact the bar follows is never a pixel it guesses: the pill rides `drawer.y` exactly, frame by frame, and the\n * chips lie in the header as drawn.\n */\nexport interface TrayAnchor {\n /** The drawer is out (the fact: its slide may still be on its way). */\n readonly open: boolean;\n /**\n * The drawer's outline as drawn this frame (CSS px; its bottom runs on under the view) and its slide — null before its first frame, or\n * while a pin hides it — and its HEADER (design-018 R4, `DRAWER.header`): the clear band under the edge's inside, from `y` for `h`,\n * where nothing of the board's content shows and the bar lays its chips.\n */\n readonly drawer: { readonly x: number; readonly y: number; readonly w: number; readonly p: number; readonly header: { readonly y: number; readonly h: number } } | null;\n readonly view: { readonly width: number; readonly height: number };\n /** The theme's night, 0 day … 1 the Moon (`MatLight.night`): the bar's label tape steps back by it as the specimens' tags do (design-018 R4). */\n readonly night: number;\n /** An object is IN HAND (not flying home): the selection menu has the view's foot — the bar steps aside. */\n readonly held: boolean;\n /** How many entries the drawer's frame hangs, every category (0: nothing to offer here — the bar steps aside). */\n readonly entries: number;\n /** The category the drawer shows (\"\" all) and the categories its frame hangs, in the lay's order (design-018 §6). */\n readonly category: string;\n readonly categories: readonly TrayCategory[];\n}\n\nexport interface DeskTrayDoor {\n /** Open the drawer: refused (false) while an object is in hand; gestures in flight cancel. */\n open(): boolean;\n close(): void;\n /** Open or close; returns whether it is open now. */\n toggle(): boolean;\n isOpen(): boolean;\n /** The board's scroll, CSS px past its top — set when given (any value: a rig's 10⁶ rows down), and returned. */\n scroll(px?: number): number;\n /** The facts and the flux as of now, the drawer as last drawn (the pose seam's answer) and what the pass last laid. */\n state(): TrayFluxState & { readonly frame: TrayScreenFrame | undefined; readonly laid: TrayLaid | null; readonly specimens: readonly TraySpecimenSeen[]; readonly tags: number; readonly slots: number; readonly carried: readonly TrayCarriedSeen[]; readonly presented: readonly number[] };\n /** Pin the drawer for a still — the slide, the band, or hidden; `null` unpins. */\n pin(pin: TrayPin | null): void;\n /**\n * design-018 §6 — the category the drawer shows (\"\" all): set when given (core's `setTrayCategory` — the lay lays only its\n * entries, the board starts at its top, and it falls back to all when the frame hangs none of it), and returned.\n */\n category(id?: string): string;\n /** design-018 §6 — the categories the drawer's frame hangs, in the lay's order: each its id, its label and its count (a host's chips). */\n categories(): readonly TrayCategory[];\n /** design-018 §5 — what the bar is placed from, as of the last frame drawn. */\n anchor(): TrayAnchor;\n /**\n * design-018 §5 — tell `listener` after each frame that moved what `anchor()` says: the drawer as drawn (its slide, frame by frame),\n * open or shut, the category or the categories, the hand, the entries, the view. Never at rest: no frame, no call.\n */\n subscribe(listener: () => void): () => void;\n}\n\nexport interface DeskLayerHandle {\n /** The drawing reflector — the facade registers it right after the plane transform, where the ground layer has always gone. */\n readonly reflector: ReflectorDef & { available(): boolean };\n dispose(): void;\n /** The canvas in the ground slot. */\n readonly canvas: HTMLCanvasElement;\n /** The device is acquired and `Ground.create` resolved. */\n available(): boolean;\n status(): DeskLayerStatus;\n /**\n * Told each time `status()` moves — the boot's end, an uncaptured error, the device lost after the boot (K9: a host says so on\n * its page; a desk that just ended leaves no canvas behind). Returns the unsubscribe; `dispose` drops every listener.\n */\n onStatus(listener: (status: DeskLayerStatus) => void): () => void;\n /** The device the layer draws with once it is here — the engine's when the context carries one (D7: one device per engine), else the layer's own. */\n device(): GPUDevice | undefined;\n /** The ground once made (a rig's door to a pass: `ground()?.pass(\"paper\")`). */\n ground(): Ground | null;\n /** The theme changed (and, with it, the palette): the looks are remade, the next frame re-renders. */\n setTheme(theme: GroundTheme, palette?: Palette): void;\n /** The mat's config over the current one (the rulers, the gobo): the root's grid. */\n configureMat(mat: Partial<MatConfig>): void;\n /** The lattice's fade-in window. */\n configureFadeIn(fadeIn: GridConfig[\"fadeIn\"]): void;\n /** A 512² rgba8 plate into slot `c` or `b` — the app's generated plates (never the study's). */\n setPlate(name: PlateName, bytes: Uint8Array<ArrayBuffer>): void;\n /** The 128² blue-noise tile; the desk's own is uploaded at the mount. */\n setNoise(bytes: Uint8Array<ArrayBuffer>): void;\n /** The rulers' and the mini mats' glyph atlas (RULER.md). */\n setGlyphs(bytes: Uint8Array<ArrayBuffer>, meta: GlyphAtlasMeta): void;\n /** Pin the mat for a still (a parity scene): the clocks, the plate, the gobo's opacity; `wind` > 0 unpins the clocks. `null` unpins everything. */\n pinMat(pin: MatPin | null): void;\n /**\n * Pin a kind's own ASSET on an object for a still (K8a — generic: the kind reads it as `ctx.asset`, in a shape the KIND defines —\n * the note's greeked writing is `{ greek }`, `PaperAsset`; the desk never knows it); `undefined` unpins. Until K8a this door was\n * `pinGreek`, a note's writing stated by its shape (`GreekPin`) — the one kind-shaped door on the handle.\n */\n pinAsset(entity: Entity, asset: unknown): void;\n /** Pin an object's spring targets for a still (a scene's `held` = `{ lift: 1 }`, never a `Grab`); `undefined` unpins. */\n pinFlux(entity: Entity, targets: Partial<Pick<ObjectFlux, \"lift\" | \"hover\">> | undefined): void;\n /** Every flux pin lifted. */\n clearFlux(): void;\n /** Live insides on or off (the oracle's `portals: false` — every face draws its far LOD alone). */\n setPortals(on: boolean): void;\n /**\n * A kind's LAW, live (D5a — the dev panel's door): every object of `kind` resolves under `law` from the next build and the\n * root's pass (its slots after it) draws with it; a kind with no live law ignores it. The host owns the law it hands in.\n */\n tuneLaw(kind: string, law: unknown): void;\n /** Pin the root's dressing (the oracle's `lodZoom`); `null` unpins. */\n pinLodZoom(zoom: number | null): void;\n /** Hold every spring and ghost where it is — a still of a moving frame (a rig's flight pin). */\n freeze(on: boolean): void;\n /** Hold the re-dressing ramp at its start (the prototype harness's `redressPinned`). */\n holdRedress(on: boolean): void;\n /** THE HAND PINNED for a still (D4b): the carry amount at `e`, the kind's open motion snapped; `null` unpins. The object itself is picked up through `ops.open`. */\n pinHold(pin: HoldPin | null): void;\n /** The object in hand as of the last frame (D4b) — a rig's witness: its carry, its frame on screen, whether settled or flying home. */\n hand(): HeldBuild | undefined;\n /** THE SEAM's answer for a container under the camera (the live one unless given) — a rig's witness (`DeskBuilder.navFace`). */\n navFace(entity: Entity, cam?: { readonly x: number; readonly y: number; readonly zoom: number }): NavFace | undefined;\n /** The last build's view of a container's inside (a rig's witness). */\n insideViewOf(entity: Entity): InsideView | undefined;\n /**\n * The camera of the flight on now at progress `p` (the prototype's `flightAt`: the endpoints c0 and c1 themselves,\n * `flightCamera` between) — what a rig's flight pin writes each tick; `undefined` when no flight drives.\n */\n flightCameraAt(p: number): { readonly x: number; readonly y: number; readonly zoom: number } | undefined;\n /** The ambient policy, live: the mode, the idle window. */\n setAmbient(mode: AmbientMode, idleMs?: number): void;\n ambient(): Ambient;\n /** The submit instrument on the layer's device — installed the first time it is asked for (K2, D-K2.1: never asked, the queue carries no wrapper), counting from then; undefined before the device. */\n submits(): SubmitInstrument | undefined;\n /** The layer's own main-thread time since the mount (D6, design-015 §11.4's idle gate): a rig diffs two readings. */\n perf(): DeskLayerPerf;\n /** The raster budget's ledger (D6): what the kinds' caches hold, by owner, against the cap; the evictions so far. */\n memory(): BudgetStats;\n /** The frame's raster queue (K6b): the asks waiting and held, the runs, the turns, their ms and the most a turn spent. */\n rasters(): RasterQueueStats;\n /** The device's live GPU memory by label (K2) — kept only under `gpuLedger: true`, from the boot; undefined otherwise or before the device. */\n gpuMemory(): MemoryLedger | undefined;\n /**\n * THE GPU PROFILER (K2, design-016 §4) on the layer's device — made on first ask, UNARMED (nothing installed) until `arm()`:\n * each drawn frame's GPU span and passes, its draws by kind, pipelines, bind groups, uploads, and the ledger's memory; the\n * layer's flush is its boundary. Undefined before the device.\n */\n profiler(): GpuProfiler | undefined;\n /** The kinds' persistent record stores' counters by kind (D6, design-015 §4.3) — the root passes'; a rig diffs two readings. */\n records(): Readonly<Record<string, RecordStoreStats>>;\n redraws(): number;\n stats(): DeskReflectorStats;\n wakes(): DeskWakes;\n /**\n * The desk's registered wake taken apart (K7a — \"why is the desk awake?\"): when each part is next due, on `performance.now()`'s\n * clock (`Infinity`: never on its own) — the reflector's, the drivers' (now while one follows), a kind woken, each kind's `due`,\n * the tray's layers' let-go (`tray`, K7a over K5a) and the raster queue's waiting asks (`rasters`, K6b: now while any wait).\n */\n due(now: number): { readonly at: number; readonly reflector: number; readonly drivers: number; readonly following: readonly string[]; readonly woken: readonly string[]; readonly kinds: Readonly<Record<string, number>>; readonly tray: number; readonly rasters: number };\n geometryOf(e: Entity): unknown | undefined;\n fluxOf(e: Entity): ObjectFlux | undefined;\n lastInputs(): GroundFrameInputs | null;\n /** The frame dirty and not yet drawn, or a kind still moving on its own (a print in the air — D3w): a rig's settle witness. */\n dirty(): boolean;\n readonly builder: DeskBuilder;\n /** A kind's own state on this desk by kind name (D3w: a print's body, a book's or a pad's pinned pose) — `undefined` when it keeps none. */\n local(name: string): KindLocal | undefined;\n /** The desk's ONE focused editor (D2c; the desk's since K8a — made at the mount whatever kinds are registered, leased by every kind that takes text). */\n editor(): DeskEditor;\n /**\n * A kind's DRIVER on this desk by object type (D-D7-A.3) — what the object declared in `defineObject` (the note's typing, the\n * board's pen, the notebook's hand, the print's carry, the calendar's writing + hand + DOM half), or undefined. A rig casts to\n * the kind's own driver type (`PaperDriver`, `CalendarDriver`); the desk itself never names one.\n */\n driver(type: string): KindDriver | undefined;\n /** Where the selection menu goes (D4a): the marks' box around the selection, published after each frame it moved. */\n readonly selection: SelectionSource;\n /** The pegboard tray's door (design-017; K3). */\n readonly tray: DeskTrayDoor;\n /**\n * The DOM-free reflector behind `reflector` — named `desk`, never `compose`: react's retired\n * `GroundLayerHandle.compose?` was the ground's COMPOSE handle (the composited profile read its\n * `sourceCanvas` seam off it, until D5b), and the desk was never one. The slot stays absent.\n */\n readonly desk: DeskReflector;\n}\n\nexport type DeskLayerFactory = (ctx: DeskLayerContext) => DeskLayerHandle;\n\n/** The object kinds behind widget types, deduplicated by name. */\nfunction kindsOf(types: readonly WidgetType[], extra: readonly KindProgram[]): { kinds: KindProgram[]; objectKinds: ObjectKind[] } {\n const byName = new Map<string, KindProgram>();\n const objectKinds: ObjectKind[] = [];\n for (const t of types) {\n const k = objectKindOf(t);\n if (k === undefined || byName.has(k.name)) continue;\n byName.set(k.name, k);\n objectKinds.push(k);\n }\n for (const k of extra) if (!byName.has(k.name)) byName.set(k.name, k);\n return { kinds: [...byName.values()], objectKinds };\n}\n\n/** The kinds told, once a page, that a local `tick` with no `due` keeps the desk awake (K9: nothing else would tell a plugin's author). */\nconst toldAwake = new Set<string>();\nfunction tellAwake(kind: string): void {\n if (toldAwake.has(kind)) return;\n toldAwake.add(kind);\n console.warn(`[ice] desk: the kind \"${kind}\" declares a local \\`tick\\` and no \\`due\\` — it is due every frame, so the desk never sleeps. Declare \\`KindLocal.due(now)\\`: now while it moves, a later time, or Infinity until a fact, an input or \\`KindHost.wake\\` moves it (design-016 K7a).`);\n}\n\nexport function deskLayer(opts: DeskLayerOptions): DeskLayerFactory {\n return (ctx) => {\n const { host, world } = ctx;\n const doc = host.container.ownerDocument;\n const view = doc.defaultView;\n // the OBJECT types: the catalog's, plus the app's — their kinds are the ground's registry\n const types = new Set<WidgetType>([...(ctx.catalog?.widgetTypes() ?? []).filter((t) => t.object !== undefined), ...(opts.objects ?? [])]);\n const { kinds, objectKinds } = kindsOf([...types], opts.kinds ?? []);\n // every kind's look from the palette BEFORE the mount touches the page (D7): an incomplete palette throws HERE, leaving no canvas,\n // no listener, no builder behind (the reflector remakes the looks it keeps; this pass only proves they can be made)\n looksOf(objectKinds, opts.palette, opts.theme);\n const canvas = doc.createElement(\"canvas\");\n canvas.style.position = \"absolute\";\n canvas.style.left = \"0\";\n canvas.style.top = \"0\";\n canvas.style.width = \"100%\";\n canvas.style.height = \"100%\";\n canvas.style.display = \"block\";\n canvas.style.pointerEvents = \"none\"; // the router owns picking; the canvas is never a DOM hit target\n host.container.prepend(canvas); // the container's first child: everything screen-space paints over it\n\n let ground: Ground | null = null;\n let ownDevice: GPUDevice | null = null;\n let drawDevice: GPUDevice | null = null; // the device the layer draws with: its own, or the engine's (D7)\n let instrument: SubmitInstrument | undefined;\n let asked = false; // the rigs' door asked for the submit instrument: it stays for the layer's life\n let holds = 0; // the profiler's arms hold it too\n let ledger: MemoryLedger | undefined;\n let profiler: GpuProfiler | undefined;\n let status: DeskLayerStatus = { state: \"pending\" };\n const statusHeard = new Set<(status: DeskLayerStatus) => void>();\n /** Every move of the status goes through here, and `onStatus`'s listeners hear it (K9). */\n const setStatus = (next: DeskLayerStatus): void => { status = next; for (const l of [...statusHeard]) l(next); };\n let disposed = false;\n let ended = false;\n let grid: GridConfig = opts.grid ?? DEFAULT_GRID;\n\n // reduced motion ⇒ still (design-015 §4.6), read from the OS at the mount and followed live\n const motionQuery = view?.matchMedia?.(\"(prefers-reduced-motion: reduce)\") ?? null;\n const ambient = createAmbient({\n ...(opts.ambient !== undefined ? { mode: opts.ambient } : {}),\n ...(opts.ambientIdleMs !== undefined ? { idleMs: opts.ambientIdleMs } : {}),\n reducedMotion: motionQuery?.matches === true,\n });\n const syncMotion = (): void => { ambient.configure({ reducedMotion: motionQuery?.matches === true }); compose.wake(\"ambient\"); };\n\n // each kind's own state on this desk (the note's writing): made once, over its root pass once the ground is here — and told what\n // the builder DRAWS (D6, `KindHost.drawn`: the builder is made after the locals, so the word is bound late)\n const locals = new Map<string, KindLocal>();\n const children = worldChildren(world); // …and its DATA children (D3w): the host reads them, never the kind\n // THE SERVICES (K8a, kit/services.ts — an open registry by key): the host's own — its text raster, the picture decoder, its byte\n // store, whatever the app lends (`opts.services`) — then what each object's DOM half LENDS (`ObjectHost.lend`: the calendar's\n // print raster, in the host's hand, D3t-c), in registration order, each handed what is lent so far; every kind's world half and\n // every DOM half `use`s any of them by key. A name lent twice throws here, at the mount, naming both lenders\n const services = createServices([\n ...(opts.text !== undefined ? [service(TEXT_RASTER, opts.text)] : []),\n service(PICTURE_DECODER, decodePicture),\n ...(opts.blobs !== undefined ? [service(BLOB_STORE, opts.blobs)] : []),\n ...(opts.services ?? []),\n ]);\n for (const t of types) {\n const lend = hostOf(t)?.lend;\n // …handed the desk's wake for a service whose work LANDS later (K7a — a sleeping loop steps and every kind is asked again)\n if (lend !== undefined) services.lend(lend({ use: services.use, wake: () => ctx.frame?.wake(\"desk:service\") }), `the object \"${t.type}\"`);\n }\n const drawn = (e: Entity): number | undefined => builder.rankOf(e); // `builder` is made just below; the word is only asked at a tick\n // THE REGISTERED WAKES (K7a): the kinds a wake named since their last tick\n const frame = ctx.frame;\n const woken = new Set<string>();\n const wakeKind = (name: string): void => { woken.add(name); frame?.wake(\"desk:kind\"); };\n // THE RASTER BUDGET (D6): one ledger for every kind's raster caches; trimmed once a tick by each kind's word on what is on screen\n const budget = createRasterBudget(opts.rasterBudget ?? DEFAULT_RASTER_BUDGET);\n // THE FRAME'S RASTER QUEUE (K6b): the kinds' re-rasters under one budget a frame, its turn once a tick before the build; an ask\n // whose object the last build did not draw is let go (the builder's word, bound late as `drawn` is)\n // …and the TRAY's (K5b): a specimen drawn with its kind's desk state (`tray.local` — a note's word) asks as a desk note does; its\n // ask is run, not let go, and its raster's landing wakes the frame that shows it (the builder holds no specimen to remake)\n const rasters = createRasterQueue({ ...(opts.rasterMs !== undefined ? { budgetMs: opts.rasterMs } : {}), shows: (e) => builder.shows(e) || compose.trayShows(e) });\n const remake = (e: Entity): void => { builder.remake(e); if (compose.trayShows(e)) compose.wake(\"ink\"); };\n for (const k of objectKinds) {\n const local = k.local?.({ pass: () => ground?.pass(k.name), use: services.use, children, drawn, budget, rasters, remake, wake: () => wakeKind(k.name) });\n if (local === undefined) continue;\n locals.set(k.name, local);\n if (local.tick !== undefined && local.due === undefined) tellAwake(k.name);\n }\n const keeps = (owner: string, key: string): boolean => locals.get(owner)?.keeps?.(key) ?? false;\n const readMarquee = ctx.readMarquee;\n const builder = createDeskBuilder(world, { objects: [...types], locals, ...(opts.springs !== undefined ? { springs: opts.springs } : {}), ...(readMarquee !== undefined ? { marquee: readMarquee } : {}), ...(ctx.spatial !== undefined ? { spatial: ctx.spatial } : {}) });\n // the object types by name (K8a): what an object provides and what acts its type declares are read off its PrefabId\n const typeNamed = new Map([...types].map((t) => [t.type, t] as const));\n // the selection's KIND ACTS (K8a): what every selected object's type declares (`defineObject({ menu })`), read off its PrefabId\n const menuOf = (e: Entity): readonly MenuActionDef[] => { const id = world.isAlive(e) ? world.get(e, PrefabId)?.id : undefined; return typeof id === \"string\" ? (typeNamed.get(id)?.menu ?? []) : []; };\n // the selection menu's source: the anchor published whenever a frame moved it — the marks' word, and the hand's (D4b: with an\n // object in hand the menu travels to the foot and becomes the held bar; it hides while the object flies home). D3t-a: the kind's\n // tools as the bar's slots (their swatches from the kind's look) and the mode in hand — core's `HeldTool`, the one slot marked\n const anchorOf = (): SelectionAnchor => {\n const a = builder.anchor();\n // the pegboard tray is out (design-017 §4): the desk under it is inert, so the menu has nothing to act on — it steps away\n if (trayOpen(world)) return { ...a, box: null, count: 0 };\n const h = builder.hand();\n if (h === undefined) return withKindActs(a, selectedEntities(world), menuOf);\n const kind = builder.kindOf(h.entity);\n const swatches = kind?.open?.swatches?.(compose.look(kind.name)) ?? {};\n const active = world.isAlive(h.entity) ? (world.get(h.entity, HeldTool)?.id ?? \"\") : \"\";\n return { ...a, held: { tools: heldSlots(kind?.open?.tools ?? [], swatches), active, landing: h.landing, settled: h.settled } };\n };\n const listeners = new Set<() => void>();\n let published = \"\";\n const publish = (): void => {\n const a = anchorOf();\n const key = JSON.stringify(a);\n if (key === published) return;\n published = key;\n for (const l of [...listeners]) l();\n };\n // the tray bar's source (design-018 §5): the drawer as the last frame drew it, and what its chips show — published after each frame\n // that moved it, as the menu's anchor is (the slide is drawn frame by frame, so the bar rides it exactly; at rest nothing is drawn)\n const trayAnchorOf = (): TrayAnchor => {\n const f = compose.tray.frame();\n const vp = world.getResource(Viewport);\n const h = builder.hand();\n return {\n open: trayOpen(world),\n drawer: f === undefined ? null : { x: f.x, y: f.y, w: f.w, p: f.p, header: { y: f.y + DRAWER.arris, h: DRAWER.header } },\n view: { width: vp?.w ?? 0, height: vp?.h ?? 0 },\n night: compose.theme().matLight.night,\n held: h !== undefined && !h.landing,\n entries: trayEntryCount(world),\n category: trayCategory(world),\n categories: trayCategories(world),\n };\n };\n const trayListeners = new Set<() => void>();\n let trayPublished = \"\";\n const publishTray = (): void => {\n const key = JSON.stringify(trayAnchorOf());\n if (key === trayPublished) return;\n trayPublished = key;\n for (const l of [...trayListeners]) l();\n };\n const compose = createDeskReflector({\n onFrame: () => { publish(); publishTray(); },\n world, builder, kinds: objectKinds, ambient,\n ground: () => ground,\n attach: { resize: (w, h) => { if (canvas.width !== w || canvas.height !== h) { canvas.width = w; canvas.height = h; } } },\n theme: opts.theme, palette: opts.palette, grid, locals,\n ...(opts.maxDpr !== undefined ? { maxDpr: opts.maxDpr } : {}),\n ...(opts.name !== undefined ? { name: opts.name } : {}),\n // a frame asked for outside the flush — a pin, an ink landing, the ground arriving, a theme: a sleeping loop wakes (K7a)\n onWake: (reason) => frame?.wake(`desk:${reason}`),\n });\n motionQuery?.addEventListener(\"change\", syncMotion); // armed once `compose` exists (D7: never a listener over a binding in its TDZ)\n\n // THE KINDS' DRIVERS (D7 #5, D-D7-A.3): each object declared its own in `defineObject` — a pen, a carry, a leaf, the calendar's\n // writing and hand, the note's typing — and the host makes them here from what it lends, never naming a kind; a third-party\n // openable kind with held tools gets its driver the same way. Ticked before the kinds' clocks; idle ones skipped (D7 #14)\n const docs: TypingDocs = opts.docs ?? NO_DOCS;\n const drivers = new Map<string, KindDriver>();\n // an INSERT GHOST (core's tray adoption, K5b) is no kind's to drive: its drag is core's until it lands (a print's carry, a pad's\n // hand, a note's typing never take it) — the twin it becomes is theirs\n const ofKind = (e: Entity, name: string): boolean => builder.kindOf(e)?.name === name && !world.has(e, InsertGhost);\n const kindNamed = (name: string): ((e: Entity) => boolean) | undefined => (objectKinds.some((k) => k.name === name) ? (e) => ofKind(e, name) : undefined);\n // …and by what an object PROVIDES (K8a): its type's keys, read off its `PrefabId` — undefined when no type on this desk provides it;\n // an insert ghost provides nothing to a driver (K5b's law above: the calendar never pins the ghost, only the twin it becomes)\n const providing = (key: string): ((e: Entity) => boolean) | undefined =>\n [...types].some((t) => t.provides.includes(key)) ? (e) => { const id = world.isAlive(e) && !world.has(e, InsertGhost) ? world.get(e, PrefabId)?.id : undefined; return typeof id === \"string\" && typeNamed.get(id)?.provides.includes(key) === true; } : undefined;\n for (const t of types) {\n const make = driversOf(t);\n const k = objectKindOf(t);\n if (make === undefined || k === undefined) continue;\n const d = make({\n world, docs, local: locals.get(k.name), look: () => compose.look(k.name), isKind: (e) => ofKind(e, k.name), kind: kindNamed, provides: providing,\n geometryOf: (e) => builder.geometryOf(e), heldToWorld: (e, x, y) => builder.heldToWorld(e, x, y), hand: () => builder.hand(),\n refused: (e) => builder.meetTape(e), wake: () => compose.wake(\"ink\"),\n });\n if (d !== undefined) drivers.set(t.type, d);\n }\n const driver = (type: string): KindDriver | undefined => drivers.get(type);\n // THE ONE FOCUSED EDITOR (D2c; the DESK's since K8a — host/editor.ts): made here whatever kinds are registered, and LEASED by\n // every kind that takes text; a tap is routed to the text parts the objects declare, in registration order\n const textParts: TextPart[] = [];\n const editor = createDeskEditor({ container: host.container, world, parts: () => textParts, wake: () => compose.wake(\"ink\"), ...(opts.idleMs !== undefined ? { idleMs: opts.idleMs } : {}) });\n // THE OBJECTS' DOM HALVES (K4b, `defineObject({ host })`), in screen space: each object declared its own and the host builds them\n // from what it lends, never naming a kind — their TEXT PARTS first (K8a: the note's body, the calendar's day line), then every\n // half that mounts (the calendar's days and pen lease the editor, D3t-c)\n const domHost = (t: WidgetType): ObjectDomHost => {\n const k = objectKindOf(t);\n return {\n container: host.container, world, docs, use: services.use, editor, object: t, driver: drivers.get(t.type), look: () => (k === undefined ? undefined : compose.look(k.name)),\n geometryOf: (e) => builder.geometryOf(e), hand: () => builder.hand(), heldToWorld: (e, x, y) => builder.heldToWorld(e, x, y),\n wake: () => compose.wake(\"ink\"), ...(opts.idleMs !== undefined ? { idleMs: opts.idleMs } : {}),\n };\n };\n for (const t of types) textParts.push(...(hostOf(t)?.text?.(domHost(t)) ?? []));\n for (const t of types) hostOf(t)?.mount?.(domHost(t));\n // the drawing reflector, wrapped: the kinds' flux ticked before it on one clock, the editor placed after it\n let moving = false;\n /** A driver had something to follow at the last ask (K7a): the desk is due every frame until each is idle again. */\n let following = false;\n const kindTicks: Record<string, number> = {};\n const perf = { ticks: 0, ms: 0, frames: 0, frameMs: 0, driverAsks: 0 };\n // the kinds whose own state moved (D6): their records are remade this build; the rest stand — told every tick, an empty set\n // included (no word at all would make the builder ask every object whether a kind lifts it). ONE set, cleared a tick (K7a)\n const restless = new Set<string>();\n const inner = compose.reflector;\n const reflector: ReflectorDef & { available(): boolean } = {\n ...inner,\n flush(w) {\n const now = performance.now();\n const drawn = compose.redraws();\n // THE REGISTERED WAKES (K7a): a step the loop took for a registered time alone (`settled` — nothing woke it, the tail long\n // run) asks no driver (they follow input, and none came) and ticks only the kinds due now or woken; any other step asks\n // every part, as before. A desk at rest takes no step at all — the loop sleeps (dom/loop.ts).\n const timeAlone = frame?.settled() === true && woken.size === 0 && !compose.dirty();\n if (!timeAlone) {\n following = false;\n for (const d of drivers.values()) {\n perf.driverAsks += 1;\n if (d.idle?.() !== true) { following = true; d.follow(now); }\n }\n }\n let want = false;\n restless.clear();\n for (const [name, local] of locals) {\n if (local.tick === undefined) continue;\n if (timeAlone && !woken.has(name) && (local.due?.(now) ?? now) > now) continue;\n kindTicks[name] = (kindTicks[name] ?? 0) + 1;\n if (local.tick(now)) { want = true; restless.add(name); }\n }\n woken.clear();\n ground?.idleTray(); // the tray's own slots let their layers go once undrawn a while, as the kinds' ticks do the root's (D-K6a.3, K5a)\n // the raster queue's turn (K6b): after the ticks (a kind's tick may ask), before the build — a raster laid now has its record\n // remade in this build (`remake`), so no frame draws a record whose ink moved under it\n if (rasters.size > 0) rasters.drain();\n if (want) compose.wake(\"ink\");\n compose.restless(restless);\n moving = want; // D3w: a kind's own motion (a print in the air) keeps the desk from reading quiet between its frames\n inner.flush(w);\n editor.follow();\n budget.trim(keeps); // over the cap: the least recently used off-screen rasters go (O(1) when under it)\n const drew = compose.redraws() !== drawn;\n // a frame drawn: what is drawn moved, and a raster no longer drawn may be evicted — the asks held for room try again (K6b)\n if (drew) rasters.wake();\n // …and so do rasters still waiting their turn (K6b; those held for room do not: nothing moves until room is made)\n if (rasters.size > 0) moving = true;\n // the desk's own main-thread time (D6): this flush, and whether it drew\n const spent = performance.now() - now;\n perf.ticks += 1; perf.ms += spent;\n if (drew) { perf.frames += 1; perf.frameMs += spent; }\n profiler?.flushed(spent); // the GPU profiler's frame boundary (K2): returns at once unless armed\n },\n };\n\n // THE DESK'S REGISTERED WAKE (K7a, `@ice/core` frame-control.ts): after every step the loop asks when the desk is next due — now\n // while a driver follows or a kind was woken, else the soonest of the reflector's (a frame owed, the wind still moving) and each\n // kind's own `due` (a motion now, a blink or a layer's release later, nothing at all); a face landing wakes it\n const deskDue = (now: number): number => {\n let t = following || woken.size > 0 ? now : compose.due(now);\n // each kind asked AFTER the step (its draw may have landed something); a kind that never said when is due every frame\n for (const local of locals.values()) {\n if (local.tick === undefined) continue;\n const d = local.due?.(now) ?? now;\n if (d < t) t = d;\n }\n // the tray's layers (K5a): their release is a TIME — the last tray draw + LAYER_IDLE_MS — so a desk asleep since the drawer\n // shut still gives them back (the tick that polled them no longer comes); the frame's raster queue: asks waiting their turn are\n // due NOW (K6b — it drains over a zoom's next frames), those held for room are not (a drawn frame or a release wakes them)\n const tray = ground?.trayIdleAt() ?? Number.POSITIVE_INFINITY;\n if (tray < t) t = tray;\n if (rasters.size > 0) t = now;\n return t;\n };\n const stopWake = frame?.wakeWhen(\"desk\", deskDue);\n const stopText = opts.text?.onVersion?.(() => frame?.wake(\"desk:text\"));\n\n // the pick source (design-015 §4.5): the kinds' mirrors on the builder's geometry — set now, `undefined` for what it cannot see yet (B9)\n const pick = createPickSource(builder, { moving: () => moving });\n const framePick = ctx.framePick;\n if (framePick !== undefined) framePick.current = pick;\n // the nav geometry seam (design-015 §9): the desk's word on its containers' faces AS DRAWN — core's nav, the zoom-through and the\n // drop-into read it; the cut is exact only on the face as drawn\n const navSource = { face: (container: Entity, cam: { readonly x: number; readonly y: number; readonly zoom: number }) => builder.navFace(container, cam) };\n const navGeometry = ctx.navGeometry;\n if (navGeometry !== undefined) navGeometry.current = navSource;\n // the held pose seam (design-015 §8, D4b): where the object in hand is on screen, as the last frame drew it — the frame the\n // builder made; nothing while it flies home (the desk is the desk's again)\n const poseSource: HeldPoseSource = {\n frame: (e) => { const h = builder.hand(); return h !== undefined && h.entity === e && !h.landing ? h.frame : undefined; },\n // …and which of the kind's parts is under a point of it (D3t-a): its `hit` on the geometry drawn in hand\n part: (e, x, y) => builder.heldPart(e, x, y),\n };\n const heldPose = ctx.heldPose;\n if (heldPose !== undefined) heldPose.current = poseSource;\n // the tray pose seam (design-017 §4): the drawer as the last frame drew it — its rect mid-slide, the layout's scroll range\n const traySource: TrayPoseSource = { frame: () => compose.tray.frame() };\n const trayPose = ctx.trayPose;\n if (trayPose !== undefined) trayPose.current = traySource;\n // the ground plane's transition adapter: prepared the moment it is asked — the desk's second slot is built from the world (D2b)\n const detachTransition = ctx.transitions?.register({ id: \"@ice/desk\", plane: \"ground\", prepare: () => null }) ?? null;\n\n const fail = (what: string, e: unknown): void => {\n console.error(`[ice] desk: ${what}`, e);\n setStatus({ state: \"failed\", message: `${what}: ${e instanceof Error ? e.message : String(e)}` });\n };\n /** The layer is over (a lost device): nothing renders again, the canvas leaves, `available()` is false. */\n const endLayer = (): void => {\n if (ended) return;\n ended = true;\n const g = ground;\n ground = null;\n g?.dispose();\n canvas.remove();\n };\n const gpu = opts.gpu ?? (typeof navigator !== \"undefined\" ? navigator.gpu : undefined);\n const events: Pick<GpuOptions, \"onLost\" | \"onError\"> = {\n onLost: (info) => { if (disposed || ended) return; fail(\"the device was lost\", new Error(`${info.reason}: ${info.message}`)); endLayer(); },\n onError: (error) => {\n console.error(\"[ice] desk: uncaptured GPU error\", error.message);\n // never silent: a lost submit leaves the desk black while nothing else says so (D7) — a failed layer stays failed\n if (status.state !== \"failed\") setStatus({ state: \"degraded\", message: `an uncaptured GPU error — ${error.constructor?.name ?? \"GPUError\"}: ${error.message}` });\n },\n };\n // ONE device per engine (D7): the ENGINE's device when it has one — drawn with, never destroyed here (the app owns it);\n // otherwise the layer's own\n const shared = ctx.gpu;\n const device: Promise<Gpu> = shared !== undefined\n ? Promise.resolve(adopt(shared.adapter, shared.device, events))\n : gpu === undefined\n ? Promise.reject(new Error(\"WebGPU is unavailable here (no navigator.gpu)\"))\n : acquire({ gpu, label: \"desk\", ...events });\n const boot: Promise<void> = device.then(async (g) => {\n if (disposed) { if (shared === undefined) g.device.destroy(); throw new Error(\"disposed before the device arrived\"); }\n drawDevice = g.device;\n if (shared === undefined) ownDevice = g.device;\n if (opts.gpuLedger === true) ledger = instrumentMemory(g.device); // before the ground makes anything\n opts.onDevice?.(g.device);\n const made = await Ground.create({ device: g.device, surface: surface(g.device, canvas), mat: matShaders(shaderText(MAT_SHADER_FILES)), kinds, marks: marksShaders(shaderText(MARKS_SHADER_FILES)), hold: holdShaders(shaderText(HOLD_SHADER_FILES)), tray: trayShaders(shaderText) });\n if (disposed || ended) { made.dispose(); return; }\n made.mat.setNoise(blueNoise()); // the desk's own noise; the plates are the app's (`setPlate`)\n made.grid = grid;\n ground = made;\n if (status.state === \"pending\") setStatus({ state: \"ready\" }); // an error while it booted keeps its word\n compose.ready();\n });\n boot.catch((e: unknown) => { if (!disposed) fail(\"no desk — the adapter, the device or the pipelines were refused\", e); });\n\n const setGrid = (next: GridConfig): void => { grid = next; if (ground !== null) ground.grid = next; compose.configureGrid(next); };\n\n return {\n reflector,\n canvas,\n available: () => ground !== null && (status.state === \"ready\" || status.state === \"degraded\"),\n status: () => status,\n onStatus(listener) { statusHeard.add(listener); return () => { statusHeard.delete(listener); }; },\n device: () => drawDevice ?? undefined,\n ground: () => ground,\n setTheme: (t, p) => compose.setTheme(t, p),\n configureMat: (mat) => setGrid({ ...grid, mat: { ...grid.mat, ...mat, ...(mat.gobo !== undefined ? { gobo: { ...grid.mat.gobo, ...mat.gobo } } : {}), ...(mat.ruler !== undefined ? { ruler: { ...grid.mat.ruler, ...mat.ruler } } : {}) } }),\n configureFadeIn: (fadeIn) => setGrid({ ...grid, fadeIn }),\n setPlate(name, bytes) { ground?.mat.setPlate(name, bytes); compose.wake(\"pin\"); },\n setNoise(bytes) { ground?.mat.setNoise(bytes); compose.wake(\"pin\"); },\n setGlyphs(bytes, meta) { ground?.mat.setGlyphs(bytes, meta); compose.wake(\"pin\"); },\n pinMat(pin) {\n if (pin === null) { ambient.pin(null); compose.wake(\"pin\"); return; }\n const still = (pin.wind ?? 0) <= 0;\n ambient.pin(still ? { ...(pin.time !== undefined ? { time: pin.time } : {}), ...(pin.goboTime !== undefined ? { goboTime: pin.goboTime } : {}), ...(pin.noise !== undefined ? { noise: pin.noise } : {}) } : null);\n if (pin.plate !== undefined || pin.opacity !== undefined) {\n setGrid({ ...grid, mat: { ...grid.mat, gobo: { ...grid.mat.gobo, ...(pin.plate !== undefined ? { plate: pin.plate } : {}), ...(pin.opacity !== undefined ? { opacity: pin.opacity } : {}) } } });\n }\n compose.wake(\"pin\");\n },\n pinAsset(entity, asset) {\n // the kind's own asset rides the builder (`ctx.asset`) — the note's greeked lines; its committed raster lives in its writing since D2c\n builder.pin(entity, asset);\n compose.wake(\"pin\");\n },\n pinFlux(entity, targets) { builder.pinFlux(entity, targets); compose.wake(\"pin\"); },\n clearFlux() { builder.clearFlux(); compose.wake(\"pin\"); },\n pinHold: (pin) => compose.pinBuild({ hold: pin }),\n hand: () => builder.hand(),\n setPortals: (on) => compose.pinBuild({ portals: on }),\n tuneLaw(kind, law) {\n for (const t of types) { const k = objectKindOf(t); if (k?.name === kind) k.tune?.(law); }\n ground?.root.kinds.get(kind)?.pass.setLaw?.(law);\n builder.invalidate(); // every record was made under the old law (D6)\n compose.wake(\"pin\");\n },\n pinLodZoom: (zoom) => compose.pinBuild({ lodZoom: zoom }),\n freeze: (on) => compose.pinBuild({ freeze: on }),\n holdRedress: (on) => compose.pinBuild({ holdRedress: on }),\n navFace(entity, cam) {\n const c = cam ?? world.getResource(Camera) ?? { x: 0, y: 0, zoom: 1 };\n return builder.navFace(entity, { x: c.x, y: c.y, zoom: c.zoom });\n },\n insideViewOf: (e) => builder.insideViewOf(e),\n flightCameraAt(p) {\n const t = world.getResource(NavTransition);\n const vp = world.getResource(Viewport);\n if (t === undefined || !t.active || vp === undefined) return undefined;\n const c0 = { x: t.c0x, y: t.c0y, zoom: t.c0z };\n const c1 = { x: t.c1x, y: t.c1y, zoom: t.c1z };\n return p <= 0 ? c0 : p >= 1 ? c1 : flightCamera(c0, c1, p, vp.w, vp.h);\n },\n setAmbient(mode, idleMs) { ambient.configure({ mode, ...(idleMs !== undefined ? { idleMs } : {}) }); compose.wake(\"ambient\"); },\n ambient: () => ambient,\n submits() {\n // armed by the first ask (D-K2.1): a window's count needs it armed before the window opens, which asking does\n if (drawDevice !== null && !disposed) { asked = true; instrument ??= instrumentSubmits(drawDevice); }\n return instrument;\n },\n profiler() {\n if (profiler === undefined && drawDevice !== null && !disposed) {\n const d = drawDevice;\n profiler = createGpuProfiler({\n device: d,\n // held while the profiler is armed; off again at its release unless the rigs' door asked for it\n submits: {\n hold: () => { holds += 1; instrument ??= instrumentSubmits(d); return instrument; },\n release: () => { holds -= 1; if (holds === 0 && !asked) { instrument?.detach(); instrument = undefined; } },\n },\n ledger: () => ledger,\n });\n }\n return profiler;\n },\n perf: () => ({ ...perf, kindTicks: { ...kindTicks } }),\n memory: () => budget.stats(),\n rasters: () => rasters.stats(),\n gpuMemory: () => ledger,\n records: () => {\n const out: Record<string, RecordStoreStats> = {};\n for (const k of objectKinds) { const s = ground?.pass(k.name)?.records?.(); if (s !== undefined) out[k.name] = s; }\n return out;\n },\n redraws: () => compose.redraws(),\n stats: () => compose.stats(),\n wakes: () => compose.wakes(),\n due: (now) => {\n const kinds: Record<string, number> = {};\n for (const [name, local] of locals) if (local.tick !== undefined) kinds[name] = local.due?.(now) ?? now;\n // the drivers with something to follow NOW (their `idle` asked — a rig's question, never the loop's)\n const busy: string[] = [];\n for (const [type, d] of drivers) if (d.idle?.() !== true) busy.push(type);\n return { at: deskDue(now), reflector: compose.due(now), drivers: following ? now : Number.POSITIVE_INFINITY, following: busy, woken: [...woken], kinds, tray: ground?.trayIdleAt() ?? Number.POSITIVE_INFINITY, rasters: rasters.size > 0 ? now : Number.POSITIVE_INFINITY };\n },\n geometryOf: (e) => builder.geometryOf(e),\n fluxOf: (e) => builder.fluxOf(e),\n lastInputs: () => compose.lastInputs(),\n // a kind still moving on its own is one DUE now (K7a): the last tick's want goes stale once the loop sleeps on its drawn frame\n dirty: () => {\n if (compose.dirty() || woken.size > 0) return true;\n const now = performance.now();\n for (const local of locals.values()) if (local.tick !== undefined && (local.due?.(now) ?? now) <= now) return true;\n return false;\n },\n builder,\n local: (name) => locals.get(name),\n editor: () => editor,\n driver,\n selection: {\n anchor: () => anchorOf(),\n subscribe(listener) { listeners.add(listener); return () => { listeners.delete(listener); }; },\n },\n desk: compose,\n tray: {\n open: () => openTray(world),\n close: () => closeTray(world),\n toggle: () => toggleTray(world),\n isOpen: () => trayOpen(world),\n scroll(px) {\n if (px !== undefined) scrollTray(world, px);\n const e = trayEntity(world);\n return e === undefined ? 0 : (world.get(e, Tray)?.scroll ?? 0);\n },\n state: () => ({\n ...compose.tray.state(), frame: compose.tray.frame(), laid: ground?.tray?.laid ?? null,\n // K5a: the specimens as the last frame drew them — each on screen, its pegs on screen, the scale its kind drew it at — its tags, its slots\n specimens: compose.traySpecimens().map((f) => ({ type: f.type, kind: f.kind, label: f.label, accessory: f.accessory, screen: f.screen, pegs: f.pegs, zoom: f.view.zoom, object: f.object })),\n tags: ground?.marks?.tagsLaid.length ?? 0,\n slots: ground?.traySlots?.size ?? 0,\n // K5b: what the tray carried last frame — the copy, a ghost growing or flying home — and the ghosts it drew for the desk\n carried: compose.trayCarried().map((f) => ({ type: f.type, phase: f.phase, ...(f.ghost !== undefined ? { ghost: f.ghost } : {}), screen: f.screen, zoom: f.view.zoom })),\n presented: [...compose.carry.presented()],\n }),\n pin(pin) { compose.tray.pin(pin); compose.wake(\"pin\"); },\n category(id) {\n if (id !== undefined) setTrayCategory(world, id);\n return trayCategory(world);\n },\n categories: () => trayCategories(world),\n anchor: () => trayAnchorOf(),\n subscribe(listener) { trayListeners.add(listener); return () => { trayListeners.delete(listener); }; },\n },\n dispose() {\n disposed = true;\n stopWake?.();\n stopText?.();\n listeners.clear();\n trayListeners.clear();\n statusHeard.clear();\n for (const d of drivers.values()) d.dispose?.(); // the calendar's disposes its DOM half\n editor.dispose();\n for (const local of locals.values()) local.dispose?.();\n motionQuery?.removeEventListener(\"change\", syncMotion);\n if (framePick !== undefined && framePick.current === pick) framePick.current = null;\n if (navGeometry !== undefined && navGeometry.current === navSource) navGeometry.current = null;\n if (heldPose !== undefined && heldPose.current === poseSource) heldPose.current = null;\n if (trayPose !== undefined && trayPose.current === traySource) trayPose.current = null;\n detachTransition?.();\n compose.dispose();\n builder.dispose();\n canvas.remove();\n ground?.dispose();\n ground = null;\n profiler?.dispose();\n instrument?.detach(); // the engine's device goes on without the layer's wrappers\n instrument = undefined;\n ledger?.detach();\n if (ownDevice !== null) { ownDevice.destroy(); ownDevice = null; } // the layer's own device: destroyed last\n },\n };\n };\n}\n","// The INK — the handwriting rasterised in the browser (design-015 §6.1; STICKY.md §3): the prototype's\n// lab/ink.ts behind the TEXT RASTER seam (paper/raster.ts). The layout is the engine's (paper/text.ts,\n// pure); this draws its glyph boxes with a Canvas 2D in a real hand — the faces the APP hands in by\n// URL (Caveat 500/600 and Kalam 400, OFL, shipped by apps/desk; or a platform face by family alone) —\n// at the band's texels per note unit, and hands back the canvas's alpha as r8 coverage for the paper\n// pass's ink pages. Each glyph in its own frame: turned by its tilt, scaled by its size, at its\n// pressure; under it a faint stroke widens the letter by the pen's bleed. The face's metrics for the\n// layout come from the same kind of context, measured at 100 px and given in em.\n//\n// A face is loaded ONCE (FontFace → document.fonts), lazily on its first use; until it lands its\n// metrics are `undefined` (a sheet waits, blank — never a stand-in hand re-written a moment later)\n// and `version()` bumps when it does, so every layout keyed by it is laid again. One OffscreenCanvas\n// is reused for every raster (`willReadFrequently`: the CPU path the readback wants).\n\nimport type { InkBitmap, TextRaster } from \"../kit/raster\";\nimport { type FaceSpec, type HandLayout, type HandMetrics, PEN_FACES } from \"../kit/text\";\n\n// the faces are the HAND's (kit/text.ts since K4a — the desk calendar's print sets them too); the note's raster keeps its door\nexport { type FaceSpec, PEN_FACES } from \"../kit/text\";\n\n/** The desk's faces with the app's files: `{ caveat: url, \"caveat-bold\": url, kalam: url }` → face specs. */\nexport function penFaces(urls: Readonly<Record<string, string>>): Readonly<Record<string, FaceSpec>> {\n return Object.fromEntries(Object.entries(PEN_FACES).map(([name, f]) => [name, urls[name] !== undefined ? { ...f, url: urls[name] } : f]));\n}\n\nexport interface InkRasterOptions {\n /** The faces by name — `penFaces({ … })` for the desk's own. */\n readonly faces: Readonly<Record<string, FaceSpec>>;\n /** The document whose font set the faces join (the window's). */\n readonly document?: Document;\n}\n\nexport interface InkRaster extends TextRaster {\n /** Load a face (once): resolves whether the browser can draw it. `metrics()` asks for this itself. */\n load(face: string): Promise<boolean>;\n /** Is the face loaded (and drawable)? */\n ready(face: string): boolean;\n}\n\nconst fontOf = (f: Omit<FaceSpec, \"url\">, px: number): string => `${f.weight} ${px}px \"${f.family}\"`;\n\nexport function inkRaster(opts: InkRasterOptions): InkRaster {\n const doc = opts.document ?? (typeof document !== \"undefined\" ? document : undefined);\n const loads = new Map<string, Promise<boolean>>();\n const ok = new Set<string>();\n const metricsCache = new Map<string, HandMetrics>();\n let version = 0;\n const versionListeners = new Set<() => void>();\n let canvas: OffscreenCanvas | null = null;\n let ctx: OffscreenCanvasRenderingContext2D | null = null;\n const context = (w: number, h: number): OffscreenCanvasRenderingContext2D => {\n if (canvas === null) {\n canvas = new OffscreenCanvas(Math.max(1, w), Math.max(1, h));\n ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n } else {\n canvas.width = Math.max(1, w); // a resize resets the context's state, as a fresh canvas would\n canvas.height = Math.max(1, h);\n }\n if (ctx === null) throw new Error(\"desk/ink: no 2d context on an OffscreenCanvas\");\n return ctx;\n };\n\n const load = (face: string): Promise<boolean> => {\n let p = loads.get(face);\n if (p !== undefined) return p;\n const f = opts.faces[face];\n if (f === undefined || doc === undefined) p = Promise.resolve(false);\n else if (f.url === undefined) p = Promise.resolve(doc.fonts.check(fontOf(f, 24)));\n else {\n const ff = new FontFace(f.family, `url(${f.url})`, { weight: String(f.weight) });\n // `FontFaceSet` is setlike: its `add` lives in lib DOM.Iterable, which the desk's tsconfig leaves out\n const set = doc.fonts as unknown as { add(face: FontFace): void };\n p = ff.load().then((loaded) => { set.add(loaded); return true; }).catch(() => false);\n }\n p = p.then((drawable) => {\n if (drawable) ok.add(face);\n metricsCache.delete(face);\n version += 1; // every layout keyed by the face is laid again — with the face, or honestly without it\n for (const fn of [...versionListeners]) fn();\n return drawable;\n });\n loads.set(face, p);\n return p;\n };\n\n const measure = (face: string): HandMetrics | undefined => {\n const hit = metricsCache.get(face);\n if (hit !== undefined) return hit;\n const f = opts.faces[face];\n if (f === undefined) return undefined;\n // the measuring context is its own: the raster's is resized under it\n const c = new OffscreenCanvas(8, 8).getContext(\"2d\");\n if (c === null) throw new Error(\"desk/ink: no 2d context to measure with\");\n c.font = fontOf(f, 100);\n c.textBaseline = \"alphabetic\";\n const m0 = c.measureText(\"x\");\n const advances = new Map<string, number>();\n const kerns = new Map<string, number>();\n const advance = (ch: string): number => {\n let a = advances.get(ch);\n if (a === undefined) { c.font = fontOf(f, 100); a = c.measureText(ch).width / 100; advances.set(ch, a); }\n return a;\n };\n const metrics: HandMetrics = {\n ascent: m0.fontBoundingBoxAscent / 100,\n descent: m0.fontBoundingBoxDescent / 100,\n advance,\n kern: (a, b) => {\n const key = a + b;\n let k = kerns.get(key);\n if (k === undefined) { c.font = fontOf(f, 100); k = c.measureText(key).width / 100 - advance(a) - advance(b); kerns.set(key, k); }\n return k;\n },\n };\n metricsCache.set(face, metrics);\n return metrics;\n };\n\n return {\n load,\n ready: (face) => ok.has(face),\n version: () => version,\n onVersion(fn) {\n versionListeners.add(fn);\n return () => { versionListeners.delete(fn); };\n },\n metrics(face) {\n if (!ok.has(face)) { void load(face); return undefined; }\n return measure(face);\n },\n raster(L: HandLayout, face: string, box: { readonly w: number; readonly h: number }, band: number, bleed: number): InkBitmap {\n const f = opts.faces[face];\n if (f === undefined) throw new Error(`desk/ink: no face \"${face}\"`);\n const w = Math.max(1, Math.ceil(box.w * band));\n const h = Math.max(1, Math.ceil(box.h * band));\n const g = context(w, h);\n g.clearRect(0, 0, w, h);\n g.scale(band, band);\n g.font = fontOf(f, L.em);\n g.textBaseline = \"alphabetic\";\n g.textAlign = \"left\";\n g.fillStyle = \"white\"; // coverage only: the alpha is what is read\n g.strokeStyle = \"white\";\n g.lineJoin = \"round\";\n g.lineCap = \"round\";\n for (const q of L.glyphs) {\n g.save();\n g.translate(q.x, q.y);\n g.rotate(q.rot);\n g.scale(q.scale, q.scale);\n if (bleed > 0) { g.globalAlpha = q.press * 0.45; g.lineWidth = bleed / q.scale; g.strokeText(q.ch, 0, 0); }\n g.globalAlpha = q.press;\n g.fillText(q.ch, 0, 0);\n g.restore();\n }\n const img = g.getImageData(0, 0, w, h).data;\n const bytes = new Uint8Array(w * h);\n for (let i = 0; i < bytes.length; i++) bytes[i] = img[i * 4 + 3] as number;\n g.setTransform(1, 0, 0, 1, 0, 0);\n return { bytes, w, h };\n },\n };\n}\n","// PER-KIND GPU COST BY ABLATION (design-016 §4.4, K2). Every kind draws inside the ONE `ground` pass (ground.ts `drawFrame`),\n// so timestamps cannot split them: what a kind costs is measured as what the frame loses without it. The method is\n// `holdCost`'s (apps/desk api.ts) and rig:cost's, made per kind:\n//\n// SATURATED a batch of the same frame drawn back to back into the canvas's texture, ~25 ms of GPU (a 4-frame probe guesses\n// it and one batch at the guess sizes it — guessed wrong once, a 370 ms command stream throttled the GPU and\n// poisoned every later round);\n// DRAINED `onSubmittedWorkDone` covers ALL prior work, so the queue is drained BEFORE the clock starts and again to\n// stop it — and one frame of the variant is drawn and drained first (a kind's records re-uploaded when it\n// comes back are the warm-up's, not the batch's);\n// VARIANTS the frame as it is (base), the frame with kind k's objects left out (for each kind in it), and an A/A\n// CONTROL — the base again, a variant of its own — round-robined within each round (the order rotates, so\n// clock drift and position are shared);\n// READ per kind, the MEDIAN over rounds of the paired difference base − without-k (pairs share a round's drift);\n// the A/A offset (median control − median base) and the NOISE FLOOR (the median |control − base| of a round)\n// beside it: a kind's cost below the floor is not a measurement.\n//\n// For rigs and a person at the console — never per frame, and at rest (a desk drawing its own frames meanwhile shares the\n// GPU with the batches). The held object is left out of every variant: this is the rest frame's cost.\n\nimport type { GroundFrameInputs, SlotInputs, SlotObject } from \"./ground\";\n\nexport interface KindCostOptions {\n /** Rounds (7). */\n readonly rounds?: number;\n /** The batch's target GPU time, ms (25). */\n readonly targetMs?: number;\n /** The probe's frames (4). */\n readonly probeFrames?: number;\n /** The batch's bounds (3 … 300 frames). */\n readonly minFrames?: number;\n readonly maxFrames?: number;\n /** The kinds to leave out (default: every kind with an object in the frame). */\n readonly kinds?: readonly string[];\n}\n\nexport interface Sampled { readonly median: number; readonly min: number }\n\nexport interface KindCost {\n /** ms per frame the frame loses without the kind: the median of the paired base − without-k over rounds. */\n readonly ms: number;\n /** …as a share of the base frame. */\n readonly share: number;\n /** The frame without the kind, ms per frame. */\n readonly without: Sampled;\n /** The kind's objects in the frame (every slot's). */\n readonly objects: number;\n /** The cost clears the noise floor. */\n readonly clears: boolean;\n}\n\nexport interface KindCostReport {\n /** Frames a batch, rounds, and every round's batches in the order drawn. */\n readonly frames: number;\n readonly rounds: number;\n /** The frame as it is, ms per frame. */\n readonly base: Sampled;\n /** The A/A control: the same frame as a variant of its own. */\n readonly control: Sampled;\n /** median(control) − median(base): the A/A offset. */\n readonly aa: number;\n /** The noise floor: the median over rounds of |control − base| within a round. */\n readonly noise: number;\n readonly kinds: Readonly<Record<string, KindCost>>;\n /** Every batch, ms per frame, by variant (`base`, `control`, each kind), in round order — round r drew variant i at position (i − r) mod n. */\n readonly samples: Readonly<Record<string, readonly number[]>>;\n}\n\nexport interface Ablation {\n /** The frame to measure (the last one drawn). */\n readonly inputs: GroundFrameInputs;\n /** Draw one frame of these inputs, synchronously (`Ground.render`). */\n render(inputs: GroundFrameInputs): void;\n /** Resolve once the GPU finished everything submitted (`queue.onSubmittedWorkDone`). */\n drain(): Promise<unknown>;\n now(): number;\n}\n\nconst median = (v: readonly number[]): number => {\n const s = [...v].sort((a, b) => a - b);\n const m = s.length >> 1;\n return s.length === 0 ? 0 : s.length % 2 === 1 ? (s[m] as number) : ((s[m - 1] as number) + (s[m] as number)) / 2;\n};\nconst sampled = (v: readonly number[]): Sampled => ({ median: median(v), min: Math.min(...v) });\n\n/** Every kind with an object in the frame, and how many — the root's, the insides', the departed desk's. */\nexport function kindsIn(inputs: GroundFrameInputs): Record<string, number> {\n const out: Record<string, number> = {};\n const walk = (s: SlotInputs): void => {\n for (const o of s.objects ?? []) out[o.kind] = (out[o.kind] ?? 0) + 1;\n for (const p of s.portals ?? []) walk(p);\n };\n walk(inputs);\n if (inputs.outgoing !== undefined) walk(inputs.outgoing);\n return out;\n}\n\n/** A slot without `kind`'s objects: the rest keep their paint order, the insides their object (re-indexed); an inside whose object left goes with it. */\nfunction slotWithout<S extends SlotInputs>(s: S, kind: string): { slot: S; index: Map<number, number> } {\n const index = new Map<number, number>();\n const objects: SlotObject[] = [];\n (s.objects ?? []).forEach((o, i) => { if (o.kind !== kind) { index.set(i, objects.length); objects.push(o); } });\n const portals = (s.portals ?? []).flatMap((p) => {\n const at = index.get(p.at);\n return at === undefined ? [] : [{ ...slotWithout(p, kind).slot, at }];\n });\n return { slot: { ...s, ...(s.objects !== undefined ? { objects } : {}), ...(s.portals !== undefined ? { portals } : {}) }, index };\n}\n\n/** The frame with `kind`'s objects left out of every slot (its insides with them); `null` kind: the frame as it is. The held object is always left out (the rest frame). */\nexport function withoutKind(inputs: GroundFrameInputs, kind: string | null): GroundFrameInputs {\n const { held: _held, ...rest } = inputs;\n if (kind === null) return rest;\n const root = slotWithout(rest, kind).slot;\n const o = rest.outgoing;\n if (o === undefined) return root;\n const out = slotWithout(o, kind);\n const at = o.at === undefined ? undefined : out.index.get(o.at);\n const { at: _at, ...moved } = out.slot;\n return { ...root, outgoing: at === undefined ? moved : { ...moved, at } };\n}\n\n/** Measure what each kind costs the frame (the header's method). */\nexport async function ablateKinds(a: Ablation, opts: KindCostOptions = {}): Promise<KindCostReport> {\n const rounds = opts.rounds ?? 7;\n const present = kindsIn(a.inputs);\n const kinds = (opts.kinds ?? Object.keys(present)).filter((k) => (present[k] ?? 0) > 0);\n const base = withoutKind(a.inputs, null);\n const variants: { name: string; inputs: GroundFrameInputs }[] = [\n { name: \"base\", inputs: base },\n { name: \"control\", inputs: base },\n ...kinds.map((k) => ({ name: k, inputs: withoutKind(a.inputs, k) })),\n ];\n const batch = async (inputs: GroundFrameInputs, n: number): Promise<number> => {\n a.render(inputs); // the warm-up: the variant's first frame (records coming back are uploaded here)\n await a.drain();\n const t0 = a.now();\n for (let i = 0; i < n; i++) a.render(inputs);\n await a.drain();\n return (a.now() - t0) / n;\n };\n const size = (perFrame: number): number => Math.max(opts.minFrames ?? 3, Math.min(opts.maxFrames ?? 300, Math.round((opts.targetMs ?? 25) / Math.max(perFrame, 0.05))));\n // the probe's few frames carry the first frames' cold costs: re-timed once at its guess, the batch sized from that\n const frames = size(await batch(base, size(await batch(base, opts.probeFrames ?? 4))));\n const ms = new Map<string, number[]>(variants.map((v) => [v.name, []]));\n for (let r = 0; r < rounds; r++) {\n for (let i = 0; i < variants.length; i++) {\n const v = variants[(i + r) % variants.length] as { name: string; inputs: GroundFrameInputs };\n (ms.get(v.name) as number[]).push(await batch(v.inputs, frames));\n }\n }\n const b = ms.get(\"base\") as number[];\n const c = ms.get(\"control\") as number[];\n const noise = median(b.map((x, r) => Math.abs((c[r] as number) - x)));\n const baseS = sampled(b);\n const out: Record<string, KindCost> = {};\n for (const k of kinds) {\n const w = ms.get(k) as number[];\n const cost = median(b.map((x, r) => x - (w[r] as number)));\n out[k] = { ms: cost, share: baseS.median > 0 ? cost / baseS.median : 0, without: sampled(w), objects: present[k] ?? 0, clears: cost > noise };\n }\n a.render(a.inputs); // the frame as it was\n return { frames, rounds, base: baseS, control: sampled(c), aa: median(c) - baseS.median, noise, kinds: out, samples: Object.fromEntries(ms) };\n}\n","// PERSISTENT RECORDS (design-015 §4.3; D6) — per kind, per slot: a GPU storage buffer of records\n// indexed by a SLOT ALLOCATOR (entity → record index, a free list, grown by doubling), written\n// when a record CHANGED and never otherwise, and the DRAW LIST — an index buffer of record slots in\n// paint order — rewritten only when membership, order or visibility moved. The prototype's passes\n// re-packed and re-uploaded every visible record every frame (`prepare(instances[])`, the per-frame\n// form); this is the step it did not take, taken under the oracle: a record's BYTES are the same\n// whichever slot holds them, and the shader reads `records[order[instance_index]]`, so no pixel\n// moves — only the uploads do.\n//\n// CHANGE is IDENTITY: the builder reuses a record object while nothing that made it changed and\n// hands a fresh one when something did (its facts, its flux, its look, its zoom rung), so the store\n// need only compare `===` — plus one number a pass folds in (`aux`: the mini mat's live-inside\n// presence, the board's raster's wet — facts the ground or the pass knows and the record does not).\n// KEYS are the builder's (the entity; a ghost's negative entity); a frame handed NO keys (the Node\n// oracle, a bare host) is TRANSIENT: every slot is dealt afresh from 0 in paint order and packed —\n// exactly the prototype's form, so the oracle's frames are what they were, byte for byte.\n//\n// BLOCKS: a kind whose record owns a fixed run of sub-records (the mini mat's chips) gets a second\n// buffer with `per` sub-records a slot, at `slot × per` — the record's `chipFirst` — grown with the\n// slots; a pack fills the block and says how many it used, and that many upload with the record.\n//\n// The uploads are coalesced: dirty slots sorted, runs with gaps of at most `GAP` slots merged, one\n// `writeBuffer` a run. Growth reallocates the buffers (the pass rebinds — `version` moved) and\n// uploads everything once. `stats()` counts what was written — the instrument rig:stress reads.\n\nimport { storageBuffer } from \"./pipeline\";\nimport type { StructBuffer, StructDef } from \"./struct\";\n\n/** How the pass packs one record into its slot; `blocks` (when the store has them) and `blockBase` name the slot's block. Returns the block records used (0 without blocks). */\nexport type RecordPacker<R, F extends string, B extends string> = (record: R, aux: number, into: StructBuffer<F>, slot: number, blocks: StructBuffer<B> | null, blockBase: number) => number;\n\nexport interface RecordStoreOptions<R, F extends string, B extends string = never> {\n readonly device: GPUDevice;\n readonly def: StructDef<F>;\n /** Slots at the start; grown by doubling up to `max` (65,536). */\n readonly capacity: number;\n readonly max?: number;\n /** The records buffer's label (`paper/notes`); the draw list is `<label> order`, the blocks `blocks.label`. */\n readonly label: string;\n readonly pack: RecordPacker<R, F, B>;\n /** A fixed block of `per` sub-records of `def` a slot (the mini mat's chips). */\n readonly blocks?: { readonly def: StructDef<B>; readonly per: number; readonly label: string };\n}\n\nexport interface RecordStoreStats {\n /** Records packed and uploaded since the store was made. */\n readonly written: number;\n /** Bytes those uploads carried (records and blocks). */\n readonly bytes: number;\n /** Draw-list uploads. */\n readonly orderWrites: number;\n /** Slots in use, the capacity, how many times the buffers were remade. */\n readonly slots: number;\n readonly capacity: number;\n readonly grown: number;\n}\n\nexport interface RecordStore<R> {\n /** The records buffer, the draw list and (with blocks) the blocks buffer — bind them; their identity moves on growth, `version` says when. */\n readonly records: GPUBuffer;\n readonly order: GPUBuffer;\n readonly blocks: GPUBuffer | null;\n readonly version: number;\n /**\n * One frame's records in paint order. `keys`: one per record, stable across frames (absent = transient: slots dealt from 0,\n * everything packed). `aux(i)`: a number per record folded into the change test and handed to the pack. Returns the count\n * that will draw — `order[0 … count)` names each paint index's slot.\n */\n prepare(records: readonly R[], keys: readonly number[] | undefined, aux?: (index: number) => number): number;\n /** The slot drawn at paint index `i` this frame. */\n slotAt(i: number): number;\n /** What the pack folded in at paint index `i`: its aux and the block records it used. */\n entryAt(i: number): { readonly aux: number; readonly blockN: number };\n /** Every live record repacked at the next `prepare` (a law changed under them). */\n invalidate(): void;\n stats(): RecordStoreStats;\n dispose(): void;\n}\n\ninterface Entry { readonly key: number; readonly slot: number; record: unknown; aux: number; gen: number; blockN: number }\n\nconst DEFAULT_MAX = 65_536;\n/** Dirty slots this close are uploaded as one run. */\nconst GAP = 4;\nconst NONE: { readonly aux: number; readonly blockN: number } = { aux: 0, blockN: 0 };\n\nexport function createRecordStore<R, F extends string, B extends string = never>(opts: RecordStoreOptions<R, F, B>): RecordStore<R> {\n const { device, def, label, pack } = opts;\n const max = opts.max ?? DEFAULT_MAX;\n const blocksDef = opts.blocks;\n const per = blocksDef?.per ?? 0;\n let capacity = Math.max(1, Math.min(opts.capacity, max));\n let cpu = def.alloc(capacity);\n let gpu = storageBuffer(device, def.size * capacity, label);\n let blockCpu: StructBuffer<B> | null = blocksDef ? blocksDef.def.alloc(capacity * per) : null;\n let blockGpu: GPUBuffer | null = blocksDef ? storageBuffer(device, blocksDef.def.size * capacity * per, blocksDef.label) : null;\n let orderCpu = new Uint32Array(capacity);\n let orderGpu = storageBuffer(device, 4 * capacity, `${label} order`);\n let version = 0;\n let grown = 0;\n const byKey = new Map<number, Entry>();\n let bySlot: (Entry | null)[] = new Array<Entry | null>(capacity).fill(null);\n const free: number[] = [];\n let next = 0;\n let gen = 0;\n /** The keys of the last frame (null: it was transient). */\n let lastKeys: number[] | null = null;\n /** The draw list as last uploaded. */\n let prevOrder: number[] = [];\n let count = 0;\n const dirty: number[] = [];\n let written = 0;\n let bytes = 0;\n let orderWrites = 0;\n\n const grow = (): void => {\n if (capacity >= max) throw new Error(`${label}: ${capacity} record slots is the most this store grows to`);\n const was = capacity;\n capacity = Math.min(capacity * 2, max);\n const nextCpu = def.alloc(capacity);\n new Uint8Array(nextCpu.bytes).set(new Uint8Array(cpu.bytes));\n cpu = nextCpu;\n gpu.destroy();\n gpu = storageBuffer(device, def.size * capacity, label);\n if (blocksDef && blockCpu && blockGpu) {\n const nextBlocks = blocksDef.def.alloc(capacity * per);\n new Uint8Array(nextBlocks.bytes).set(new Uint8Array(blockCpu.bytes));\n blockCpu = nextBlocks;\n blockGpu.destroy();\n blockGpu = storageBuffer(device, blocksDef.def.size * capacity * per, blocksDef.label);\n }\n const nextOrder = new Uint32Array(capacity);\n nextOrder.set(orderCpu);\n orderCpu = nextOrder;\n orderGpu.destroy();\n orderGpu = storageBuffer(device, 4 * capacity, `${label} order`);\n const nextBySlot = new Array<Entry | null>(capacity).fill(null);\n for (let i = 0; i < was; i++) nextBySlot[i] = bySlot[i] ?? null;\n bySlot = nextBySlot;\n version += 1;\n grown += 1;\n };\n let grew = false;\n const alloc = (): number => {\n const reused = free.pop();\n if (reused !== undefined) return reused;\n if (next === capacity) { grow(); grew = true; }\n return next++;\n };\n const release = (ent: Entry): void => {\n byKey.delete(ent.key);\n bySlot[ent.slot] = null;\n free.push(ent.slot);\n };\n /** Every slot given back: the store starts afresh from slot 0 (a transient frame, or the first keyed one after it). */\n const resetAll = (): void => { bySlot.fill(null); byKey.clear(); free.length = 0; next = 0; };\n const packInto = (ent: Entry, record: R, aux: number): void => {\n ent.record = record;\n ent.aux = aux;\n ent.blockN = pack(record, aux, cpu, ent.slot, blockCpu, ent.slot * per);\n dirty.push(ent.slot);\n };\n /** The dirty slots as runs [a, b], sorted and merged where the gap is small. */\n const runs = (): [number, number][] => {\n dirty.sort((a, b) => a - b);\n const out: [number, number][] = [];\n for (const s of dirty) {\n const last = out[out.length - 1];\n if (last !== undefined && s <= last[1] + 1 + GAP) { if (s > last[1]) last[1] = s; } else out.push([s, s]);\n }\n return out;\n };\n const upload = (n: number, orderMoved: boolean): void => {\n let rewriteOrder = orderMoved;\n if (grew) {\n grew = false;\n // everything once: the buffers are new\n if (next > 0) { device.queue.writeBuffer(gpu, 0, cpu.bytes, 0, next * def.size); bytes += next * def.size; }\n if (blocksDef && blockCpu && blockGpu && next > 0) { device.queue.writeBuffer(blockGpu, 0, blockCpu.bytes, 0, next * per * blocksDef.def.size); bytes += next * per * blocksDef.def.size; }\n written += dirty.length;\n dirty.length = 0;\n rewriteOrder = true;\n } else if (dirty.length > 0) {\n for (const [a, b] of runs()) {\n const n0 = b - a + 1;\n device.queue.writeBuffer(gpu, a * def.size, cpu.bytes, a * def.size, n0 * def.size);\n bytes += n0 * def.size;\n }\n if (blocksDef && blockCpu && blockGpu) {\n const bsize = blocksDef.def.size;\n for (const s of dirty) {\n const ent = bySlot[s];\n if (!ent || ent.blockN === 0) continue;\n device.queue.writeBuffer(blockGpu, s * per * bsize, blockCpu.bytes, s * per * bsize, ent.blockN * bsize);\n bytes += ent.blockN * bsize;\n }\n }\n written += dirty.length;\n dirty.length = 0;\n }\n if (rewriteOrder) {\n if (n > 0) device.queue.writeBuffer(orderGpu, 0, orderCpu, 0, n);\n orderWrites += 1;\n prevOrder = Array.from(orderCpu.subarray(0, n));\n }\n };\n\n return {\n get records() { return gpu; },\n get order() { return orderGpu; },\n get blocks() { return blockGpu; },\n get version() { return version; },\n prepare(records, keys, aux) {\n gen += 1;\n const n = records.length;\n let orderChanged = n !== prevOrder.length;\n if (keys === undefined) {\n // TRANSIENT: the prototype's form — every slot dealt afresh from 0 in paint order, every record packed\n resetAll();\n lastKeys = null;\n for (let i = 0; i < n; i++) {\n const slot = alloc();\n // a transient key is no entity's: a half, never an integer (a ghost's key is its entity negated)\n const ent: Entry = { key: -0.5 - i, slot, record: undefined, aux: 0, gen, blockN: 0 };\n bySlot[slot] = ent;\n packInto(ent, records[i] as R, aux ? aux(i) : 0);\n if (!orderChanged && prevOrder[i] !== slot) orderChanged = true;\n orderCpu[i] = slot;\n }\n } else {\n if (keys.length !== n) throw new Error(`${label}: ${keys.length} keys for ${n} records`);\n // after a transient frame (or none) nothing keyed is live: the store starts afresh, its slots dealt from 0 again\n if (lastKeys === null) resetAll();\n const same = lastKeys !== null && lastKeys.length === n && lastKeys.every((k, i) => k === keys[i]);\n for (let i = 0; i < n; i++) {\n const key = keys[i] as number;\n let ent = byKey.get(key);\n if (ent === undefined) {\n const slot = alloc();\n ent = { key, slot, record: undefined, aux: 0, gen, blockN: 0 };\n byKey.set(key, ent);\n bySlot[slot] = ent;\n }\n ent.gen = gen;\n const a = aux ? aux(i) : 0;\n if (ent.record !== records[i] || ent.aux !== a) packInto(ent, records[i] as R, a);\n if (!orderChanged && prevOrder[i] !== ent.slot) orderChanged = true;\n orderCpu[i] = ent.slot;\n }\n if (!same) {\n // what left: the last frame's keys not seen this frame give their slots back\n if (lastKeys !== null) for (const k of lastKeys) { const ent = byKey.get(k); if (ent !== undefined && ent.gen !== gen) release(ent); }\n lastKeys = keys.slice();\n }\n }\n upload(n, orderChanged);\n count = n;\n return n;\n },\n slotAt: (i) => (i < count ? (orderCpu[i] as number) : -1),\n entryAt(i) {\n if (i >= count) return NONE;\n const ent = bySlot[orderCpu[i] as number];\n return ent === null || ent === undefined ? NONE : { aux: ent.aux, blockN: ent.blockN };\n },\n invalidate() { for (const ent of byKey.values()) ent.record = undefined; },\n stats: () => ({ written, bytes, orderWrites, slots: next - free.length, capacity, grown }),\n dispose() { gpu.destroy(); orderGpu.destroy(); blockGpu?.destroy(); byKey.clear(); },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,IAAM,SAAiC,CAAC,QAAQ,UAAU,QAAQ;;;ACtBlE,IAAM,SAAS;AAAA;AAAA,EAEpB,OAAO;AAAA;AAAA,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AU,CAAC,MAAM,IAAI,KAAM,gBAAe;AAC/D,mBAAS,CAAC,IAAI,IAAI;AAAA,QACpB;AACA,YAAI,CAAC,MAAM;AAET,cAAI,aAAa,KAAM,YAAW,KAAK,UAAU;AAAE,kBAAM,MAAM,MAAM,IAAI,CAAC;AAAG,gBAAI,QAAQ,UAAa,IAAI,QAAQ,IAAK,SAAQ,GAAG;AAAA,UAAG;AACrI,qBAAW,KAAK,MAAM;AAAA,QACxB;AAAA,MACF;AACA,aAAO,GAAG,YAAY;AACtB,cAAQ;AACR,aAAO;AAAA,IACT;AAAA,IACA,QAAQ,CAAC,MAAO,IAAI,QAAS,SAAS,CAAC,IAAe;AAAA,IACtD,QAAQ,GAAG;AACT,UAAI,KAAK,MAAO,QAAO;AACvB,YAAM,MAAM,OAAO,SAAS,CAAC,CAAW;AACxC,aAAO,QAAQ,QAAQ,QAAQ,SAAY,OAAO,EAAE,KAAK,IAAI,KAAK,QAAQ,IAAI,OAAO;AAAA,IACvF;AAAA,IACA,aAAa;AAAE,iBAAW,OAAO,MAAM,OAAO,EAAG,KAAI,SAAS;AAAA,IAAW;AAAA,IACzE,OAAO,OAAO,EAAE,SAAS,OAAO,aAAa,OAAO,OAAO,KAAK,QAAQ,UAAU,MAAM;AAAA,IACxF,UAAU;AAAE,UAAI,QAAQ;AAAG,eAAS,QAAQ;AAAG,gBAAU,QAAQ;AAAG,YAAM,MAAM;AAAA,IAAG;AAAA,EACrF;AACF;","names":["text","text","BLEND_PREMUL","from","text","a","b","BLEND_PREMUL","g","homePose","face","BLEND_PREMUL","at","box","surface","encoder","pass","clamp01","marquee","tape","union","box","laser","ruler","marquee","smoothstep","band","id","l","list","view","face","marginPx","cam","redressOut","rows","at","redress","ruler","keep","id","spent","EPS","to","localPointersQ","carry","at","box","i","keep","at","b","text","compose","id","drawn","heldPose","kinds","face","advance","metrics","box","band","at"]}