@oasys/oecs 0.4.0 → 0.5.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 (272) hide show
  1. package/CHANGELOG.md +553 -0
  2. package/README.md +42 -31
  3. package/dist/core/ecs/access_check.d.cts +77 -0
  4. package/dist/core/ecs/access_check.d.ts +8 -8
  5. package/dist/core/ecs/access_check.d.ts.map +1 -1
  6. package/dist/core/ecs/archetype.d.cts +486 -0
  7. package/dist/core/ecs/archetype.d.ts +23 -11
  8. package/dist/core/ecs/archetype.d.ts.map +1 -1
  9. package/dist/core/ecs/archetype_graph.d.cts +96 -0
  10. package/dist/core/ecs/archetype_graph.d.ts +96 -0
  11. package/dist/core/ecs/archetype_graph.d.ts.map +1 -0
  12. package/dist/core/ecs/builtin_relations.d.cts +43 -0
  13. package/dist/core/ecs/builtin_relations.d.ts +8 -8
  14. package/dist/core/ecs/builtin_relations.d.ts.map +1 -1
  15. package/dist/core/ecs/command_log.d.cts +116 -0
  16. package/dist/core/ecs/command_log.d.ts +13 -10
  17. package/dist/core/ecs/command_log.d.ts.map +1 -1
  18. package/dist/core/ecs/component.d.cts +176 -0
  19. package/dist/core/ecs/component.d.ts +75 -5
  20. package/dist/core/ecs/component.d.ts.map +1 -1
  21. package/dist/core/ecs/compute_backend.d.cts +37 -0
  22. package/dist/core/ecs/compute_backend.d.ts +2 -2
  23. package/dist/core/ecs/debug_names.d.cts +7 -0
  24. package/dist/core/ecs/debug_names.d.ts +7 -0
  25. package/dist/core/ecs/debug_names.d.ts.map +1 -0
  26. package/dist/core/ecs/deferred_commands.d.cts +55 -0
  27. package/dist/core/ecs/deferred_commands.d.ts +55 -0
  28. package/dist/core/ecs/deferred_commands.d.ts.map +1 -0
  29. package/dist/core/ecs/dispatch_trace.d.cts +93 -0
  30. package/dist/core/ecs/dispatch_trace.d.ts +3 -3
  31. package/dist/core/ecs/ecs.d.cts +562 -0
  32. package/dist/core/ecs/ecs.d.ts +314 -285
  33. package/dist/core/ecs/ecs.d.ts.map +1 -1
  34. package/dist/core/ecs/ecs_memory.d.cts +179 -0
  35. package/dist/core/ecs/ecs_memory.d.ts +1 -1
  36. package/dist/core/ecs/entity.d.cts +34 -0
  37. package/dist/core/ecs/entity.d.ts +7 -1
  38. package/dist/core/ecs/entity.d.ts.map +1 -1
  39. package/dist/core/ecs/entity_allocator.d.cts +59 -0
  40. package/dist/core/ecs/entity_allocator.d.ts +59 -0
  41. package/dist/core/ecs/entity_allocator.d.ts.map +1 -0
  42. package/dist/core/ecs/event.d.cts +79 -0
  43. package/dist/core/ecs/event.d.ts +36 -11
  44. package/dist/core/ecs/event.d.ts.map +1 -1
  45. package/dist/core/ecs/event_registry.d.cts +22 -0
  46. package/dist/core/ecs/event_registry.d.ts +22 -0
  47. package/dist/core/ecs/event_registry.d.ts.map +1 -0
  48. package/dist/core/ecs/facades.d.cts +158 -0
  49. package/dist/core/ecs/facades.d.ts +158 -0
  50. package/dist/core/ecs/facades.d.ts.map +1 -0
  51. package/dist/core/ecs/frame_stepper.d.cts +58 -0
  52. package/dist/core/ecs/frame_stepper.d.ts +58 -0
  53. package/dist/core/ecs/frame_stepper.d.ts.map +1 -0
  54. package/dist/core/ecs/frame_trace.d.cts +133 -0
  55. package/dist/core/ecs/frame_trace.d.ts +5 -5
  56. package/dist/core/ecs/frame_trace.d.ts.map +1 -1
  57. package/dist/core/ecs/host_commands.d.cts +274 -0
  58. package/dist/core/ecs/host_commands.d.ts +53 -31
  59. package/dist/core/ecs/host_commands.d.ts.map +1 -1
  60. package/dist/core/ecs/index.d.cts +46 -0
  61. package/dist/core/ecs/index.d.ts +45 -40
  62. package/dist/core/ecs/index.d.ts.map +1 -1
  63. package/dist/core/ecs/observer.d.cts +173 -0
  64. package/dist/core/ecs/observer.d.ts +43 -12
  65. package/dist/core/ecs/observer.d.ts.map +1 -1
  66. package/dist/core/ecs/query.d.cts +718 -0
  67. package/dist/core/ecs/query.d.ts +251 -90
  68. package/dist/core/ecs/query.d.ts.map +1 -1
  69. package/dist/core/ecs/ref.d.cts +31 -0
  70. package/dist/core/ecs/ref.d.ts +3 -3
  71. package/dist/core/ecs/relation.d.cts +243 -0
  72. package/dist/core/ecs/relation.d.ts +26 -14
  73. package/dist/core/ecs/relation.d.ts.map +1 -1
  74. package/dist/core/ecs/relation_service.d.cts +235 -0
  75. package/dist/core/ecs/relation_service.d.ts +235 -0
  76. package/dist/core/ecs/relation_service.d.ts.map +1 -0
  77. package/dist/core/ecs/resource.d.cts +53 -0
  78. package/dist/core/ecs/resource.d.ts +25 -5
  79. package/dist/core/ecs/resource.d.ts.map +1 -1
  80. package/dist/core/ecs/resource_registry.d.cts +20 -0
  81. package/dist/core/ecs/resource_registry.d.ts +20 -0
  82. package/dist/core/ecs/resource_registry.d.ts.map +1 -0
  83. package/dist/core/ecs/resume.d.cts +85 -0
  84. package/dist/core/ecs/resume.d.ts +6 -6
  85. package/dist/core/ecs/resume.d.ts.map +1 -1
  86. package/dist/core/ecs/run_condition.d.cts +81 -0
  87. package/dist/core/ecs/run_condition.d.ts +15 -9
  88. package/dist/core/ecs/run_condition.d.ts.map +1 -1
  89. package/dist/core/ecs/schedule.d.cts +142 -0
  90. package/dist/core/ecs/schedule.d.ts +15 -6
  91. package/dist/core/ecs/schedule.d.ts.map +1 -1
  92. package/dist/core/ecs/snapshot_service.d.cts +94 -0
  93. package/dist/core/ecs/snapshot_service.d.ts +94 -0
  94. package/dist/core/ecs/snapshot_service.d.ts.map +1 -0
  95. package/dist/core/ecs/sparse_store.d.cts +110 -0
  96. package/dist/core/ecs/sparse_store.d.ts +5 -2
  97. package/dist/core/ecs/sparse_store.d.ts.map +1 -1
  98. package/dist/core/ecs/store.d.cts +950 -0
  99. package/dist/core/ecs/store.d.ts +143 -342
  100. package/dist/core/ecs/store.d.ts.map +1 -1
  101. package/dist/core/ecs/store_layout_listener.d.cts +23 -0
  102. package/dist/core/ecs/system.d.cts +250 -0
  103. package/dist/core/ecs/system.d.ts +138 -22
  104. package/dist/core/ecs/system.d.ts.map +1 -1
  105. package/dist/{utils/arrays.d.ts → core/ecs/utils/arrays.d.cts} +1 -0
  106. package/dist/core/ecs/utils/error.d.cts +61 -0
  107. package/dist/core/ecs/utils/error.d.ts +12 -2
  108. package/dist/core/ecs/utils/error.d.ts.map +1 -1
  109. package/dist/core/store/action_ring.d.cts +136 -0
  110. package/dist/core/store/allocator.d.cts +238 -0
  111. package/dist/core/store/allocator.d.ts.map +1 -1
  112. package/dist/core/store/buffer_backed_column.d.cts +69 -0
  113. package/dist/core/store/buffer_backed_column.d.ts +2 -2
  114. package/dist/core/store/column_store.d.cts +273 -0
  115. package/dist/core/store/column_store.d.ts +18 -10
  116. package/dist/core/store/column_store.d.ts.map +1 -1
  117. package/dist/core/store/command_dispatch.d.cts +52 -0
  118. package/dist/core/store/command_ring.d.cts +107 -0
  119. package/dist/core/store/descriptor.d.cts +80 -0
  120. package/dist/core/store/descriptor.d.ts +1 -1
  121. package/dist/core/store/descriptor.d.ts.map +1 -1
  122. package/dist/core/store/entity_index.d.cts +108 -0
  123. package/dist/core/store/event_ring.d.cts +95 -0
  124. package/dist/core/store/extend.d.cts +39 -0
  125. package/dist/core/store/extend.d.ts +3 -73
  126. package/dist/core/store/extend.d.ts.map +1 -1
  127. package/dist/core/store/grow.d.cts +34 -0
  128. package/dist/core/store/grow.d.ts +4 -9
  129. package/dist/core/store/grow.d.ts.map +1 -1
  130. package/dist/core/store/header.d.cts +64 -0
  131. package/dist/core/store/header.d.ts +1 -1
  132. package/dist/core/store/header.d.ts.map +1 -1
  133. package/dist/core/store/index.d.cts +17 -0
  134. package/dist/core/store/index.d.ts +16 -15
  135. package/dist/core/store/index.d.ts.map +1 -1
  136. package/dist/core/store/layout_ops.d.cts +152 -0
  137. package/dist/core/store/layout_ops.d.ts +152 -0
  138. package/dist/core/store/layout_ops.d.ts.map +1 -0
  139. package/dist/core/store/region_table.d.cts +74 -0
  140. package/dist/core/store/region_table.d.ts +1 -1
  141. package/dist/core/store/region_table.d.ts.map +1 -1
  142. package/dist/core/store/snapshot.d.cts +43 -0
  143. package/dist/core/store/snapshot.d.ts +2 -2
  144. package/dist/core/store/state_hash.d.cts +38 -0
  145. package/dist/core/store/state_hash.d.ts +1 -1
  146. package/dist/core/store/store_regions.d.cts +38 -0
  147. package/dist/core/store/store_regions.d.ts +1 -1
  148. package/dist/core/store/vendored_abi/abi.d.ts +43 -0
  149. package/dist/core/store/{__generated__ → vendored_abi}/abi.d.ts.map +1 -1
  150. package/dist/dev_flag.d.cts +17 -0
  151. package/dist/dev_flag.d.ts +17 -0
  152. package/dist/dev_flag.d.ts.map +1 -0
  153. package/dist/extensions/editor/editor.d.cts +170 -0
  154. package/dist/extensions/editor/editor.d.ts +43 -22
  155. package/dist/extensions/editor/editor.d.ts.map +1 -1
  156. package/dist/extensions/editor/field_handle.d.cts +40 -0
  157. package/dist/extensions/editor/field_handle.d.ts +8 -3
  158. package/dist/extensions/editor/field_handle.d.ts.map +1 -1
  159. package/dist/extensions/editor/index.cjs +1 -1
  160. package/dist/extensions/editor/index.d.cts +21 -0
  161. package/dist/extensions/editor/index.d.ts +2 -2
  162. package/dist/extensions/editor/index.js +116 -88
  163. package/dist/extensions/reactive/ecs_sync.d.cts +214 -0
  164. package/dist/extensions/reactive/ecs_sync.d.ts +26 -22
  165. package/dist/extensions/reactive/ecs_sync.d.ts.map +1 -1
  166. package/dist/extensions/reactive/index.cjs +1 -1
  167. package/dist/extensions/reactive/index.d.cts +23 -0
  168. package/dist/extensions/reactive/index.d.ts +1 -1
  169. package/dist/extensions/reactive/index.js +106 -116
  170. package/dist/extensions/solid/index.cjs +1 -1
  171. package/dist/extensions/solid/index.d.cts +6 -0
  172. package/dist/extensions/solid/index.d.ts +2 -2
  173. package/dist/extensions/solid/index.js +8 -4
  174. package/dist/extensions/solid/kernel_solid.d.cts +45 -0
  175. package/dist/extensions/solid/kernel_solid.d.ts +6 -3
  176. package/dist/extensions/solid/kernel_solid.d.ts.map +1 -1
  177. package/dist/host_commands-BF8QMi3c.cjs +1 -0
  178. package/dist/host_commands-i4cAeyL5.js +2318 -0
  179. package/dist/index.cjs +1 -2
  180. package/dist/index.d.cts +66 -0
  181. package/dist/index.d.ts +50 -1
  182. package/dist/index.d.ts.map +1 -1
  183. package/dist/index.js +4469 -5933
  184. package/dist/internal.cjs +2 -0
  185. package/dist/internal.d.cts +20 -0
  186. package/dist/internal.d.ts +20 -0
  187. package/dist/internal.d.ts.map +1 -0
  188. package/dist/internal.js +141 -0
  189. package/dist/primitives.cjs +1 -1
  190. package/dist/primitives.d.cts +18 -0
  191. package/dist/primitives.d.ts +6 -6
  192. package/dist/primitives.js +24 -23
  193. package/dist/reactive/array.d.ts +24 -0
  194. package/dist/reactive/array.d.ts.map +1 -0
  195. package/dist/reactive/index.cjs +1 -0
  196. package/dist/reactive/index.d.cts +11 -0
  197. package/dist/reactive/index.d.ts +11 -0
  198. package/dist/reactive/index.d.ts.map +1 -0
  199. package/dist/reactive/index.js +18 -0
  200. package/dist/reactive/interop.d.cts +19 -0
  201. package/dist/{core/reactive → reactive}/interop.d.ts +1 -1
  202. package/dist/reactive/interop.d.ts.map +1 -0
  203. package/dist/reactive/kernel.d.cts +73 -0
  204. package/dist/{core/reactive → reactive}/kernel.d.ts +5 -3
  205. package/dist/reactive/kernel.d.ts.map +1 -0
  206. package/dist/reactive/map.d.ts +16 -0
  207. package/dist/reactive/map.d.ts.map +1 -0
  208. package/dist/reactive/shallow.d.cts +11 -0
  209. package/dist/reactive/shallow.d.ts +11 -0
  210. package/dist/reactive/shallow.d.ts.map +1 -0
  211. package/dist/reactive/struct.d.cts +10 -0
  212. package/dist/{core/reactive → reactive}/struct.d.ts +1 -1
  213. package/dist/reactive/struct.d.ts.map +1 -0
  214. package/dist/shallow-DQ8aG51_.cjs +1 -0
  215. package/dist/shallow-DfnAm9vG.js +150 -0
  216. package/dist/shared-BU1Cd40h.js +103 -0
  217. package/dist/shared-BymrGTyR.cjs +1 -0
  218. package/dist/shared.cjs +1 -1
  219. package/dist/shared.d.cts +22 -0
  220. package/dist/shared.d.ts +2 -2
  221. package/dist/shared.js +1 -1
  222. package/dist/topological_sort-BDvEyb9W.cjs +1 -0
  223. package/dist/topological_sort-DK6EjpWa.js +135 -0
  224. package/dist/type_primitives/assertions.d.cts +32 -0
  225. package/dist/type_primitives/assertions.d.ts +13 -1
  226. package/dist/type_primitives/assertions.d.ts.map +1 -1
  227. package/dist/type_primitives/binary_heap/binary_heap.d.cts +37 -0
  228. package/dist/type_primitives/bitset/bitset.d.cts +54 -0
  229. package/dist/type_primitives/brand.d.cts +23 -0
  230. package/dist/type_primitives/error.d.cts +16 -0
  231. package/dist/type_primitives/error.d.ts +4 -3
  232. package/dist/type_primitives/error.d.ts.map +1 -1
  233. package/dist/type_primitives/index.d.cts +13 -0
  234. package/dist/type_primitives/index.d.ts +9 -9
  235. package/dist/type_primitives/sparse_map/sparse_map.d.cts +30 -0
  236. package/dist/type_primitives/sparse_set/sparse_set.d.cts +28 -0
  237. package/dist/type_primitives/topological_sort/topological_sort.d.cts +29 -0
  238. package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +127 -0
  239. package/dist/typed_arrays-BcXcnzB4.js +258 -0
  240. package/dist/typed_arrays-D3NmwtCG.cjs +1 -0
  241. package/dist/utils/error.d.cts +6 -0
  242. package/dist/version.d.cts +10 -0
  243. package/dist/version.d.ts +10 -0
  244. package/dist/version.d.ts.map +1 -0
  245. package/package.json +102 -19
  246. package/dist/array-CxbPyiHO.cjs +0 -1
  247. package/dist/array-uFR7Q8fU.js +0 -132
  248. package/dist/core/reactive/array.d.ts.map +0 -1
  249. package/dist/core/reactive/index.cjs +0 -1
  250. package/dist/core/reactive/index.d.ts +0 -10
  251. package/dist/core/reactive/index.d.ts.map +0 -1
  252. package/dist/core/reactive/index.js +0 -17
  253. package/dist/core/reactive/interop.d.ts.map +0 -1
  254. package/dist/core/reactive/kernel.d.ts.map +0 -1
  255. package/dist/core/reactive/map.d.ts.map +0 -1
  256. package/dist/core/reactive/struct.d.ts.map +0 -1
  257. package/dist/log/console_sink.d.ts +0 -4
  258. package/dist/log/console_sink.d.ts.map +0 -1
  259. package/dist/log/index.d.ts +0 -3
  260. package/dist/log/index.d.ts.map +0 -1
  261. package/dist/log/logger.d.ts +0 -27
  262. package/dist/log/logger.d.ts.map +0 -1
  263. package/dist/shared-BXSZnxx4.cjs +0 -1
  264. package/dist/shared-C678TAPY.js +0 -99
  265. package/dist/topological_sort-DlRpSrxu.js +0 -391
  266. package/dist/topological_sort-WAT-VHb-.cjs +0 -1
  267. package/dist/utils/arrays.d.ts.map +0 -1
  268. package/dist/utils/constants.d.ts.map +0 -1
  269. /package/dist/{utils/constants.d.ts → core/ecs/utils/constants.d.cts} +0 -0
  270. /package/dist/core/store/{__generated__/abi.d.ts → vendored_abi/abi.d.cts} +0 -0
  271. /package/dist/{core/reactive/array.d.ts → reactive/array.d.cts} +0 -0
  272. /package/dist/{core/reactive/map.d.ts → reactive/map.d.cts} +0 -0
@@ -1,6 +1,6 @@
1
- import { ComponentDef } from './component';
2
- import { ResourceKey } from './resource';
3
- import { Query } from './query';
1
+ import { ComponentDef } from './component.js';
2
+ import { ResourceKey } from './resource.js';
3
+ import { Query } from './query.js';
4
4
  /**
5
5
  * The read-only slice of `SystemContext` a run condition is handed. Deliberately
6
6
  * narrow — a condition can read the ECS tick and resources, but has no path to
@@ -11,7 +11,7 @@ import { Query } from './query';
11
11
  export interface ConditionContext {
12
12
  /** Current ECS tick — the deterministic clock built-ins key off. */
13
13
  readonly ecsTick: number;
14
- /** Read a resource value (checked against `resourceReads` in `__DEV__`). */
14
+ /** Read a resource value (checked against `resourceReads` in `DEV`). */
15
15
  resource<T>(key: ResourceKey<T>): T;
16
16
  /** Membership probe for a resource — unchecked, mirrors `hasComponent`. */
17
17
  hasResource<T>(key: ResourceKey<T>): boolean;
@@ -32,14 +32,14 @@ export interface RunCondition {
32
32
  * not runtime-checkable today, but it is the read-edge a parallel scheduler
33
33
  * will consume. */
34
34
  readonly reads?: readonly ComponentDef[];
35
- /** Resources the predicate reads. Validated at runtime in `__DEV__` when the
35
+ /** Resources the predicate reads. Validated at runtime in `DEV` when the
36
36
  * condition evaluates inside `accessCheck.enterCondition`. */
37
- readonly resourceReads?: readonly ResourceKey<unknown>[];
37
+ readonly resourceReads?: readonly ResourceKey<any>[];
38
38
  }
39
39
  /**
40
40
  * Run the gated system(s) only while a resource equals `expected` (strict `===`,
41
41
  * so reference identity for objects). The canonical "feature flag / game phase"
42
- * gate — flip `world.setResource(key, …)` and the whole group toggles.
42
+ * gate — flip `ecs.resources.set(key, …)` and the whole group toggles.
43
43
  */
44
44
  export declare function runIfResourceEq<T>(key: ResourceKey<T>, expected: T): RunCondition;
45
45
  /**
@@ -66,10 +66,16 @@ export declare function runEveryNTicks(n: number, offset?: number): RunCondition
66
66
  * its component defs are declared as `reads`. `count()` is a membership sum over
67
67
  * matching archetypes (no column reads), so it trips no `accessCheck` read.
68
68
  *
69
- * The query must be **dense-only**: `count()` asserts this in `__DEV__`
70
- * (`_assertDenseOnly`), so pass a plain `world.query(...)` — a query carrying
69
+ * The query must be **dense-only**: `entityCount` asserts this in `DEV`
70
+ * (`_assertDenseOnly`), so pass a plain `ecs.query(...)` — a query carrying
71
71
  * `.optional(...)` or sparse terms throws. Gate on sparse membership with a
72
72
  * custom predicate over `forEachEntity` instead.
73
73
  */
74
74
  export declare function runIfAnyMatch(query: Query<readonly ComponentDef[]>): RunCondition;
75
+ /** Invert a condition: run exactly when `cond` would skip. */
76
+ export declare function not(cond: RunCondition): RunCondition;
77
+ /** Run only when EVERY condition passes (`&&`, short-circuit). */
78
+ export declare function allOf(...conds: RunCondition[]): RunCondition;
79
+ /** Run when ANY condition passes (`||`, short-circuit). */
80
+ export declare function anyOf(...conds: RunCondition[]): RunCondition;
75
81
  //# sourceMappingURL=run_condition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run_condition.d.ts","sourceRoot":"","sources":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,EAAE,MAAM,SAAI,GAAG,YAAY,CAoBlE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,YAAY,EAAE,CAAC,GAAG,YAAY,CAMjF;AA4BD,8DAA8D;AAC9D,wBAAgB,GAAG,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,CAMpD;AAED,kEAAkE;AAClE,wBAAgB,KAAK,CAAC,GAAG,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,CAM5D;AAED,2DAA2D;AAC3D,wBAAgB,KAAK,CAAC,GAAG,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,CAM5D"}
@@ -0,0 +1,142 @@
1
+ import { SystemContext } from './query.cjs';
2
+ import { SystemDescriptor } from './system.cjs';
3
+ import { ComputeBackend } from './compute_backend.cjs';
4
+ import { RunCondition } from './run_condition.cjs';
5
+ export declare enum SCHEDULE {
6
+ PRE_STARTUP = "PRE_STARTUP",
7
+ STARTUP = "STARTUP",
8
+ POST_STARTUP = "POST_STARTUP",
9
+ FIXED_UPDATE = "FIXED_UPDATE",
10
+ PRE_UPDATE = "PRE_UPDATE",
11
+ UPDATE = "UPDATE",
12
+ POST_UPDATE = "POST_UPDATE"
13
+ }
14
+ /**
15
+ * An opaque handle for a named group of systems (#576). A set carries a shared
16
+ * run condition and shared ordering that every member inherits. Sets are
17
+ * identified by **object identity**, not by name — create one with
18
+ * `systemSet(name)`, hold the handle, and reuse it across `addSystems`
19
+ * (`SystemEntry.set`) and `Schedule.configureSet`. The `name` is for
20
+ * diagnostics only.
21
+ */
22
+ export interface SystemSet {
23
+ readonly name: string;
24
+ }
25
+ /** Create a `SystemSet` handle (#576). Two calls with the same name are two
26
+ * distinct sets — keep the returned handle and pass it around. */
27
+ export declare function systemSet(name: string): SystemSet;
28
+ /** A `before`/`after` ordering target: either a concrete system or a whole set
29
+ * (expanded to its members within the same phase at sort time). */
30
+ export type SystemOrderingTarget = SystemDescriptor | SystemSet;
31
+ /** Shared configuration applied to a `SystemSet` via `configureSet` (#576).
32
+ * Accumulates across calls — conditions AND together, ordering targets union. */
33
+ export interface SystemSetConfig {
34
+ /** Condition(s) every member is gated by (ANDed with each member's own). */
35
+ runIf?: RunCondition | readonly RunCondition[];
36
+ /** Every member runs before each of these targets. */
37
+ before?: readonly SystemOrderingTarget[];
38
+ /** Every member runs after each of these targets. */
39
+ after?: readonly SystemOrderingTarget[];
40
+ }
41
+ export interface SystemOrdering {
42
+ before?: readonly SystemOrderingTarget[];
43
+ after?: readonly SystemOrderingTarget[];
44
+ }
45
+ export interface SystemEntry {
46
+ system: SystemDescriptor;
47
+ ordering?: SystemOrdering;
48
+ /** Run condition(s) gating just this system — ANDed with any set conditions
49
+ * it inherits (#576). A `false` verdict skips the body that tick. */
50
+ runIf?: RunCondition | readonly RunCondition[];
51
+ /** Set membership — the system inherits each set's shared condition and
52
+ * ordering (#576). */
53
+ set?: SystemSet | readonly SystemSet[];
54
+ }
55
+ export declare class Schedule {
56
+ private readonly labelSystems;
57
+ private readonly sortedCache;
58
+ private readonly systemIndex;
59
+ private readonly systemLastRun;
60
+ private readonly gatedSystems;
61
+ private readonly setConditions;
62
+ private readonly setOrdering;
63
+ private nextInsertionOrder;
64
+ private _backend;
65
+ /** Dev-diagnostic sink (`ECSOptions.onWarn`); defaults to `console.warn`.
66
+ * The only schedule diagnostic today is `warnDroppedEdge`. */
67
+ private readonly onWarn;
68
+ constructor(onWarn?: (message: string) => void);
69
+ addSystems(label: SCHEDULE, ...entries: (SystemDescriptor | SystemEntry)[]): void;
70
+ /**
71
+ * Configure a `SystemSet` (#576) — its shared run condition(s) and/or
72
+ * ordering, inherited by every member. Additive and order-independent w.r.t.
73
+ * `addSystems`: conditions accumulate (ANDed), ordering targets union, and
74
+ * a member added before or after this call picks the configuration up.
75
+ */
76
+ configureSet(set: SystemSet, config: SystemSetConfig): void;
77
+ removeSystem(system: SystemDescriptor): void;
78
+ /** Attach (or, with `null`, detach) the opt-in compute backend (#622). Driven
79
+ * by `ECS.attachBackend`; routes any scheduled system carrying a
80
+ * `backendHandle` to `backend.run(handle)` in place of its `fn`. */
81
+ setBackend(backend: ComputeBackend | null): void;
82
+ runStartup(ctx: SystemContext, tick: number): void;
83
+ runUpdate(ctx: SystemContext, deltaTime: number, tick: number): void;
84
+ runFixedUpdate(ctx: SystemContext, fixedDt: number, tick: number): void;
85
+ hasFixedSystems(): boolean;
86
+ getAllSystems(): SystemDescriptor[];
87
+ hasSystem(system: SystemDescriptor): boolean;
88
+ clear(): void;
89
+ private runLabel;
90
+ /**
91
+ * Whether a gated system runs this tick — the AND of its own conditions and
92
+ * every set it belongs to. A set's conditions are evaluated at most once per
93
+ * phase (memoized in `setVerdicts`) and the verdict gates every member of the
94
+ * set uniformly; a `configureSet` between phases is still honored because the
95
+ * memo lives only for a single `runLabel` pass. Short-circuits on the first
96
+ * `false`. The system's own conditions evaluate per system, in canonical order.
97
+ *
98
+ * #731 SEMANTIC NOTE: this evaluates a set's conditions once-per-set-per-phase
99
+ * rather than once-per-member. Equivalent for pure RunConditions; observably
100
+ * different only if a set condition reads state mutated earlier in the SAME
101
+ * phase (resources write immediately). That is intentional — the set gates as a
102
+ * unit, so all its members share one verdict for the phase.
103
+ */
104
+ private shouldRun;
105
+ /** Evaluate a condition list with AND semantics. Each predicate runs inside a
106
+ * reads-only `accessCheck` span (dev), so a condition that reads an
107
+ * undeclared resource — or attempts any mutation — throws. */
108
+ private evalConditions;
109
+ private getSorted;
110
+ /**
111
+ * Delegates to the shared topologicalSort utility.
112
+ * Builds the dependency edge map from before/after constraints, then
113
+ * catches any cycle TypeError and re-throws as ECSError.
114
+ */
115
+ private sortSystems;
116
+ /**
117
+ * Add the topo edges for one ordering list (#576). For `"before"` the source
118
+ * runs before each target (edge source→target); for `"after"` it runs after
119
+ * each target (edge target→source). A `SystemSet` target expands to every
120
+ * member within this phase (self-edges skipped, so a member ordered against
121
+ * its own set is a no-op); a descriptor target absent from this phase is
122
+ * dropped — with a dev warning only for a concrete system, since a set
123
+ * legitimately expands to nothing when its members live in another phase.
124
+ */
125
+ private resolveEdges;
126
+ /** Push one directed edge into the adjacency map. Both endpoints are known to
127
+ * be in this phase (callers guard), so `edges.get(...)` is non-null. */
128
+ private addDirectedEdge;
129
+ /**
130
+ * Dev-only diagnostic for an ordering edge that was dropped during sort.
131
+ *
132
+ * Cross-label ordering is impossible by design (`nodeSet` is per-label), so
133
+ * a target registered in *another* phase is skipped silently — that's the
134
+ * intended isolation. But a target unknown to *every* phase is almost
135
+ * certainly a typo or a system that was never scheduled; without this warning
136
+ * the constraint vanishes and the system runs in insertion-order tiebreak as
137
+ * if unconstrained, with nothing to distinguish mistake from intent. Compiled
138
+ * out of production builds by the `DEV` guards at the call sites.
139
+ */
140
+ private warnDroppedEdge;
141
+ }
142
+ //# sourceMappingURL=schedule.d.ts.map
@@ -1,7 +1,7 @@
1
- import { SystemContext } from './query';
2
- import { SystemDescriptor } from './system';
3
- import { ComputeBackend } from './compute_backend';
4
- import { RunCondition } from './run_condition';
1
+ import { SystemContext } from './query.js';
2
+ import { SystemDescriptor } from './system.js';
3
+ import { ComputeBackend } from './compute_backend.js';
4
+ import { RunCondition } from './run_condition.js';
5
5
  export declare enum SCHEDULE {
6
6
  PRE_STARTUP = "PRE_STARTUP",
7
7
  STARTUP = "STARTUP",
@@ -62,7 +62,10 @@ export declare class Schedule {
62
62
  private readonly setOrdering;
63
63
  private nextInsertionOrder;
64
64
  private _backend;
65
- constructor();
65
+ /** Dev-diagnostic sink (`ECSOptions.onWarn`); defaults to `console.warn`.
66
+ * The only schedule diagnostic today is `warnDroppedEdge`. */
67
+ private readonly onWarn;
68
+ constructor(onWarn?: (message: string) => void);
66
69
  addSystems(label: SCHEDULE, ...entries: (SystemDescriptor | SystemEntry)[]): void;
67
70
  /**
68
71
  * Configure a `SystemSet` (#576) — its shared run condition(s) and/or
@@ -91,6 +94,12 @@ export declare class Schedule {
91
94
  * set uniformly; a `configureSet` between phases is still honored because the
92
95
  * memo lives only for a single `runLabel` pass. Short-circuits on the first
93
96
  * `false`. The system's own conditions evaluate per system, in canonical order.
97
+ *
98
+ * #731 SEMANTIC NOTE: this evaluates a set's conditions once-per-set-per-phase
99
+ * rather than once-per-member. Equivalent for pure RunConditions; observably
100
+ * different only if a set condition reads state mutated earlier in the SAME
101
+ * phase (resources write immediately). That is intentional — the set gates as a
102
+ * unit, so all its members share one verdict for the phase.
94
103
  */
95
104
  private shouldRun;
96
105
  /** Evaluate a condition list with AND semantics. Each predicate runs inside a
@@ -126,7 +135,7 @@ export declare class Schedule {
126
135
  * certainly a typo or a system that was never scheduled; without this warning
127
136
  * the constraint vanishes and the system runs in insertion-order tiebreak as
128
137
  * if unconstrained, with nothing to distinguish mistake from intent. Compiled
129
- * out of production builds by the `__DEV__` guards at the call sites.
138
+ * out of production builds by the `DEV` guards at the call sites.
130
139
  */
131
140
  private warnDroppedEdge;
132
141
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/schedule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmCK;AAIL,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKpD,oBAAY,QAAQ;IACnB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;CAC3B;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED;kEACkE;AAClE,wBA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;;;;;;;OAaG;IACH,OAAO,CAAC,SAAS;IAwBjB;;kEAE8D;IAC9D,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,SAAS;IAWjB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IA2FnB;;;;;;;;OAQG;IACH,OAAO,CAAC,YAAY;IA4BpB;4EACwE;IACxE,OAAO,CAAC,eAAe;IAevB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,eAAe;CAgBvB"}
@@ -0,0 +1,94 @@
1
+ import { Archetype } from './archetype.cjs';
2
+ import { EntityAllocator } from './entity_allocator.cjs';
3
+ import { SparseComponentStore } from './sparse_store.cjs';
4
+ import { RelationStore } from './relation.cjs';
5
+ import { ColumnStore, InPlaceBufferAllocator } from '../store/index.cjs';
6
+ import { HostState } from './resume.cjs';
7
+ /** What the snapshot/resume orchestration needs from `Store` — closure-
8
+ * injected (the `RelationServiceHost` style). Accessors re-read live fields
9
+ * per call (the column store and the entity-index views are replaced on
10
+ * restore); the three mutation members keep Store-owned state transitions on
11
+ * the Store side. All cold-path. */
12
+ export interface SnapshotHost {
13
+ readonly sparseStores: () => readonly SparseComponentStore[];
14
+ readonly relationStores: () => readonly RelationStore[];
15
+ /** Live SAB generations view (replanted on restore) — for rebuilding
16
+ * relation ids from entity indices. */
17
+ readonly generations: () => Int32Array;
18
+ readonly archetypes: () => readonly Archetype[];
19
+ readonly columnStore: () => ColumnStore;
20
+ readonly bufferAllocator: () => InPlaceBufferAllocator;
21
+ readonly entityIndexCapacity: () => number;
22
+ readonly tick: () => number;
23
+ readonly setTick: (tick: number) => void;
24
+ /** Stamp live row counts into the dense descriptors so a bare dense
25
+ * reader of the snapshot sees self-consistent counts. */
26
+ readonly publishRowCounts: () => void;
27
+ /** Adopt a restored dense store: swap the live backing, refresh archetype
28
+ * views, recover the allocator high-water from the restored region, and
29
+ * republish (the grow tail). Owned by Store — see `_mountRestoredDense`. */
30
+ readonly mountRestoredDense: (restored: ColumnStore) => void;
31
+ /** Rebuild each archetype's host-side `length`/`enabledCount`/entity-id
32
+ * back-references from the restored entity-index region + captured host
33
+ * state. Owned by Store — see `_reconstructHostRows`. */
34
+ readonly reconstructHostRows: (host: HostState) => void;
35
+ /** Every archetype's membership just changed — bump the query epoch and
36
+ * force the next descriptor publish. */
37
+ readonly invalidateQueryCaches: () => void;
38
+ }
39
+ export declare class SnapshotService {
40
+ private readonly host;
41
+ /** The allocator IS its own snapshot seam (H1 step 3): free-list copy on
42
+ * capture; `setHighWater` + `restoreHostState` on mount. */
43
+ private readonly allocator;
44
+ constructor(host: SnapshotHost, allocator: EntityAllocator);
45
+ /** Serialize the sparse stores **and** relation side data to a self-contained
46
+ * byte buffer — the sparse half of a world snapshot (the dense half is the
47
+ * SAB snapshot). Two framed sections: the sparse stores (`snapshotSparseStores`
48
+ * — exclusive relation targets + multi membership ride here) followed
49
+ * by the relation side data (`snapshotRelations` — multi forward target
50
+ * sets, which live outside the sparse store). Both are written in canonical
51
+ * entity-index order, so two worlds with identical contents inserted in
52
+ * different orders snapshot byte-for-byte the same (#470). The reverse index
53
+ * is derived and never serialized — `restoreSparse` rebuilds it. */
54
+ snapshotSparse(): Uint8Array;
55
+ /** Repopulate the sparse stores from `snapshotSparse` bytes, replacing all
56
+ * current sparse data (full-equality round-trip of membership + data), then
57
+ * rebuild every relation's derived side indices: multi forward sets from the
58
+ * relation section, and the reverse index for both cardinalities (exclusive
59
+ * from the just-restored sparse target field, multi from the rebuilt forward
60
+ * sets). The sparse components and relations must already be registered in
61
+ * the same order — restore carries data, not the registration (which is
62
+ * code). Throws `SparseRestoreError` if the snapshot's shape, field identity,
63
+ * entity-index bounds, or frame length don't validate. */
64
+ restoreSparse(bytes: Uint8Array): void;
65
+ /** Rebuild every relation's derived side indices after the sparse stores have
66
+ * been restored. `restoreRelations` resets all relations, rebuilds the multi
67
+ * forward sets + their reverse edges from `relBytes`, and validates shape.
68
+ * The exclusive reverse index can't be carried in the bytes (it's derivable),
69
+ * so it's rebuilt here from the backing sparse store: every member row holds
70
+ * `(source index → target EntityID)`, which is exactly one reverse edge. */
71
+ private rebuildRelationIndices;
72
+ /** Capture the full live world to one self-contained byte buffer that
73
+ * `restoreInto` can mount back onto a live, ticking world (#789). Three
74
+ * sections (see `resume.ts`): the dense SAB column bytes, the sparse +
75
+ * relation bytes, and the host-side bookkeeping the SAB omits. */
76
+ snapshot(): Uint8Array;
77
+ /** Gather the host-side state a snapshot carries alongside the dense + sparse
78
+ * bytes — see `snapshot()`. The free-list is copied (it's a live mutable). */
79
+ private collectHostState;
80
+ /** Mount a `snapshot()` buffer onto the live world and leave it ready to keep
81
+ * ticking. Fails closed on a malformed frame or a registration mismatch
82
+ * BEFORE any live state is touched. */
83
+ restoreInto(bytes: Uint8Array): void;
84
+ /** Read-only validation of a `snapshotSparse` SECTION (the framed
85
+ * `[sparseLen][relLen][sparse][rel]` buffer) against the live registry, used
86
+ * by `restoreInto` to fail closed on a sparse-registration mismatch BEFORE the
87
+ * dense mount commits. Mirrors `restoreSparse`'s frame check, then validates the
88
+ * sparse-stores sub-section without mutating. A relation-registration difference
89
+ * surfaces here too: every `registerRelation` adds a backing sparse store, so a
90
+ * differing relation set changes the sparse store count / schema. Throws
91
+ * `SparseRestoreError` on a mismatch. */
92
+ private assertSparseSectionMatches;
93
+ }
94
+ //# sourceMappingURL=snapshot_service.d.ts.map
@@ -0,0 +1,94 @@
1
+ import { Archetype } from './archetype.js';
2
+ import { EntityAllocator } from './entity_allocator.js';
3
+ import { SparseComponentStore } from './sparse_store.js';
4
+ import { RelationStore } from './relation.js';
5
+ import { ColumnStore, InPlaceBufferAllocator } from '../store/index.js';
6
+ import { HostState } from './resume.js';
7
+ /** What the snapshot/resume orchestration needs from `Store` — closure-
8
+ * injected (the `RelationServiceHost` style). Accessors re-read live fields
9
+ * per call (the column store and the entity-index views are replaced on
10
+ * restore); the three mutation members keep Store-owned state transitions on
11
+ * the Store side. All cold-path. */
12
+ export interface SnapshotHost {
13
+ readonly sparseStores: () => readonly SparseComponentStore[];
14
+ readonly relationStores: () => readonly RelationStore[];
15
+ /** Live SAB generations view (replanted on restore) — for rebuilding
16
+ * relation ids from entity indices. */
17
+ readonly generations: () => Int32Array;
18
+ readonly archetypes: () => readonly Archetype[];
19
+ readonly columnStore: () => ColumnStore;
20
+ readonly bufferAllocator: () => InPlaceBufferAllocator;
21
+ readonly entityIndexCapacity: () => number;
22
+ readonly tick: () => number;
23
+ readonly setTick: (tick: number) => void;
24
+ /** Stamp live row counts into the dense descriptors so a bare dense
25
+ * reader of the snapshot sees self-consistent counts. */
26
+ readonly publishRowCounts: () => void;
27
+ /** Adopt a restored dense store: swap the live backing, refresh archetype
28
+ * views, recover the allocator high-water from the restored region, and
29
+ * republish (the grow tail). Owned by Store — see `_mountRestoredDense`. */
30
+ readonly mountRestoredDense: (restored: ColumnStore) => void;
31
+ /** Rebuild each archetype's host-side `length`/`enabledCount`/entity-id
32
+ * back-references from the restored entity-index region + captured host
33
+ * state. Owned by Store — see `_reconstructHostRows`. */
34
+ readonly reconstructHostRows: (host: HostState) => void;
35
+ /** Every archetype's membership just changed — bump the query epoch and
36
+ * force the next descriptor publish. */
37
+ readonly invalidateQueryCaches: () => void;
38
+ }
39
+ export declare class SnapshotService {
40
+ private readonly host;
41
+ /** The allocator IS its own snapshot seam (H1 step 3): free-list copy on
42
+ * capture; `setHighWater` + `restoreHostState` on mount. */
43
+ private readonly allocator;
44
+ constructor(host: SnapshotHost, allocator: EntityAllocator);
45
+ /** Serialize the sparse stores **and** relation side data to a self-contained
46
+ * byte buffer — the sparse half of a world snapshot (the dense half is the
47
+ * SAB snapshot). Two framed sections: the sparse stores (`snapshotSparseStores`
48
+ * — exclusive relation targets + multi membership ride here) followed
49
+ * by the relation side data (`snapshotRelations` — multi forward target
50
+ * sets, which live outside the sparse store). Both are written in canonical
51
+ * entity-index order, so two worlds with identical contents inserted in
52
+ * different orders snapshot byte-for-byte the same (#470). The reverse index
53
+ * is derived and never serialized — `restoreSparse` rebuilds it. */
54
+ snapshotSparse(): Uint8Array;
55
+ /** Repopulate the sparse stores from `snapshotSparse` bytes, replacing all
56
+ * current sparse data (full-equality round-trip of membership + data), then
57
+ * rebuild every relation's derived side indices: multi forward sets from the
58
+ * relation section, and the reverse index for both cardinalities (exclusive
59
+ * from the just-restored sparse target field, multi from the rebuilt forward
60
+ * sets). The sparse components and relations must already be registered in
61
+ * the same order — restore carries data, not the registration (which is
62
+ * code). Throws `SparseRestoreError` if the snapshot's shape, field identity,
63
+ * entity-index bounds, or frame length don't validate. */
64
+ restoreSparse(bytes: Uint8Array): void;
65
+ /** Rebuild every relation's derived side indices after the sparse stores have
66
+ * been restored. `restoreRelations` resets all relations, rebuilds the multi
67
+ * forward sets + their reverse edges from `relBytes`, and validates shape.
68
+ * The exclusive reverse index can't be carried in the bytes (it's derivable),
69
+ * so it's rebuilt here from the backing sparse store: every member row holds
70
+ * `(source index → target EntityID)`, which is exactly one reverse edge. */
71
+ private rebuildRelationIndices;
72
+ /** Capture the full live world to one self-contained byte buffer that
73
+ * `restoreInto` can mount back onto a live, ticking world (#789). Three
74
+ * sections (see `resume.ts`): the dense SAB column bytes, the sparse +
75
+ * relation bytes, and the host-side bookkeeping the SAB omits. */
76
+ snapshot(): Uint8Array;
77
+ /** Gather the host-side state a snapshot carries alongside the dense + sparse
78
+ * bytes — see `snapshot()`. The free-list is copied (it's a live mutable). */
79
+ private collectHostState;
80
+ /** Mount a `snapshot()` buffer onto the live world and leave it ready to keep
81
+ * ticking. Fails closed on a malformed frame or a registration mismatch
82
+ * BEFORE any live state is touched. */
83
+ restoreInto(bytes: Uint8Array): void;
84
+ /** Read-only validation of a `snapshotSparse` SECTION (the framed
85
+ * `[sparseLen][relLen][sparse][rel]` buffer) against the live registry, used
86
+ * by `restoreInto` to fail closed on a sparse-registration mismatch BEFORE the
87
+ * dense mount commits. Mirrors `restoreSparse`'s frame check, then validates the
88
+ * sparse-stores sub-section without mutating. A relation-registration difference
89
+ * surfaces here too: every `registerRelation` adds a backing sparse store, so a
90
+ * differing relation set changes the sparse store count / schema. Throws
91
+ * `SparseRestoreError` on a mismatch. */
92
+ private assertSparseSectionMatches;
93
+ }
94
+ //# sourceMappingURL=snapshot_service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot_service.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/snapshot_service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACN,oBAAoB,EAKpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAuC,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,EAGN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAON,KAAK,SAAS,EACd,MAAM,UAAU,CAAC;AAElB;;;;oCAIoC;AACpC,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,SAAS,oBAAoB,EAAE,CAAC;IAC7D,QAAQ,CAAC,cAAc,EAAE,MAAM,SAAS,aAAa,EAAE,CAAC;IACxD;2CACuC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,UAAU,CAAC;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,SAAS,SAAS,EAAE,CAAC;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,WAAW,CAAC;IACxC,QAAQ,CAAC,eAAe,EAAE,MAAM,sBAAsB,CAAC;IACvD,QAAQ,CAAC,mBAAmB,EAAE,MAAM,MAAM,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC;6DACyD;IACzD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,IAAI,CAAC;IACtC;;gFAE4E;IAC5E,QAAQ,CAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,CAAC;IAC7D;;6DAEyD;IACzD,QAAQ,CAAC,mBAAmB,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACxD;4CACwC;IACxC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,IAAI,CAAC;CAC3C;AAED,qBAAa,eAAe;IAC3B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAe;IACpC;gEAC4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;gBAEhC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe;IAK1D;;;;;;;;wEAQoE;IAC7D,cAAc,IAAI,UAAU;IAanC;;;;;;;;8DAQ0D;IACnD,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAuB7C;;;;;gFAK4E;IAC5E,OAAO,CAAC,sBAAsB;IAW9B;;;sEAGkE;IAC3D,QAAQ,IAAI,UAAU;IAa7B;kFAC8E;IAC9E,OAAO,CAAC,gBAAgB;IAqBxB;;2CAEuC;IAChC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IA2C3C;;;;;;;6CAOyC;IACzC,OAAO,CAAC,0BAA0B;CAgBlC"}
@@ -0,0 +1,110 @@
1
+ import { Brand, TypedArrayTag } from '../../type_primitives/index.cjs';
2
+ import { ComponentSchema } from './component.cjs';
3
+ /** Sparse-component handle id. A separate id space from `ComponentID` — it
4
+ * indexes `Store`'s `sparseStores`, never the archetype mask, which is the
5
+ * mechanism by which sparse components escape the 128-bit identity cap. */
6
+ export type SparseComponentID = Brand<number, "sparse_component_id">;
7
+ declare const __sparseSchema: unique symbol;
8
+ export type SparseComponentDef<S extends ComponentSchema = ComponentSchema> = SparseComponentID & {
9
+ readonly [__sparseSchema]: S;
10
+ };
11
+ /** Recover a sparse def's schema type — the sparse sibling of `SchemaOf`
12
+ * (component.ts), used by the typed `SystemContext` sparse surface. */
13
+ export type SparseSchemaOf<D> = D extends SparseComponentDef<infer S extends ComponentSchema> ? S : never;
14
+ /** One sparse component's membership + data. Pure data structure — the `Store`
15
+ * owns liveness checks and dev-mode error throwing; this class only knows
16
+ * entity indices and field rows. */
17
+ export declare class SparseComponentStore {
18
+ /** entity index → field-value row (length = field count; `[]` for a tag). */
19
+ private readonly _data;
20
+ readonly fieldNames: string[];
21
+ readonly fieldTypes: TypedArrayTag[];
22
+ readonly fieldIndex: Record<string, number>;
23
+ constructor(fieldNames: string[], fieldTypes: TypedArrayTag[]);
24
+ /** Number of entities holding this sparse component. */
25
+ get size(): number;
26
+ /** Live entity indices that hold this component (dense, iteration order is
27
+ * SparseMap insertion/swap order — NOT canonical). Used by the hot query
28
+ * integration path (#469); for the determinism surface use
29
+ * `canonicalIndices` instead. */
30
+ get indices(): readonly number[];
31
+ /** Live entity indices in **canonical** (ascending) order — the determinism
32
+ * ordering for `stateHash` + snapshot/restore (ADR-0011, #470). The native
33
+ * `indices` getter is insertion/swap order and would make two worlds with
34
+ * identical contents reached by different add/remove histories diverge, so
35
+ * the cold determinism paths sort here. Allocates a sorted copy each call;
36
+ * never call it on the hot query path. Indices are 20-bit entity indices,
37
+ * so the subtraction comparator can't overflow. */
38
+ canonicalIndices(): number[];
39
+ /** The field-value row for `index` (length = field count; `[]` for a tag),
40
+ * or `undefined` if `index` isn't a member. Read-only view for the
41
+ * determinism paths (`stateHash`, snapshot); mutate via `setField`. */
42
+ getRow(index: number): readonly number[] | undefined;
43
+ /** Drop all membership + data. Restore path only — `restoreSparseStores`
44
+ * repopulates a cleared store from snapshot bytes. */
45
+ clear(): void;
46
+ /** Insert the positional field-value `row` for `index`, taking ownership of
47
+ * the array. Restore path only; bypasses the name→index mapping `setRow`
48
+ * does, because snapshot bytes are already positional. */
49
+ setRawRow(index: number, row: number[]): void;
50
+ has(index: number): boolean;
51
+ /** Insert or overwrite the row for `index`, building it from `values`.
52
+ * Fields absent from `values` default to 0; a tag stores `[]`. */
53
+ setRow(index: number, values: Record<string, number>): void;
54
+ /** Drop `index`'s membership + data. Returns whether it was present. */
55
+ remove(index: number): boolean;
56
+ /** Read one field, or `undefined` if `index` doesn't hold this component. */
57
+ getField(index: number, fieldIdx: number): number | undefined;
58
+ /** Write one field. Returns `false` (no-op) if `index` isn't a member. */
59
+ setField(index: number, fieldIdx: number, value: number): boolean;
60
+ }
61
+ export declare class SparseRestoreError extends Error {
62
+ constructor(message: string);
63
+ }
64
+ /** Serialize a registry of sparse stores into a self-contained byte buffer —
65
+ * the **sparse half** of a world snapshot (the dense half is the SAB snapshot,
66
+ * `snapshotColumnStore`). Members are emitted in canonical (ascending
67
+ * entity-index) order so the bytes are independent of insertion / removal
68
+ * history: two worlds with identical sparse contents reached by different
69
+ * mutation orders serialize byte-for-byte the same (#470).
70
+ *
71
+ * Layout (all integers little-endian, to match the dense SAB snapshot and stay
72
+ * architecture-independent):
73
+ *
74
+ * u32 storeCount
75
+ * repeat storeCount times:
76
+ * u32 fieldCount
77
+ * u32 schemaHash
78
+ * u32 memberCount
79
+ * repeat memberCount times (canonical entity-index order):
80
+ * u32 entityIndex
81
+ * f64 × fieldCount (the positional field row; none for a tag)
82
+ *
83
+ * `fieldCount` is redundant with the registered schema but is written so
84
+ * `restoreSparseStores` can reject a snapshot whose shape doesn't match the
85
+ * stores it's restoring into; `schemaHash` (a `schemaFingerprint` over the
86
+ * field names + types) goes further and rejects a buffer whose shape matches
87
+ * field-for-field but whose field **identity** doesn't (#494). */
88
+ export declare function snapshotSparseStores(stores: readonly SparseComponentStore[]): Uint8Array;
89
+ /** Repopulate already-registered sparse stores from `snapshotSparseStores`
90
+ * bytes, giving full-equality round-trip (membership + data). The `stores`
91
+ * registry must already exist with the same shape the snapshot was taken from
92
+ * — restore replays data into a world whose sparse components are registered
93
+ * in the same order (the registration is code, not snapshot state). Each store
94
+ * is cleared first, so restoring is idempotent and drops any pre-existing rows.
95
+ *
96
+ * Throws `SparseRestoreError` on any shape or identity mismatch (store count,
97
+ * field count, schema-hash field identity, an entity index past `MAX_INDEX`,
98
+ * or a truncated / over-long buffer) rather than silently corrupting state.
99
+ * The index bound matters because the index keys a `SparseMap` whose backing
100
+ * array grows to `index` length — an unvalidated crafted u32 (up to ~4.29e9)
101
+ * would allocate multi-GB (#494). */
102
+ export declare function restoreSparseStores(stores: readonly SparseComponentStore[], bytes: Uint8Array): void;
103
+ /** Read-only validation of a `snapshotSparseStores` buffer against the live
104
+ * registry, WITHOUT mutating any store (#789). Mirrors `restoreSparseStores`'s
105
+ * shape/field-identity/index-bounds/frame checks so `Store.restoreInto` can fail
106
+ * closed on a sparse-registration mismatch BEFORE the dense mount overwrites live
107
+ * column data. Throws `SparseRestoreError` on any mismatch / malformed buffer. */
108
+ export declare function validateSparseStores(stores: readonly SparseComponentStore[], bytes: Uint8Array): void;
109
+ export {};
110
+ //# sourceMappingURL=sparse_store.d.ts.map
@@ -1,5 +1,5 @@
1
- import { Brand, TypedArrayTag } from '../../type_primitives';
2
- import { ComponentSchema } from './component';
1
+ import { Brand, TypedArrayTag } from '../../type_primitives/index.js';
2
+ import { ComponentSchema } from './component.js';
3
3
  /** Sparse-component handle id. A separate id space from `ComponentID` — it
4
4
  * indexes `Store`'s `sparseStores`, never the archetype mask, which is the
5
5
  * mechanism by which sparse components escape the 128-bit identity cap. */
@@ -8,6 +8,9 @@ declare const __sparseSchema: unique symbol;
8
8
  export type SparseComponentDef<S extends ComponentSchema = ComponentSchema> = SparseComponentID & {
9
9
  readonly [__sparseSchema]: S;
10
10
  };
11
+ /** Recover a sparse def's schema type — the sparse sibling of `SchemaOf`
12
+ * (component.ts), used by the typed `SystemContext` sparse surface. */
13
+ export type SparseSchemaOf<D> = D extends SparseComponentDef<infer S extends ComponentSchema> ? S : never;
11
14
  /** One sparse component's membership + data. Pure data structure — the `Store`
12
15
  * owns liveness checks and dev-mode error throwing; this class only knows
13
16
  * entity indices and field rows. */
@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