@oasys/oecs 0.5.4 → 0.6.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 (510) hide show
  1. package/CHANGELOG.md +1223 -266
  2. package/README.md +217 -112
  3. package/dist/core/ecs/access_check.d.cts +29 -29
  4. package/dist/core/ecs/access_check.d.ts +29 -29
  5. package/dist/core/ecs/access_check.d.ts.map +1 -1
  6. package/dist/core/ecs/archetype.d.cts +217 -209
  7. package/dist/core/ecs/archetype.d.ts +217 -209
  8. package/dist/core/ecs/archetype.d.ts.map +1 -1
  9. package/dist/core/ecs/archetype_closure.d.cts +23 -0
  10. package/dist/core/ecs/archetype_closure.d.ts +23 -0
  11. package/dist/core/ecs/archetype_closure.d.ts.map +1 -0
  12. package/dist/core/ecs/archetype_graph.d.cts +33 -33
  13. package/dist/core/ecs/archetype_graph.d.ts +33 -33
  14. package/dist/core/ecs/archetype_graph.d.ts.map +1 -1
  15. package/dist/core/ecs/archetype_types.d.cts +55 -0
  16. package/dist/core/ecs/archetype_types.d.ts +55 -0
  17. package/dist/core/ecs/archetype_types.d.ts.map +1 -0
  18. package/dist/core/ecs/change_feed.d.cts +53 -0
  19. package/dist/core/ecs/change_feed.d.ts +53 -0
  20. package/dist/core/ecs/change_feed.d.ts.map +1 -0
  21. package/dist/core/ecs/changed_query.d.cts +36 -0
  22. package/dist/core/ecs/changed_query.d.ts +36 -0
  23. package/dist/core/ecs/changed_query.d.ts.map +1 -0
  24. package/dist/core/ecs/chunk_columns.d.cts +49 -0
  25. package/dist/core/ecs/chunk_columns.d.ts +49 -0
  26. package/dist/core/ecs/chunk_columns.d.ts.map +1 -0
  27. package/dist/core/ecs/command_log.d.cts +26 -26
  28. package/dist/core/ecs/command_log.d.ts +26 -26
  29. package/dist/core/ecs/command_log.d.ts.map +1 -1
  30. package/dist/core/ecs/component.d.cts +43 -42
  31. package/dist/core/ecs/component.d.ts +43 -42
  32. package/dist/core/ecs/component.d.ts.map +1 -1
  33. package/dist/core/ecs/component_registry.d.cts +53 -0
  34. package/dist/core/ecs/component_registry.d.ts +53 -0
  35. package/dist/core/ecs/component_registry.d.ts.map +1 -0
  36. package/dist/core/ecs/compute_backend.d.cts +18 -7
  37. package/dist/core/ecs/compute_backend.d.ts +18 -7
  38. package/dist/core/ecs/compute_backend.d.ts.map +1 -1
  39. package/dist/core/ecs/deferred_commands.d.cts +15 -14
  40. package/dist/core/ecs/deferred_commands.d.ts +15 -14
  41. package/dist/core/ecs/deferred_commands.d.ts.map +1 -1
  42. package/dist/core/ecs/dispatch_trace.d.cts +32 -31
  43. package/dist/core/ecs/dispatch_trace.d.ts +32 -31
  44. package/dist/core/ecs/dispatch_trace.d.ts.map +1 -1
  45. package/dist/core/ecs/ecs.d.cts +289 -270
  46. package/dist/core/ecs/ecs.d.ts +289 -270
  47. package/dist/core/ecs/ecs.d.ts.map +1 -1
  48. package/dist/core/ecs/ecs_memory.d.cts +134 -136
  49. package/dist/core/ecs/ecs_memory.d.ts +134 -136
  50. package/dist/core/ecs/ecs_memory.d.ts.map +1 -1
  51. package/dist/core/ecs/ecs_options.d.cts +89 -0
  52. package/dist/core/ecs/ecs_options.d.ts +89 -0
  53. package/dist/core/ecs/ecs_options.d.ts.map +1 -0
  54. package/dist/core/ecs/entity.d.cts +4 -4
  55. package/dist/core/ecs/entity.d.ts +4 -4
  56. package/dist/core/ecs/entity_allocator.d.cts +20 -18
  57. package/dist/core/ecs/entity_allocator.d.ts +20 -18
  58. package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
  59. package/dist/core/ecs/event.d.cts +36 -22
  60. package/dist/core/ecs/event.d.ts +36 -22
  61. package/dist/core/ecs/event.d.ts.map +1 -1
  62. package/dist/core/ecs/facades.d.cts +12 -126
  63. package/dist/core/ecs/facades.d.ts +12 -126
  64. package/dist/core/ecs/facades.d.ts.map +1 -1
  65. package/dist/core/ecs/frame_stepper.d.cts +12 -12
  66. package/dist/core/ecs/frame_stepper.d.ts +12 -12
  67. package/dist/core/ecs/frame_stepper.d.ts.map +1 -1
  68. package/dist/core/ecs/frame_trace.d.cts +32 -32
  69. package/dist/core/ecs/frame_trace.d.ts +32 -32
  70. package/dist/core/ecs/frame_trace.d.ts.map +1 -1
  71. package/dist/core/ecs/host_commands.d.cts +103 -85
  72. package/dist/core/ecs/host_commands.d.ts +103 -85
  73. package/dist/core/ecs/host_commands.d.ts.map +1 -1
  74. package/dist/core/ecs/index.d.cts +21 -11
  75. package/dist/core/ecs/index.d.ts +21 -11
  76. package/dist/core/ecs/index.d.ts.map +1 -1
  77. package/dist/core/ecs/observer.d.cts +39 -120
  78. package/dist/core/ecs/observer.d.ts +39 -120
  79. package/dist/core/ecs/observer.d.ts.map +1 -1
  80. package/dist/core/ecs/phase.d.cts +79 -0
  81. package/dist/core/ecs/phase.d.ts +79 -0
  82. package/dist/core/ecs/phase.d.ts.map +1 -0
  83. package/dist/core/ecs/plugin.d.cts +125 -0
  84. package/dist/core/ecs/plugin.d.ts +125 -0
  85. package/dist/core/ecs/plugin.d.ts.map +1 -0
  86. package/dist/core/ecs/plugin_slots.d.cts +26 -0
  87. package/dist/core/ecs/plugin_slots.d.ts +26 -0
  88. package/dist/core/ecs/plugin_slots.d.ts.map +1 -0
  89. package/dist/core/ecs/query.d.cts +208 -578
  90. package/dist/core/ecs/query.d.ts +208 -578
  91. package/dist/core/ecs/query.d.ts.map +1 -1
  92. package/dist/core/ecs/query_cache.d.cts +130 -0
  93. package/dist/core/ecs/query_cache.d.ts +130 -0
  94. package/dist/core/ecs/query_cache.d.ts.map +1 -0
  95. package/dist/core/ecs/query_registry.d.cts +47 -0
  96. package/dist/core/ecs/query_registry.d.ts +47 -0
  97. package/dist/core/ecs/query_registry.d.ts.map +1 -0
  98. package/dist/core/ecs/query_terms.d.cts +126 -0
  99. package/dist/core/ecs/query_terms.d.ts +126 -0
  100. package/dist/core/ecs/query_terms.d.ts.map +1 -0
  101. package/dist/core/ecs/ref.d.cts +100 -39
  102. package/dist/core/ecs/ref.d.ts +100 -39
  103. package/dist/core/ecs/ref.d.ts.map +1 -1
  104. package/dist/core/ecs/relation.d.cts +101 -182
  105. package/dist/core/ecs/relation.d.ts +101 -182
  106. package/dist/core/ecs/relation.d.ts.map +1 -1
  107. package/dist/core/ecs/resource.d.cts +13 -13
  108. package/dist/core/ecs/resource.d.ts +13 -13
  109. package/dist/core/ecs/resource_registry.d.cts +5 -5
  110. package/dist/core/ecs/resource_registry.d.ts +5 -5
  111. package/dist/core/ecs/resource_registry.d.ts.map +1 -1
  112. package/dist/core/ecs/row_kinds.d.cts +24 -0
  113. package/dist/core/ecs/row_kinds.d.ts +24 -0
  114. package/dist/core/ecs/row_kinds.d.ts.map +1 -0
  115. package/dist/core/ecs/run_condition.d.cts +23 -23
  116. package/dist/core/ecs/run_condition.d.ts +23 -23
  117. package/dist/core/ecs/run_condition.d.ts.map +1 -1
  118. package/dist/core/ecs/schedule.d.cts +91 -120
  119. package/dist/core/ecs/schedule.d.ts +91 -120
  120. package/dist/core/ecs/schedule.d.ts.map +1 -1
  121. package/dist/core/ecs/schedule_plan.d.cts +33 -0
  122. package/dist/core/ecs/schedule_plan.d.ts +33 -0
  123. package/dist/core/ecs/schedule_plan.d.ts.map +1 -0
  124. package/dist/core/ecs/snapshot.d.cts +77 -0
  125. package/dist/core/ecs/snapshot.d.ts +77 -0
  126. package/dist/core/ecs/snapshot.d.ts.map +1 -0
  127. package/dist/core/ecs/snapshot_mount.d.cts +42 -0
  128. package/dist/core/ecs/snapshot_mount.d.ts +42 -0
  129. package/dist/core/ecs/snapshot_mount.d.ts.map +1 -0
  130. package/dist/core/ecs/sparse_store.d.cts +108 -51
  131. package/dist/core/ecs/sparse_store.d.ts +108 -51
  132. package/dist/core/ecs/sparse_store.d.ts.map +1 -1
  133. package/dist/core/ecs/store.d.cts +527 -473
  134. package/dist/core/ecs/store.d.ts +527 -473
  135. package/dist/core/ecs/store.d.ts.map +1 -1
  136. package/dist/core/ecs/store_layout_listener.d.cts +6 -6
  137. package/dist/core/ecs/store_layout_listener.d.ts +6 -6
  138. package/dist/core/ecs/store_types.d.cts +122 -0
  139. package/dist/core/ecs/store_types.d.ts +122 -0
  140. package/dist/core/ecs/store_types.d.ts.map +1 -0
  141. package/dist/core/ecs/system.d.cts +146 -61
  142. package/dist/core/ecs/system.d.ts +146 -61
  143. package/dist/core/ecs/system.d.ts.map +1 -1
  144. package/dist/core/ecs/system_context.d.cts +296 -0
  145. package/dist/core/ecs/system_context.d.ts +296 -0
  146. package/dist/core/ecs/system_context.d.ts.map +1 -0
  147. package/dist/core/ecs/system_set.d.cts +48 -0
  148. package/dist/core/ecs/system_set.d.ts +48 -0
  149. package/dist/core/ecs/system_set.d.ts.map +1 -0
  150. package/dist/core/ecs/utils/arrays.d.cts +15 -1
  151. package/dist/core/ecs/utils/arrays.d.ts +15 -1
  152. package/dist/core/ecs/utils/arrays.d.ts.map +1 -1
  153. package/dist/core/ecs/utils/error.d.cts +82 -6
  154. package/dist/core/ecs/utils/error.d.ts +82 -6
  155. package/dist/core/ecs/utils/error.d.ts.map +1 -1
  156. package/dist/core/ecs/utils/plugin_error.d.cts +10 -0
  157. package/dist/core/ecs/utils/plugin_error.d.ts +10 -0
  158. package/dist/core/ecs/utils/plugin_error.d.ts.map +1 -0
  159. package/dist/core/restore_errors.d.cts +30 -0
  160. package/dist/core/restore_errors.d.ts +30 -0
  161. package/dist/core/restore_errors.d.ts.map +1 -0
  162. package/dist/core/store/action_ring.d.cts +44 -44
  163. package/dist/core/store/action_ring.d.ts +44 -44
  164. package/dist/core/store/action_ring.d.ts.map +1 -1
  165. package/dist/core/store/allocator.d.cts +149 -95
  166. package/dist/core/store/allocator.d.ts +149 -95
  167. package/dist/core/store/allocator.d.ts.map +1 -1
  168. package/dist/core/store/buffer_backed_column.d.cts +17 -17
  169. package/dist/core/store/buffer_backed_column.d.ts +17 -17
  170. package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
  171. package/dist/core/store/column_store.d.cts +124 -86
  172. package/dist/core/store/column_store.d.ts +124 -86
  173. package/dist/core/store/column_store.d.ts.map +1 -1
  174. package/dist/core/store/command_dispatch.d.cts +14 -15
  175. package/dist/core/store/command_dispatch.d.ts +14 -15
  176. package/dist/core/store/command_dispatch.d.ts.map +1 -1
  177. package/dist/core/store/command_ring.d.cts +36 -39
  178. package/dist/core/store/command_ring.d.ts +36 -39
  179. package/dist/core/store/command_ring.d.ts.map +1 -1
  180. package/dist/core/store/descriptor.d.cts +34 -17
  181. package/dist/core/store/descriptor.d.ts +34 -17
  182. package/dist/core/store/descriptor.d.ts.map +1 -1
  183. package/dist/core/store/entity_index.d.cts +34 -35
  184. package/dist/core/store/entity_index.d.ts +34 -35
  185. package/dist/core/store/entity_index.d.ts.map +1 -1
  186. package/dist/core/store/event_ring.d.cts +36 -38
  187. package/dist/core/store/event_ring.d.ts +36 -38
  188. package/dist/core/store/event_ring.d.ts.map +1 -1
  189. package/dist/core/store/extend.d.cts +13 -7
  190. package/dist/core/store/extend.d.ts +13 -7
  191. package/dist/core/store/extend.d.ts.map +1 -1
  192. package/dist/core/store/grow.d.cts +2 -2
  193. package/dist/core/store/grow.d.ts +2 -2
  194. package/dist/core/store/grow.d.ts.map +1 -1
  195. package/dist/core/store/header.d.cts +31 -27
  196. package/dist/core/store/header.d.ts +31 -27
  197. package/dist/core/store/header.d.ts.map +1 -1
  198. package/dist/core/store/index.d.cts +10 -10
  199. package/dist/core/store/index.d.ts +10 -10
  200. package/dist/core/store/index.d.ts.map +1 -1
  201. package/dist/core/store/layout_ops.d.cts +71 -62
  202. package/dist/core/store/layout_ops.d.ts +71 -62
  203. package/dist/core/store/layout_ops.d.ts.map +1 -1
  204. package/dist/core/store/region_table.d.cts +28 -21
  205. package/dist/core/store/region_table.d.ts +28 -21
  206. package/dist/core/store/region_table.d.ts.map +1 -1
  207. package/dist/core/store/snapshot.d.cts +31 -16
  208. package/dist/core/store/snapshot.d.ts +31 -16
  209. package/dist/core/store/snapshot.d.ts.map +1 -1
  210. package/dist/core/store/state_hash.d.cts +12 -12
  211. package/dist/core/store/state_hash.d.ts +12 -12
  212. package/dist/core/store/state_hash.d.ts.map +1 -1
  213. package/dist/core/store/store_regions.d.cts +10 -10
  214. package/dist/core/store/store_regions.d.ts +10 -10
  215. package/dist/core/store/store_regions.d.ts.map +1 -1
  216. package/dist/core/store/vendored_abi/abi.d.cts +27 -2
  217. package/dist/core/store/vendored_abi/abi.d.ts +27 -2
  218. package/dist/core/store/vendored_abi/abi.d.ts.map +1 -1
  219. package/dist/host_commands-B2KMx8O2.cjs +1 -0
  220. package/dist/host_commands-ClVPvhSa.cjs +2 -0
  221. package/dist/host_commands-CwxVQS1z.js +1524 -0
  222. package/dist/host_commands-nJvTy88E.js +1667 -0
  223. package/dist/index.cjs +1 -1
  224. package/dist/index.d.cts +15 -10
  225. package/dist/index.d.ts +15 -10
  226. package/dist/index.d.ts.map +1 -1
  227. package/dist/index.development.cjs +1 -1
  228. package/dist/index.development.js +5804 -5203
  229. package/dist/index.js +5323 -4764
  230. package/dist/internal.cjs +2 -2
  231. package/dist/internal.d.cts +5 -2
  232. package/dist/internal.d.ts +5 -2
  233. package/dist/internal.d.ts.map +1 -1
  234. package/dist/internal.development.cjs +1 -1
  235. package/dist/internal.development.js +70 -20
  236. package/dist/internal.js +138 -83
  237. package/dist/plugins/abi-D3V-QUSf.cjs +1 -0
  238. package/dist/plugins/abi-NP8pNxpd.js +42 -0
  239. package/dist/plugins/arrays-Dr_1hCjL.js +28 -0
  240. package/dist/plugins/arrays-Dt-Joc4i.cjs +1 -0
  241. package/dist/plugins/assertions-gtDVfbnQ.js +6 -0
  242. package/dist/plugins/assertions-z5GQd_bB.cjs +1 -0
  243. package/dist/{extensions → plugins}/editor/editor.d.cts +54 -54
  244. package/dist/{extensions → plugins}/editor/editor.d.ts +54 -54
  245. package/dist/plugins/editor/editor.d.ts.map +1 -0
  246. package/dist/{extensions → plugins}/editor/field_handle.d.cts +12 -12
  247. package/dist/{extensions → plugins}/editor/field_handle.d.ts +12 -12
  248. package/dist/plugins/editor/field_handle.d.ts.map +1 -0
  249. package/dist/plugins/editor/index.d.cts +22 -0
  250. package/dist/plugins/editor/index.d.ts +22 -0
  251. package/dist/plugins/editor/index.d.ts.map +1 -0
  252. package/dist/plugins/editor.cjs +1 -0
  253. package/dist/plugins/editor.d.cts +1 -0
  254. package/dist/plugins/editor.d.ts +1 -0
  255. package/dist/plugins/editor.development.cjs +1 -0
  256. package/dist/{extensions/editor/index.development.js → plugins/editor.development.js} +81 -64
  257. package/dist/{extensions/editor/index.js → plugins/editor.js} +81 -64
  258. package/dist/plugins/events/event_channel.d.cts +13 -0
  259. package/dist/plugins/events/event_channel.d.ts +13 -0
  260. package/dist/plugins/events/event_channel.d.ts.map +1 -0
  261. package/dist/plugins/events/event_registry.d.cts +22 -0
  262. package/dist/plugins/events/event_registry.d.ts +22 -0
  263. package/dist/plugins/events/event_registry.d.ts.map +1 -0
  264. package/dist/plugins/events/facade.d.cts +26 -0
  265. package/dist/plugins/events/facade.d.ts +26 -0
  266. package/dist/plugins/events/facade.d.ts.map +1 -0
  267. package/dist/plugins/events/index.d.cts +10 -0
  268. package/dist/plugins/events/index.d.ts +10 -0
  269. package/dist/plugins/events/index.d.ts.map +1 -0
  270. package/dist/plugins/events.cjs +1 -0
  271. package/dist/plugins/events.d.cts +1 -0
  272. package/dist/plugins/events.d.ts +1 -0
  273. package/dist/plugins/events.development.cjs +1 -0
  274. package/dist/plugins/events.development.js +174 -0
  275. package/dist/plugins/events.js +159 -0
  276. package/dist/plugins/observers/index.d.cts +23 -0
  277. package/dist/plugins/observers/index.d.ts +23 -0
  278. package/dist/plugins/observers/index.d.ts.map +1 -0
  279. package/dist/plugins/observers/observer_registry.d.cts +101 -0
  280. package/dist/plugins/observers/observer_registry.d.ts +101 -0
  281. package/dist/plugins/observers/observer_registry.d.ts.map +1 -0
  282. package/dist/plugins/observers.cjs +1 -0
  283. package/dist/plugins/observers.d.cts +1 -0
  284. package/dist/plugins/observers.d.ts +1 -0
  285. package/dist/plugins/observers.development.cjs +1 -0
  286. package/dist/plugins/observers.development.js +431 -0
  287. package/dist/plugins/observers.js +403 -0
  288. package/dist/plugins/relation_store-BsoegrZh.js +313 -0
  289. package/dist/plugins/relation_store-DQKSnxsm.cjs +1 -0
  290. package/dist/plugins/relation_store-RBhpcE28.cjs +1 -0
  291. package/dist/plugins/relation_store-RqW5Snx6.js +328 -0
  292. package/dist/plugins/relations/builtin_relations.d.cts +48 -0
  293. package/dist/plugins/relations/builtin_relations.d.ts +48 -0
  294. package/dist/plugins/relations/builtin_relations.d.ts.map +1 -0
  295. package/dist/plugins/relations/facade.d.cts +73 -0
  296. package/dist/plugins/relations/facade.d.ts +73 -0
  297. package/dist/plugins/relations/facade.d.ts.map +1 -0
  298. package/dist/plugins/relations/index.d.cts +11 -0
  299. package/dist/plugins/relations/index.d.ts +11 -0
  300. package/dist/plugins/relations/index.d.ts.map +1 -0
  301. package/dist/{core/ecs → plugins/relations}/relation_service.d.cts +85 -97
  302. package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +85 -97
  303. package/dist/plugins/relations/relation_service.d.ts.map +1 -0
  304. package/dist/plugins/relations/relation_store.d.cts +177 -0
  305. package/dist/plugins/relations/relation_store.d.ts +177 -0
  306. package/dist/plugins/relations/relation_store.d.ts.map +1 -0
  307. package/dist/plugins/relations.cjs +1 -0
  308. package/dist/plugins/relations.d.cts +1 -0
  309. package/dist/plugins/relations.d.ts +1 -0
  310. package/dist/plugins/relations.development.cjs +1 -0
  311. package/dist/plugins/relations.development.js +603 -0
  312. package/dist/plugins/relations.js +553 -0
  313. package/dist/plugins/snapshots/index.d.cts +33 -0
  314. package/dist/plugins/snapshots/index.d.ts +33 -0
  315. package/dist/plugins/snapshots/index.d.ts.map +1 -0
  316. package/dist/plugins/snapshots/resume.d.cts +57 -0
  317. package/dist/plugins/snapshots/resume.d.ts +57 -0
  318. package/dist/plugins/snapshots/resume.d.ts.map +1 -0
  319. package/dist/plugins/snapshots/snapshot_service.d.cts +59 -0
  320. package/dist/plugins/snapshots/snapshot_service.d.ts +59 -0
  321. package/dist/plugins/snapshots/snapshot_service.d.ts.map +1 -0
  322. package/dist/plugins/snapshots.cjs +1 -0
  323. package/dist/plugins/snapshots.d.cts +1 -0
  324. package/dist/plugins/snapshots.d.ts +1 -0
  325. package/dist/plugins/snapshots.development.cjs +1 -0
  326. package/dist/plugins/snapshots.development.js +737 -0
  327. package/dist/plugins/snapshots.js +737 -0
  328. package/dist/plugins/solid/index.d.cts +8 -0
  329. package/dist/plugins/solid/index.d.ts +8 -0
  330. package/dist/plugins/solid/index.d.ts.map +1 -0
  331. package/dist/plugins/solid/solid.d.cts +97 -0
  332. package/dist/plugins/solid/solid.d.ts +97 -0
  333. package/dist/plugins/solid/solid.d.ts.map +1 -0
  334. package/dist/plugins/solid.cjs +1 -0
  335. package/dist/plugins/solid.d.cts +1 -0
  336. package/dist/plugins/solid.d.ts +1 -0
  337. package/dist/plugins/solid.development.cjs +1 -0
  338. package/dist/plugins/solid.development.js +319 -0
  339. package/dist/plugins/solid.js +319 -0
  340. package/dist/plugins/workers/index.d.cts +75 -0
  341. package/dist/plugins/workers/index.d.ts +75 -0
  342. package/dist/plugins/workers/index.d.ts.map +1 -0
  343. package/dist/plugins/workers/node_threads.d.cts +25 -0
  344. package/dist/plugins/workers/node_threads.d.ts +25 -0
  345. package/dist/plugins/workers/node_threads.d.ts.map +1 -0
  346. package/dist/plugins/workers/plan.d.cts +61 -0
  347. package/dist/plugins/workers/plan.d.ts +61 -0
  348. package/dist/plugins/workers/plan.d.ts.map +1 -0
  349. package/dist/plugins/workers/pool.d.cts +144 -0
  350. package/dist/plugins/workers/pool.d.ts +144 -0
  351. package/dist/plugins/workers/pool.d.ts.map +1 -0
  352. package/dist/plugins/workers/protocol.d.cts +112 -0
  353. package/dist/plugins/workers/protocol.d.ts +112 -0
  354. package/dist/plugins/workers/protocol.d.ts.map +1 -0
  355. package/dist/plugins/workers/worker_bind.d.cts +64 -0
  356. package/dist/plugins/workers/worker_bind.d.ts +64 -0
  357. package/dist/plugins/workers/worker_bind.d.ts.map +1 -0
  358. package/dist/plugins/workers/worker_loop.d.cts +14 -0
  359. package/dist/plugins/workers/worker_loop.d.ts +14 -0
  360. package/dist/plugins/workers/worker_loop.d.ts.map +1 -0
  361. package/dist/plugins/workers.cjs +1 -0
  362. package/dist/plugins/workers.d.cts +1 -0
  363. package/dist/plugins/workers.d.ts +1 -0
  364. package/dist/plugins/workers.development.cjs +1 -0
  365. package/dist/plugins/workers.development.js +596 -0
  366. package/dist/plugins/workers.js +474 -0
  367. package/dist/primitives.cjs +1 -1
  368. package/dist/primitives.d.cts +4 -4
  369. package/dist/primitives.d.ts +4 -4
  370. package/dist/primitives.development.cjs +1 -1
  371. package/dist/primitives.development.js +66 -22
  372. package/dist/primitives.js +66 -22
  373. package/dist/shared-BKl12xF1.js +132 -0
  374. package/dist/shared-Dk-pACZT.cjs +1 -0
  375. package/dist/shared.cjs +1 -1
  376. package/dist/shared.d.cts +7 -7
  377. package/dist/shared.d.ts +7 -7
  378. package/dist/shared.d.ts.map +1 -1
  379. package/dist/shared.development.cjs +1 -1
  380. package/dist/shared.development.js +4 -3
  381. package/dist/shared.js +4 -3
  382. package/dist/topological_sort-Cc_yXqPT.js +346 -0
  383. package/dist/topological_sort-vp1imU6D.cjs +1 -0
  384. package/dist/type_primitives/assertions.d.cts +12 -16
  385. package/dist/type_primitives/assertions.d.ts +12 -16
  386. package/dist/type_primitives/assertions.d.ts.map +1 -1
  387. package/dist/type_primitives/binary_heap/binary_heap.d.cts +2 -6
  388. package/dist/type_primitives/binary_heap/binary_heap.d.ts +2 -6
  389. package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
  390. package/dist/type_primitives/bitset/bitset.d.cts +7 -11
  391. package/dist/type_primitives/bitset/bitset.d.ts +7 -11
  392. package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
  393. package/dist/type_primitives/brand.d.cts +2 -7
  394. package/dist/type_primitives/brand.d.ts +2 -7
  395. package/dist/type_primitives/brand.d.ts.map +1 -1
  396. package/dist/type_primitives/error.d.cts +1 -2
  397. package/dist/type_primitives/error.d.ts +1 -2
  398. package/dist/type_primitives/error.d.ts.map +1 -1
  399. package/dist/type_primitives/index.d.cts +1 -1
  400. package/dist/type_primitives/index.d.ts +1 -1
  401. package/dist/type_primitives/sparse_map/sparse_map.d.cts +3 -7
  402. package/dist/type_primitives/sparse_map/sparse_map.d.ts +3 -7
  403. package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
  404. package/dist/type_primitives/sparse_set/sparse_set.d.cts +2 -6
  405. package/dist/type_primitives/sparse_set/sparse_set.d.ts +2 -6
  406. package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
  407. package/dist/type_primitives/topological_sort/topological_sort.d.cts +1 -5
  408. package/dist/type_primitives/topological_sort/topological_sort.d.ts +1 -5
  409. package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
  410. package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +16 -15
  411. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +16 -15
  412. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
  413. package/dist/utils/error.d.ts.map +1 -1
  414. package/dist/version.d.cts +3 -3
  415. package/dist/version.d.ts +3 -3
  416. package/dist/worker.cjs +1 -0
  417. package/dist/worker.d.cts +17 -0
  418. package/dist/worker.d.ts +17 -0
  419. package/dist/worker.d.ts.map +1 -0
  420. package/dist/worker.development.cjs +1 -0
  421. package/dist/worker.development.js +253 -0
  422. package/dist/worker.js +253 -0
  423. package/package.json +363 -191
  424. package/dist/core/ecs/builtin_relations.d.cts +0 -43
  425. package/dist/core/ecs/builtin_relations.d.ts +0 -43
  426. package/dist/core/ecs/builtin_relations.d.ts.map +0 -1
  427. package/dist/core/ecs/event_registry.d.cts +0 -22
  428. package/dist/core/ecs/event_registry.d.ts +0 -22
  429. package/dist/core/ecs/event_registry.d.ts.map +0 -1
  430. package/dist/core/ecs/relation_service.d.ts.map +0 -1
  431. package/dist/core/ecs/resume.d.cts +0 -85
  432. package/dist/core/ecs/resume.d.ts +0 -85
  433. package/dist/core/ecs/resume.d.ts.map +0 -1
  434. package/dist/core/ecs/snapshot_service.d.cts +0 -94
  435. package/dist/core/ecs/snapshot_service.d.ts +0 -94
  436. package/dist/core/ecs/snapshot_service.d.ts.map +0 -1
  437. package/dist/extensions/editor/editor.d.ts.map +0 -1
  438. package/dist/extensions/editor/field_handle.d.ts.map +0 -1
  439. package/dist/extensions/editor/index.cjs +0 -1
  440. package/dist/extensions/editor/index.d.cts +0 -21
  441. package/dist/extensions/editor/index.d.ts +0 -21
  442. package/dist/extensions/editor/index.d.ts.map +0 -1
  443. package/dist/extensions/editor/index.development.cjs +0 -1
  444. package/dist/extensions/reactive/ecs_sync.d.cts +0 -214
  445. package/dist/extensions/reactive/ecs_sync.d.ts +0 -214
  446. package/dist/extensions/reactive/ecs_sync.d.ts.map +0 -1
  447. package/dist/extensions/reactive/index.cjs +0 -1
  448. package/dist/extensions/reactive/index.d.cts +0 -23
  449. package/dist/extensions/reactive/index.d.ts +0 -23
  450. package/dist/extensions/reactive/index.d.ts.map +0 -1
  451. package/dist/extensions/reactive/index.development.cjs +0 -1
  452. package/dist/extensions/reactive/index.development.js +0 -215
  453. package/dist/extensions/reactive/index.js +0 -215
  454. package/dist/extensions/solid/index.cjs +0 -1
  455. package/dist/extensions/solid/index.d.cts +0 -6
  456. package/dist/extensions/solid/index.d.ts +0 -6
  457. package/dist/extensions/solid/index.d.ts.map +0 -1
  458. package/dist/extensions/solid/index.development.cjs +0 -1
  459. package/dist/extensions/solid/index.development.js +0 -40
  460. package/dist/extensions/solid/index.js +0 -36
  461. package/dist/extensions/solid/kernel_solid.d.cts +0 -45
  462. package/dist/extensions/solid/kernel_solid.d.ts +0 -45
  463. package/dist/extensions/solid/kernel_solid.d.ts.map +0 -1
  464. package/dist/host_commands-BlR3oZ3x.js +0 -2406
  465. package/dist/host_commands-C2cpU3yC.cjs +0 -1
  466. package/dist/internal-BoxWl4dG.js +0 -2565
  467. package/dist/internal-CGBEwfeB.cjs +0 -2
  468. package/dist/interop-CT-REx0W.cjs +0 -1
  469. package/dist/interop-CcY6ASQc.js +0 -18
  470. package/dist/interop-DqxleBo7.js +0 -18
  471. package/dist/interop-T1HZ-Dpa.cjs +0 -1
  472. package/dist/kernel-Cz2Kxlwl.js +0 -240
  473. package/dist/kernel-DgyrLFjW.js +0 -227
  474. package/dist/kernel-sw7ScKWu.cjs +0 -1
  475. package/dist/kernel-yWV3XnAb.cjs +0 -1
  476. package/dist/reactive/array.d.cts +0 -24
  477. package/dist/reactive/array.d.ts +0 -24
  478. package/dist/reactive/array.d.ts.map +0 -1
  479. package/dist/reactive/index.cjs +0 -1
  480. package/dist/reactive/index.d.cts +0 -11
  481. package/dist/reactive/index.d.ts +0 -11
  482. package/dist/reactive/index.d.ts.map +0 -1
  483. package/dist/reactive/index.development.cjs +0 -1
  484. package/dist/reactive/index.development.js +0 -18
  485. package/dist/reactive/index.js +0 -18
  486. package/dist/reactive/interop.d.cts +0 -19
  487. package/dist/reactive/interop.d.ts +0 -19
  488. package/dist/reactive/interop.d.ts.map +0 -1
  489. package/dist/reactive/kernel.d.cts +0 -73
  490. package/dist/reactive/kernel.d.ts +0 -73
  491. package/dist/reactive/kernel.d.ts.map +0 -1
  492. package/dist/reactive/map.d.cts +0 -16
  493. package/dist/reactive/map.d.ts +0 -16
  494. package/dist/reactive/map.d.ts.map +0 -1
  495. package/dist/reactive/shallow.d.cts +0 -11
  496. package/dist/reactive/shallow.d.ts +0 -11
  497. package/dist/reactive/shallow.d.ts.map +0 -1
  498. package/dist/reactive/struct.d.cts +0 -10
  499. package/dist/reactive/struct.d.ts +0 -10
  500. package/dist/reactive/struct.d.ts.map +0 -1
  501. package/dist/shallow-Bs39EPh1.js +0 -150
  502. package/dist/shallow-C5YmTbtb.cjs +0 -1
  503. package/dist/shallow-CiFC70Dz.js +0 -159
  504. package/dist/shallow-DQ8aG51_.cjs +0 -1
  505. package/dist/shared-B4v0L1cw.js +0 -109
  506. package/dist/shared-DU78k0pU.cjs +0 -1
  507. package/dist/topological_sort-BDvEyb9W.cjs +0 -1
  508. package/dist/topological_sort-DK6EjpWa.js +0 -135
  509. package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
  510. package/dist/typed_arrays-DIVwVy5_.js +0 -258
@@ -1,93 +1,110 @@
1
1
  /**
2
- * BufferAllocator pluggable buffer source for the SAB layer.
2
+ * BufferAllocator, pluggable buffer source for the SAB layer.
3
3
  *
4
4
  * The engine has historically allocated its SAB as a fresh
5
5
  * `new SharedArrayBuffer(totalBytes)` inside `createColumnStore`.
6
6
  * A WASM backend needs the SAB to optionally be backed by a
7
- * `WebAssembly.Memory.buffer` instead, so the sim can read and write the live
7
+ * `WebAssembly.Memory.buffer` instead, so a compute backend can read and write the live
8
8
  * ECS columns through its own memory handle. This module abstracts the
9
9
  * "where does the buffer come from" decision behind a single function
10
10
  * type.
11
11
  *
12
12
  * Contract for every `BufferAllocator`:
13
13
  * - Returns a `SharedArrayBuffer` of byteLength >= `bytes`.
14
- * - MAY detach any prior buffer the implementation has handed out
14
+ * - May detach any prior buffer the implementation has handed out
15
15
  * (e.g., `WebAssembly.Memory.grow` detaches existing typed-array
16
- * views into the previous buffer). Callers MUST snapshot any data
17
- * they need to preserve BEFORE invoking the allocator.
18
- * - Returned buffers MAY be larger than `bytes` (e.g., wasm-memory
16
+ * views into the previous buffer). Callers must snapshot any data
17
+ * they need to preserve before invoking the allocator.
18
+ * - Returned buffers may be larger than `bytes` (e.g., wasm-memory
19
19
  * rounds up to 64 KiB page boundaries). Callers must rely on the
20
- * SAB header / descriptor for the canonical layout, not on
20
+ * SAB header and descriptor for the canonical layout, not on
21
21
  * `buffer.byteLength`.
22
22
  *
23
- * The default `DEFAULT_SAB_ALLOCATOR` does `new SharedArrayBuffer(bytes)`
24
- * fast, allocation-per-call, prior buffers untouched. Production code
23
+ * The default `DEFAULT_SAB_ALLOCATOR` does `new SharedArrayBuffer(bytes)`,
24
+ * fast, allocation-per-call, prior buffers untouched. Production code
25
25
  * paths that don't care about wasm interop stay on this.
26
26
  *
27
27
  * `wasmMemoryAllocator(memory)` returns an allocator that grows the
28
28
  * given `WebAssembly.Memory` (in 64 KiB page increments) as needed and
29
29
  * returns its current buffer. Used by a host so the
30
- * engine's SAB IS the sim's memory.
30
+ * engine's SAB is the module's own memory.
31
31
  */
32
32
  /**
33
33
  * Source of `SharedArrayBuffer`s for the SAB layer. See the file header
34
- * for the contract in particular, the detachment caveat for in-place
34
+ * for the contract, in particular, the detachment caveat for in-place
35
35
  * implementations.
36
36
  *
37
37
  * The optional `isInPlace` marker tells the SAB layer that
38
38
  * **TypedArray and DataView views built over a returned buffer remain
39
- * valid after a subsequent allocator call** reads and writes through
39
+ * valid after a subsequent allocator call**, reads and writes through
40
40
  * the old views land on the same underlying memory the new buffer
41
41
  * exposes. The `extendColumnStore` fast path uses this hint to skip the
42
42
  * snapshot+restore + view-rebuild work that's only necessary when the
43
43
  * memory actually moves.
44
44
  *
45
- * Note: `isInPlace` does NOT promise the SAB *reference* stays
45
+ * `isInPlace` does not promise the SAB *reference* stays
46
46
  * identical. `growableSabAllocator` happens to return the same SAB
47
47
  * instance every time (`SharedArrayBuffer.prototype.grow` resizes in
48
- * place); `wasmMemoryAllocator` on shared `WebAssembly.Memory`
48
+ * place). `wasmMemoryAllocator` on shared `WebAssembly.Memory`
49
49
  * returns a *new* SAB ref after `memory.grow()`, but old views built
50
- * over the previous ref keep working V8 keeps the underlying linear
51
- * memory mapped at the same address. Verified empirically (this branch,
52
- * Bun + V8): writes via an old `Int32Array(old_ref, off, len)` after
50
+ * over the previous ref keep working. V8 keeps the underlying linear
51
+ * memory mapped at the same address. Verified empirically on Bun and V8:
52
+ * writes via an old `Int32Array(old_ref, off, len)` after
53
53
  * `memory.grow()` are visible through a fresh view over the new ref,
54
- * and vice versa. Default allocator omits the marker;
54
+ * and vice versa. Default allocator omits the marker
55
55
  * `growableSabAllocator` and `wasmMemoryAllocator` set it.
56
56
  */
57
57
  export interface BufferAllocator {
58
58
  /** Returns a buffer of byteLength >= `bytes`. The historical name is
59
- * "SAB", but the return is `ArrayBufferLike`: `growableSabAllocator` /
59
+ * "SAB", but the return is `ArrayBufferLike`. `growableSabAllocator` and
60
60
  * `wasmMemoryAllocator` produce a `SharedArrayBuffer` (the SAB profile),
61
- * while `heapArraybufferAllocator` produces a plain fixed (non-resizable)
62
- * `ArrayBuffer` reserved at the cap (the pure-TS heap profile no
61
+ * while `heapArrayBufferAllocator` produces a plain fixed (non-resizable)
62
+ * `ArrayBuffer` reserved at the cap (the pure-TS heap profile, no
63
63
  * cross-origin isolation required). The store layer treats the backing
64
- * uniformly; only the WASM/worker boundary narrows back to
64
+ * uniformly. Only the WASM or worker boundary narrows back to
65
65
  * `SharedArrayBuffer`. */
66
66
  (bytes: number): ArrayBufferLike;
67
67
  readonly isInPlace?: boolean;
68
+ /**
69
+ * The allocator reserves the whole cap in one buffer at the first call, and
70
+ * the buffer never grows.
71
+ *
72
+ * `byteLength` then holds the cap and not the used size, so the tail cursor
73
+ * for a new column region must come from the header `capacity` instead. See
74
+ * `tailCursorBytes`. An allocator that grows its buffer to the live extent
75
+ * omits this marker, because for it `byteLength` is the tail.
76
+ *
77
+ * This is a property of the allocator and not of the buffer class. The heap
78
+ * profile reserves a fixed `ArrayBuffer`, and `fixedSabAllocator` reserves a
79
+ * fixed `SharedArrayBuffer` for the same reason. Both need the same tail
80
+ * rule.
81
+ */
82
+ readonly reservedAtCap?: boolean;
68
83
  }
69
84
  /**
70
85
  * The only allocator shape a **live `Store`** accepts. The engine makes
71
- * "a live Store is backed by an in-place allocator" a correctness invariant
86
+ * "a live Store is backed by an in-place allocator" a correctness invariant,
72
87
  * the flush loops hoist entity-index views across grows. This brand moves
73
- * that invariant from runtime convention to the type/construction boundary:
74
- * `growableSabAllocator` / `wasmMemoryAllocator` / `heapArraybufferAllocator`
75
- * return it; `DEFAULT_SAB_ALLOCATOR` keeps the wide `BufferAllocator` type and
76
- * therefore cannot typecheck where a live-Store backing is required. Non-in-place
77
- * allocators remain valid for snapshot/test sizing only. The brand says nothing
78
- * about *shared* vs *heap* backing — `heapArraybufferAllocator`'s fixed
79
- * `ArrayBuffer` is just as in-place as a growable SAB: it is reserved at the full
80
- * cap up front and never moves, so grow/extend relocate columns *within* it
81
- * (`copyWithin`) rather than resizing the buffer existing views stay valid, the
82
- * same guarantee `SharedArrayBuffer.prototype.grow` gives by resizing in place.
88
+ * that invariant from runtime convention to the type and construction boundary.
89
+ * `growableSabAllocator`, `wasmMemoryAllocator` and `heapArrayBufferAllocator`
90
+ * return it. `DEFAULT_SAB_ALLOCATOR` keeps the wide `BufferAllocator` type, so
91
+ * it cannot typecheck where a live-Store backing is required. An allocator that
92
+ * is not in-place stays valid for snapshot or test sizing only.
93
+ *
94
+ * The brand says nothing about *shared* against *heap* backing.
95
+ * `heapArrayBufferAllocator`'s fixed `ArrayBuffer` is as in-place as a growable
96
+ * SAB. It is reserved at the full cap up front and never moves, so grow and
97
+ * extend relocate columns *within* it (`copyWithin`) rather than resizing the
98
+ * buffer. Existing views stay valid, the same guarantee
99
+ * `SharedArrayBuffer.prototype.grow` gives by resizing in place.
83
100
  */
84
101
  export type InPlaceBufferAllocator = BufferAllocator & {
85
102
  readonly isInPlace: true;
86
103
  };
87
104
  /**
88
105
  * Thrown when an allocator cannot satisfy a request because its by-design
89
- * byte ceiling is reached (the cap is a runaway-growth signal, not a
90
- * limit to paper over there is deliberately no grow-beyond-cap fallback).
106
+ * byte ceiling is reached. The cap is a runaway-growth signal, not a limit to
107
+ * paper over, so there is deliberately no grow-beyond-cap fallback.
91
108
  * Typed so `Store`'s grow handler can recognise the cap case and re-throw
92
109
  * with the caller's declared sizing intent attached without ever
93
110
  * catching-to-recover.
@@ -105,8 +122,8 @@ export declare class StoreCapExceededError extends Error {
105
122
  /** Thrown when a **SAB-producing** allocator runs in an environment that
106
123
  * doesn't expose `SharedArrayBuffer`. The fix is environment-level (the host
107
124
  * must serve the page cross-origin isolated, or be a runtime like Bun that
108
- * exposes SAB unconditionally) OR choose the pure-TS heap profile
109
- * (`memory: { heap: {} }` / `heapArraybufferAllocator`), which needs no SAB
125
+ * exposes SAB unconditionally). Or choose the pure-TS heap profile
126
+ * (`memory: { backing: "heap" }`, `heapArrayBufferAllocator`), which needs no SAB
110
127
  * and no cross-origin isolation. Lives on the allocator (not the store)
111
128
  * because the allocator is the only thing that constructs a SAB. */
112
129
  export declare class SabUnavailableError extends Error {
@@ -116,78 +133,80 @@ export declare class SabUnavailableError extends Error {
116
133
  * Allocate a fresh `SharedArrayBuffer` per call. Prior buffers are
117
134
  * untouched and remain valid for as long as the caller holds references.
118
135
  * This is the default used by `createColumnStore` when no allocator is
119
- * provided. Throws `SabUnavailableError` in a runtime without SAB the
136
+ * provided. Throws `SabUnavailableError` in a runtime without SAB, the
120
137
  * availability check lives here (the SAB-producing seam), not in
121
138
  * `createColumnStore`, so a heap allocator never trips it.
122
139
  */
123
140
  export declare const DEFAULT_SAB_ALLOCATOR: BufferAllocator;
124
141
  /**
125
142
  * Allocator that backs the SAB by a single growable `SharedArrayBuffer`
126
- * (created with `{ maxByteLength: maxBytes }`). First call allocates;
127
- * subsequent calls `.grow(bytes)` the existing buffer and return it.
143
+ * (created with `{ maxByteLength: maxBytes }`). The first call allocates. A
144
+ * later call grows the existing buffer and returns it.
145
+ *
146
+ * JavaScriptCore pays for the growth. It has no fast store path for a
147
+ * TypedArray view over a growable `SharedArrayBuffer`. A column read costs what
148
+ * a fixed buffer costs, but every column write costs far more. A system that
149
+ * writes a column in a loop is thus much slower here than the same system on
150
+ * the heap profile. The cost is per access and not per byte, so a small world
151
+ * pays the same penalty as a large one. V8 shows no such difference at the time
152
+ * of measurement. Safari and Bun are JavaScriptCore.
153
+ *
154
+ * Use `fixedSabAllocator` if you need a shared buffer and your code runs on
155
+ * JavaScriptCore. It reserves the cap at construction and keeps the fast store
156
+ * path on both engine families. It gives up the growth, and nothing else.
128
157
  *
129
158
  * The `isInPlace` marker is set so `extendColumnStore` knows it can
130
- * reuse the buffer rather than allocating fresh and copying data
159
+ * reuse the buffer rather than allocating fresh and copying data,
131
160
  * existing typed-array views built with explicit `(byteOffset, length)`
132
161
  * stay valid after `.grow()` in Bun + V8 (the underlying mapping extends
133
162
  * in place rather than relocating).
134
163
  *
135
- * Sizing: `maxBytes` is committed *virtual* memory, not resident RAM —
164
+ * Sizing: `maxBytes` is committed *virtual* memory, not resident ram,
136
165
  * physical pages fault in lazily as the SAB actually grows. A larger cap costs
137
166
  * more time per allocation than a smaller one, because V8 does per-byte
138
- * bookkeeping when it constructs the buffer. The cost increases with the cap, so
139
- * a 1 GiB cap is the slowest of the sizes we measured and a 1 MiB cap the
140
- * quickest. A caller with a bigger world can pass a larger cap; a caller that
141
- * stays under the 256 MiB default keeps the quicker Store construction.
167
+ * bookkeeping when it constructs the buffer. A caller with a bigger world can
168
+ * pass a larger cap. A caller that stays under the 256 MiB default keeps the
169
+ * quicker Store construction.
142
170
  *
143
- * THE 256 MiB DEFAULT IS A HARD DESIGN CEILING, NOT A SOFT TARGET and
144
- * exceeding it is INTENDED to be fatal. There is deliberately no
171
+ * The 256 MiB default is a hard design ceiling, not a soft target, and
172
+ * exceeding it is intended to be fatal. There is deliberately no
145
173
  * grow-beyond-cap fallback or compaction pass (see the loud
146
174
  * note at the `bytes > maxBytes` throw below). If you are here because
147
175
  * a workload died at the cap and you are tempted to add a fresh-allocator
148
- * realloc fallback: don't, unless the numbers below have changed. They
149
- * say the cap is structurally unreachable for a real workload.
176
+ * realloc fallback: don't. The cap is structurally out of reach for a real
177
+ * workload.
150
178
  *
151
- * Measured footprint of a real 2-party workload (instrumented, 2026-05;
152
- * do NOT trust the old "~500 archetypes × 64-capacity ≈ 2 MiB" figure
153
- * that used to live here it was wrong on every term):
154
- * - Total SAB capacity 16.2 MiB ~6% of the cap.
155
- * - ~12 MiB of that is the entity-index region's *virtual* reservation
156
- * (`ENTITY_INDEX_DEFAULT_CAPACITY = 1<<20` slots × 12 B); only ~12 KiB
157
- * of it is physically resident for a 1000-entity workload.
158
- * - Only ~5 archetypes are prewarmed (no lazy archetypes), each at
159
- * `DEFAULT_COLUMN_CAPACITY = 1024` rows NOT 64. Live column data is
160
- * ~0.1 MiB; a fully-populated entity row is ~49 B.
161
- * - Columns never trigger a grow: 1024 initial capacity already covers the
162
- * ~1000-row budget, so the doubling + in-place hole tax never fires on
163
- * the hot path.
164
- * The entity-ID space itself caps total live entities at `1<<20` ≈ 1M
165
- * (20-bit index in `EntityID`). Even at that absolute ceiling — ~1M rows
166
- * × 49 B × ~3 (post-double capacity + abandoned holes) ≈ ~150 MiB columns
167
- * + 12 MiB index — the workload still lands under 256 MiB. You cannot reach
168
- * the cap without first exhausting the entity-ID space. Hitting it
169
- * therefore signals a real defect upstream (runaway entity creation), not
170
- * a sizing shortfall to paper over.
179
+ * Why it is out of reach. The entity-index region dominates the footprint, and
180
+ * it is a virtual reservation of `ENTITY_INDEX_DEFAULT_CAPACITY` (1<<20) slots
181
+ * of `ENTITY_INDEX_BYTES_PER_SLOT` each, of which only the touched pages are
182
+ * resident. Live column data is a small part beside it, because an archetype
183
+ * is prewarmed at `DEFAULT_COLUMN_CAPACITY` rows and a real world stays inside
184
+ * that, so a column grow never fires on the hot path. The entity-id space caps
185
+ * live entities at `1<<20` (the 20-bit index in `EntityID`). Even at that
186
+ * ceiling, the columns plus the index still land under the default cap. You
187
+ * cannot reach the cap without first exhausting the entity-id space. Hitting
188
+ * it therefore signals a real defect upstream (runaway entity creation), not a
189
+ * sizing shortfall to paper over.
171
190
  *
172
191
  * Cited verification: a Bun runtime check
173
192
  * confirms `new Int32Array(buffer, off, len)` retains identical byteOffset,
174
- * length, and stored values after `.grow()`; DataView byteLength
193
+ * length, and stored values after `.grow()`. DataView byteLength
175
194
  * auto-tracks the grown buffer.
176
195
  *
177
196
  * Used by the `extendColumnStore` fast path during lazy archetype
178
- * registration keeps existing column views valid so
197
+ * registration, keeps existing column views valid so
179
198
  * `refreshViews` is a no-op for old archetypes.
180
199
  */
181
200
  export declare function growableSabAllocator(maxBytes?: number): InPlaceBufferAllocator;
182
201
  /**
183
202
  * Allocator that backs the store by a single **fixed (non-resizable) plain
184
203
  * `ArrayBuffer`** reserved at the full `maxBytes` cap up front. This is the
185
- * pure-TS **heap profile** the oecs default: no `SharedArrayBuffer`,
204
+ * pure-TS **heap profile**, the oecs default: no `SharedArrayBuffer`,
186
205
  * hence no cross-origin isolation
187
- * (COOP/COEP) requirement, and no worker/WASM transfer (single-process worlds
206
+ * (COOP and COEP) requirement, and no worker or WASM transfer (single-process worlds
188
207
  * only).
189
208
  *
190
- * WHY FIXED, NOT RESIZABLE (the 0.5.3 iteration-perf fix): V8 has no fast
209
+ * Why fixed, not resizable (the 0.5.3 iteration-perf fix): V8 has no fast
191
210
  * element-access path for TypedArray views over a **resizable or growable**
192
211
  * `ArrayBuffer`, because each `col[i]` reads the mutable length again. Thus a
193
212
  * loop over a column is much slower than the same loop over a fixed buffer.
@@ -197,48 +216,83 @@ export declare function growableSabAllocator(maxBytes?: number): InPlaceBufferAl
197
216
  *
198
217
  * How growth still works in place: the cap is reserved as one fixed buffer at
199
218
  * construction. A resizable buffer was originally chosen so `.resize()` could
200
- * grow in place without moving views; a fixed buffer never moves EITHER the
201
- * store's grow/extend relocate columns to the tail *within* this buffer
219
+ * grow in place without moving views. A fixed buffer never moves either, the
220
+ * store's grow and extend relocate columns to the tail *within* this buffer
202
221
  * (`copyWithin`), so the buffer object and every existing view stay valid.
203
222
  * `isInPlace: true` therefore still holds, and the
204
223
  * entity-index-hoist-across-grow invariant is preserved. The store keys its
205
- * tail cursor off the header `capacity` (the logical high-water), NOT
206
- * `buffer.byteLength` which is now always `maxBytes` (the same decoupling the
224
+ * tail cursor off the header `capacity` (the logical high-water), not
225
+ * `buffer.byteLength`, which is now always `maxBytes` (the same decoupling the
207
226
  * wasm page-rounded allocator already relied on).
208
227
  *
209
228
  * - Memory cost is unchanged: a fixed `ArrayBuffer(maxBytes)` faults pages in
210
229
  * lazily (untouched pages cost no RSS), exactly like the resizable buffer's
211
- * `maxByteLength` reservation a 256 MiB reservation on a 1000-entity world
212
- * stays a few MiB resident (measured ~4 MiB RSS, within ~1 MiB of the old
213
- * resizable buffer).
230
+ * `maxByteLength` reservation. A large reservation on a small world stays
231
+ * small in resident memory, the same as the old resizable buffer.
214
232
  * - same 256 MiB default cap with hard-ceiling semantics: a request
215
- * past `maxBytes` throws `StoreCapExceededError` runaway growth signal,
233
+ * past `maxBytes` throws `StoreCapExceededError`, runaway growth signal,
216
234
  * not a limit to route around.
217
235
  *
218
236
  * Why a non-shared buffer suffices: `Atomics` live only on the cross-thread
219
- * command/event/action rings, never on the core store path, so a single-process
220
- * world needs no sharing. `stateHash` determinism works here too FNV1a over
237
+ * command, event and action rings, never on the core store path, so a single-process
238
+ * world needs no sharing. `stateHash` determinism works here too. FNV1a over
221
239
  * column bytes is backing-agnostic.
222
240
  */
223
- export declare function heapArraybufferAllocator(maxBytes?: number): InPlaceBufferAllocator;
241
+ export declare function heapArrayBufferAllocator(maxBytes?: number): InPlaceBufferAllocator;
224
242
  /**
225
- * Allocator that backs the SAB by `memory.buffer` i.e. makes the engine's
243
+ * Allocator that backs the store by a single **fixed (non-growable)
244
+ * `SharedArrayBuffer`** reserved at the full `maxBytes` cap up front. This is
245
+ * the shared profile without the growth, and it exists for one measured
246
+ * reason.
247
+ *
248
+ * Why fixed, not growable: JavaScriptCore has no fast store path for a
249
+ * TypedArray view over a **growable** `SharedArrayBuffer`. A column read there
250
+ * costs what a fixed buffer costs, but every column write costs far
251
+ * more, so an iteration-bound system that updates a column is far slower on
252
+ * JavaScriptCore than the same system on the heap profile. Safari and Bun are
253
+ * JavaScriptCore. V8 shows no such difference at the time of measurement, so
254
+ * this is one engine family paying and the other not. A fixed buffer restores
255
+ * the fast store path on both.
256
+ *
257
+ * This is `heapArrayBufferAllocator` with a `SharedArrayBuffer` in place of the
258
+ * `ArrayBuffer`, and it keeps every property the shared profile needs: the
259
+ * buffer is shared, so a worker or a WASM module reads the same bytes, and it
260
+ * never moves, so views built over it stay valid. Growth still works the way
261
+ * the heap profile's does, the store relocates columns to the tail *within*
262
+ * the reserved buffer, and the tail comes from the header `capacity` because
263
+ * `reservedAtCap` says `byteLength` is the cap.
264
+ *
265
+ * The trade: the cap is reserved at construction instead of growing into. That
266
+ * is address space and not resident memory, the same as the heap profile's
267
+ * reservation.
268
+ */
269
+ export declare function fixedSabAllocator(maxBytes?: number): InPlaceBufferAllocator;
270
+ /**
271
+ * Allocator that backs the SAB by `memory.buffer`, i.e. makes the engine's
226
272
  * live SAB *be* a WASM module's `WebAssembly.Memory`. Grows the memory in
227
273
  * 64 KiB page increments when `bytes` exceeds the current buffer.
228
274
  *
275
+ * This backing is growable by nature. A shared `WebAssembly.Memory` gives a
276
+ * growable `SharedArrayBuffer` and can give nothing else. That looks like the
277
+ * shape `growableSabAllocator` warns about, and it is not. A probe measured a
278
+ * column write through a shared `WebAssembly.Memory` against the growable
279
+ * `SharedArrayBuffer` on JavaScriptCore and found no such cost. A WASM-backed
280
+ * world costs what the heap profile costs on every runtime tested, so
281
+ * `fixedSabAllocator` is no remedy here and none is needed.
282
+ *
229
283
  * This is the **opt-in storage backing for the WASM path**. A consumer
230
284
  * that attaches a WASM `ComputeBackend` passes
231
- * `bufferAllocator: wasmMemoryAllocator(memory)` so the Zig systems read/write
232
- * the same bytes the host's columns live in zero-copy across the FFI boundary.
233
- * It is NOT a match-context assumption: a pure-TS game omits `bufferAllocator` and
234
- * gets the default (`DEFAULT_SAB_ALLOCATOR` a fresh `SharedArrayBuffer` per
235
- * alloc) or opts into `growableSabAllocator` for the in-place fast path
236
- * without any WASM module. "The SAB is the WebAssembly.Memory" is thus a
285
+ * `bufferAllocator: wasmMemoryAllocator(memory)` so the module's systems read
286
+ * and write the same bytes the host's columns live in, zero-copy across the FFI
287
+ * boundary. A pure-TS world omits `bufferAllocator`
288
+ * and gets the default, `DEFAULT_SAB_ALLOCATOR`, a fresh `SharedArrayBuffer`
289
+ * per alloc. Or it opts into `growableSabAllocator` for the in-place fast path,
290
+ * with no WASM module at all. "The SAB is the WebAssembly.Memory" is thus a
237
291
  * property the WASM backend opts into, paid for only when WASM is in use.
238
292
  *
239
293
  * After `memory.grow()` on a *shared* memory, `memory.buffer` returns a
240
294
  * new `SharedArrayBuffer` reference, but **TypedArrays and DataViews
241
- * built over the previous reference remain valid** V8 keeps the
295
+ * built over the previous reference remain valid**. V8 keeps the
242
296
  * underlying linear memory mapped at the same address, so reads and
243
297
  * writes through old views land on the same bytes the new buffer
244
298
  * exposes. This is why `isInPlace: true` is safe here (verified
@@ -249,7 +303,7 @@ export declare function heapArraybufferAllocator(maxBytes?: number): InPlaceBuff
249
303
  * construct a fresh DataView over the post-grow buffer (the SAB-layer
250
304
  * extend path does this).
251
305
  *
252
- * Throws if `memory` was not constructed with `shared: true` the SAB
306
+ * Throws if `memory` was not constructed with `shared: true`, the SAB
253
307
  * contract requires `SharedArrayBuffer`-backed memory. Throws a contextual
254
308
  * error if a needed grow fails (cap reached or host refusal): the JS API's
255
309
  * `memory.grow` throws a RangeError on cap overrun rather than returning the
@@ -1 +1 @@
1
- {"version":3,"file":"allocator.d.ts","sourceRoot":"","sources":["../../../src/core/store/allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;8BAO0B;IAC1B,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC;AAEpF;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;aAG9B,cAAc,EAAE,MAAM;IACtC;6DACyD;aACzC,QAAQ,EAAE,MAAM,GAAG,IAAI;gBAJvC,OAAO,EAAE,MAAM,EACC,cAAc,EAAE,MAAM;IACtC;6DACyD;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvC,OAAO,CAAC,EAAE,YAAY;CAKvB;AAED;;;;;;oEAMoE;AACpE,qBAAa,mBAAoB,SAAQ,KAAK;;CAe7C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,eAGnC,CAAC;AAgEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,MAA0B,GAAG,sBAAsB,CA6BjG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,wBAAwB,CACvC,QAAQ,GAAE,MAA0B,GAClC,sBAAsB,CAsBxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,sBAAsB,CA4DtF"}
1
+ {"version":3,"file":"allocator.d.ts","sourceRoot":"","sources":["../../../src/core/store/allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;8BAO0B;IAC1B,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC;AAEpF;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;aAG9B,cAAc,EAAE,MAAM;IACtC;6DACyD;aACzC,QAAQ,EAAE,MAAM,GAAG,IAAI;gBAJvC,OAAO,EAAE,MAAM,EACC,cAAc,EAAE,MAAM;IACtC;6DACyD;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvC,OAAO,CAAC,EAAE,YAAY;CAKvB;AAED;;;;;;oEAMoE;AACpE,qBAAa,mBAAoB,SAAQ,KAAK;;CAe7C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,eAGnC,CAAC;AAsEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,MAA0B,GAAG,sBAAsB,CA6BjG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,wBAAwB,CACvC,QAAQ,GAAE,MAA0B,GAClC,sBAAsB,CAuBxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAA0B,GAAG,sBAAsB,CAqB9F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,sBAAsB,CA4DtF"}
@@ -1,9 +1,9 @@
1
1
  import { ColumnBacking } from '../../type_primitives/index.cjs';
2
2
  import { AnyTypedArray } from './column_store.cjs';
3
- /** Thrown when an operation would grow a fixed-capacity SAB column. The
4
- * grow path (re-allocate the SAB, bump `view_stamp`, rebuild views) is a
5
- * separate sub-task; until it lands, hitting capacity is a hard error so
6
- * the symptom surfaces immediately rather than silently corrupting state. */
3
+ /** Thrown when an operation would grow a fixed-capacity SAB column. The column
4
+ * does not own its buffer, so it cannot grow. The store's grow path
5
+ * (`growColumnStore`, then `refreshView`) is the only way capacity rises, and
6
+ * this throw makes a missed grow surface at once rather than corrupt state. */
7
7
  export declare class StoreColumnOverflowError extends Error {
8
8
  readonly capacity: number;
9
9
  readonly requested: number;
@@ -13,25 +13,25 @@ export declare class BufferBackedColumn<T extends AnyTypedArray> implements Colu
13
13
  private _buf;
14
14
  private _capacity;
15
15
  private _len;
16
- /** `view` MUST be a TypedArray constructed over a SAB at the correct
16
+ /** `view` must be a TypedArray constructed over a SAB at the correct
17
17
  * stride alignment (see `createColumnStore`). The column treats
18
- * `view.length` as the immutable capacity for the lifetime of this view
18
+ * `view.length` as the immutable capacity for the lifetime of this view,
19
19
  * call `refreshView` after a SAB realloc to point at the new view. */
20
20
  constructor(view: T);
21
21
  /** Swap the backing view to one over a freshly-grown SAB. The caller is
22
22
  * responsible for having copied the first `length` elements into
23
23
  * `newView` already (`growColumnStore` does this). The logical length is
24
- * preserved across the swap; capacity becomes `newView.length`.
24
+ * preserved across the swap. Capacity becomes `newView.length`.
25
25
  *
26
26
  * Used to honour the `view_stamp` invariant after a host-side SAB realloc:
27
27
  * every cached column view must be rebuilt before
28
- * the next read/write. */
28
+ * the next read or write. */
29
29
  refreshView(newView: T): void;
30
30
  get length(): number;
31
31
  get capacity(): number;
32
32
  push(value: number): void;
33
33
  pop(): number;
34
- get(i: number): number;
34
+ getAt(i: number): number;
35
35
  setAt(i: number, value: number): void;
36
36
  /** Move the last element into slot `i`, decrement length. Returns the
37
37
  * value previously at slot `i`. Matches `GrowableTypedArray.swapRemove`. */
@@ -40,22 +40,22 @@ export declare class BufferBackedColumn<T extends AnyTypedArray> implements Colu
40
40
  /** Set the logical length directly, declaring that `[0, len)` of the backing
41
41
  * SAB view already holds valid data. The snapshot-mount path
42
42
  * (`Archetype.restoreHostRows`) uses this to re-sync the column's
43
- * logical length with the restored `Archetype.length` the bytes come from
43
+ * logical length with the restored `Archetype.length`, the bytes come from
44
44
  * the restored SAB, but `_len` is host state. Throws on overrun (cannot grow
45
- * a fixed SAB view here the mount already adopted the restored capacity). */
45
+ * a fixed SAB view here, the mount already adopted the restored capacity). */
46
46
  setLength(len: number): void;
47
- /** Raw backing view. Stable for the lifetime of the SAB; views over a
47
+ /** Raw backing view. Stable for the lifetime of the SAB. Views over a
48
48
  * SAB do not invalidate the way a `GrowableTypedArray`'s `buf` does
49
49
  * after a grow. (`view_stamp` signals "underlying SAB swapped".) */
50
50
  get buf(): T;
51
51
  /** Zero-copy subarray of valid data (`0..length-1`). */
52
52
  view(): T;
53
53
  [Symbol.iterator](): Iterator<number>;
54
- /** Throw if the backing view cannot hold `capacity` elements. Mirrors
55
- * `GrowableTypedArray.ensureCapacity` but cannot allocate a SAB
56
- * grow requires republishing the underlying buffer and rebuilding views
57
- * across every archetype, which is the republish invariant. */
58
- ensureCapacity(capacity: number): void;
54
+ /** Throw if the view cannot hold `capacity` elements. The column does not own
55
+ * its buffer, so it cannot grow: a grow reallocates the store buffer and
56
+ * rebuilds the views of every archetype, which is the republish invariant.
57
+ * The allocator drives that path, and this method refuses it. */
58
+ reserve(capacity: number): void;
59
59
  /** Append `count` elements from `src[srcOffset..srcOffset+count]`.
60
60
  * Throws on overrun. */
61
61
  bulkAppend(src: T, srcOffset: number, count: number): void;
@@ -1,9 +1,9 @@
1
1
  import { ColumnBacking } from '../../type_primitives/index.js';
2
2
  import { AnyTypedArray } from './column_store.js';
3
- /** Thrown when an operation would grow a fixed-capacity SAB column. The
4
- * grow path (re-allocate the SAB, bump `view_stamp`, rebuild views) is a
5
- * separate sub-task; until it lands, hitting capacity is a hard error so
6
- * the symptom surfaces immediately rather than silently corrupting state. */
3
+ /** Thrown when an operation would grow a fixed-capacity SAB column. The column
4
+ * does not own its buffer, so it cannot grow. The store's grow path
5
+ * (`growColumnStore`, then `refreshView`) is the only way capacity rises, and
6
+ * this throw makes a missed grow surface at once rather than corrupt state. */
7
7
  export declare class StoreColumnOverflowError extends Error {
8
8
  readonly capacity: number;
9
9
  readonly requested: number;
@@ -13,25 +13,25 @@ export declare class BufferBackedColumn<T extends AnyTypedArray> implements Colu
13
13
  private _buf;
14
14
  private _capacity;
15
15
  private _len;
16
- /** `view` MUST be a TypedArray constructed over a SAB at the correct
16
+ /** `view` must be a TypedArray constructed over a SAB at the correct
17
17
  * stride alignment (see `createColumnStore`). The column treats
18
- * `view.length` as the immutable capacity for the lifetime of this view
18
+ * `view.length` as the immutable capacity for the lifetime of this view,
19
19
  * call `refreshView` after a SAB realloc to point at the new view. */
20
20
  constructor(view: T);
21
21
  /** Swap the backing view to one over a freshly-grown SAB. The caller is
22
22
  * responsible for having copied the first `length` elements into
23
23
  * `newView` already (`growColumnStore` does this). The logical length is
24
- * preserved across the swap; capacity becomes `newView.length`.
24
+ * preserved across the swap. Capacity becomes `newView.length`.
25
25
  *
26
26
  * Used to honour the `view_stamp` invariant after a host-side SAB realloc:
27
27
  * every cached column view must be rebuilt before
28
- * the next read/write. */
28
+ * the next read or write. */
29
29
  refreshView(newView: T): void;
30
30
  get length(): number;
31
31
  get capacity(): number;
32
32
  push(value: number): void;
33
33
  pop(): number;
34
- get(i: number): number;
34
+ getAt(i: number): number;
35
35
  setAt(i: number, value: number): void;
36
36
  /** Move the last element into slot `i`, decrement length. Returns the
37
37
  * value previously at slot `i`. Matches `GrowableTypedArray.swapRemove`. */
@@ -40,22 +40,22 @@ export declare class BufferBackedColumn<T extends AnyTypedArray> implements Colu
40
40
  /** Set the logical length directly, declaring that `[0, len)` of the backing
41
41
  * SAB view already holds valid data. The snapshot-mount path
42
42
  * (`Archetype.restoreHostRows`) uses this to re-sync the column's
43
- * logical length with the restored `Archetype.length` the bytes come from
43
+ * logical length with the restored `Archetype.length`, the bytes come from
44
44
  * the restored SAB, but `_len` is host state. Throws on overrun (cannot grow
45
- * a fixed SAB view here the mount already adopted the restored capacity). */
45
+ * a fixed SAB view here, the mount already adopted the restored capacity). */
46
46
  setLength(len: number): void;
47
- /** Raw backing view. Stable for the lifetime of the SAB; views over a
47
+ /** Raw backing view. Stable for the lifetime of the SAB. Views over a
48
48
  * SAB do not invalidate the way a `GrowableTypedArray`'s `buf` does
49
49
  * after a grow. (`view_stamp` signals "underlying SAB swapped".) */
50
50
  get buf(): T;
51
51
  /** Zero-copy subarray of valid data (`0..length-1`). */
52
52
  view(): T;
53
53
  [Symbol.iterator](): Iterator<number>;
54
- /** Throw if the backing view cannot hold `capacity` elements. Mirrors
55
- * `GrowableTypedArray.ensureCapacity` but cannot allocate a SAB
56
- * grow requires republishing the underlying buffer and rebuilding views
57
- * across every archetype, which is the republish invariant. */
58
- ensureCapacity(capacity: number): void;
54
+ /** Throw if the view cannot hold `capacity` elements. The column does not own
55
+ * its buffer, so it cannot grow: a grow reallocates the store buffer and
56
+ * rebuilds the views of every archetype, which is the republish invariant.
57
+ * The allocator drives that path, and this method refuses it. */
58
+ reserve(capacity: number): void;
59
59
  /** Append `count` elements from `src[srcOffset..srcOffset+count]`.
60
60
  * Throws on overrun. */
61
61
  bulkAppend(src: T, srcOffset: number, count: number): void;
@@ -1 +1 @@
1
- {"version":3,"file":"buffer_backed_column.d.ts","sourceRoot":"","sources":["../../../src/core/store/buffer_backed_column.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;6EAG6E;AAC7E,qBAAa,wBAAyB,SAAQ,KAAK;IAClD,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;gBAEtB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAM/C;AAED,qBAAa,kBAAkB,CAAC,CAAC,SAAS,aAAa,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACnF,OAAO,CAAC,IAAI,CAAI;IAChB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,IAAI,CAAK;IAEjB;;;0EAGsE;gBAC1D,IAAI,EAAE,CAAC;IAKnB;;;;;;;8BAO0B;IACnB,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI;IAQpC,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAEM,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOzB,GAAG,IAAI,MAAM;IAIb,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAItB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI5C;gFAC4E;IACrE,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM7B,KAAK,IAAI,IAAI;IAIpB;;;;;mFAK+E;IACxE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAOnC;;wEAEoE;IACpE,IAAW,GAAG,IAAI,CAAC,CAElB;IAED,wDAAwD;IACjD,IAAI,IAAI,CAAC;IAQhB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC;IAYrC;;;mEAG+D;IACxD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAM7C;4BACwB;IACjB,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAQjE,gDAAgD;IACzC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM5C;gEAC4D;IACrD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAK1D"}
1
+ {"version":3,"file":"buffer_backed_column.d.ts","sourceRoot":"","sources":["../../../src/core/store/buffer_backed_column.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;+EAG+E;AAC/E,qBAAa,wBAAyB,SAAQ,KAAK;IAClD,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;gBAEtB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAQ/C;AAED,qBAAa,kBAAkB,CAAC,CAAC,SAAS,aAAa,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACnF,OAAO,CAAC,IAAI,CAAI;IAChB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,IAAI,CAAK;IAEjB;;;0EAGsE;gBAC1D,IAAI,EAAE,CAAC;IAKnB;;;;;;;iCAO6B;IACtB,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI;IAQpC,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAEM,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOzB,GAAG,IAAI,MAAM;IAIb,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAIxB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI5C;gFAC4E;IACrE,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM7B,KAAK,IAAI,IAAI;IAIpB;;;;;kFAK8E;IACvE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAOnC;;wEAEoE;IACpE,IAAW,GAAG,IAAI,CAAC,CAElB;IAED,wDAAwD;IACjD,IAAI,IAAI,CAAC;IAQhB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC;IAYrC;;;qEAGiE;IAC1D,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMtC;4BACwB;IACjB,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAQjE,gDAAgD;IACzC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM5C;gEAC4D;IACrD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAK1D"}