@adobe/ecs 0.2.1 → 0.2.4

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 (330) hide show
  1. package/README.md +2 -2
  2. package/dist/implementation/compiler/body-access.d.ts +18 -1
  3. package/dist/implementation/compiler/body-access.js +104 -15
  4. package/dist/implementation/compiler/body-access.js.map +1 -1
  5. package/dist/implementation/compiler/describe.d.ts +1 -1
  6. package/dist/implementation/compiler/describe.js +3 -3
  7. package/dist/implementation/compiler/describe.js.map +1 -1
  8. package/dist/implementation/compiler/estree.d.ts +5 -2
  9. package/dist/implementation/compiler/estree.js +8 -5
  10. package/dist/implementation/compiler/estree.js.map +1 -1
  11. package/dist/implementation/compiler/inferred.js +4 -2
  12. package/dist/implementation/compiler/inferred.js.map +1 -1
  13. package/dist/implementation/compiler/signature.js +1 -1
  14. package/dist/implementation/compiler/transform.js +6 -5
  15. package/dist/implementation/compiler/transform.js.map +1 -1
  16. package/dist/implementation/world/activate.js +14 -2
  17. package/dist/implementation/world/activate.js.map +1 -1
  18. package/dist/implementation/world/buffer.d.ts +7 -0
  19. package/dist/implementation/world/buffer.js +7 -0
  20. package/dist/implementation/world/buffer.js.map +1 -1
  21. package/dist/implementation/world/cascade.d.ts +10 -3
  22. package/dist/implementation/world/cascade.js +48 -23
  23. package/dist/implementation/world/cascade.js.map +1 -1
  24. package/dist/implementation/world/commands.js +86 -2
  25. package/dist/implementation/world/commands.js.map +1 -1
  26. package/dist/implementation/world/create.js +53 -2
  27. package/dist/implementation/world/create.js.map +1 -1
  28. package/dist/implementation/world/entities.d.ts +2 -0
  29. package/dist/implementation/world/entities.js +6 -0
  30. package/dist/implementation/world/entities.js.map +1 -1
  31. package/dist/implementation/world/execute.d.ts +4 -4
  32. package/dist/implementation/world/execute.js +132 -83
  33. package/dist/implementation/world/execute.js.map +1 -1
  34. package/dist/implementation/world/finalizers.d.ts +2 -0
  35. package/dist/implementation/world/finalizers.js +24 -3
  36. package/dist/implementation/world/finalizers.js.map +1 -1
  37. package/dist/implementation/world/join.js +22 -4
  38. package/dist/implementation/world/join.js.map +1 -1
  39. package/dist/implementation/world/register.js +2 -2
  40. package/dist/implementation/world/resource-changes.d.ts +18 -0
  41. package/dist/implementation/world/resource-changes.js +66 -0
  42. package/dist/implementation/world/resource-changes.js.map +1 -0
  43. package/dist/implementation/world/rows.d.ts +1 -1
  44. package/dist/implementation/world/rows.js +23 -13
  45. package/dist/implementation/world/rows.js.map +1 -1
  46. package/dist/implementation/world/run-changes.d.ts +38 -0
  47. package/dist/implementation/world/run-changes.js +138 -0
  48. package/dist/implementation/world/run-changes.js.map +1 -0
  49. package/dist/implementation/world/runner.js +19 -15
  50. package/dist/implementation/world/runner.js.map +1 -1
  51. package/dist/implementation/world/sharing.js +1 -1
  52. package/dist/implementation/world/staging.d.ts +4 -0
  53. package/dist/implementation/world/staging.js +15 -3
  54. package/dist/implementation/world/staging.js.map +1 -1
  55. package/dist/implementation/world/state.d.ts +13 -0
  56. package/dist/implementation/world/state.js +13 -1
  57. package/dist/implementation/world/state.js.map +1 -1
  58. package/dist/implementation/world/synchronize.js +72 -22
  59. package/dist/implementation/world/synchronize.js.map +1 -1
  60. package/dist/implementation/world/tables-read.d.ts +9 -0
  61. package/dist/implementation/world/tables-read.js +72 -0
  62. package/dist/implementation/world/tables-read.js.map +1 -0
  63. package/dist/implementation/world/tables.d.ts +10 -0
  64. package/dist/implementation/world/tables.js +401 -0
  65. package/dist/implementation/world/tables.js.map +1 -0
  66. package/dist/implementation/world/thread-observer.js +1 -1
  67. package/dist/implementation/world/thread-observer.js.map +1 -1
  68. package/dist/implementation/world/thread-systems.js +11 -6
  69. package/dist/implementation/world/thread-systems.js.map +1 -1
  70. package/dist/implementation/world/up.js +7 -1
  71. package/dist/implementation/world/up.js.map +1 -1
  72. package/dist/implementation/world/where.d.ts +8 -0
  73. package/dist/implementation/world/where.js +40 -11
  74. package/dist/implementation/world/where.js.map +1 -1
  75. package/dist/index.d.ts +8 -28
  76. package/dist/index.js +4 -9
  77. package/dist/index.js.map +1 -1
  78. package/dist/interface/component/declarations.d.ts +4 -0
  79. package/dist/interface/component/declarations.js +8 -0
  80. package/dist/interface/component/declarations.js.map +1 -0
  81. package/dist/interface/component/declared.d.ts +12 -0
  82. package/dist/interface/component/declared.js +2 -0
  83. package/dist/interface/component/declared.js.map +1 -0
  84. package/dist/interface/component/index.d.ts +2 -0
  85. package/dist/interface/component/index.js +1 -1
  86. package/dist/interface/component/index.js.map +1 -1
  87. package/dist/interface/finalizer/body.d.ts +18 -3
  88. package/dist/interface/finalizer/create.d.ts +7 -5
  89. package/dist/interface/finalizer/create.js +8 -5
  90. package/dist/interface/finalizer/create.js.map +1 -1
  91. package/dist/interface/finalizer/declaration.d.ts +4 -2
  92. package/dist/interface/indexes/declaration-of.d.ts +17 -0
  93. package/dist/interface/indexes/declaration-of.js +20 -0
  94. package/dist/interface/indexes/declaration-of.js.map +1 -0
  95. package/dist/interface/indexes/index.d.ts +1 -0
  96. package/dist/interface/indexes/index.js +1 -0
  97. package/dist/interface/indexes/index.js.map +1 -1
  98. package/dist/interface/registry/names.d.ts +2 -0
  99. package/dist/interface/registry/names.js +9 -0
  100. package/dist/interface/registry/names.js.map +1 -1
  101. package/dist/interface/registry/schedule.d.ts +31 -4
  102. package/dist/interface/registry/schedule.js +185 -24
  103. package/dist/interface/registry/schedule.js.map +1 -1
  104. package/dist/interface/resource/declarations.d.ts +4 -0
  105. package/dist/interface/resource/declarations.js +8 -0
  106. package/dist/interface/resource/declarations.js.map +1 -0
  107. package/dist/interface/resource/index.d.ts +2 -0
  108. package/dist/interface/resource/index.js +1 -1
  109. package/dist/interface/resource/index.js.map +1 -1
  110. package/dist/interface/system/access.d.ts +15 -0
  111. package/dist/interface/system/body.d.ts +11 -6
  112. package/dist/interface/system/check.d.ts +8 -1
  113. package/dist/interface/system/check.js +42 -12
  114. package/dist/interface/system/check.js.map +1 -1
  115. package/dist/interface/system/commands.d.ts +37 -0
  116. package/dist/interface/system/create-resolved.js +1 -1
  117. package/dist/interface/system/create-resolved.js.map +1 -1
  118. package/dist/interface/system/create.d.ts +31 -15
  119. package/dist/interface/system/create.js +8 -7
  120. package/dist/interface/system/create.js.map +1 -1
  121. package/dist/interface/system/declaration.d.ts +9 -2
  122. package/dist/interface/system/describe.d.ts +120 -0
  123. package/dist/interface/system/describe.js +116 -0
  124. package/dist/interface/system/describe.js.map +1 -0
  125. package/dist/interface/system/index.d.ts +1 -0
  126. package/dist/interface/system/index.js +1 -0
  127. package/dist/interface/system/index.js.map +1 -1
  128. package/dist/interface/system/leaf.d.ts +6 -0
  129. package/dist/interface/system/render.js +1 -0
  130. package/dist/interface/system/render.js.map +1 -1
  131. package/dist/interface/system/resolve.d.ts +5 -1
  132. package/dist/interface/system/resolve.js +19 -1
  133. package/dist/interface/system/resolve.js.map +1 -1
  134. package/dist/interface/system/shared-only.d.ts +7 -0
  135. package/dist/interface/system/shared-only.js +2 -0
  136. package/dist/interface/system/shared-only.js.map +1 -0
  137. package/dist/interface/system/tables.d.ts +28 -0
  138. package/dist/interface/system/tables.js +2 -0
  139. package/dist/interface/system/tables.js.map +1 -0
  140. package/dist/interface/world/index.d.ts +1 -1
  141. package/dist/interface/world/table/index.d.ts +27 -0
  142. package/dist/interface/world/table/index.js +3 -0
  143. package/dist/interface/world/table/index.js.map +1 -0
  144. package/dist/interface/world/table/table.d.ts +11 -0
  145. package/dist/interface/world/table/table.js +2 -0
  146. package/dist/interface/world/table/table.js.map +1 -0
  147. package/dist/interface/world/world.d.ts +25 -10
  148. package/dist/world.d.ts +27 -0
  149. package/dist/world.js +27 -0
  150. package/dist/world.js.map +1 -0
  151. package/package.json +11 -2
  152. package/src/exports.test.ts +1 -1
  153. package/src/guide/00-keys.ts +1 -1
  154. package/src/guide/01-resources.md +1 -1
  155. package/src/guide/01-resources.ts +1 -1
  156. package/src/guide/02-entities.ts +2 -2
  157. package/src/guide/03-systems.md +2 -2
  158. package/src/guide/03-systems.out +1 -1
  159. package/src/guide/03-systems.ts +3 -3
  160. package/src/guide/04-ticks.md +1 -1
  161. package/src/guide/04-ticks.ts +3 -3
  162. package/src/guide/05-scheduling.ts +1 -1
  163. package/src/guide/06-sync-points.md +18 -7
  164. package/src/guide/06-sync-points.out +1 -2
  165. package/src/guide/06-sync-points.ts +10 -6
  166. package/src/guide/07-change-filters.ts +2 -2
  167. package/src/guide/08-input.ts +1 -1
  168. package/src/guide/09-rules.ts +1 -1
  169. package/src/guide/11-traits.ts +3 -3
  170. package/src/guide/12-lookups.ts +2 -2
  171. package/src/guide/13-indexes.ts +4 -4
  172. package/src/guide/14-kernels.ts +1 -1
  173. package/src/guide/15-reductions.ts +1 -1
  174. package/src/guide/16-gpu.ts +1 -1
  175. package/src/guide/17-hierarchies.ts +1 -1
  176. package/src/guide/18-identity.out +1 -1
  177. package/src/guide/19-threads.md +4 -2
  178. package/src/guide/19-threads.ts +2 -2
  179. package/src/guide/20-shared.ts +3 -3
  180. package/src/guide/21-dom.md +2 -2
  181. package/src/guide/21-dom.ts +1 -1
  182. package/src/guide/22-canvas.md +1 -1
  183. package/src/guide/22-canvas.ts +1 -1
  184. package/src/guide/CLAUDE.md +1 -1
  185. package/src/guide/guide.test.ts +9 -154
  186. package/src/implementation/compiler/body-access.ts +102 -12
  187. package/src/implementation/compiler/describe.test-helper.ts +1 -1
  188. package/src/implementation/compiler/describe.test.ts +1 -1
  189. package/src/implementation/compiler/describe.ts +3 -3
  190. package/src/implementation/compiler/estree.ts +9 -6
  191. package/src/implementation/compiler/hygiene.test.ts +1 -1
  192. package/src/implementation/compiler/inferred.test.ts +1 -1
  193. package/src/implementation/compiler/inferred.ts +4 -2
  194. package/src/implementation/compiler/plugin.test.ts +2 -2
  195. package/src/implementation/compiler/signature.ts +1 -1
  196. package/src/implementation/compiler/transform.test.ts +43 -23
  197. package/src/implementation/compiler/transform.ts +6 -4
  198. package/src/implementation/world/activate.ts +11 -2
  199. package/src/implementation/world/batches.test.ts +3 -3
  200. package/src/implementation/world/buffer.ts +7 -0
  201. package/src/implementation/world/cascade.ts +46 -22
  202. package/src/implementation/world/change-blocks.test.ts +1 -1
  203. package/src/implementation/world/commands.ts +76 -2
  204. package/src/implementation/world/create.test.ts +8 -8
  205. package/src/implementation/world/create.ts +57 -2
  206. package/src/implementation/world/defaults.test.ts +1 -1
  207. package/src/implementation/world/despawn-where.test.ts +287 -0
  208. package/src/implementation/world/entities.ts +6 -0
  209. package/src/implementation/world/execute.ts +125 -78
  210. package/src/implementation/world/finalizers.test.ts +1 -1
  211. package/src/implementation/world/finalizers.ts +27 -4
  212. package/src/implementation/world/ids.test.ts +1 -1
  213. package/src/implementation/world/index-changed.test.ts +2 -2
  214. package/src/implementation/world/index-joined.test.ts +5 -5
  215. package/src/implementation/world/index-order.test.ts +1 -1
  216. package/src/implementation/world/indexes.test.ts +2 -1
  217. package/src/implementation/world/join.test.ts +23 -4
  218. package/src/implementation/world/join.ts +26 -4
  219. package/src/implementation/world/joined-observer.test.ts +1 -1
  220. package/src/implementation/world/joining-worker.fixture.ts +1 -1
  221. package/src/implementation/world/joining.fixture.ts +1 -1
  222. package/src/implementation/world/joining.test-helper.ts +1 -1
  223. package/src/implementation/world/kernel-spawns.test.ts +1 -1
  224. package/src/implementation/world/names.test.ts +1 -2
  225. package/src/implementation/world/observe-factories.test.ts +2 -2
  226. package/src/implementation/world/observe-ticks-cases.test.ts +1 -1
  227. package/src/implementation/world/observe.test-helper.ts +1 -1
  228. package/src/implementation/world/observer-contained-worker.fixture.ts +1 -1
  229. package/src/implementation/world/observer-contained.test-helper.ts +1 -1
  230. package/src/implementation/world/observer-contained.test.ts +2 -2
  231. package/src/implementation/world/observer-joined.test-helper.ts +4 -4
  232. package/src/implementation/world/observer-joined.test.ts +23 -15
  233. package/src/implementation/world/observer.browser.test.ts +2 -2
  234. package/src/implementation/world/observer.test.ts +8 -8
  235. package/src/implementation/world/optional-workers.fixture.ts +1 -1
  236. package/src/implementation/world/optional.test.ts +7 -7
  237. package/src/implementation/world/perf.md +3 -1
  238. package/src/implementation/world/reclaim.test.ts +3 -3
  239. package/src/implementation/world/register.ts +2 -2
  240. package/src/implementation/world/remote-objects.test-helper.ts +1 -1
  241. package/src/implementation/world/resource-changes.test.ts +61 -0
  242. package/src/implementation/world/resource-changes.ts +67 -0
  243. package/src/implementation/world/rows.ts +24 -13
  244. package/src/implementation/world/rules.test.ts +37 -0
  245. package/src/implementation/world/run-changes.test.ts +88 -0
  246. package/src/implementation/world/run-changes.ts +160 -0
  247. package/src/implementation/world/run-results.test.ts +10 -10
  248. package/src/implementation/world/runner.ts +20 -16
  249. package/src/implementation/world/shared-gpu.browser.test.ts +2 -2
  250. package/src/implementation/world/shared-kernels.test.ts +2 -2
  251. package/src/implementation/world/shared-workers.fixture.ts +2 -2
  252. package/src/implementation/world/shared.test.ts +10 -10
  253. package/src/implementation/world/sharing.ts +1 -1
  254. package/src/implementation/world/staging.ts +16 -3
  255. package/src/implementation/world/state.ts +19 -0
  256. package/src/implementation/world/sync-points.test.ts +135 -0
  257. package/src/implementation/world/synchronize.ts +65 -18
  258. package/src/implementation/world/tables-read.ts +70 -0
  259. package/src/implementation/world/tables.test.ts +369 -0
  260. package/src/implementation/world/tables.ts +368 -0
  261. package/src/implementation/world/tails.test.ts +1 -1
  262. package/src/implementation/world/target.test.ts +2 -2
  263. package/src/implementation/world/thread-observer.ts +1 -1
  264. package/src/implementation/world/thread-systems.test-helper.ts +3 -3
  265. package/src/implementation/world/thread-systems.ts +11 -6
  266. package/src/implementation/world/up.test.ts +13 -1
  267. package/src/implementation/world/up.ts +6 -1
  268. package/src/implementation/world/where.test.ts +4 -4
  269. package/src/implementation/world/where.ts +38 -10
  270. package/src/implementation/world/workers.fixture.ts +2 -2
  271. package/src/index.ts +4 -29
  272. package/src/interface/component/declarations.ts +11 -0
  273. package/src/interface/component/declared.ts +9 -0
  274. package/src/interface/component/index.ts +2 -0
  275. package/src/interface/finalizer/body.ts +13 -3
  276. package/src/interface/finalizer/create.test.ts +3 -1
  277. package/src/interface/finalizer/create.ts +12 -7
  278. package/src/interface/finalizer/declaration.ts +4 -2
  279. package/src/interface/index.type-test.ts +2 -2
  280. package/src/interface/indexes/create.test.ts +10 -0
  281. package/src/interface/indexes/declaration-of.ts +34 -0
  282. package/src/interface/indexes/index.ts +1 -0
  283. package/src/interface/indexes/index.type-test.ts +1 -1
  284. package/src/interface/registry/names.ts +8 -0
  285. package/src/interface/registry/schedule.ts +200 -27
  286. package/src/interface/resource/declarations.ts +11 -0
  287. package/src/interface/resource/index.ts +2 -0
  288. package/src/interface/system/access.ts +16 -0
  289. package/src/interface/system/body.ts +7 -5
  290. package/src/interface/system/check.ts +37 -10
  291. package/src/interface/system/commands.ts +33 -0
  292. package/src/interface/system/commands.type-test.ts +31 -0
  293. package/src/interface/system/create-resolved.ts +1 -1
  294. package/src/interface/system/create.test.ts +21 -13
  295. package/src/interface/system/create.ts +24 -15
  296. package/src/interface/system/declaration.ts +9 -2
  297. package/src/interface/system/describe.test.ts +79 -0
  298. package/src/interface/system/describe.ts +122 -0
  299. package/src/interface/system/index.ts +1 -0
  300. package/src/interface/system/leaf.ts +6 -0
  301. package/src/interface/system/lists.type-test.ts +1 -1
  302. package/src/interface/system/optional.type-test.ts +1 -1
  303. package/src/interface/system/render.ts +1 -0
  304. package/src/interface/system/resolve.ts +25 -2
  305. package/src/interface/system/shared-only.ts +5 -0
  306. package/src/interface/system/shared.type-test.ts +1 -1
  307. package/src/interface/system/system.type-test.ts +26 -20
  308. package/src/interface/system/tables.ts +27 -0
  309. package/src/interface/system/up.type-test.ts +3 -3
  310. package/src/interface/world/index.ts +2 -2
  311. package/src/interface/world/run.type-test.ts +14 -4
  312. package/src/interface/world/table/index.ts +20 -0
  313. package/src/interface/world/table/table.ts +12 -0
  314. package/src/interface/world/world.ts +23 -10
  315. package/src/observe/entity.ts +2 -2
  316. package/src/observe/resource.ts +2 -2
  317. package/src/observe/select.ts +4 -4
  318. package/src/observe/world-state.ts +3 -3
  319. package/src/perftest/benchmarks.ts +19 -1
  320. package/src/perftest/indexes.ts +3 -3
  321. package/src/perftest/loop.ts +1 -1
  322. package/src/perftest/observer.ts +4 -4
  323. package/src/perftest/reads.ts +2 -2
  324. package/src/perftest/remote.ts +5 -5
  325. package/src/perftest/strings.ts +1 -1
  326. package/src/perftest/structural.ts +20 -0
  327. package/src/perftest/suite.ts +1 -1
  328. package/src/perftest/tables.ts +107 -0
  329. package/src/world.test.ts +2 -2
  330. package/src/world.ts +32 -0
@@ -4,6 +4,11 @@ import { indexDefinitionOf } from '../registry/indexes.js';
4
4
  import { declarationOf, labelOf } from '../registry/names.js';
5
5
  import { isString, isStruct } from '../registry/schemas.js';
6
6
  const isKeys = (value) => Array.isArray(value) && value.every(key => typeof key === "symbol");
7
+ const isNamed = (value) => Array.isArray(value) && value.every(item => typeof item === "symbol" || isKeys(item));
8
+ /** A binding a command named that holds neither a key nor a list of them, as one declared below its system, isn't followed. */
9
+ const isCommanded = (value) => typeof value === "object" && value !== null
10
+ && isNamed(Reflect.get(value, "spawn")) && isNamed(Reflect.get(value, "add")) && isNamed(Reflect.get(value, "remove"))
11
+ && typeof Reflect.get(value, "despawn") === "boolean";
7
12
  const isUsed = (value) => typeof value === "object" && value !== null
8
13
  && isKeys(Reflect.get(value, "read")) && isKeys(Reflect.get(value, "write"))
9
14
  && (Reflect.get(value, "mutate") === undefined || isKeys(Reflect.get(value, "mutate")));
@@ -79,7 +84,7 @@ export const componentLists = (components, used, reading, whereReads = []) => {
79
84
  : used.write;
80
85
  const read = used === null ? without(held, write) : without(used.read, write);
81
86
  const has = [...without(members, read, write), ...without(filtered, read, write)];
82
- return compact({ read, write, has, optional, not: components.not, added: components.added, changed: components.changed, where, whereReads });
87
+ return compact({ read, write, has, optional, not: components.not, added: components.added, changed: components.changed, where, whereReads, whole: components.whole });
83
88
  };
84
89
  /**
85
90
  * A lookup's lists: what the body reads of its rows, the rest of its `with` only required. Without the body's uses,
@@ -133,6 +138,19 @@ export const whereReadsOf = (what, components, access) => {
133
138
  throw new Error(`${what}'s where predicates (${access.at}) read resources in a way the build can't follow, so it can't tell when to evaluate them again: index them by key directly, or destructure them by key, in a predicate written in place in a module built with Compiler.plugin().`);
134
139
  return reads;
135
140
  };
141
+ /** What a body's commands name, as the world takes it: null where the build couldn't follow them, nothing for none. */
142
+ export const commandLists = (access) => {
143
+ const { commands } = access;
144
+ if (commands === undefined)
145
+ return undefined;
146
+ if (!isCommanded(commands))
147
+ return null;
148
+ if (!commands.despawn && commands.spawn.length + commands.add.length + commands.remove.length === 0)
149
+ return undefined;
150
+ const flat = (named) => [...new Set(named.flat())];
151
+ const lists = compact({ spawn: flat(commands.spawn), add: flat(commands.add), remove: flat(commands.remove), despawn: commands.despawn ? true : undefined });
152
+ return Object.keys(lists).length === 0 ? undefined : lists;
153
+ };
136
154
  /** What a body reads of its parent's values. */
137
155
  export const upReads = (what, access) => followed(what, access.up, "its parent's values", access);
138
156
  //# sourceMappingURL=resolve.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/interface/system/resolve.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAwB5D,MAAM,MAAM,GAAG,CAAC,KAAc,EAA2B,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC;AAEhI,MAAM,MAAM,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IA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,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAa,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IACtK,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/D,CAAC,CAAC;AAEF,gDAAgD;AAChD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,MAAc,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,qBAAqB,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Shared } from '../component/value.js';
2
+ /** A `where`'s keys that aren't shared components, each an error: `where` names only shared components. */
3
+ export type SharedOnly<W> = {
4
+ readonly [K in Exclude<keyof W, Shared>]: {
5
+ readonly "error: where names only shared components, which each archetype holds one value of": K;
6
+ };
7
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=shared-only.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-only.js","sourceRoot":"","sources":["../../../src/interface/system/shared-only.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import type { Component } from '../component/component.js';
2
+ import type { Shared } from '../component/value.js';
3
+ import type { Resource } from '../resource/resource.js';
4
+ import type { Table } from '../world/table/table.js';
5
+ /**
6
+ * What a readonly system's `tables` reads: of every archetype matching `with`, `not` and `where` that holds any of
7
+ * `components`, a table of those it holds; and, with `resources`, each resource's value.
8
+ */
9
+ export type TablesDeclaration = {
10
+ readonly components: readonly Component.Key[];
11
+ readonly with?: readonly Component.Key[];
12
+ readonly not?: readonly Component.Key[];
13
+ /**
14
+ * Keeps the tables to the archetypes holding these values of shared components, each one required as `with`
15
+ * requires it, as a system's `where` of values keeps its system to them.
16
+ */
17
+ readonly where?: {
18
+ readonly [K in Shared]?: Component<K>;
19
+ };
20
+ readonly resources?: readonly Resource.Key[];
21
+ };
22
+ /** A readonly system's `tables`: a table of each archetype its declaration reads, and the values of the resources it reads. */
23
+ export type Tables = {
24
+ readonly archetypes: readonly Table[];
25
+ readonly resources: {
26
+ readonly [K in Resource.Key]?: Resource<K>;
27
+ };
28
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tables.js","sourceRoot":"","sources":["../../../src/interface/system/tables.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- export {};
1
+ export type { Table } from './table/table.js';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * One component's values in a table, copies taken as a readonly system reads `tables`:
3
+ * - `bytes`: a struct's or number's, `stride` bytes per row in the world's layout for it, which is a function of the
4
+ * component's schema alone;
5
+ * - `values`: a string's or an object's, one per row;
6
+ * - `value`: one value every row holds, for a shared component or one whose schema is a constant.
7
+ */
8
+ export type Column = {
9
+ readonly kind: "bytes";
10
+ readonly bytes: Uint8Array;
11
+ readonly stride: number;
12
+ } | {
13
+ readonly kind: "values";
14
+ readonly values: readonly unknown[];
15
+ } | {
16
+ readonly kind: "value";
17
+ readonly value: unknown;
18
+ };
19
+ /**
20
+ * What `commands.spawnTables` spawned: each table's entities in its row order, the one spawned for each row, the one
21
+ * existing for a row its `existing` maps, and `Entity.none` for a row it didn't spawn; and how many rows it didn't,
22
+ * those owned by an entity outside the tables.
23
+ */
24
+ export type Spawned = {
25
+ readonly entities: readonly Float64Array[];
26
+ readonly dropped: number;
27
+ };
@@ -0,0 +1,3 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ export {};
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interface/world/table/index.ts"],"names":[],"mappings":"AAAA,uDAAuD"}
@@ -0,0 +1,11 @@
1
+ import type { Component } from '../../component/component.js';
2
+ import type { Column } from './index.js';
3
+ /** The rows of one archetype: their entities in row order, and a column for each component asked for that it holds. */
4
+ export type Table = {
5
+ readonly count: number;
6
+ readonly entities: Float64Array;
7
+ readonly columns: {
8
+ readonly [K in Component.Key]?: Column;
9
+ };
10
+ };
11
+ export type * as Table from './index.js';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../../src/interface/world/table/table.ts"],"names":[],"mappings":""}
@@ -1,33 +1,48 @@
1
1
  import type { Input } from '../system/input.js';
2
2
  import type { System } from '../system/system.js';
3
+ import type { ChangeSet } from '../finalizer/body.js';
4
+ import type { Essential } from '../component/value.js';
5
+ import type { Resource } from '../resource/resource.js';
3
6
  /**
4
- * A world. Systems read and change it; observer systems read it after each run's and tick's sync point. Every member's
7
+ * A world. Systems read and change it; readonly systems read it after each run's and tick's sync point. Every member's
5
8
  * type is named from the package root, so declarations a consumer emits for its results name no internal module.
6
9
  */
7
10
  export type World = {
8
11
  /**
9
12
  * The one way to change state. Runs are sequential in call order; physically, any that don't conflict overlap. Each
10
- * runs a system or composite, ending in a sync point, then observer systems, the run's and those added, and
13
+ * runs a system or composite, ending in a sync point, then readonly systems, the run's and those added, and
11
14
  * resolves to what a per-run body returns: a system without components resolves to its body's value, or
12
15
  * `undefined` when its body was skipped, and any other system or composite to nothing. So a one-off read is a run
13
- * of an observer system returning what it read; one that runs on a joined thread, as it reads objects there, runs
14
- * there before the run resolves, to its value as structured clone. A run of observer systems alone runs them once
16
+ * of a readonly system returning what it read; one that runs on a joined thread, as it reads objects there, runs
17
+ * there before the run resolves, to its value as structured clone. A run of readonly systems alone runs them once
15
18
  * after an empty sync point, and doesn't wake the loop.
16
19
  *
17
20
  * When a system or finalizer of the run fails, later tiers are skipped, the sync point still applies what was done,
18
- * and once its observer systems ran the run rejects with an `Error` naming each failure, its system's label and id,
21
+ * and once its readonly systems ran the run rejects with an `Error` naming each failure, its system's label and id,
19
22
  * message and cause. It rejects too when the run can't happen or finish: registration fails, the world is disposed,
20
- * its GPU device is lost, or its sync point can't apply a command's value. What fails after it, an observer system
23
+ * its GPU device is lost, or its sync point can't apply a command's value. What fails after it, a readonly system
21
24
  * added or GPU work, is reported out of band, as ticks' failures are (see `add`).
22
25
  */
23
26
  run<I, R>(system: System<I, R>, ...input: Input<NoInfer<I>>): Promise<R>;
27
+ /**
28
+ * Runs as `run` does, and resolves to this run's own changes, in the shape `Finalizer.changes` gives, rather than its
29
+ * value: the structural changes its commands made, rules and cascades included, to every component that isn't
30
+ * derived or an object a joined thread fills, the values its adds gave components entities had before and after, and
31
+ * each resource its systems write or reduce into whose value changed, compared as `Finalizer.changes` compares them;
32
+ * `previous` and `next` give values before and after the run. Commands the finalizers of an earlier sync point
33
+ * queued apply first, at a sync point of their own. Values written to rows aren't structural changes, so they're in
34
+ * none. The run pays for this only when asked. Only on the world's thread: a joined thread's rejects.
35
+ */
36
+ run<I, R>(system: System<I, R>, ...input: [...Input<NoInfer<I>>, options: {
37
+ readonly changes: true;
38
+ }]): Promise<ChangeSet<Essential, Resource.Key>>;
24
39
  /**
25
40
  * Adds a system to every tick, from the next one on, ordered with those already added by its constraints, as a
26
41
  * composite's members are. A tick runs on a beat of the `cadence` resource where `always` is set, `wake` is due or
27
42
  * a run arrived since the last tick, and only while some system is added. Throws for a system with no ordering path
28
- * to one already added that conflicts with it. An observer system runs after every run's and tick's sync point
43
+ * to one already added that conflicts with it. A readonly system runs after every run's and tick's sync point
29
44
  * instead. It never conflicts and doesn't count as an added system for ticking. On a joined thread `add` takes only
30
- * observer systems, whose keys need ids: each runs on that thread after the world's sync points, once for the
45
+ * readonly systems, whose keys need ids: each runs on that thread after the world's sync points, once for the
31
46
  * newest when the thread fell behind, reading structs and the objects of the threads it fills as of one sync point.
32
47
  *
33
48
  * What added systems throw, and what fails in ticks, is reported out of band on the world's thread, as an `Error`
@@ -41,14 +56,14 @@ export type World = {
41
56
  * released. A system added both alone and within an added composite stays until both are removed; constraints
42
57
  * naming a removed system are ignored. Removing a value that isn't added does nothing. Throws, removing nothing,
43
58
  * when the systems left would conflict with no ordering path between them, as `add` does. On a joined thread it
44
- * takes only observer systems.
59
+ * takes only readonly systems.
45
60
  */
46
61
  remove(system: System<void>): void;
47
62
  /**
48
63
  * Lets another thread join this world through `port`, one end of a channel to it, of the browser or node: a
49
64
  * `MessagePort`, a `Worker`, or a worker's own scope, `self` or node's `parentPort`. That thread joins through the
50
65
  * other end, claiming the logical threads it fills. Resolves once it has joined: the threads it claims are its own,
51
- * and the observer systems it added as its join resolved, before awaiting anything else, are added, so a run
66
+ * and the readonly systems it added as its join resolved, before awaiting anything else, are added, so a run
52
67
  * started afterwards runs on it and reaches them; one it adds later reaches the runs after its add arrived.
53
68
  * Rejects with an `Error` saying why it didn't join: the world refused its claim, as of a thread claimed twice, the
54
69
  * world was disposed, the port is shared already, or that thread ended first, as the platform reports it: a
@@ -0,0 +1,27 @@
1
+ import type { Create } from './interface/world/create.js';
2
+ import type { Join } from './interface/world/join.js';
3
+ export type { Table } from './interface/world/table/table.js';
4
+ /**
5
+ * Creates a world on this thread, synchronously, with resources starting at the given values in place of their
6
+ * defaults. This thread is its `"world"` thread for the world's life: it runs the sync points, the ticks and the GPU
7
+ * device, and fills every logical thread no joined thread claims. Keys are the resources' symbols, built-in ones
8
+ * included (`{ [workers]: 0 }`); string keys are never a resource's, so they're ignored. Throws for a symbol that isn't
9
+ * a resource, or is one only the world writes. While a declaration's trait or default doesn't hold, each call fails to
10
+ * compile, once, naming each such key, its members and what's wrong with them.
11
+ * @function
12
+ */
13
+ export declare const create: Create;
14
+ /**
15
+ * Joins, from another thread, a world that `share` let join through the other end of `port`, claiming the logical
16
+ * `threads` this thread fills: their objects live here, and the systems and finalizers reading them run here. Resolves,
17
+ * once the world accepted the claim, to the same world: its `run` runs systems there, and its `add` and `remove` take
18
+ * readonly systems, which run here after the world's sync points. Add them before awaiting anything else, so the
19
+ * world's `share` resolves with them in place. Its `dispose` disconnects this thread. Rejects with an `Error` saying
20
+ * why it didn't join: the world refused the claim, was disposed, or its thread ended first, as the platform reports it:
21
+ * the world's `Worker` failing to start or throwing first, a port closed, as in node, or, in a browser, the world's
22
+ * thread ending once it was shared through a port this thread listened on. A browser world's worker that the page ended
23
+ * before this thread heard from it isn't reported, so the join stays pending. Rejects too where memory can't be shared,
24
+ * as without cross-origin isolation.
25
+ * @function
26
+ */
27
+ export declare const join: Join;
package/dist/world.js ADDED
@@ -0,0 +1,27 @@
1
+ // © 2026 Adobe. MIT License. See /LICENSE for details.
2
+ import { create as createWorld, join as joinWorld } from './implementation/index.js';
3
+ /**
4
+ * Creates a world on this thread, synchronously, with resources starting at the given values in place of their
5
+ * defaults. This thread is its `"world"` thread for the world's life: it runs the sync points, the ticks and the GPU
6
+ * device, and fills every logical thread no joined thread claims. Keys are the resources' symbols, built-in ones
7
+ * included (`{ [workers]: 0 }`); string keys are never a resource's, so they're ignored. Throws for a symbol that isn't
8
+ * a resource, or is one only the world writes. While a declaration's trait or default doesn't hold, each call fails to
9
+ * compile, once, naming each such key, its members and what's wrong with them.
10
+ * @function
11
+ */
12
+ export const create = createWorld;
13
+ /**
14
+ * Joins, from another thread, a world that `share` let join through the other end of `port`, claiming the logical
15
+ * `threads` this thread fills: their objects live here, and the systems and finalizers reading them run here. Resolves,
16
+ * once the world accepted the claim, to the same world: its `run` runs systems there, and its `add` and `remove` take
17
+ * readonly systems, which run here after the world's sync points. Add them before awaiting anything else, so the
18
+ * world's `share` resolves with them in place. Its `dispose` disconnects this thread. Rejects with an `Error` saying
19
+ * why it didn't join: the world refused the claim, was disposed, or its thread ended first, as the platform reports it:
20
+ * the world's `Worker` failing to start or throwing first, a port closed, as in node, or, in a browser, the world's
21
+ * thread ending once it was shared through a port this thread listened on. A browser world's worker that the page ended
22
+ * before this thread heard from it isn't reported, so the join stays pending. Rejects too where memory can't be shared,
23
+ * as without cross-origin isolation.
24
+ * @function
25
+ */
26
+ export const join = joinWorld;
27
+ //# sourceMappingURL=world.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"world.js","sourceRoot":"","sources":["../src/world.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAMrF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,MAAM,GAAW,WAAW,CAAC;AAE1C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,IAAI,GAAS,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/ecs",
3
- "version": "0.2.1",
3
+ "version": "0.2.4",
4
4
  "description": "Adobe ECS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -46,7 +46,8 @@
46
46
  "typescript": "^5.8.3",
47
47
  "vite": "^8.3.4",
48
48
  "vitest": "^5.0.5",
49
- "wabt": "1.0.39"
49
+ "wabt": "1.0.39",
50
+ "ecs-guide-checks": "0.0.0"
50
51
  },
51
52
  "peerDependencies": {
52
53
  "vite": "^8.0.0"
@@ -66,6 +67,14 @@
66
67
  "types": "./dist/implementation/compiler/index.d.ts"
67
68
  }
68
69
  },
70
+ "guide": {
71
+ "files": [
72
+ "src/index.ts",
73
+ "src/interface/**/*.ts",
74
+ "dist/index.js",
75
+ "dist/interface/**/*.js"
76
+ ]
77
+ },
69
78
  "scripts": {
70
79
  "build": "cp ../../LICENSE . && tsc -b",
71
80
  "dev": "tsc -b -w --preserveWatchOutput",
@@ -50,7 +50,7 @@ export const world: World = World.create({ [workers]: 0 });
50
50
  // Another thread joins it through the other end of a channel the world shares.
51
51
  declare const port: MessagePort;
52
52
  export const joined: Promise<World> = World.join(port, { threads: ["main"] });
53
- export const read = System.create({ observer: true, components: { with: [position] }, lookup: { at: { with: [position] } } }, () => {});
53
+ export const read = System.create({ readonly: true, components: { with: [position] }, lookup: { at: { with: [position] } } }, () => {});
54
54
  export const added = world.add(read);
55
55
  `;
56
56
 
@@ -23,7 +23,7 @@ const award = System.create({ components: { with: [score] } }, (row, { resources
23
23
  row[score] += resources[bonus];
24
24
  });
25
25
 
26
- const read = System.create({ observer: true, components: { with: [score] } }, row => {
26
+ const read = System.create({ readonly: true, components: { with: [score] } }, row => {
27
27
  console.log("score", row[score]);
28
28
  });
29
29
 
@@ -17,6 +17,6 @@ that isn't data, such as an `AudioContext`, is stored as it is; a change inside
17
17
  written back. An `Entity` resource with no entity holds `Entity.none`, which is `0` rather than `null`, so it stays data
18
18
  every thread can read.
19
19
 
20
- A system reads resources by key. With `observer: true` it only reads, and runs after the world's changes apply.
20
+ A system reads resources by key. With `readonly: true` it only reads, and runs after the world's changes apply.
21
21
  [`run`](01-resources.ts#L31-L32) runs a system once, and resolves to what the body returns, for a system without
22
22
  components.
@@ -22,7 +22,7 @@ declare module "@adobe/ecs" {
22
22
  }
23
23
  }
24
24
 
25
- const read = System.create({ observer: true }, ({ resources }) =>
25
+ const read = System.create({ readonly: true }, ({ resources }) =>
26
26
  [resources[gravity], resources[floor], resources[names], resources[audio], resources[focused]]);
27
27
 
28
28
  export const main = async (): Promise<void> => {
@@ -25,10 +25,10 @@ export const defeat = System.create({ components: { with: [enemy] } }, (row, { c
25
25
  commands.remove(row.entity, enemy);
26
26
  });
27
27
 
28
- const readFoes = System.create({ observer: true, components: { with: [position, enemy] } }, row => {
28
+ const readFoes = System.create({ readonly: true, components: { with: [position, enemy] } }, row => {
29
29
  console.log("a foe at", row[position]);
30
30
  });
31
- const readParticles = System.create({ observer: true, components: { with: [...Particle] } }, row => {
31
+ const readParticles = System.create({ readonly: true, components: { with: [...Particle] } }, row => {
32
32
  console.log("a particle moving at", row[velocity]);
33
33
  });
34
34
 
@@ -8,8 +8,8 @@ it in parallel.
8
8
  component in `with` and none in `not`, so the `frozen` one stays put. Values are replaced whole, never edited in
9
9
  place.
10
10
  - **Systems without components**, such as [`count`](03-systems.ts#L35-L37), run once per run.
11
- - **Observer systems**, `observer: true`, only read. They see what the runs before them left. Run one to read the
12
- world, or add one to react to it.
11
+ - **Readonly systems**, `readonly: true`, only read. Run one to read the world, as [`read`](03-systems.ts#L40-L42)
12
+ does, or add one to react to it. [Sync points](06-sync-points.md) says when and where they run.
13
13
  - **Optional components**, `optional: [velocity]`, are in the row where the entity has them and `undefined` where it
14
14
  doesn't. They never narrow which entities a system runs on; [`readSpeeds`](03-systems.ts#L44-L47) still reads the
15
15
  entity without a velocity. Only commands add and remove them.
@@ -1,5 +1,5 @@
1
1
  at [ 0, 1, 5 ]
2
2
  moving [ 'at 2', 'at 2', 'still' ]
3
3
  frames 1
4
- Error: System "fail" (@adobe/ecs@0.2.1/src/guide/03-systems.ts#fail) failed: broken
4
+ Error: System "fail" (@adobe/ecs@0.2.4/src/guide/03-systems.ts#fail) failed: broken
5
5
  frames 2
@@ -37,16 +37,16 @@ const count = System.create({}, ({ resources }) => {
37
37
  });
38
38
 
39
39
  const places: number[] = [];
40
- const read = System.create({ observer: true, components: { with: [position] } }, row => {
40
+ const read = System.create({ readonly: true, components: { with: [position] } }, row => {
41
41
  places.push(row[position][0]);
42
42
  });
43
43
 
44
44
  const speeds: string[] = [];
45
- const readSpeeds = System.create({ observer: true, components: { with: [position], optional: [velocity] } }, row => {
45
+ const readSpeeds = System.create({ readonly: true, components: { with: [position], optional: [velocity] } }, row => {
46
46
  speeds.push(row[velocity] === undefined ? "still" : `at ${row[velocity][0]}`);
47
47
  });
48
48
 
49
- const frameCount = System.create({ observer: true }, ({ resources }) => resources[frames]);
49
+ const frameCount = System.create({ readonly: true }, ({ resources }) => resources[frames]);
50
50
 
51
51
  const fail = System.create(() => {
52
52
  throw new Error("broken");
@@ -9,7 +9,7 @@ every tick from then on, and [`world.remove`](04-ticks.ts#L41) takes it off.
9
9
  `step` milliseconds, each with that `delta`.
10
10
  - A world ticks only after a run arrives, unless `always` is set, as for [the first world](04-ticks.ts#L36).
11
11
 
12
- An observer with `resources: { changed: [elapsed] }` runs after each tick that changed `elapsed`:
12
+ A readonly system with `resources: { changed: [elapsed] }` runs after each tick that changed `elapsed`:
13
13
  [`watch`](04-ticks.ts#L18-L21) resolves once 30 ms have passed. Once `advance` is removed, `elapsed` stays put.
14
14
 
15
15
  **Asking for a tick.** A system that needs another tick contributes a time to the `wake` reduction:
@@ -16,11 +16,11 @@ const advance = System.create({}, ({ resources }) => {
16
16
  });
17
17
 
18
18
  let reached: (elapsed: number) => void = () => {};
19
- const watch = System.create({ observer: true, resources: { changed: [elapsed] } }, ({ resources }) => {
19
+ const watch = System.create({ readonly: true, resources: { changed: [elapsed] } }, ({ resources }) => {
20
20
  if (resources[elapsed] >= 30) reached(resources[elapsed]);
21
21
  });
22
22
 
23
- const readTime = System.create({ observer: true }, ({ resources }) => ({ elapsed: resources[elapsed], delta: resources[clock].delta }));
23
+ const readTime = System.create({ readonly: true }, ({ resources }) => ({ elapsed: resources[elapsed], delta: resources[clock].delta }));
24
24
 
25
25
  const step = System.create({}, ({ resources, reduce }) => {
26
26
  resources[steps] += 1;
@@ -28,7 +28,7 @@ const step = System.create({}, ({ resources, reduce }) => {
28
28
  });
29
29
 
30
30
  let finished: (steps: number) => void = () => {};
31
- const watchSteps = System.create({ observer: true, resources: { changed: [steps] } }, ({ resources }) => {
31
+ const watchSteps = System.create({ readonly: true, resources: { changed: [steps] } }, ({ resources }) => {
32
32
  if (resources[steps] === 3) finished(resources[steps]);
33
33
  });
34
34
 
@@ -20,7 +20,7 @@ const heal = System.create({ components: { with: [health] }, after: [hit] }, row
20
20
  });
21
21
  const frame = System.create([heal, hit]);
22
22
 
23
- const read = System.create({ observer: true, components: { with: [health] } }, row => {
23
+ const read = System.create({ readonly: true, components: { with: [health] } }, row => {
24
24
  console.log("health", row[health]);
25
25
  });
26
26
 
@@ -1,14 +1,25 @@
1
1
  # Sync points
2
2
 
3
- A run ends at a *sync point*, where its commands apply.
3
+ A run applies its commands at *sync points*.
4
4
 
5
5
  - **Values** written to rows and resources apply at once.
6
- - **Commands** wait for the sync point, then apply in the order issued. `commands.spawn` returns the new entity at
7
- once, so [later commands can name it](06-sync-points.ts#L16-L21): `commands.add` sets the hero's health to 5. An
6
+ - **Commands** wait for a sync point, then apply in the order issued. `commands.spawn` returns the new entity at
7
+ once, so [later commands can name it](06-sync-points.ts#L18-L23): `commands.add` sets the hero's health to 5. An
8
8
  entity spawned and removed with `commands.despawn` before the sync point never exists.
9
9
 
10
- A composite is one run with one sync point. In [`frame`](06-sync-points.ts#L25), `count` runs `after: [spawn]` but
11
- before the spawned entities exist, so it counts none; run alone, after the sync point, it counts the hero.
10
+ Every run ends at a sync point. Within it, the build tells which components each system's commands name, and a system
11
+ that follows one whose commands could change what it reads, matches, looks up or indexes gets a sync point before its
12
+ tier. In [`frame`](06-sync-points.ts#L30), `count` runs `after: [spawn]`, so the hero exists by then and it counts it;
13
+ [`early`](06-sync-points.ts#L27-L29), ordered with nothing, runs beside `spawn`, before that sync point, and counts
14
+ none. Sync points cost a little each, so a run adds the fewest that put one between every such pair, and none where no
15
+ system depends on another's commands.
12
16
 
13
- An observer added to a world runs after the sync point of every run and tick, reading what it left:
14
- [`watch`](06-sync-points.ts#L39-L41) logs the hero after the run that spawned it.
17
+ **Readonly systems.** `readonly: true` places a system after the last sync point, so it reads what the commands did.
18
+ Added to a world, [`watch`](06-sync-points.ts#L32-L34) runs after the last sync point of every run and tick, and logs
19
+ the hero after the run that spawned it; `count`, which isn't readonly, runs in its tier.
20
+
21
+ - **Where:** a readonly system runs on the thread that added or ran it, so a [joined thread](19-threads.md) adds only
22
+ readonly systems.
23
+ - **Order:** none. It can't declare `before`, `after` or `during`.
24
+ - **Limits:** it can't write, use `commands` or `reduce`, or take input. Its row and resources are read-only, so each
25
+ is a type error.
@@ -1,3 +1,2 @@
1
- counted 0
2
- counted 1
1
+ counted 1 early 0
3
2
  health 5
@@ -3,6 +3,7 @@ import { System, World } from "../index.js";
3
3
 
4
4
  const health = Symbol();
5
5
  const seen = Symbol();
6
+ const seenEarly = Symbol();
6
7
 
7
8
  declare module "@adobe/ecs" {
8
9
  interface Components {
@@ -10,6 +11,7 @@ declare module "@adobe/ecs" {
10
11
  }
11
12
  interface Resources {
12
13
  [seen]: { type: number };
14
+ [seenEarly]: { type: number };
13
15
  }
14
16
  }
15
17
 
@@ -22,19 +24,21 @@ const spawn = System.create(({ commands }) => {
22
24
  const count = System.create({ components: { with: [health] }, after: [spawn] }, (row, { resources }) => {
23
25
  resources[seen] += 1;
24
26
  });
25
- const frame = System.create([spawn, count]);
27
+ const early = System.create({ components: { with: [health] } }, (row, { resources }) => {
28
+ resources[seenEarly] += 1;
29
+ });
30
+ const frame = System.create([spawn, count, early]);
26
31
 
27
- const watch = System.create({ observer: true, components: { with: [health] } }, row => {
32
+ const watch = System.create({ readonly: true, components: { with: [health] } }, row => {
28
33
  console.log("health", row[health]);
29
34
  });
30
- const readSeen = System.create({ observer: true }, ({ resources }) => resources[seen]);
35
+ const readSeen = System.create({ readonly: true }, ({ resources }) => [resources[seen], resources[seenEarly]]);
31
36
 
32
37
  export const main = async (): Promise<void> => {
33
38
  await using world = World.create();
34
39
  await world.run(frame);
35
- console.log("counted", await world.run(readSeen));
36
- await world.run(count);
37
- console.log("counted", await world.run(readSeen));
40
+ const [counted, countedEarly] = await world.run(readSeen);
41
+ console.log("counted", counted, "early", countedEarly);
38
42
 
39
43
  await using watched = World.create();
40
44
  watched.add(watch);
@@ -36,7 +36,7 @@ const bump = System.create({ components: { with: [score, boss] } }, row => {
36
36
  });
37
37
 
38
38
  let loaded = 0;
39
- const countLoaded = System.create({ observer: true, components: { with: [shown] } }, () => {
39
+ const countLoaded = System.create({ readonly: true, components: { with: [shown] } }, () => {
40
40
  loaded += 1;
41
41
  });
42
42
 
@@ -45,7 +45,7 @@ const step = System.create({ resources: { is: [map], not: [paused] } }, ({ resou
45
45
  });
46
46
  const pause = System.create({}, ({ resources }) => { resources[paused] = true; });
47
47
  const open = System.create({}, ({ resources }) => { resources[map] = { width: 4 }; });
48
- const readSteps = System.create({ observer: true }, ({ resources }) => resources[steps]);
48
+ const readSteps = System.create({ readonly: true }, ({ resources }) => resources[steps]);
49
49
 
50
50
  export const main = async (): Promise<void> => {
51
51
  await using world = World.create();