@oasys/oecs 0.3.0 → 0.4.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 (204) hide show
  1. package/README.md +196 -267
  2. package/dist/array-CxbPyiHO.cjs +1 -0
  3. package/dist/array-uFR7Q8fU.js +132 -0
  4. package/dist/core/ecs/access_check.d.ts +77 -0
  5. package/dist/core/ecs/access_check.d.ts.map +1 -0
  6. package/dist/core/ecs/archetype.d.ts +474 -0
  7. package/dist/core/ecs/archetype.d.ts.map +1 -0
  8. package/dist/core/ecs/builtin_relations.d.ts +43 -0
  9. package/dist/core/ecs/builtin_relations.d.ts.map +1 -0
  10. package/dist/core/ecs/command_log.d.ts +113 -0
  11. package/dist/core/ecs/command_log.d.ts.map +1 -0
  12. package/dist/core/ecs/component.d.ts +106 -0
  13. package/dist/core/ecs/component.d.ts.map +1 -0
  14. package/dist/core/ecs/compute_backend.d.ts +37 -0
  15. package/dist/core/ecs/compute_backend.d.ts.map +1 -0
  16. package/dist/core/ecs/dispatch_trace.d.ts +93 -0
  17. package/dist/core/ecs/dispatch_trace.d.ts.map +1 -0
  18. package/dist/core/ecs/ecs.d.ts +533 -0
  19. package/dist/core/ecs/ecs.d.ts.map +1 -0
  20. package/dist/core/ecs/ecs_memory.d.ts +179 -0
  21. package/dist/core/ecs/ecs_memory.d.ts.map +1 -0
  22. package/dist/core/ecs/entity.d.ts +28 -0
  23. package/dist/core/ecs/entity.d.ts.map +1 -0
  24. package/dist/core/ecs/event.d.ts +54 -0
  25. package/dist/core/ecs/event.d.ts.map +1 -0
  26. package/dist/core/ecs/frame_trace.d.ts +133 -0
  27. package/dist/core/ecs/frame_trace.d.ts.map +1 -0
  28. package/dist/core/ecs/host_commands.d.ts +252 -0
  29. package/dist/core/ecs/host_commands.d.ts.map +1 -0
  30. package/dist/core/ecs/index.d.ts +41 -0
  31. package/dist/core/ecs/index.d.ts.map +1 -0
  32. package/dist/core/ecs/observer.d.ts +142 -0
  33. package/dist/core/ecs/observer.d.ts.map +1 -0
  34. package/dist/core/ecs/query.d.ts +557 -0
  35. package/dist/core/ecs/query.d.ts.map +1 -0
  36. package/dist/core/ecs/ref.d.ts +31 -0
  37. package/dist/core/ecs/ref.d.ts.map +1 -0
  38. package/dist/core/ecs/relation.d.ts +231 -0
  39. package/dist/core/ecs/relation.d.ts.map +1 -0
  40. package/dist/core/ecs/resource.d.ts +33 -0
  41. package/dist/core/ecs/resource.d.ts.map +1 -0
  42. package/dist/core/ecs/resume.d.ts +85 -0
  43. package/dist/core/ecs/resume.d.ts.map +1 -0
  44. package/dist/core/ecs/run_condition.d.ts +75 -0
  45. package/dist/core/ecs/run_condition.d.ts.map +1 -0
  46. package/dist/core/ecs/schedule.d.ts +133 -0
  47. package/dist/core/ecs/schedule.d.ts.map +1 -0
  48. package/dist/core/ecs/sparse_store.d.ts +107 -0
  49. package/dist/core/ecs/sparse_store.d.ts.map +1 -0
  50. package/dist/core/ecs/store.d.ts +1149 -0
  51. package/dist/core/ecs/store.d.ts.map +1 -0
  52. package/dist/core/ecs/store_layout_listener.d.ts +23 -0
  53. package/dist/core/ecs/store_layout_listener.d.ts.map +1 -0
  54. package/dist/core/ecs/system.d.ts +134 -0
  55. package/dist/core/ecs/system.d.ts.map +1 -0
  56. package/dist/core/ecs/utils/arrays.d.ts +7 -0
  57. package/dist/core/ecs/utils/arrays.d.ts.map +1 -0
  58. package/dist/core/ecs/utils/constants.d.ts +12 -0
  59. package/dist/core/ecs/utils/constants.d.ts.map +1 -0
  60. package/dist/core/ecs/utils/error.d.ts +51 -0
  61. package/dist/core/ecs/utils/error.d.ts.map +1 -0
  62. package/dist/core/reactive/array.d.ts +24 -0
  63. package/dist/core/reactive/array.d.ts.map +1 -0
  64. package/dist/core/reactive/index.cjs +1 -0
  65. package/dist/core/reactive/index.d.ts +10 -0
  66. package/dist/core/reactive/index.d.ts.map +1 -0
  67. package/dist/core/reactive/index.js +17 -0
  68. package/dist/core/reactive/interop.d.ts +19 -0
  69. package/dist/core/reactive/interop.d.ts.map +1 -0
  70. package/dist/core/reactive/kernel.d.ts +71 -0
  71. package/dist/core/reactive/kernel.d.ts.map +1 -0
  72. package/dist/core/reactive/map.d.ts +16 -0
  73. package/dist/core/reactive/map.d.ts.map +1 -0
  74. package/dist/core/reactive/struct.d.ts +10 -0
  75. package/dist/core/reactive/struct.d.ts.map +1 -0
  76. package/dist/core/store/__generated__/abi.d.ts +43 -0
  77. package/dist/core/store/__generated__/abi.d.ts.map +1 -0
  78. package/dist/core/store/action_ring.d.ts +136 -0
  79. package/dist/core/store/action_ring.d.ts.map +1 -0
  80. package/dist/core/store/allocator.d.ts +238 -0
  81. package/dist/core/store/allocator.d.ts.map +1 -0
  82. package/dist/core/store/buffer_backed_column.d.ts +69 -0
  83. package/dist/core/store/buffer_backed_column.d.ts.map +1 -0
  84. package/dist/core/store/column_store.d.ts +265 -0
  85. package/dist/core/store/column_store.d.ts.map +1 -0
  86. package/dist/core/store/command_dispatch.d.ts +52 -0
  87. package/dist/core/store/command_dispatch.d.ts.map +1 -0
  88. package/dist/core/store/command_ring.d.ts +107 -0
  89. package/dist/core/store/command_ring.d.ts.map +1 -0
  90. package/dist/core/store/descriptor.d.ts +80 -0
  91. package/dist/core/store/descriptor.d.ts.map +1 -0
  92. package/dist/core/store/entity_index.d.ts +108 -0
  93. package/dist/core/store/entity_index.d.ts.map +1 -0
  94. package/dist/core/store/event_ring.d.ts +95 -0
  95. package/dist/core/store/event_ring.d.ts.map +1 -0
  96. package/dist/core/store/extend.d.ts +109 -0
  97. package/dist/core/store/extend.d.ts.map +1 -0
  98. package/dist/core/store/grow.d.ts +39 -0
  99. package/dist/core/store/grow.d.ts.map +1 -0
  100. package/dist/core/store/header.d.ts +64 -0
  101. package/dist/core/store/header.d.ts.map +1 -0
  102. package/dist/core/store/index.d.ts +16 -0
  103. package/dist/core/store/index.d.ts.map +1 -0
  104. package/dist/core/store/region_table.d.ts +74 -0
  105. package/dist/core/store/region_table.d.ts.map +1 -0
  106. package/dist/core/store/snapshot.d.ts +43 -0
  107. package/dist/core/store/snapshot.d.ts.map +1 -0
  108. package/dist/core/store/state_hash.d.ts +38 -0
  109. package/dist/core/store/state_hash.d.ts.map +1 -0
  110. package/dist/core/store/store_regions.d.ts +38 -0
  111. package/dist/core/store/store_regions.d.ts.map +1 -0
  112. package/dist/extensions/editor/editor.d.ts +149 -0
  113. package/dist/extensions/editor/editor.d.ts.map +1 -0
  114. package/dist/extensions/editor/field_handle.d.ts +35 -0
  115. package/dist/extensions/editor/field_handle.d.ts.map +1 -0
  116. package/dist/extensions/editor/index.cjs +1 -0
  117. package/dist/extensions/editor/index.d.ts +21 -0
  118. package/dist/extensions/editor/index.d.ts.map +1 -0
  119. package/dist/extensions/editor/index.js +209 -0
  120. package/dist/extensions/reactive/ecs_sync.d.ts +210 -0
  121. package/dist/extensions/reactive/ecs_sync.d.ts.map +1 -0
  122. package/dist/extensions/reactive/index.cjs +1 -0
  123. package/dist/extensions/reactive/index.d.ts +23 -0
  124. package/dist/extensions/reactive/index.d.ts.map +1 -0
  125. package/dist/extensions/reactive/index.js +225 -0
  126. package/dist/extensions/solid/index.cjs +1 -0
  127. package/dist/extensions/solid/index.d.ts +6 -0
  128. package/dist/extensions/solid/index.d.ts.map +1 -0
  129. package/dist/extensions/solid/index.js +32 -0
  130. package/dist/extensions/solid/kernel_solid.d.ts +42 -0
  131. package/dist/extensions/solid/kernel_solid.d.ts.map +1 -0
  132. package/dist/index.cjs +2 -1
  133. package/dist/index.d.ts +16 -12
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +8563 -1233
  136. package/dist/interop-CT-REx0W.cjs +1 -0
  137. package/dist/interop-CcY6ASQc.js +18 -0
  138. package/dist/kernel-DgyrLFjW.js +227 -0
  139. package/dist/kernel-yWV3XnAb.cjs +1 -0
  140. package/dist/log/console_sink.d.ts +4 -0
  141. package/dist/log/console_sink.d.ts.map +1 -0
  142. package/dist/log/index.d.ts +3 -0
  143. package/dist/log/index.d.ts.map +1 -0
  144. package/dist/log/logger.d.ts +27 -0
  145. package/dist/log/logger.d.ts.map +1 -0
  146. package/dist/primitives.cjs +1 -0
  147. package/dist/primitives.d.ts +18 -0
  148. package/dist/primitives.d.ts.map +1 -0
  149. package/dist/primitives.js +44 -0
  150. package/dist/shared-BXSZnxx4.cjs +1 -0
  151. package/dist/shared-C678TAPY.js +99 -0
  152. package/dist/shared.cjs +1 -0
  153. package/dist/shared.d.ts +22 -0
  154. package/dist/shared.d.ts.map +1 -0
  155. package/dist/shared.js +7 -0
  156. package/dist/topological_sort-DlRpSrxu.js +391 -0
  157. package/dist/topological_sort-WAT-VHb-.cjs +1 -0
  158. package/dist/type_primitives/assertions.d.ts +12 -8
  159. package/dist/type_primitives/assertions.d.ts.map +1 -1
  160. package/dist/type_primitives/binary_heap/binary_heap.d.ts +6 -2
  161. package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
  162. package/dist/type_primitives/bitset/bitset.d.ts +16 -4
  163. package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
  164. package/dist/type_primitives/brand.d.ts +6 -1
  165. package/dist/type_primitives/brand.d.ts.map +1 -1
  166. package/dist/type_primitives/error.d.ts +4 -0
  167. package/dist/type_primitives/error.d.ts.map +1 -1
  168. package/dist/type_primitives/index.d.ts +3 -0
  169. package/dist/type_primitives/index.d.ts.map +1 -1
  170. package/dist/type_primitives/sparse_map/sparse_map.d.ts +7 -3
  171. package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
  172. package/dist/type_primitives/sparse_set/sparse_set.d.ts +4 -0
  173. package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
  174. package/dist/type_primitives/topological_sort/topological_sort.d.ts +7 -3
  175. package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
  176. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +53 -16
  177. package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
  178. package/dist/utils/arrays.d.ts +1 -1
  179. package/dist/utils/arrays.d.ts.map +1 -1
  180. package/dist/utils/error.d.ts +2 -20
  181. package/dist/utils/error.d.ts.map +1 -1
  182. package/package.json +36 -9
  183. package/dist/archetype.d.ts +0 -101
  184. package/dist/archetype.d.ts.map +0 -1
  185. package/dist/component.d.ts +0 -45
  186. package/dist/component.d.ts.map +0 -1
  187. package/dist/ecs.d.ts +0 -104
  188. package/dist/ecs.d.ts.map +0 -1
  189. package/dist/entity.d.ts +0 -11
  190. package/dist/entity.d.ts.map +0 -1
  191. package/dist/event.d.ts +0 -30
  192. package/dist/event.d.ts.map +0 -1
  193. package/dist/query.d.ts +0 -90
  194. package/dist/query.d.ts.map +0 -1
  195. package/dist/ref.d.ts +0 -23
  196. package/dist/ref.d.ts.map +0 -1
  197. package/dist/resource.d.ts +0 -23
  198. package/dist/resource.d.ts.map +0 -1
  199. package/dist/schedule.d.ts +0 -45
  200. package/dist/schedule.d.ts.map +0 -1
  201. package/dist/store.d.ts +0 -118
  202. package/dist/store.d.ts.map +0 -1
  203. package/dist/system.d.ts +0 -16
  204. package/dist/system.d.ts.map +0 -1
@@ -0,0 +1,533 @@
1
+ import { Template, TemplateEntries, TemplateOverrides } from './store';
2
+ import { FrameTraceSink } from './frame_trace';
3
+ import { ObserverHandle, EntitySetObserverConfig, ArchetypeSetObserverConfig, StructuralObserverConfig } from './observer';
4
+ import { ColumnStore, ColumnStoreRegionHandle, StoreRegionSpec } from '../store';
5
+ import { SCHEDULE, SystemEntry, SystemSet, SystemSetConfig } from './schedule';
6
+ import { Archetype, ArchetypeID } from './archetype';
7
+ import { SystemContext, Query, QueryBuilder, ChangedQuery, QueryResolver } from './query';
8
+ import { EntityID } from './entity';
9
+ import { ComponentDef, ComponentSchema, FieldValues, BundleOrDef } from './component';
10
+ import { SparseComponentDef, SparseComponentID } from './sparse_store';
11
+ import { RelationDef, RelationOptions } from './relation';
12
+ import { EventKey, EventReader, EventSchema, SignalKey } from './event';
13
+ import { ResourceKey } from './resource';
14
+ import { SystemFn, SystemConfig, SystemDescriptor } from './system';
15
+ import { BitSet, TypedArrayTag } from '../../type_primitives';
16
+ import { StoreLayoutListener } from './store_layout_listener';
17
+ import { ComputeBackend } from './compute_backend';
18
+ import { ResolvedECSMemory, ECSMemoryOptions } from './ecs_memory';
19
+ export interface ECSOptions {
20
+ fixedTimestep?: number;
21
+ maxFixedSteps?: number;
22
+ /** How the world's memory is sized and backed (#682) — the single
23
+ * sizing surface, replacing the pre-release `initialCapacity` +
24
+ * `bufferAllocator` pair. Express intent through exactly one arm:
25
+ * `{ budget: { entities } }` (derive everything), `{ maxBytes }`
26
+ * (explicit cap), `{ wasm: { memory } | { maximumPages } }` (the SAB
27
+ * IS a WebAssembly.Memory — zero-copy with a WASM `ComputeBackend`), or
28
+ * `{ allocator }` (expert escape hatch, in-place-typed per ADR-0008).
29
+ * Omitted ⇒ growable backing with a 256 MiB cap and 1024-row columns.
30
+ * The resolved plan is exposed as `ECS.memoryPlan`. */
31
+ memory?: ECSMemoryOptions;
32
+ /** Consumer-declared SAB regions (#623), forwarded to `Store`. Each
33
+ * `StoreRegionSpec` carries an opaque `region_id`, a precomputed byte size,
34
+ * and an `init` closure; the engine lays them out generically and exposes
35
+ * them via `regionHandle(id)` / `regionOffset(id)`. A game (e.g.
36
+ * `@internal/sim`'s region specs) supplies these — the engine ships no
37
+ * game regions of its own. Replaces the eight game-named region options
38
+ * (`terrain_map_radius`, `spatial_grid_*`, `army_*`, `flow_field_*`,
39
+ * `actionRingCapacitySlots`) the ECS used to carry. (ADR-0018.) */
40
+ regions?: readonly StoreRegionSpec[];
41
+ /** Byte size of the opt-in sim-bindings region (#625), forwarded to `Store`.
42
+ * A consumer that attaches a WASM `ComputeBackend` passes its own size — for
43
+ * this game, `@internal/sim`'s `SIM_BINDINGS_BYTES` (computed from the binding
44
+ * manifest) — so the host can publish the `(component_id, field_id)` IDs the
45
+ * accelerated systems read. Omitted / 0 ⇒ no region: a pure-TS world pays
46
+ * nothing for the WASM seam. The size is a runtime input, not an engine ABI
47
+ * constant, since #625 de-welded it from the generated ABI. */
48
+ bindingsRegionBytes?: number;
49
+ /** Opt into the **determinism surface** (#626 / ADR-0020), forwarded to
50
+ * `Store`. Default `false`. When `false`, the canonical-ordering methods
51
+ * (`stateHash`, `snapshotSparse`, `restoreSparse`) throw
52
+ * `DETERMINISM_DISABLED`; when `true`, today's replay/hash behavior is
53
+ * reproduced bit-for-bit. Determinism is the implementer's choice — our
54
+ * server match opts in (replay verification), the client stays off (it rolls
55
+ * back via diffs, not re-sim). The flag gates ONLY that surface: memory-safety
56
+ * invariants (the in-place SAB allocator, ADR-0008) and the `enabled_count`
57
+ * partition are always-on regardless. */
58
+ deterministic?: boolean;
59
+ }
60
+ export declare class ECS implements QueryResolver {
61
+ private readonly store;
62
+ private readonly schedule;
63
+ private readonly ctx;
64
+ /** Component observers (#517 §1 / ADR-0013). Inert until `observe(...)` is
65
+ * called — the structural-flush fast path is byte-for-byte unchanged. */
66
+ private readonly _observers;
67
+ private readonly systems;
68
+ private nextSystemId;
69
+ private _tick;
70
+ private _fixedTimestep;
71
+ private _accumulator;
72
+ private _maxFixedSteps;
73
+ private readonly queryCache;
74
+ private readonly scratchMask;
75
+ private _nextQueryIdCounter;
76
+ readonly _andSingleCache: Map<number, Query<any>>;
77
+ readonly _notSingleCache: Map<number, Query<any>>;
78
+ readonly _anyOfSingleCache: Map<number, Query<any>>;
79
+ readonly _changedSingleCache: Map<number, ChangedQuery<any>>;
80
+ readonly _withSparseSingleCache: Map<number, Query<any>>;
81
+ readonly _withoutSparseSingleCache: Map<number, Query<any>>;
82
+ readonly _withRelationSingleCache: Map<number, Query<any>>;
83
+ readonly _withoutRelationSingleCache: Map<number, Query<any>>;
84
+ readonly _optionalSingleCache: Map<number, Query<any>>;
85
+ readonly _includeDisabledSingleCache: Map<number, Query<any>>;
86
+ readonly _hierarchySingleCache: Map<number, Query<any>>;
87
+ private readonly _layoutSubscribers;
88
+ private _backend;
89
+ private readonly _memory;
90
+ /** What `ECSOptions.memory` resolved to (#682): backing allocator kind,
91
+ * column capacity, entity-index reservation, byte cap, and a
92
+ * human-readable derivation trace. Diagnostics surface — log it when
93
+ * sizing questions come up instead of reverse-engineering the SAB. */
94
+ get memoryPlan(): ResolvedECSMemory;
95
+ /** The backing `WebAssembly.Memory` when `memory.wasm` was used (both
96
+ * bring-your-own and engine-constructed), else `null`. A consumer hands
97
+ * this to its WASM `ComputeBackend` so the sim and the live columns
98
+ * share the same bytes. */
99
+ get wasmMemory(): WebAssembly.Memory | null;
100
+ constructor(options?: ECSOptions);
101
+ /** Resolve a consumer-declared SAB region's byte offset by `region_id`, or
102
+ * 0 when absent. Generic, de-gamed replacement (#623) for the removed
103
+ * game-named accessors; pair with the consumer's own region module to
104
+ * materialise a typed view. Delegates to `Store.regionOffset`. */
105
+ regionOffset(regionId: number): number;
106
+ /** A handle (`{ buffer, view, offset, bytes }`) to a consumer-declared SAB
107
+ * region resolved by `region_id`, or `null` when absent. A consumer's
108
+ * region module builds a TypedArray view over the region's span from this.
109
+ * Re-fetch after a SAB grow. Delegates to `Store.regionHandle`. (#623) */
110
+ regionHandle(regionId: number): ColumnStoreRegionHandle | null;
111
+ /** Batch variant of `regionHandle` for hosts wiring several consumer
112
+ * regions at startup: returns the handles in argument order, never null —
113
+ * throws ONE `REGION_NOT_DECLARED` naming every missing region id instead
114
+ * of a null-guard per region. Same staleness rule as `regionHandle`:
115
+ * re-fetch after a SAB grow. */
116
+ regionHandles(...regionIds: number[]): ColumnStoreRegionHandle[];
117
+ /** Subscribe to SAB-layout publications. `listener.setLayout(0)` is
118
+ * called immediately to seed the initial layout, then again after
119
+ * every SAB grow / extend (the `view_stamp` republish protocol).
120
+ * Returns an unsubscribe function.
121
+ *
122
+ * The engine has no concept of what subscribes — it publishes SAB layouts
123
+ * and walks away. A consumer subscribes whatever wrapper it owns (a compute
124
+ * backend, a Worker proxy, a debug recorder) and drives it from its own
125
+ * code. A `ComputeBackend` is subscribed automatically by `attachBackend`,
126
+ * so most consumers call that rather than this directly. */
127
+ onStoreLayoutPublished(listener: StoreLayoutListener): () => void;
128
+ /** Attach an opt-in compute backend (#622). Default is none: a bare `ECS`
129
+ * runs pure-TS systems and the schedule's dispatch is byte-for-byte the
130
+ * no-backend path. Once attached, a scheduled system carrying a
131
+ * `backendHandle` (its `SystemConfig`) is executed via `backend.run(handle)`
132
+ * instead of its `fn` closure; systems without a handle are unaffected.
133
+ *
134
+ * The backend is also subscribed as a SAB-layout listener (seeded now, then
135
+ * republished on every grow), folding in the `onStoreLayoutPublished` seam.
136
+ * Returns a detach function that unsubscribes the layout listener and reverts
137
+ * the schedule to the pure-TS path.
138
+ *
139
+ * One backend per ECS: attaching while one is already attached throws in
140
+ * `__DEV__` (detach first). The engine never inspects the backend beyond
141
+ * `setLayout` / `run` — it carries no game vocabulary. */
142
+ attachBackend(backend: ComputeBackend): () => void;
143
+ /** Look up the field index a component reserves for `fieldName`. The
144
+ * index is assigned by `registerComponent` in insertion order and is
145
+ * stable for the lifetime of the ECS. Used by systems that need to
146
+ * pass `(component_id, field_id)` pairs across the WASM FFI — the Zig
147
+ * side identifies columns by these numeric IDs. */
148
+ fieldId<S extends Record<string, TypedArrayTag>>(def: ComponentDef<S>, fieldName: Extract<keyof S, string>): number;
149
+ /** Resolve an archetype's row index to the `EntityID` at that slot.
150
+ * A WASM system that drains events from the event ring as
151
+ * `(archId, row, …)` payloads uses this to convert the (archId, row)
152
+ * pair into the `EntityID` the `ctx.emit(...)` API expects.
153
+ * Throws if the (archId, row) pair is out of range. (#250 / Phase 4
154
+ * PR 4D) */
155
+ entityIdAtRow(archetypeId: number, row: number): EntityID;
156
+ get fixedTimestep(): number;
157
+ set fixedTimestep(value: number);
158
+ get fixedAlpha(): number;
159
+ /** The single SAB backing every archetype's column views. Exposed for
160
+ * snapshot/restore, `columnStoreStateHash`-based determinism checks, and
161
+ * Phase 2+ WASM/worker hand-off paths. Mutation flows through the
162
+ * usual `addComponent` / `removeComponent` / `flush` APIs; readers
163
+ * that hold a column view across a grow must consult
164
+ * `header.view_stamp` to detect a republish (#171 §8.1). */
165
+ get columnStore(): ColumnStore;
166
+ /** Count of live archetypes (including the empty one). Surfaces the
167
+ * Store-side `archetype_count` so Phase C tests can assert the
168
+ * pre-warmed closure was materialised; equally useful for diagnostics. */
169
+ get archetypeCount(): number;
170
+ /** Count of registered relations (#471). Surfaces the Store-side count so
171
+ * tests can assert it alongside `archetype_count` when checking the
172
+ * no-transition invariant. */
173
+ get relationCount(): number;
174
+ /** Whether the determinism surface is enabled (#626 / ADR-0020). `false`
175
+ * (the default) ⇒ `stateHash` / `snapshotSparse` / `restoreSparse` throw
176
+ * `DETERMINISM_DISABLED`. Opt in via `new ECS({ deterministic: true })`. */
177
+ get deterministic(): boolean;
178
+ /** Attach (or detach with `null`) a per-world frame-trace sink (ADR-0030):
179
+ * the engine then fires structured `FrameTraceSink` events at each system,
180
+ * flush, command, observer firing, and event during `update()`, so a consumer
181
+ * can reconstruct exactly what travelled through the ECS each frame. The sink
182
+ * also receives a `phaseBoundary(phase)` at each phase's post-flush settle
183
+ * point — the safe seam to read `stateHash()` between phases of one frame and
184
+ * bisect a divergence to the exact phase (#797 / ADR-0032). The seam is
185
+ * `__DEV__`-gated end to end — in a production build this setter keeps an empty
186
+ * body and the world never retains a sink. The sink only observes; it does not
187
+ * perturb `stateHash`, ordering, or any behaviour. */
188
+ setTrace(sink: FrameTraceSink | null): void;
189
+ /** FNV-1a 32 over (archetype_id, live row count, live column bytes)
190
+ * for every archetype in id order. The canonical "live ECS state
191
+ * digest" — broader than the pre-#171 per-networked-component fold
192
+ * (every column contributes, not just BIT_HEALTH / BIT_HEX_POS etc.)
193
+ * and tighter than `columnStoreStateHash(ecs.columnStore)` (skips trailing
194
+ * unused SAB capacity). Per-call cost scales with live entity count,
195
+ * not SAB capacity. (#171 §6.1.9 Phase 5)
196
+ *
197
+ * Opt-in (#626 / ADR-0020): throws `DETERMINISM_DISABLED` unless the ECS was
198
+ * constructed with `{ deterministic: true }`. */
199
+ stateHash(): number;
200
+ /** Serialize the sparse stores (out-of-identity components, ADR-0011) to a
201
+ * self-contained byte buffer — the sparse half of a world snapshot, written
202
+ * in canonical entity-index order so it's insertion-order-independent
203
+ * (#470). The dense half is the SAB snapshot (`snapshotColumnStore(columnStore)`).
204
+ * Pairs with `restoreSparse`.
205
+ *
206
+ * Opt-in (#626 / ADR-0020): throws `DETERMINISM_DISABLED` unless the ECS was
207
+ * constructed with `{ deterministic: true }`. */
208
+ snapshotSparse(): Uint8Array;
209
+ /** Repopulate the sparse stores from `snapshotSparse` bytes (full-equality
210
+ * round-trip of membership + data). Sparse components must already be
211
+ * registered in the same order; throws `SparseRestoreError` on a shape or
212
+ * identity mismatch (store/field count, field-identity schema hash, an entity
213
+ * index past `MAX_INDEX`, or a non-canonical frame with trailing bytes).
214
+ *
215
+ * Opt-in (#626 / ADR-0020): throws `DETERMINISM_DISABLED` unless the ECS was
216
+ * constructed with `{ deterministic: true }`. */
217
+ restoreSparse(bytes: Uint8Array): void;
218
+ /** Capture the full live world — dense (SAB columns), sparse + relations, and
219
+ * the host-side bookkeeping the SAB omits (tick, entity recycle free-list,
220
+ * alive count, per-archetype row/enabled counts) — to one self-contained byte
221
+ * buffer that `restoreInto` can mount back onto a live, ticking world
222
+ * ("rewind a running world and keep ticking", #789). Take it at a tick
223
+ * boundary (between `update()`s).
224
+ *
225
+ * Opt-in (ADR-0020): throws `DETERMINISM_DISABLED` unless `{ deterministic:
226
+ * true }`. v1 does NOT capture resources, events, or change-detection /
227
+ * scheduler baselines (`changed()` queries) — see ADR-0031. */
228
+ snapshot(): Uint8Array;
229
+ /** Mount a `snapshot()` buffer onto this live world and leave it ready to keep
230
+ * ticking (#789). Fails closed on a malformed frame or a registration mismatch
231
+ * (different component/archetype graph, mismatched entity-index capacity, or a
232
+ * divergent sparse-store registration) BEFORE mutating any live state — the
233
+ * guard reads the snapshot's descriptors + sparse-section shape from the bytes,
234
+ * since the dense build reuses (and overwrites) the live in-place backing.
235
+ * Throws `WorldRestoreError` (dense) / `SparseRestoreError` (sparse). Requires a
236
+ * world whose archetype set + column layout match the snapshot's (prewarm so the
237
+ * set is stable).
238
+ *
239
+ * Opt-in (ADR-0020): throws `DETERMINISM_DISABLED` unless `{ deterministic:
240
+ * true }`. */
241
+ restoreInto(bytes: Uint8Array): void;
242
+ registerComponent<S extends Record<string, TypedArrayTag>>(schema: S): ComponentDef<S>;
243
+ registerComponent<const F extends readonly string[], T extends TypedArrayTag = "f64">(fields: F, type?: T): ComponentDef<{
244
+ readonly [K in F[number]]: T;
245
+ }>;
246
+ registerTag(): ComponentDef<Record<string, never>>;
247
+ registerSparseComponent<S extends Record<string, TypedArrayTag>>(schema: S): SparseComponentDef<S>;
248
+ registerSparseComponent<const F extends readonly string[], T extends TypedArrayTag = "f64">(fields: F, type?: T): SparseComponentDef<{
249
+ readonly [K in F[number]]: T;
250
+ }>;
251
+ /** Register a sparse tag (empty schema) — membership only, no data. */
252
+ registerSparseTag(): SparseComponentDef<Record<string, never>>;
253
+ registerEvent<S extends EventSchema>(key: EventKey<S>, fields: readonly (keyof S & string)[]): void;
254
+ registerSignal(key: SignalKey): void;
255
+ registerResource<T>(key: ResourceKey<T>, value: T): void;
256
+ resource<T>(key: ResourceKey<T>): T;
257
+ setResource<T>(key: ResourceKey<T>, value: T): void;
258
+ /** Drop a resource from the world (#798). Unlike {@link registerResource}
259
+ * — a one-time world-setup op — this is a runtime mutation, so it is access-
260
+ * checked as a *write* (a system removing a resource must declare it in
261
+ * `resourceWrites`, which is what serialises it against readers/writers of the
262
+ * same key). Fails closed on a missing key. Afterwards the key is free to
263
+ * `registerResource` again — the present → absent → present lifecycle.
264
+ * Resources are out of `stateHash` and snapshot/resume, so a remove never
265
+ * perturbs the determinism hash. */
266
+ removeResource<T>(key: ResourceKey<T>): void;
267
+ hasResource<T>(key: ResourceKey<T>): boolean;
268
+ createEntity(): EntityID;
269
+ createEntity<Defs extends readonly ComponentDef[]>(template: Template<Defs>, overrides?: TemplateOverrides<Defs>): EntityID;
270
+ /** Register an archetype template (#462). Resolves the component set +
271
+ * default field values to a target archetype once (creating it if absent —
272
+ * fits the prewarm model), so later `spawn` / `spawnMany` calls land
273
+ * entities directly in that archetype with **zero archetype transitions**.
274
+ *
275
+ * const Bullet = ecs.template([
276
+ * { def: Position, values: { x: 0, y: 0 } },
277
+ * { def: Velocity, values: { vx: 0, vy: 0 } },
278
+ * ]);
279
+ *
280
+ * The big win is multi-component entities and bulk spawns; a single-
281
+ * component spawn is no faster than `createEntity` + `addComponent`, which
282
+ * already bump-allocates a fresh entity into the target archetype. See
283
+ * ADR-0010. */
284
+ template<Defs extends readonly ComponentDef[]>(entries: TemplateEntries<Defs>): Template<Defs>;
285
+ /** Bulk-spawn `count` identical entities from `template`. Field writes are
286
+ * O(columns) (one `TypedArray.fill` per column), not O(count×columns).
287
+ * Returns the new ids in spawn order. */
288
+ createEntities(template: Template, count: number): EntityID[];
289
+ /**
290
+ * Spawn an entity from varargs bundles (§bundles) — the immediate
291
+ * host-side analog of `ctx.commands.spawn`. `ecs.spawnBundle(bundle(Pos,{x,y}),
292
+ * bundle(Vel,{vx:1}), IsEnemy)` collapses the five attach shapes into one. Each
293
+ * bundle is applied immediately; a single combined-archetype insertion (one
294
+ * transition instead of one-per-component) is a later optimization — for the
295
+ * prototype this mirrors the existing per-component `addComponent` path.
296
+ */
297
+ spawnBundle(...items: BundleOrDef[]): EntityID;
298
+ /** Buffer an entity for deferred destruction (applied at the next phase
299
+ * flush — matches the semantics of `SystemContext.destroyEntity`). The
300
+ * ECS surface is unsuffixed because the context (`ECS` vs Store) already
301
+ * implies the mode; `Store.destroyEntity` is the immediate path. */
302
+ destroyEntity(id: EntityID): void;
303
+ isAlive(id: EntityID): boolean;
304
+ get entityCount(): number;
305
+ addComponent(entityId: EntityID, def: ComponentDef<Record<string, never>>): this;
306
+ addComponent<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, values: FieldValues<S>): this;
307
+ addComponents(entityId: EntityID, entries: {
308
+ def: ComponentDef;
309
+ values?: Record<string, number>;
310
+ }[]): void;
311
+ removeComponent(entityId: EntityID, def: ComponentDef): this;
312
+ removeComponents(entityId: EntityID, defs: ComponentDef[]): void;
313
+ hasComponent(entityId: EntityID, def: ComponentDef): boolean;
314
+ /** Disable `id` (idempotent). Excluded from default queries until re-enabled. */
315
+ disable(id: EntityID): this;
316
+ /** Re-enable a disabled `id` (idempotent). */
317
+ enable(id: EntityID): this;
318
+ /** Whether `id` is currently disabled. */
319
+ isDisabled(id: EntityID): boolean;
320
+ addSparse(entityId: EntityID, def: SparseComponentDef<Record<string, never>>): this;
321
+ addSparse<S extends ComponentSchema>(entityId: EntityID, def: SparseComponentDef<S>, values: FieldValues<S>): this;
322
+ removeSparse(entityId: EntityID, def: SparseComponentDef): this;
323
+ hasSparse(entityId: EntityID, def: SparseComponentDef): boolean;
324
+ getSparseField<S extends ComponentSchema>(entityId: EntityID, def: SparseComponentDef<S>, field: string & keyof S): number;
325
+ setSparseField<S extends ComponentSchema>(entityId: EntityID, def: SparseComponentDef<S>, field: string & keyof S, value: number): void;
326
+ /** Register a relation kind. Exclusive (default) stores one target per
327
+ * source in a backing sparse component; `{ multi: true }` stores a target
328
+ * set per source. `{ onDeleteTarget: "delete" | "clear" | "orphan" }`
329
+ * selects what happens to a relation's sources when a target is destroyed
330
+ * (default `orphan`, #473). See `registerRelation` on `Store` / ADR-0011. */
331
+ registerRelation(opts?: RelationOptions): RelationDef;
332
+ /** Add a `(R, tgt)` pair to `src`. Exclusive replaces the existing target;
333
+ * multi adds to the set. No archetype transition. */
334
+ addRelation(src: EntityID, def: RelationDef, tgt: EntityID): this;
335
+ /** Remove a `(R, tgt)` pair from `src`. For multi, omitting `tgt` removes
336
+ * all of `src`'s targets. No archetype transition. */
337
+ removeRelation(src: EntityID, def: RelationDef, tgt?: EntityID): this;
338
+ /** The single target of `src` under an exclusive relation, or `undefined`. */
339
+ targetOf(src: EntityID, def: RelationDef): EntityID | undefined;
340
+ /** All targets of `src` under `R`, ascending by id. */
341
+ targetsOf(src: EntityID, def: RelationDef): EntityID[];
342
+ /** Sources pointing at `tgt` under `R` (the reverse index), ascending by id. */
343
+ sourcesOf(def: RelationDef, tgt: EntityID): EntityID[];
344
+ /** Whether `src` holds any pair under `R`. */
345
+ hasRelation(src: EntityID, def: RelationDef): boolean;
346
+ /** All `(source, target)` pairs of relation `R` — the `(R, *)` wildcard
347
+ * (#472). Sources in canonical entity-index order; a multi source's targets
348
+ * ascending by id. Cold path. */
349
+ pairsOf(def: RelationDef): [EntityID, EntityID][];
350
+ /** Every `(relation, source)` pointing at `tgt`, across all relation kinds —
351
+ * the `(*, T)` wildcard (#472). Ordered by relation id then source id. The
352
+ * single-relation form is `sourcesOf(def, tgt)`. */
353
+ sourcesOfAny(tgt: EntityID): [RelationDef, EntityID][];
354
+ /** Reclaim relation reverse-index memory: drop every reverse entry whose
355
+ * target has been destroyed, returning the total dropped (#491). Under the
356
+ * default `orphan` policy a destroyed target's reverse entry lingers until
357
+ * each source re-targets or dies, so orphan-pointing at a churn of
358
+ * short-lived targets grows the index without bound. A purely cold-path
359
+ * reclaim — no observable state change (forward links stay dangling per
360
+ * `orphan`, `stateHash` is unaffected) — call it at scene/snapshot
361
+ * boundaries. */
362
+ compactRelations(): number;
363
+ /** Walk relation `R` up from `src` to its chain root, returning
364
+ * `[src, parent, …, root]` (nearest-ancestor-first). Exclusive only. */
365
+ ancestorsOf(src: EntityID, def: RelationDef): EntityID[];
366
+ /** The root of `src`'s `R`-chain (`src` itself when it has no target).
367
+ * Exclusive only. */
368
+ rootOf(src: EntityID, def: RelationDef): EntityID;
369
+ /** Walk relation `R` down from `root` over the reverse index, returning the
370
+ * subtree (including `root`) breadth-first — parents before children (the
371
+ * `cascade` order). Exclusive only. */
372
+ cascadeOf(root: EntityID, def: RelationDef): EntityID[];
373
+ /**
374
+ * Bulk add a component to ALL entities in the given archetype.
375
+ * O(columns) via TypedArray.set() instead of O(N×columns).
376
+ *
377
+ * Takes an `ArchetypeID` (from `ArchetypeView.id`) rather than a concrete
378
+ * `Archetype` — the concrete type is internal (issue #378).
379
+ */
380
+ batchAddComponent(src: ArchetypeID, def: ComponentDef<Record<string, never>>): void;
381
+ batchAddComponent<S extends ComponentSchema>(src: ArchetypeID, def: ComponentDef<S>, values: FieldValues<S>): void;
382
+ /**
383
+ * Bulk remove a component from ALL entities in the given archetype.
384
+ * O(columns) via TypedArray.set() instead of O(N×columns).
385
+ *
386
+ * Takes an `ArchetypeID` (from `ArchetypeView.id`); see `batchAddComponent`.
387
+ */
388
+ batchRemoveComponent(src: ArchetypeID, def: ComponentDef): void;
389
+ getField<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, field: string & keyof S): number;
390
+ setField<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, field: string & keyof S, value: number): void;
391
+ /** Read-modify-write one field: `updateField(e, Gold, "value", v => v - cost)`
392
+ * is the one-line form of the `getField` → compute → `setField` round trip.
393
+ * Returns the written value. Same access-check and observer semantics as the
394
+ * two calls it composes. */
395
+ updateField<S extends ComponentSchema>(entityId: EntityID, def: ComponentDef<S>, field: string & keyof S, fn: (current: number) => number): number;
396
+ emit(key: SignalKey): void;
397
+ emit<S extends EventSchema>(key: EventKey<S>, values: S): void;
398
+ read<S extends EventSchema>(key: EventKey<S>): EventReader<S>;
399
+ query<T extends ComponentDef[]>(...defs: T): Query<T>;
400
+ _getLastRunTick(): number;
401
+ /** Current ECS write tick — the tick `eachChunk` stamps via `cols.mut` (§eachChunk). */
402
+ _getCurrentTick(): number;
403
+ _getQueryDirtyEpoch(): number;
404
+ _nextQueryId(): number;
405
+ /** QueryResolver implementation — sparse-membership match path (#469). */
406
+ _forEachSparseMatch(include: BitSet, exclude: BitSet | null, anyOf: BitSet | null, sparseInclude: readonly SparseComponentID[], sparseExclude: readonly SparseComponentID[], denseArchetypes: readonly Archetype[], cb: (entityId: EntityID) => void, includeDisabled: boolean): void;
407
+ /** QueryResolver implementation — backing sparse id of a relation, for the
408
+ * `(R, *)` wildcard term (`Query.withRelation`, #579). */
409
+ _relationBackingSparseId(def: RelationDef): SparseComponentID;
410
+ /** QueryResolver implementation — `(*, T)` wildcard match path (#579). */
411
+ _forEachRelationTargetMatch(target: EntityID, include: BitSet, exclude: BitSet | null, anyOf: BitSet | null, sparseInclude: readonly SparseComponentID[], sparseExclude: readonly SparseComponentID[], includeDisabled: boolean, cb: (entityId: EntityID) => void): void;
412
+ /** QueryResolver implementation — depth-ordered hierarchy match path (#581). */
413
+ _forEachHierarchyMatch(include: BitSet, exclude: BitSet | null, anyOf: BitSet | null, sparseInclude: readonly SparseComponentID[], sparseExclude: readonly SparseComponentID[], denseArchetypes: readonly Archetype[], relation: RelationDef, maxDepth: number, includeDisabled: boolean, cb: (entityId: EntityID) => void): void;
414
+ /** QueryResolver implementation — creates or retrieves a cached Query. */
415
+ _resolveQuery(include: BitSet, exclude: BitSet | null, anyOf: BitSet | null, defs: readonly ComponentDef[]): Query<any>;
416
+ private _findCached;
417
+ /**
418
+ * Register a system.
419
+ *
420
+ * // Bare function (no query, no lifecycle hooks)
421
+ * world.registerSystem((ctx, dt) => { ... });
422
+ *
423
+ * // Function + query builder (query resolved at registration time)
424
+ * world.registerSystem(
425
+ * (q, ctx, dt) => { q.forEach((arch) => { ... }); },
426
+ * (qb) => qb.with(Pos, Vel),
427
+ * );
428
+ *
429
+ * // Full config — declares reads/writes (dev-checked) + optional lifecycle hooks
430
+ * world.registerSystem({ reads: [Pos, Vel], writes: [Pos], fn(ctx, dt) { ... } });
431
+ */
432
+ registerSystem(fn: SystemFn): SystemDescriptor;
433
+ registerSystem<Defs extends readonly ComponentDef[]>(fn: (q: Query<Defs>, ctx: SystemContext, dt: number) => void, queryFn: (qb: QueryBuilder) => Query<Defs>): SystemDescriptor;
434
+ registerSystem(config: SystemConfig): SystemDescriptor;
435
+ addSystems(label: SCHEDULE, ...entries: (SystemDescriptor | SystemEntry)[]): this;
436
+ /**
437
+ * Configure a `SystemSet` (#576) — the shared run condition and/or ordering
438
+ * every member inherits. Additive and order-independent with respect to
439
+ * `addSystems`: see `Schedule.configureSet`. Returns `this` to chain.
440
+ */
441
+ configureSet(set: SystemSet, config: SystemSetConfig): this;
442
+ removeSystem(system: SystemDescriptor): void;
443
+ get systemCount(): number;
444
+ /**
445
+ * Register a per-component observer (#517 §1 / ADR-0013). Reactions that were
446
+ * hand-polled every tick — "on `Death` added → spawn corpse", "on `HexPos`
447
+ * set → mark the spatial index" — become declarative.
448
+ *
449
+ * - **`onAdd` / `onRemove`** `(eid, ctx)` fire at the structural-flush
450
+ * boundary, after the batch commits, in canonical order (access-topological
451
+ * across observers, entity-id order within), looping to a fixed point so
452
+ * cascades settle. Determinism: a `stateHash` replay reproduces regardless
453
+ * of the order ops were queued.
454
+ * - **`onDisable` / `onEnable`** `(eid, ctx)` fire at the same flush boundary
455
+ * when an entity carrying the component is *disabled* / *enabled* (#577,
456
+ * ADR-0023), once per net transition, for every component the entity carries
457
+ * (a disable is a soft remove of the whole mask from default queries). Like
458
+ * `onAdd`/`onRemove`, an *immediate* `world.disable()` does not fire — only
459
+ * the deferred `ctx.disable()` toggle does. `yieldExisting` seeds enabled
460
+ * members only, so a disabled entity is correctly absent at seed.
461
+ * - **`onSet`** fires at the post-update detection point. Default
462
+ * `granularity: "archetype"` fires `(arch, ctx)` once per changed
463
+ * archetype-column (the consumer iterates `arch.entityCount` rows) — free,
464
+ * reusing the change tick. `granularity: "entity"` fires `(eid, ctx)` once
465
+ * per changed entity, draining the opt-in per-row dirty list (registering it
466
+ * enables dirty tracking for the component; the producer records via
467
+ * `ctx.setField` automatically, or `ctx.markChanged` in a `getColumn`
468
+ * hot loop).
469
+ *
470
+ * Observer callbacks that touch ECS state must declare it via `access`
471
+ * (merged over an all-empty declaration) — undeclared access throws in
472
+ * `__DEV__`, and those decls drive the firing order. `yieldExisting` replays
473
+ * `onAdd` over current matches on registration. Register at world-build time
474
+ * (before `startup()`); the returned handle's `dispose()` unregisters.
475
+ */
476
+ observe<S extends ComponentSchema>(def: ComponentDef<S>, config: StructuralObserverConfig): ObserverHandle;
477
+ observe<S extends ComponentSchema>(def: ComponentDef<S>, config: EntitySetObserverConfig): ObserverHandle;
478
+ observe<S extends ComponentSchema>(def: ComponentDef<S>, config: ArchetypeSetObserverConfig): ObserverHandle;
479
+ startup(): void;
480
+ /** Compute the archetype closure from every registered system's AND
481
+ * observer's `spawns` + `transitions` and ask the store to plant the
482
+ * whole set in one `extendColumnStore` call. Observers carry the same
483
+ * access shape systems do (a synthesized `SystemDescriptor`), so an
484
+ * observer that spawns/transitions gets its target archetype prewarmed
485
+ * too rather than first-touching lazily mid-tick (#768). Exposed as
486
+ * `private` because the only caller is `startup()`; visible to tests via
487
+ * the `archetype_count` delta on the public ECS facade. */
488
+ private prewarmArchetypes;
489
+ update(dt: number): void;
490
+ /**
491
+ * Stamp every SAB-backed archetype's live `length` into its SAB
492
+ * descriptor's `row_count` field. **You usually don't need to call
493
+ * this directly** — `update()` publishes at tick start and
494
+ * `SystemContext.flush()` publishes at every phase boundary, so any
495
+ * WASM scan running inside the schedule sees fresh counts for free.
496
+ * This is an escape hatch for code that mutates archetype state
497
+ * outside the system framework and wants to force a republish without
498
+ * going through `flush()`. No in-repo callers today.
499
+ *
500
+ * Cheap: walks the descriptor region once, does no column I/O.
501
+ */
502
+ publishArchetypeRowCounts(): void;
503
+ flush(): void;
504
+ dispose(): void;
505
+ }
506
+ /** Phase C of issue #213 — archetype closure from a descriptor set.
507
+ *
508
+ * Each descriptor is a system or an observer's synthesized `SystemDescriptor`
509
+ * (#768) — both carry `spawns` + `transitions`. Seeds the worklist with every
510
+ * descriptor's `spawns`; iteratively applies every descriptor's `transitions`
511
+ * to every discovered mask whose components cover the transition's `whenHas`.
512
+ * Returns the union of seeds + reachable targets, deduplicated by hash-bucketed
513
+ * mask equality.
514
+ *
515
+ * Termination: every transition either monotonically grows the mask (add
516
+ * outpacing remove), monotonically shrinks it, or returns a mask the
517
+ * `seen` map already holds. Because the universe of masks is bounded by
518
+ * `2^|components|` (and in practice the in-tree spawn/transition set is
519
+ * tiny — ~20 masks at most), the worklist is finite and we exit when it
520
+ * empties.
521
+ *
522
+ * Liberal `whenHas` per design doc §6.6 — over-approximation is fine; an
523
+ * unreachable transition target costs one descriptor row at the SAB tail,
524
+ * not column bytes. Empty `spawns` + `transitions` short-circuit to zero.
525
+ */
526
+ declare function computeArchetypeClosure(descriptors: Iterable<SystemDescriptor>): BitSet[];
527
+ /** @internal — test seam for the closure walk. Exposed so the prewarm
528
+ * tests can exercise the BFS without standing up a full Store. */
529
+ export declare const _ecsInternals: {
530
+ computeArchetypeClosure: typeof computeArchetypeClosure;
531
+ };
532
+ export {};
533
+ //# sourceMappingURL=ecs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecs.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/ecs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8DK;AAEL,OAAO,EAAS,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACN,aAAa,EACb,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,KAAK,aA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