@adobe/ecs 0.1.0 → 0.2.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.
- package/README.md +58 -0
- package/dist/implementation/compiler/access.js +9 -5
- package/dist/implementation/compiler/access.js.map +1 -1
- package/dist/implementation/compiler/archetypes.d.ts +17 -0
- package/dist/implementation/compiler/archetypes.js +141 -0
- package/dist/implementation/compiler/archetypes.js.map +1 -0
- package/dist/implementation/compiler/assign.js.map +1 -1
- package/dist/implementation/compiler/augmentations.d.ts +25 -0
- package/dist/implementation/compiler/augmentations.js +943 -0
- package/dist/implementation/compiler/augmentations.js.map +1 -0
- package/dist/implementation/compiler/bind.js +5 -4
- package/dist/implementation/compiler/bind.js.map +1 -1
- package/dist/implementation/compiler/body-access.d.ts +20 -3
- package/dist/implementation/compiler/body-access.js +138 -36
- package/dist/implementation/compiler/body-access.js.map +1 -1
- package/dist/implementation/compiler/booleans.js.map +1 -1
- package/dist/implementation/compiler/branches.js.map +1 -1
- package/dist/implementation/compiler/calls.js +14 -3
- package/dist/implementation/compiler/calls.js.map +1 -1
- package/dist/implementation/compiler/columns.d.ts +8 -2
- package/dist/implementation/compiler/columns.js +19 -3
- package/dist/implementation/compiler/columns.js.map +1 -1
- package/dist/implementation/compiler/compile-kernel.d.ts +24 -1
- package/dist/implementation/compiler/compile-kernel.js +66 -22
- package/dist/implementation/compiler/compile-kernel.js.map +1 -1
- package/dist/implementation/compiler/compiler.d.ts +6 -0
- package/dist/implementation/compiler/compiler.js +7 -0
- package/dist/implementation/compiler/compiler.js.map +1 -0
- package/dist/implementation/compiler/data.js.map +1 -1
- package/dist/implementation/compiler/describe.d.ts +41 -0
- package/dist/implementation/compiler/describe.js +510 -0
- package/dist/implementation/compiler/describe.js.map +1 -0
- package/dist/implementation/compiler/estree.js.map +1 -1
- package/dist/implementation/compiler/expression.js +26 -2
- package/dist/implementation/compiler/expression.js.map +1 -1
- package/dist/implementation/compiler/failure.js.map +1 -1
- package/dist/implementation/compiler/identify.d.ts +18 -8
- package/dist/implementation/compiler/identify.js +90 -32
- package/dist/implementation/compiler/identify.js.map +1 -1
- package/dist/implementation/compiler/index.d.ts +5 -1
- package/dist/implementation/compiler/index.js +6 -1
- package/dist/implementation/compiler/index.js.map +1 -1
- package/dist/implementation/compiler/inferred.d.ts +32 -0
- package/dist/implementation/compiler/inferred.js +185 -0
- package/dist/implementation/compiler/inferred.js.map +1 -0
- package/dist/implementation/compiler/inline-kernels.d.ts +7 -0
- package/dist/implementation/compiler/inline-kernels.js +16 -0
- package/dist/implementation/compiler/inline-kernels.js.map +1 -0
- package/dist/implementation/compiler/input-schemas.d.ts +23 -0
- package/dist/implementation/compiler/input-schemas.js +102 -0
- package/dist/implementation/compiler/input-schemas.js.map +1 -0
- package/dist/implementation/compiler/ir.d.ts +13 -1
- package/dist/implementation/compiler/ir.js.map +1 -1
- package/dist/implementation/compiler/kernel-id.js +1 -0
- package/dist/implementation/compiler/kernel-id.js.map +1 -1
- package/dist/implementation/compiler/key.js.map +1 -1
- package/dist/implementation/compiler/link.d.ts +13 -0
- package/dist/implementation/compiler/link.js +17 -0
- package/dist/implementation/compiler/link.js.map +1 -1
- package/dist/implementation/compiler/lists.d.ts +12 -1
- package/dist/implementation/compiler/lists.js +35 -14
- package/dist/implementation/compiler/lists.js.map +1 -1
- package/dist/implementation/compiler/lookups.js.map +1 -1
- package/dist/implementation/compiler/math.js +1 -0
- package/dist/implementation/compiler/math.js.map +1 -1
- package/dist/implementation/compiler/memory-compiler.d.ts +61 -0
- package/dist/implementation/compiler/memory-compiler.js +271 -0
- package/dist/implementation/compiler/memory-compiler.js.map +1 -0
- package/dist/implementation/compiler/module-scope.js.map +1 -1
- package/dist/implementation/compiler/module-value.js +18 -3
- package/dist/implementation/compiler/module-value.js.map +1 -1
- package/dist/implementation/compiler/out.js.map +1 -1
- package/dist/implementation/compiler/oxc.d.ts +41 -0
- package/dist/implementation/compiler/oxc.js +80 -0
- package/dist/implementation/compiler/oxc.js.map +1 -0
- package/dist/implementation/compiler/package-copies.d.ts +60 -0
- package/dist/implementation/compiler/package-copies.js +140 -0
- package/dist/implementation/compiler/package-copies.js.map +1 -0
- package/dist/implementation/compiler/passes.d.ts +25 -0
- package/dist/implementation/compiler/passes.js +24 -0
- package/dist/implementation/compiler/passes.js.map +1 -0
- package/dist/implementation/compiler/paths.d.ts +5 -14
- package/dist/implementation/compiler/paths.js +16 -25
- package/dist/implementation/compiler/paths.js.map +1 -1
- package/dist/implementation/compiler/plugin.d.ts +17 -1
- package/dist/implementation/compiler/plugin.js +207 -35
- package/dist/implementation/compiler/plugin.js.map +1 -1
- package/dist/implementation/compiler/posix.d.ts +8 -0
- package/dist/implementation/compiler/posix.js +205 -0
- package/dist/implementation/compiler/posix.js.map +1 -0
- package/dist/implementation/compiler/predicates.d.ts +11 -0
- package/dist/implementation/compiler/predicates.js +281 -0
- package/dist/implementation/compiler/predicates.js.map +1 -0
- package/dist/implementation/compiler/print.js +27 -7
- package/dist/implementation/compiler/print.js.map +1 -1
- package/dist/implementation/compiler/program.js +3 -0
- package/dist/implementation/compiler/program.js.map +1 -1
- package/dist/implementation/compiler/public.d.ts +1 -0
- package/dist/implementation/compiler/public.js +3 -0
- package/dist/implementation/compiler/public.js.map +1 -0
- package/dist/implementation/compiler/scalar.js.map +1 -1
- package/dist/implementation/compiler/scope.js.map +1 -1
- package/dist/implementation/compiler/serialize.js +1 -0
- package/dist/implementation/compiler/serialize.js.map +1 -1
- package/dist/implementation/compiler/signature.d.ts +18 -3
- package/dist/implementation/compiler/signature.js +68 -30
- package/dist/implementation/compiler/signature.js.map +1 -1
- package/dist/implementation/compiler/snapshot.d.ts +3 -1
- package/dist/implementation/compiler/snapshot.js +1 -1
- package/dist/implementation/compiler/snapshot.js.map +1 -1
- package/dist/implementation/compiler/source-map.js +1 -0
- package/dist/implementation/compiler/source-map.js.map +1 -1
- package/dist/implementation/compiler/spawns.d.ts +13 -1
- package/dist/implementation/compiler/spawns.js +67 -5
- package/dist/implementation/compiler/spawns.js.map +1 -1
- package/dist/implementation/compiler/stamps.d.ts +10 -3
- package/dist/implementation/compiler/stamps.js +28 -9
- package/dist/implementation/compiler/stamps.js.map +1 -1
- package/dist/implementation/compiler/statement.js.map +1 -1
- package/dist/implementation/compiler/terminal.js.map +1 -1
- package/dist/implementation/compiler/transform.d.ts +55 -5
- package/dist/implementation/compiler/transform.js +311 -55
- package/dist/implementation/compiler/transform.js.map +1 -1
- package/dist/implementation/compiler/type-schemas.d.ts +130 -0
- package/dist/implementation/compiler/type-schemas.js +701 -0
- package/dist/implementation/compiler/type-schemas.js.map +1 -0
- package/dist/implementation/compiler/unit.d.ts +20 -3
- package/dist/implementation/compiler/unit.js +2 -2
- package/dist/implementation/compiler/unit.js.map +1 -1
- package/dist/implementation/compiler/value.js.map +1 -1
- package/dist/implementation/compiler/wat.d.ts +12 -0
- package/dist/implementation/compiler/wat.js +379 -0
- package/dist/implementation/compiler/wat.js.map +1 -0
- package/dist/implementation/index.js +1 -0
- package/dist/implementation/index.js.map +1 -1
- package/dist/implementation/world/activate.js +8 -3
- package/dist/implementation/world/activate.js.map +1 -1
- package/dist/implementation/world/archetype.d.ts +64 -9
- package/dist/implementation/world/archetype.js +103 -14
- package/dist/implementation/world/archetype.js.map +1 -1
- package/dist/implementation/world/arrays.d.ts +6 -1
- package/dist/implementation/world/arrays.js +3 -0
- package/dist/implementation/world/arrays.js.map +1 -1
- package/dist/implementation/world/arrivals.d.ts +52 -0
- package/dist/implementation/world/arrivals.js +146 -0
- package/dist/implementation/world/arrivals.js.map +1 -0
- package/dist/implementation/world/attach-kernel.d.ts +3 -2
- package/dist/implementation/world/attach-kernel.js +16 -8
- package/dist/implementation/world/attach-kernel.js.map +1 -1
- package/dist/implementation/world/batches.d.ts +5 -2
- package/dist/implementation/world/batches.js +72 -8
- package/dist/implementation/world/batches.js.map +1 -1
- package/dist/implementation/world/buffer.js +37 -4
- package/dist/implementation/world/buffer.js.map +1 -1
- package/dist/implementation/world/cascade.js +1 -1
- package/dist/implementation/world/cascade.js.map +1 -1
- package/dist/implementation/world/cells.js.map +1 -1
- package/dist/implementation/world/check-kernel.d.ts +7 -5
- package/dist/implementation/world/check-kernel.js +51 -34
- package/dist/implementation/world/check-kernel.js.map +1 -1
- package/dist/implementation/world/claims.js +1 -0
- package/dist/implementation/world/claims.js.map +1 -1
- package/dist/implementation/world/closure.js +1 -0
- package/dist/implementation/world/closure.js.map +1 -1
- package/dist/implementation/world/command-ring.js +2 -1
- package/dist/implementation/world/command-ring.js.map +1 -1
- package/dist/implementation/world/commands.js +26 -4
- package/dist/implementation/world/commands.js.map +1 -1
- package/dist/implementation/world/create.d.ts +40 -0
- package/dist/implementation/world/create.js +479 -257
- package/dist/implementation/world/create.js.map +1 -1
- package/dist/implementation/world/directories.js +2 -1
- package/dist/implementation/world/directories.js.map +1 -1
- package/dist/implementation/world/entities.js.map +1 -1
- package/dist/implementation/world/execute.d.ts +1 -7
- package/dist/implementation/world/execute.js +248 -107
- package/dist/implementation/world/execute.js.map +1 -1
- package/dist/implementation/world/failures.d.ts +48 -5
- package/dist/implementation/world/failures.js +36 -4
- package/dist/implementation/world/failures.js.map +1 -1
- package/dist/implementation/world/finalizers.d.ts +2 -0
- package/dist/implementation/world/finalizers.js +42 -14
- package/dist/implementation/world/finalizers.js.map +1 -1
- package/dist/implementation/world/gpu.d.ts +8 -8
- package/dist/implementation/world/gpu.js +21 -12
- package/dist/implementation/world/gpu.js.map +1 -1
- package/dist/implementation/world/holders.js +1 -0
- package/dist/implementation/world/holders.js.map +1 -1
- package/dist/implementation/world/index-build.js +1 -0
- package/dist/implementation/world/index-build.js.map +1 -1
- package/dist/implementation/world/index-hash.d.ts +52 -13
- package/dist/implementation/world/index-hash.js +440 -71
- package/dist/implementation/world/index-hash.js.map +1 -1
- package/dist/implementation/world/index-keys.js +1 -0
- package/dist/implementation/world/index-keys.js.map +1 -1
- package/dist/implementation/world/index-lookups.d.ts +3 -3
- package/dist/implementation/world/index-lookups.js +22 -17
- package/dist/implementation/world/index-lookups.js.map +1 -1
- package/dist/implementation/world/index-order.js.map +1 -1
- package/dist/implementation/world/index-readers.js.map +1 -1
- package/dist/implementation/world/index-sorted.d.ts +2 -2
- package/dist/implementation/world/index-sorted.js +10 -4
- package/dist/implementation/world/index-sorted.js.map +1 -1
- package/dist/implementation/world/indexes.d.ts +9 -14
- package/dist/implementation/world/indexes.js +57 -115
- package/dist/implementation/world/indexes.js.map +1 -1
- package/dist/implementation/world/input.js +1 -1
- package/dist/implementation/world/input.js.map +1 -1
- package/dist/implementation/world/intrinsics.js.map +1 -1
- package/dist/implementation/world/join.d.ts +10 -7
- package/dist/implementation/world/join.js +116 -59
- package/dist/implementation/world/join.js.map +1 -1
- package/dist/implementation/world/joined-observer.d.ts +31 -2
- package/dist/implementation/world/joined-observer.js +69 -17
- package/dist/implementation/world/joined-observer.js.map +1 -1
- package/dist/implementation/world/joining.d.ts +60 -6
- package/dist/implementation/world/joining.js +47 -3
- package/dist/implementation/world/joining.js.map +1 -1
- package/dist/implementation/world/journal.d.ts +3 -2
- package/dist/implementation/world/journal.js +7 -4
- package/dist/implementation/world/journal.js.map +1 -1
- package/dist/implementation/world/kernel-indexes.d.ts +9 -2
- package/dist/implementation/world/kernel-indexes.js +13 -3
- package/dist/implementation/world/kernel-indexes.js.map +1 -1
- package/dist/implementation/world/kernel.d.ts +39 -5
- package/dist/implementation/world/kernel.js +2 -0
- package/dist/implementation/world/kernel.js.map +1 -1
- package/dist/implementation/world/kernels.d.ts +10 -2
- package/dist/implementation/world/kernels.js +85 -13
- package/dist/implementation/world/kernels.js.map +1 -1
- package/dist/implementation/world/layout-directory.d.ts +28 -12
- package/dist/implementation/world/layout-directory.js +72 -17
- package/dist/implementation/world/layout-directory.js.map +1 -1
- package/dist/implementation/world/lists.d.ts +37 -7
- package/dist/implementation/world/lists.js +169 -29
- package/dist/implementation/world/lists.js.map +1 -1
- package/dist/implementation/world/lookup-keys.d.ts +9 -8
- package/dist/implementation/world/lookup-keys.js.map +1 -1
- package/dist/implementation/world/loop.js +4 -5
- package/dist/implementation/world/loop.js.map +1 -1
- package/dist/implementation/world/memory.js +1 -0
- package/dist/implementation/world/memory.js.map +1 -1
- package/dist/implementation/world/mirror.d.ts +16 -3
- package/dist/implementation/world/mirror.js +37 -9
- package/dist/implementation/world/mirror.js.map +1 -1
- package/dist/implementation/world/move-log.js.map +1 -1
- package/dist/implementation/world/observer.d.ts +1 -1
- package/dist/implementation/world/observer.js +1 -2
- package/dist/implementation/world/observer.js.map +1 -1
- package/dist/implementation/world/order.js +1 -0
- package/dist/implementation/world/order.js.map +1 -1
- package/dist/implementation/world/out-of-band.d.ts +28 -0
- package/dist/implementation/world/out-of-band.js +66 -0
- package/dist/implementation/world/out-of-band.js.map +1 -0
- package/dist/implementation/world/plan.js.map +1 -1
- package/dist/implementation/world/pool.js +1 -0
- package/dist/implementation/world/pool.js.map +1 -1
- package/dist/implementation/world/port.d.ts +4 -3
- package/dist/implementation/world/port.js +14 -9
- package/dist/implementation/world/port.js.map +1 -1
- package/dist/implementation/world/prepared-lookup.js +1 -0
- package/dist/implementation/world/prepared-lookup.js.map +1 -1
- package/dist/implementation/world/prepared-spawn.js +13 -9
- package/dist/implementation/world/prepared-spawn.js.map +1 -1
- package/dist/implementation/world/program.js.map +1 -1
- package/dist/implementation/world/protocol.d.ts +8 -1
- package/dist/implementation/world/protocol.js.map +1 -1
- package/dist/implementation/world/publish.js.map +1 -1
- package/dist/implementation/world/ranges.d.ts +13 -3
- package/dist/implementation/world/ranges.js +118 -35
- package/dist/implementation/world/ranges.js.map +1 -1
- package/dist/implementation/world/reclaim.d.ts +27 -0
- package/dist/implementation/world/reclaim.js +176 -0
- package/dist/implementation/world/reclaim.js.map +1 -0
- package/dist/implementation/world/reductions.d.ts +7 -6
- package/dist/implementation/world/reductions.js +11 -11
- package/dist/implementation/world/reductions.js.map +1 -1
- package/dist/implementation/world/register.js +2 -2
- package/dist/implementation/world/register.js.map +1 -1
- package/dist/implementation/world/remote-systems.d.ts +9 -4
- package/dist/implementation/world/remote-systems.js +33 -28
- package/dist/implementation/world/remote-systems.js.map +1 -1
- package/dist/implementation/world/remote.js +1 -0
- package/dist/implementation/world/remote.js.map +1 -1
- package/dist/implementation/world/render-order.d.ts +19 -0
- package/dist/implementation/world/render-order.js +126 -0
- package/dist/implementation/world/render-order.js.map +1 -0
- package/dist/implementation/world/required.d.ts +3 -0
- package/dist/implementation/world/required.js +9 -0
- package/dist/implementation/world/required.js.map +1 -0
- package/dist/implementation/world/resources.d.ts +4 -1
- package/dist/implementation/world/resources.js +6 -3
- package/dist/implementation/world/resources.js.map +1 -1
- package/dist/implementation/world/rows.d.ts +15 -12
- package/dist/implementation/world/rows.js +90 -20
- package/dist/implementation/world/rows.js.map +1 -1
- package/dist/implementation/world/runner.d.ts +10 -0
- package/dist/implementation/world/runner.js +398 -78
- package/dist/implementation/world/runner.js.map +1 -1
- package/dist/implementation/world/shared.d.ts +55 -0
- package/dist/implementation/world/shared.js +301 -0
- package/dist/implementation/world/shared.js.map +1 -0
- package/dist/implementation/world/sharing.d.ts +7 -6
- package/dist/implementation/world/sharing.js +86 -23
- package/dist/implementation/world/sharing.js.map +1 -1
- package/dist/implementation/world/staging.d.ts +28 -5
- package/dist/implementation/world/staging.js +35 -9
- package/dist/implementation/world/staging.js.map +1 -1
- package/dist/implementation/world/state.d.ts +72 -13
- package/dist/implementation/world/state.js +138 -14
- package/dist/implementation/world/state.js.map +1 -1
- package/dist/implementation/world/stop-lists.d.ts +25 -2
- package/dist/implementation/world/stop-lists.js +63 -8
- package/dist/implementation/world/stop-lists.js.map +1 -1
- package/dist/implementation/world/strings.js +1 -0
- package/dist/implementation/world/strings.js.map +1 -1
- package/dist/implementation/world/structure.d.ts +1 -1
- package/dist/implementation/world/structure.js +4 -1
- package/dist/implementation/world/structure.js.map +1 -1
- package/dist/implementation/world/synchronize.d.ts +1 -1
- package/dist/implementation/world/synchronize.js +59 -17
- package/dist/implementation/world/synchronize.js.map +1 -1
- package/dist/implementation/world/tail-blocks.d.ts +5 -2
- package/dist/implementation/world/tail-blocks.js +9 -4
- package/dist/implementation/world/tail-blocks.js.map +1 -1
- package/dist/implementation/world/tails.d.ts +10 -5
- package/dist/implementation/world/tails.js +25 -18
- package/dist/implementation/world/tails.js.map +1 -1
- package/dist/implementation/world/terminal.js +1 -0
- package/dist/implementation/world/terminal.js.map +1 -1
- package/dist/implementation/world/thread-directory.d.ts +8 -2
- package/dist/implementation/world/thread-directory.js +82 -12
- package/dist/implementation/world/thread-directory.js.map +1 -1
- package/dist/implementation/world/thread-finalizers.d.ts +1 -2
- package/dist/implementation/world/thread-finalizers.js +129 -19
- package/dist/implementation/world/thread-finalizers.js.map +1 -1
- package/dist/implementation/world/thread-indexes.d.ts +3 -1
- package/dist/implementation/world/thread-indexes.js +4 -3
- package/dist/implementation/world/thread-indexes.js.map +1 -1
- package/dist/implementation/world/thread-observer.d.ts +4 -2
- package/dist/implementation/world/thread-observer.js +53 -11
- package/dist/implementation/world/thread-observer.js.map +1 -1
- package/dist/implementation/world/thread-systems.d.ts +10 -2
- package/dist/implementation/world/thread-systems.js +396 -78
- package/dist/implementation/world/thread-systems.js.map +1 -1
- package/dist/implementation/world/thread-tasks.d.ts +8 -4
- package/dist/implementation/world/thread-tasks.js +9 -4
- package/dist/implementation/world/thread-tasks.js.map +1 -1
- package/dist/implementation/world/transfers.js.map +1 -1
- package/dist/implementation/world/up.d.ts +9 -6
- package/dist/implementation/world/up.js +291 -75
- package/dist/implementation/world/up.js.map +1 -1
- package/dist/implementation/world/wasm.d.ts +39 -8
- package/dist/implementation/world/wasm.js +428 -127
- package/dist/implementation/world/wasm.js.map +1 -1
- package/dist/implementation/world/wgsl.d.ts +4 -2
- package/dist/implementation/world/wgsl.js +20 -8
- package/dist/implementation/world/wgsl.js.map +1 -1
- package/dist/implementation/world/where.d.ts +74 -0
- package/dist/implementation/world/where.js +202 -0
- package/dist/implementation/world/where.js.map +1 -0
- package/dist/implementation/world/worker-platform.js.map +1 -1
- package/dist/implementation/world/worker-window.d.ts +7 -0
- package/dist/implementation/world/worker-window.js +47 -0
- package/dist/implementation/world/worker-window.js.map +1 -0
- package/dist/implementation/world/worker.js +47 -61
- package/dist/implementation/world/worker.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/interface/component/component.js +1 -0
- package/dist/interface/component/component.js.map +1 -1
- package/dist/interface/component/index.d.ts +0 -1
- package/dist/interface/component/index.js +1 -1
- package/dist/interface/component/index.js.map +1 -1
- package/dist/interface/component/types.d.ts +2 -2
- package/dist/interface/component/value.d.ts +7 -2
- package/dist/interface/entity/entity.js.map +1 -1
- package/dist/interface/entity/index.d.ts +2 -0
- package/dist/interface/entity/index.js +2 -0
- package/dist/interface/entity/index.js.map +1 -1
- package/dist/interface/finalizer/body.d.ts +14 -11
- package/dist/interface/finalizer/create.d.ts +14 -14
- package/dist/interface/finalizer/create.js +43 -10
- package/dist/interface/finalizer/create.js.map +1 -1
- package/dist/interface/finalizer/created.d.ts +5 -5
- package/dist/interface/finalizer/declaration.d.ts +33 -13
- package/dist/interface/finalizer/finalizer.d.ts +2 -2
- package/dist/interface/finalizer/finalizer.js.map +1 -1
- package/dist/interface/finalizer/index.js +1 -0
- package/dist/interface/finalizer/index.js.map +1 -1
- package/dist/interface/gpu/accessors.d.ts +4 -3
- package/dist/interface/gpu/accessors.js +25 -8
- package/dist/interface/gpu/accessors.js.map +1 -1
- package/dist/interface/gpu/gpu.js.map +1 -1
- package/dist/interface/gpu/index.js +1 -0
- package/dist/interface/gpu/index.js.map +1 -1
- package/dist/interface/gpu/layout.js +1 -0
- package/dist/interface/gpu/layout.js.map +1 -1
- package/dist/interface/gpu/record.js +1 -0
- package/dist/interface/gpu/record.js.map +1 -1
- package/dist/interface/gpu/wgsl.d.ts +2 -1
- package/dist/interface/gpu/wgsl.js +9 -5
- package/dist/interface/gpu/wgsl.js.map +1 -1
- package/dist/interface/index.d.ts +0 -3
- package/dist/interface/index.js +1 -3
- package/dist/interface/index.js.map +1 -1
- package/dist/interface/indexes/create.d.ts +18 -9
- package/dist/interface/indexes/create.js +16 -13
- package/dist/interface/indexes/create.js.map +1 -1
- package/dist/interface/indexes/created.d.ts +2 -2
- package/dist/interface/indexes/declaration.d.ts +8 -3
- package/dist/interface/indexes/index-type.d.ts +3 -3
- package/dist/interface/indexes/index-type.js.map +1 -1
- package/dist/interface/indexes/index.js +1 -0
- package/dist/interface/indexes/index.js.map +1 -1
- package/dist/interface/math/f32/default.d.ts +4 -0
- package/dist/interface/math/f32/default.js +4 -0
- package/dist/interface/math/f32/default.js.map +1 -0
- package/dist/interface/math/f32/index.d.ts +3 -1
- package/dist/interface/math/f32/index.js.map +1 -1
- package/dist/interface/math/f32/public.d.ts +1 -0
- package/dist/interface/math/f32/public.js +2 -0
- package/dist/interface/math/f32/public.js.map +1 -1
- package/dist/interface/math/f32/round-half-even.js +1 -0
- package/dist/interface/math/f32/round-half-even.js.map +1 -1
- package/dist/interface/math/f32/schema.js.map +1 -1
- package/dist/interface/math/i32/default.d.ts +4 -0
- package/dist/interface/math/i32/default.js +4 -0
- package/dist/interface/math/i32/default.js.map +1 -0
- package/dist/interface/math/i32/index.d.ts +3 -1
- package/dist/interface/math/i32/index.js.map +1 -1
- package/dist/interface/math/i32/public.d.ts +1 -0
- package/dist/interface/math/i32/public.js +2 -0
- package/dist/interface/math/i32/public.js.map +1 -1
- package/dist/interface/math/i32/schema.js.map +1 -1
- package/dist/interface/math/i32/shift-right.js.map +1 -1
- package/dist/interface/math/index.js +1 -0
- package/dist/interface/math/index.js.map +1 -1
- package/dist/interface/math/intrinsic.js.map +1 -1
- package/dist/interface/math/mat4x4/add.js.map +1 -1
- package/dist/interface/math/mat4x4/determinant.js.map +1 -1
- package/dist/interface/math/mat4x4/identity.js.map +1 -1
- package/dist/interface/math/mat4x4/index.d.ts +3 -1
- package/dist/interface/math/mat4x4/index.js.map +1 -1
- package/dist/interface/math/mat4x4/inverse.js.map +1 -1
- package/dist/interface/math/mat4x4/look-at.js.map +1 -1
- package/dist/interface/math/mat4x4/multiply-vec3.js.map +1 -1
- package/dist/interface/math/mat4x4/multiply-vec4.js.map +1 -1
- package/dist/interface/math/mat4x4/multiply.js.map +1 -1
- package/dist/interface/math/mat4x4/orthographic.js.map +1 -1
- package/dist/interface/math/mat4x4/perspective.js.map +1 -1
- package/dist/interface/math/mat4x4/public.d.ts +1 -0
- package/dist/interface/math/mat4x4/public.js +2 -0
- package/dist/interface/math/mat4x4/public.js.map +1 -1
- package/dist/interface/math/mat4x4/rotation-x.js.map +1 -1
- package/dist/interface/math/mat4x4/rotation-y.js.map +1 -1
- package/dist/interface/math/mat4x4/rotation-z.js.map +1 -1
- package/dist/interface/math/mat4x4/scale.js.map +1 -1
- package/dist/interface/math/mat4x4/scaling.js.map +1 -1
- package/dist/interface/math/mat4x4/schema.js.map +1 -1
- package/dist/interface/math/mat4x4/subtract.js.map +1 -1
- package/dist/interface/math/mat4x4/translation.js.map +1 -1
- package/dist/interface/math/mat4x4/transpose.js.map +1 -1
- package/dist/interface/math/mat4x4/zero.js.map +1 -1
- package/dist/interface/math/quat/add.js.map +1 -1
- package/dist/interface/math/quat/align-to.js.map +1 -1
- package/dist/interface/math/quat/conjugate.js.map +1 -1
- package/dist/interface/math/quat/distance.js.map +1 -1
- package/dist/interface/math/quat/dot.js.map +1 -1
- package/dist/interface/math/quat/from-axis-angle.js.map +1 -1
- package/dist/interface/math/quat/from-euler.js.map +1 -1
- package/dist/interface/math/quat/identity.js.map +1 -1
- package/dist/interface/math/quat/index.d.ts +3 -1
- package/dist/interface/math/quat/index.js.map +1 -1
- package/dist/interface/math/quat/inverse.js.map +1 -1
- package/dist/interface/math/quat/length-squared.js.map +1 -1
- package/dist/interface/math/quat/length.js.map +1 -1
- package/dist/interface/math/quat/lerp.js.map +1 -1
- package/dist/interface/math/quat/look-at.js.map +1 -1
- package/dist/interface/math/quat/multiply.js.map +1 -1
- package/dist/interface/math/quat/negate.js.map +1 -1
- package/dist/interface/math/quat/normalize.js.map +1 -1
- package/dist/interface/math/quat/public.d.ts +1 -0
- package/dist/interface/math/quat/public.js +2 -0
- package/dist/interface/math/quat/public.js.map +1 -1
- package/dist/interface/math/quat/rotate-vec3.js.map +1 -1
- package/dist/interface/math/quat/scale.js.map +1 -1
- package/dist/interface/math/quat/schema.js.map +1 -1
- package/dist/interface/math/quat/slerp.js.map +1 -1
- package/dist/interface/math/quat/subtract.js.map +1 -1
- package/dist/interface/math/quat/to-axis-angle.js.map +1 -1
- package/dist/interface/math/quat/to-euler.js.map +1 -1
- package/dist/interface/math/quat/to-mat4.js.map +1 -1
- package/dist/interface/math/u32/count-leading-zeros.js.map +1 -1
- package/dist/interface/math/u32/count-one-bits.js.map +1 -1
- package/dist/interface/math/u32/count-trailing-zeros.js.map +1 -1
- package/dist/interface/math/u32/default.d.ts +4 -0
- package/dist/interface/math/u32/default.js +4 -0
- package/dist/interface/math/u32/default.js.map +1 -0
- package/dist/interface/math/u32/index.d.ts +3 -1
- package/dist/interface/math/u32/index.js.map +1 -1
- package/dist/interface/math/u32/public.d.ts +1 -0
- package/dist/interface/math/u32/public.js +2 -0
- package/dist/interface/math/u32/public.js.map +1 -1
- package/dist/interface/math/u32/reverse-bits.js.map +1 -1
- package/dist/interface/math/u32/schema.js.map +1 -1
- package/dist/interface/math/u32/shift-right.js.map +1 -1
- package/dist/interface/math/vec2/f32/abs.js.map +1 -1
- package/dist/interface/math/vec2/f32/acos.js.map +1 -1
- package/dist/interface/math/vec2/f32/acosh.js.map +1 -1
- package/dist/interface/math/vec2/f32/add.js.map +1 -1
- package/dist/interface/math/vec2/f32/asin.js.map +1 -1
- package/dist/interface/math/vec2/f32/asinh.js.map +1 -1
- package/dist/interface/math/vec2/f32/atan.js.map +1 -1
- package/dist/interface/math/vec2/f32/atanh.js.map +1 -1
- package/dist/interface/math/vec2/f32/ceil.js.map +1 -1
- package/dist/interface/math/vec2/f32/clamp.js.map +1 -1
- package/dist/interface/math/vec2/f32/cos.js.map +1 -1
- package/dist/interface/math/vec2/f32/cosh.js.map +1 -1
- package/dist/interface/math/vec2/f32/distance.js.map +1 -1
- package/dist/interface/math/vec2/f32/dot.js.map +1 -1
- package/dist/interface/math/vec2/f32/equals.js.map +1 -1
- package/dist/interface/math/vec2/f32/exp.js.map +1 -1
- package/dist/interface/math/vec2/f32/exp2.js.map +1 -1
- package/dist/interface/math/vec2/f32/f32.d.ts +3 -1
- package/dist/interface/math/vec2/f32/f32.js.map +1 -1
- package/dist/interface/math/vec2/f32/faceforward.js.map +1 -1
- package/dist/interface/math/vec2/f32/floor.js.map +1 -1
- package/dist/interface/math/vec2/f32/fract.js.map +1 -1
- package/dist/interface/math/vec2/f32/length.js.map +1 -1
- package/dist/interface/math/vec2/f32/log.js.map +1 -1
- package/dist/interface/math/vec2/f32/log2.js.map +1 -1
- package/dist/interface/math/vec2/f32/max.js.map +1 -1
- package/dist/interface/math/vec2/f32/min.js.map +1 -1
- package/dist/interface/math/vec2/f32/mix.js.map +1 -1
- package/dist/interface/math/vec2/f32/mod.js.map +1 -1
- package/dist/interface/math/vec2/f32/modf.js.map +1 -1
- package/dist/interface/math/vec2/f32/negate.js.map +1 -1
- package/dist/interface/math/vec2/f32/normalize.js.map +1 -1
- package/dist/interface/math/vec2/f32/pow.js.map +1 -1
- package/dist/interface/math/vec2/f32/public.d.ts +1 -0
- package/dist/interface/math/vec2/f32/public.js +2 -0
- package/dist/interface/math/vec2/f32/public.js.map +1 -1
- package/dist/interface/math/vec2/f32/reflect.js.map +1 -1
- package/dist/interface/math/vec2/f32/refract.js.map +1 -1
- package/dist/interface/math/vec2/f32/round.js.map +1 -1
- package/dist/interface/math/vec2/f32/scale.js.map +1 -1
- package/dist/interface/math/vec2/f32/schema.js.map +1 -1
- package/dist/interface/math/vec2/f32/sign.js.map +1 -1
- package/dist/interface/math/vec2/f32/sin.js.map +1 -1
- package/dist/interface/math/vec2/f32/sinh.js.map +1 -1
- package/dist/interface/math/vec2/f32/smoothstep.js.map +1 -1
- package/dist/interface/math/vec2/f32/sqrt.js.map +1 -1
- package/dist/interface/math/vec2/f32/step.js.map +1 -1
- package/dist/interface/math/vec2/f32/subtract.js.map +1 -1
- package/dist/interface/math/vec2/f32/tan.js.map +1 -1
- package/dist/interface/math/vec2/f32/tanh.js.map +1 -1
- package/dist/interface/math/vec2/f32/trunc.js.map +1 -1
- package/dist/interface/math/vec2/f32/zero.js.map +1 -1
- package/dist/interface/math/vec2/i32/abs.js.map +1 -1
- package/dist/interface/math/vec2/i32/add.js.map +1 -1
- package/dist/interface/math/vec2/i32/bitwise-and.js.map +1 -1
- package/dist/interface/math/vec2/i32/bitwise-not.js.map +1 -1
- package/dist/interface/math/vec2/i32/bitwise-or.js.map +1 -1
- package/dist/interface/math/vec2/i32/bitwise-xor.js.map +1 -1
- package/dist/interface/math/vec2/i32/clamp.js.map +1 -1
- package/dist/interface/math/vec2/i32/count-leading-zeros.js.map +1 -1
- package/dist/interface/math/vec2/i32/count-one-bits.js.map +1 -1
- package/dist/interface/math/vec2/i32/count-trailing-zeros.js.map +1 -1
- package/dist/interface/math/vec2/i32/equals.js.map +1 -1
- package/dist/interface/math/vec2/i32/i32.d.ts +3 -1
- package/dist/interface/math/vec2/i32/i32.js.map +1 -1
- package/dist/interface/math/vec2/i32/max.js.map +1 -1
- package/dist/interface/math/vec2/i32/min.js.map +1 -1
- package/dist/interface/math/vec2/i32/negate.js.map +1 -1
- package/dist/interface/math/vec2/i32/public.d.ts +1 -0
- package/dist/interface/math/vec2/i32/public.js +2 -0
- package/dist/interface/math/vec2/i32/public.js.map +1 -1
- package/dist/interface/math/vec2/i32/reverse-bits.js.map +1 -1
- package/dist/interface/math/vec2/i32/scale.js.map +1 -1
- package/dist/interface/math/vec2/i32/schema.js.map +1 -1
- package/dist/interface/math/vec2/i32/shift-left.js.map +1 -1
- package/dist/interface/math/vec2/i32/shift-right.js.map +1 -1
- package/dist/interface/math/vec2/i32/subtract.js.map +1 -1
- package/dist/interface/math/vec2/i32/zero.js.map +1 -1
- package/dist/interface/math/vec2/index.js.map +1 -1
- package/dist/interface/math/vec2/public.d.ts +1 -0
- package/dist/interface/math/vec2/public.js +2 -0
- package/dist/interface/math/vec2/public.js.map +1 -1
- package/dist/interface/math/vec2/u32/add.js.map +1 -1
- package/dist/interface/math/vec2/u32/bitwise-and.js.map +1 -1
- package/dist/interface/math/vec2/u32/bitwise-not.js.map +1 -1
- package/dist/interface/math/vec2/u32/bitwise-or.js.map +1 -1
- package/dist/interface/math/vec2/u32/bitwise-xor.js.map +1 -1
- package/dist/interface/math/vec2/u32/clamp.js.map +1 -1
- package/dist/interface/math/vec2/u32/count-leading-zeros.js.map +1 -1
- package/dist/interface/math/vec2/u32/count-one-bits.js.map +1 -1
- package/dist/interface/math/vec2/u32/count-trailing-zeros.js.map +1 -1
- package/dist/interface/math/vec2/u32/equals.js.map +1 -1
- package/dist/interface/math/vec2/u32/max.js.map +1 -1
- package/dist/interface/math/vec2/u32/min.js.map +1 -1
- package/dist/interface/math/vec2/u32/negate.js.map +1 -1
- package/dist/interface/math/vec2/u32/public.d.ts +1 -0
- package/dist/interface/math/vec2/u32/public.js +2 -0
- package/dist/interface/math/vec2/u32/public.js.map +1 -1
- package/dist/interface/math/vec2/u32/reverse-bits.js.map +1 -1
- package/dist/interface/math/vec2/u32/scale.js.map +1 -1
- package/dist/interface/math/vec2/u32/schema.js.map +1 -1
- package/dist/interface/math/vec2/u32/shift-left.js.map +1 -1
- package/dist/interface/math/vec2/u32/shift-right.js.map +1 -1
- package/dist/interface/math/vec2/u32/subtract.js.map +1 -1
- package/dist/interface/math/vec2/u32/u32.d.ts +3 -1
- package/dist/interface/math/vec2/u32/u32.js.map +1 -1
- package/dist/interface/math/vec2/u32/zero.js.map +1 -1
- package/dist/interface/math/vec3/f32/abs.js.map +1 -1
- package/dist/interface/math/vec3/f32/acos.js.map +1 -1
- package/dist/interface/math/vec3/f32/acosh.js.map +1 -1
- package/dist/interface/math/vec3/f32/add.js.map +1 -1
- package/dist/interface/math/vec3/f32/asin.js.map +1 -1
- package/dist/interface/math/vec3/f32/asinh.js.map +1 -1
- package/dist/interface/math/vec3/f32/atan.js.map +1 -1
- package/dist/interface/math/vec3/f32/atanh.js.map +1 -1
- package/dist/interface/math/vec3/f32/ceil.js.map +1 -1
- package/dist/interface/math/vec3/f32/clamp.js.map +1 -1
- package/dist/interface/math/vec3/f32/cos.js.map +1 -1
- package/dist/interface/math/vec3/f32/cosh.js.map +1 -1
- package/dist/interface/math/vec3/f32/cross.js.map +1 -1
- package/dist/interface/math/vec3/f32/distance-squared.js.map +1 -1
- package/dist/interface/math/vec3/f32/distance.js.map +1 -1
- package/dist/interface/math/vec3/f32/dot.js.map +1 -1
- package/dist/interface/math/vec3/f32/equals.js.map +1 -1
- package/dist/interface/math/vec3/f32/exp.js.map +1 -1
- package/dist/interface/math/vec3/f32/exp2.js.map +1 -1
- package/dist/interface/math/vec3/f32/f32.d.ts +3 -1
- package/dist/interface/math/vec3/f32/f32.js.map +1 -1
- package/dist/interface/math/vec3/f32/faceforward.js.map +1 -1
- package/dist/interface/math/vec3/f32/floor.js.map +1 -1
- package/dist/interface/math/vec3/f32/fract.js.map +1 -1
- package/dist/interface/math/vec3/f32/length-squared.js.map +1 -1
- package/dist/interface/math/vec3/f32/length.js.map +1 -1
- package/dist/interface/math/vec3/f32/log.js.map +1 -1
- package/dist/interface/math/vec3/f32/log2.js.map +1 -1
- package/dist/interface/math/vec3/f32/max.js.map +1 -1
- package/dist/interface/math/vec3/f32/min.js.map +1 -1
- package/dist/interface/math/vec3/f32/mix.js.map +1 -1
- package/dist/interface/math/vec3/f32/mod.js.map +1 -1
- package/dist/interface/math/vec3/f32/modf.js.map +1 -1
- package/dist/interface/math/vec3/f32/multiply.js.map +1 -1
- package/dist/interface/math/vec3/f32/negate.js.map +1 -1
- package/dist/interface/math/vec3/f32/normalize.js.map +1 -1
- package/dist/interface/math/vec3/f32/one.js.map +1 -1
- package/dist/interface/math/vec3/f32/pow.js.map +1 -1
- package/dist/interface/math/vec3/f32/public.d.ts +1 -0
- package/dist/interface/math/vec3/f32/public.js +2 -0
- package/dist/interface/math/vec3/f32/public.js.map +1 -1
- package/dist/interface/math/vec3/f32/random.js.map +1 -1
- package/dist/interface/math/vec3/f32/reflect.js.map +1 -1
- package/dist/interface/math/vec3/f32/refract.js.map +1 -1
- package/dist/interface/math/vec3/f32/round.js.map +1 -1
- package/dist/interface/math/vec3/f32/scale.js.map +1 -1
- package/dist/interface/math/vec3/f32/schema.js.map +1 -1
- package/dist/interface/math/vec3/f32/sign.js.map +1 -1
- package/dist/interface/math/vec3/f32/sin.js.map +1 -1
- package/dist/interface/math/vec3/f32/sinh.js.map +1 -1
- package/dist/interface/math/vec3/f32/smoothstep.js.map +1 -1
- package/dist/interface/math/vec3/f32/sqrt.js.map +1 -1
- package/dist/interface/math/vec3/f32/step.js.map +1 -1
- package/dist/interface/math/vec3/f32/subtract.js.map +1 -1
- package/dist/interface/math/vec3/f32/tan.js.map +1 -1
- package/dist/interface/math/vec3/f32/tanh.js.map +1 -1
- package/dist/interface/math/vec3/f32/trunc.js.map +1 -1
- package/dist/interface/math/vec3/f32/zero.js.map +1 -1
- package/dist/interface/math/vec3/i32/abs.js.map +1 -1
- package/dist/interface/math/vec3/i32/add.js.map +1 -1
- package/dist/interface/math/vec3/i32/bitwise-and.js.map +1 -1
- package/dist/interface/math/vec3/i32/bitwise-not.js.map +1 -1
- package/dist/interface/math/vec3/i32/bitwise-or.js.map +1 -1
- package/dist/interface/math/vec3/i32/bitwise-xor.js.map +1 -1
- package/dist/interface/math/vec3/i32/clamp.js.map +1 -1
- package/dist/interface/math/vec3/i32/count-leading-zeros.js.map +1 -1
- package/dist/interface/math/vec3/i32/count-one-bits.js.map +1 -1
- package/dist/interface/math/vec3/i32/count-trailing-zeros.js.map +1 -1
- package/dist/interface/math/vec3/i32/equals.js.map +1 -1
- package/dist/interface/math/vec3/i32/i32.d.ts +3 -1
- package/dist/interface/math/vec3/i32/i32.js.map +1 -1
- package/dist/interface/math/vec3/i32/max.js.map +1 -1
- package/dist/interface/math/vec3/i32/min.js.map +1 -1
- package/dist/interface/math/vec3/i32/multiply.js.map +1 -1
- package/dist/interface/math/vec3/i32/negate.js.map +1 -1
- package/dist/interface/math/vec3/i32/one.js.map +1 -1
- package/dist/interface/math/vec3/i32/public.d.ts +1 -0
- package/dist/interface/math/vec3/i32/public.js +2 -0
- package/dist/interface/math/vec3/i32/public.js.map +1 -1
- package/dist/interface/math/vec3/i32/reverse-bits.js.map +1 -1
- package/dist/interface/math/vec3/i32/scale.js.map +1 -1
- package/dist/interface/math/vec3/i32/schema.js.map +1 -1
- package/dist/interface/math/vec3/i32/shift-left.js.map +1 -1
- package/dist/interface/math/vec3/i32/shift-right.js.map +1 -1
- package/dist/interface/math/vec3/i32/subtract.js.map +1 -1
- package/dist/interface/math/vec3/i32/zero.js.map +1 -1
- package/dist/interface/math/vec3/index.js.map +1 -1
- package/dist/interface/math/vec3/public.d.ts +1 -0
- package/dist/interface/math/vec3/public.js +2 -0
- package/dist/interface/math/vec3/public.js.map +1 -1
- package/dist/interface/math/vec3/u32/add.js.map +1 -1
- package/dist/interface/math/vec3/u32/bitwise-and.js.map +1 -1
- package/dist/interface/math/vec3/u32/bitwise-not.js.map +1 -1
- package/dist/interface/math/vec3/u32/bitwise-or.js.map +1 -1
- package/dist/interface/math/vec3/u32/bitwise-xor.js.map +1 -1
- package/dist/interface/math/vec3/u32/clamp.js.map +1 -1
- package/dist/interface/math/vec3/u32/count-leading-zeros.js.map +1 -1
- package/dist/interface/math/vec3/u32/count-one-bits.js.map +1 -1
- package/dist/interface/math/vec3/u32/count-trailing-zeros.js.map +1 -1
- package/dist/interface/math/vec3/u32/equals.js.map +1 -1
- package/dist/interface/math/vec3/u32/max.js.map +1 -1
- package/dist/interface/math/vec3/u32/min.js.map +1 -1
- package/dist/interface/math/vec3/u32/multiply.js.map +1 -1
- package/dist/interface/math/vec3/u32/negate.js.map +1 -1
- package/dist/interface/math/vec3/u32/one.js.map +1 -1
- package/dist/interface/math/vec3/u32/public.d.ts +1 -0
- package/dist/interface/math/vec3/u32/public.js +2 -0
- package/dist/interface/math/vec3/u32/public.js.map +1 -1
- package/dist/interface/math/vec3/u32/reverse-bits.js.map +1 -1
- package/dist/interface/math/vec3/u32/scale.js.map +1 -1
- package/dist/interface/math/vec3/u32/schema.js.map +1 -1
- package/dist/interface/math/vec3/u32/shift-left.js.map +1 -1
- package/dist/interface/math/vec3/u32/shift-right.js.map +1 -1
- package/dist/interface/math/vec3/u32/subtract.js.map +1 -1
- package/dist/interface/math/vec3/u32/u32.d.ts +3 -1
- package/dist/interface/math/vec3/u32/u32.js.map +1 -1
- package/dist/interface/math/vec3/u32/volume.js.map +1 -1
- package/dist/interface/math/vec3/u32/zero.js.map +1 -1
- package/dist/interface/math/vec4/f32/abs.js.map +1 -1
- package/dist/interface/math/vec4/f32/acos.js.map +1 -1
- package/dist/interface/math/vec4/f32/acosh.js.map +1 -1
- package/dist/interface/math/vec4/f32/add.js.map +1 -1
- package/dist/interface/math/vec4/f32/asin.js.map +1 -1
- package/dist/interface/math/vec4/f32/asinh.js.map +1 -1
- package/dist/interface/math/vec4/f32/atan.js.map +1 -1
- package/dist/interface/math/vec4/f32/atanh.js.map +1 -1
- package/dist/interface/math/vec4/f32/ceil.js.map +1 -1
- package/dist/interface/math/vec4/f32/clamp.js.map +1 -1
- package/dist/interface/math/vec4/f32/cos.js.map +1 -1
- package/dist/interface/math/vec4/f32/cosh.js.map +1 -1
- package/dist/interface/math/vec4/f32/default.d.ts +4 -0
- package/dist/interface/math/vec4/f32/default.js +4 -0
- package/dist/interface/math/vec4/f32/default.js.map +1 -0
- package/dist/interface/math/vec4/f32/distance.js.map +1 -1
- package/dist/interface/math/vec4/f32/dot.js.map +1 -1
- package/dist/interface/math/vec4/f32/exp.js.map +1 -1
- package/dist/interface/math/vec4/f32/exp2.js.map +1 -1
- package/dist/interface/math/vec4/f32/f32.d.ts +3 -1
- package/dist/interface/math/vec4/f32/f32.js.map +1 -1
- package/dist/interface/math/vec4/f32/faceforward.js.map +1 -1
- package/dist/interface/math/vec4/f32/floor.js.map +1 -1
- package/dist/interface/math/vec4/f32/fract.js.map +1 -1
- package/dist/interface/math/vec4/f32/length.js.map +1 -1
- package/dist/interface/math/vec4/f32/log.js.map +1 -1
- package/dist/interface/math/vec4/f32/log2.js.map +1 -1
- package/dist/interface/math/vec4/f32/max.js.map +1 -1
- package/dist/interface/math/vec4/f32/min.js.map +1 -1
- package/dist/interface/math/vec4/f32/mix.js.map +1 -1
- package/dist/interface/math/vec4/f32/mod.js.map +1 -1
- package/dist/interface/math/vec4/f32/modf.js.map +1 -1
- package/dist/interface/math/vec4/f32/multiply.js.map +1 -1
- package/dist/interface/math/vec4/f32/negate.js.map +1 -1
- package/dist/interface/math/vec4/f32/normalize.js.map +1 -1
- package/dist/interface/math/vec4/f32/pow.js.map +1 -1
- package/dist/interface/math/vec4/f32/public.d.ts +1 -0
- package/dist/interface/math/vec4/f32/public.js +2 -0
- package/dist/interface/math/vec4/f32/public.js.map +1 -1
- package/dist/interface/math/vec4/f32/reflect.js.map +1 -1
- package/dist/interface/math/vec4/f32/refract.js.map +1 -1
- package/dist/interface/math/vec4/f32/round.js.map +1 -1
- package/dist/interface/math/vec4/f32/scale.js.map +1 -1
- package/dist/interface/math/vec4/f32/schema.js.map +1 -1
- package/dist/interface/math/vec4/f32/sign.js.map +1 -1
- package/dist/interface/math/vec4/f32/sin.js.map +1 -1
- package/dist/interface/math/vec4/f32/sinh.js.map +1 -1
- package/dist/interface/math/vec4/f32/smoothstep.js.map +1 -1
- package/dist/interface/math/vec4/f32/sqrt.js.map +1 -1
- package/dist/interface/math/vec4/f32/step.js.map +1 -1
- package/dist/interface/math/vec4/f32/subtract.js.map +1 -1
- package/dist/interface/math/vec4/f32/tan.js.map +1 -1
- package/dist/interface/math/vec4/f32/tanh.js.map +1 -1
- package/dist/interface/math/vec4/f32/trunc.js.map +1 -1
- package/dist/interface/math/vec4/i32/abs.js.map +1 -1
- package/dist/interface/math/vec4/i32/add.js.map +1 -1
- package/dist/interface/math/vec4/i32/bitwise-and.js.map +1 -1
- package/dist/interface/math/vec4/i32/bitwise-not.js.map +1 -1
- package/dist/interface/math/vec4/i32/bitwise-or.js.map +1 -1
- package/dist/interface/math/vec4/i32/bitwise-xor.js.map +1 -1
- package/dist/interface/math/vec4/i32/clamp.js.map +1 -1
- package/dist/interface/math/vec4/i32/count-leading-zeros.js.map +1 -1
- package/dist/interface/math/vec4/i32/count-one-bits.js.map +1 -1
- package/dist/interface/math/vec4/i32/count-trailing-zeros.js.map +1 -1
- package/dist/interface/math/vec4/i32/equals.js.map +1 -1
- package/dist/interface/math/vec4/i32/i32.d.ts +3 -1
- package/dist/interface/math/vec4/i32/i32.js.map +1 -1
- package/dist/interface/math/vec4/i32/max.js.map +1 -1
- package/dist/interface/math/vec4/i32/min.js.map +1 -1
- package/dist/interface/math/vec4/i32/multiply.js.map +1 -1
- package/dist/interface/math/vec4/i32/negate.js.map +1 -1
- package/dist/interface/math/vec4/i32/one.js.map +1 -1
- package/dist/interface/math/vec4/i32/public.d.ts +1 -0
- package/dist/interface/math/vec4/i32/public.js +2 -0
- package/dist/interface/math/vec4/i32/public.js.map +1 -1
- package/dist/interface/math/vec4/i32/reverse-bits.js.map +1 -1
- package/dist/interface/math/vec4/i32/scale.js.map +1 -1
- package/dist/interface/math/vec4/i32/schema.js.map +1 -1
- package/dist/interface/math/vec4/i32/shift-left.js.map +1 -1
- package/dist/interface/math/vec4/i32/shift-right.js.map +1 -1
- package/dist/interface/math/vec4/i32/subtract.js.map +1 -1
- package/dist/interface/math/vec4/i32/zero.js.map +1 -1
- package/dist/interface/math/vec4/index.js.map +1 -1
- package/dist/interface/math/vec4/public.d.ts +1 -0
- package/dist/interface/math/vec4/public.js +2 -0
- package/dist/interface/math/vec4/public.js.map +1 -1
- package/dist/interface/math/vec4/u32/add.js.map +1 -1
- package/dist/interface/math/vec4/u32/bitwise-and.js.map +1 -1
- package/dist/interface/math/vec4/u32/bitwise-not.js.map +1 -1
- package/dist/interface/math/vec4/u32/bitwise-or.js.map +1 -1
- package/dist/interface/math/vec4/u32/bitwise-xor.js.map +1 -1
- package/dist/interface/math/vec4/u32/clamp.js.map +1 -1
- package/dist/interface/math/vec4/u32/count-leading-zeros.js.map +1 -1
- package/dist/interface/math/vec4/u32/count-one-bits.js.map +1 -1
- package/dist/interface/math/vec4/u32/count-trailing-zeros.js.map +1 -1
- package/dist/interface/math/vec4/u32/equals.js.map +1 -1
- package/dist/interface/math/vec4/u32/max.js.map +1 -1
- package/dist/interface/math/vec4/u32/min.js.map +1 -1
- package/dist/interface/math/vec4/u32/multiply.js.map +1 -1
- package/dist/interface/math/vec4/u32/negate.js.map +1 -1
- package/dist/interface/math/vec4/u32/one.js.map +1 -1
- package/dist/interface/math/vec4/u32/public.d.ts +1 -0
- package/dist/interface/math/vec4/u32/public.js +2 -0
- package/dist/interface/math/vec4/u32/public.js.map +1 -1
- package/dist/interface/math/vec4/u32/reverse-bits.js.map +1 -1
- package/dist/interface/math/vec4/u32/scale.js.map +1 -1
- package/dist/interface/math/vec4/u32/schema.js.map +1 -1
- package/dist/interface/math/vec4/u32/shift-left.js.map +1 -1
- package/dist/interface/math/vec4/u32/shift-right.js.map +1 -1
- package/dist/interface/math/vec4/u32/subtract.js.map +1 -1
- package/dist/interface/math/vec4/u32/u32.d.ts +3 -1
- package/dist/interface/math/vec4/u32/u32.js.map +1 -1
- package/dist/interface/math/vec4/u32/zero.js.map +1 -1
- package/dist/interface/registry/archetypes.d.ts +25 -3
- package/dist/interface/registry/archetypes.js +40 -10
- package/dist/interface/registry/archetypes.js.map +1 -1
- package/dist/interface/registry/declarations.d.ts +7 -7
- package/dist/interface/registry/declarations.js +120 -10
- package/dist/interface/registry/declarations.js.map +1 -1
- package/dist/interface/registry/finalizer-order.js +3 -3
- package/dist/interface/registry/finalizer-order.js.map +1 -1
- package/dist/interface/registry/ids.d.ts +23 -0
- package/dist/interface/registry/ids.js +42 -0
- package/dist/interface/registry/ids.js.map +1 -1
- package/dist/interface/registry/index.d.ts +3 -3
- package/dist/interface/registry/index.js +3 -3
- package/dist/interface/registry/index.js.map +1 -1
- package/dist/interface/registry/indexes.js +2 -2
- package/dist/interface/registry/indexes.js.map +1 -1
- package/dist/interface/registry/items.d.ts +6 -11
- package/dist/interface/registry/items.js +14 -43
- package/dist/interface/registry/items.js.map +1 -1
- package/dist/interface/registry/layout.d.ts +3 -1
- package/dist/interface/registry/layout.js +7 -1
- package/dist/interface/registry/layout.js.map +1 -1
- package/dist/interface/registry/names.d.ts +13 -5
- package/dist/interface/registry/names.js +55 -38
- package/dist/interface/registry/names.js.map +1 -1
- package/dist/interface/registry/program.js.map +1 -1
- package/dist/interface/registry/reduction.js.map +1 -1
- package/dist/interface/registry/schedule.d.ts +5 -1
- package/dist/interface/registry/schedule.js +8 -13
- package/dist/interface/registry/schedule.js.map +1 -1
- package/dist/interface/registry/schemas.d.ts +9 -0
- package/dist/interface/registry/schemas.js +65 -0
- package/dist/interface/registry/schemas.js.map +1 -1
- package/dist/interface/registry/strata.js +1 -0
- package/dist/interface/registry/strata.js.map +1 -1
- package/dist/interface/registry/threads.js +3 -2
- package/dist/interface/registry/threads.js.map +1 -1
- package/dist/interface/registry/traits.js +2 -1
- package/dist/interface/registry/traits.js.map +1 -1
- package/dist/interface/registry/written.js +1 -0
- package/dist/interface/registry/written.js.map +1 -1
- package/dist/interface/resource/index.d.ts +0 -1
- package/dist/interface/resource/index.js +1 -1
- package/dist/interface/resource/index.js.map +1 -1
- package/dist/interface/resource/resource.js +1 -0
- package/dist/interface/resource/resource.js.map +1 -1
- package/dist/interface/resource/types.d.ts +4 -1
- package/dist/interface/resources/always.js +3 -2
- package/dist/interface/resources/always.js.map +1 -1
- package/dist/interface/resources/cadence.js +4 -3
- package/dist/interface/resources/cadence.js.map +1 -1
- package/dist/interface/resources/clock.js +5 -3
- package/dist/interface/resources/clock.js.map +1 -1
- package/dist/interface/resources/gpu-device.js +3 -2
- package/dist/interface/resources/gpu-device.js.map +1 -1
- package/dist/interface/resources/index.js +1 -0
- package/dist/interface/resources/index.js.map +1 -1
- package/dist/interface/resources/wake.js +3 -2
- package/dist/interface/resources/wake.js.map +1 -1
- package/dist/interface/resources/workers.js +3 -2
- package/dist/interface/resources/workers.js.map +1 -1
- package/dist/interface/rule/create.d.ts +6 -2
- package/dist/interface/rule/create.js +8 -6
- package/dist/interface/rule/create.js.map +1 -1
- package/dist/interface/rule/created.d.ts +3 -3
- package/dist/interface/rule/declaration.d.ts +8 -3
- package/dist/interface/rule/index.js +1 -0
- package/dist/interface/rule/index.js.map +1 -1
- package/dist/interface/rule/rule.js.map +1 -1
- package/dist/interface/schema/is-struct.d.ts +15 -0
- package/dist/interface/schema/schema.d.ts +21 -1
- package/dist/interface/system/access.d.ts +87 -26
- package/dist/interface/system/body.d.ts +53 -26
- package/dist/interface/system/check.d.ts +13 -3
- package/dist/interface/system/check.js +87 -47
- package/dist/interface/system/check.js.map +1 -1
- package/dist/interface/system/commands.d.ts +54 -5
- package/dist/interface/system/composite-declaration.d.ts +0 -2
- package/dist/interface/system/create-resolved.d.ts +9 -0
- package/dist/interface/system/create-resolved.js +18 -0
- package/dist/interface/system/create-resolved.js.map +1 -0
- package/dist/interface/system/create.d.ts +116 -110
- package/dist/interface/system/create.js +34 -8
- package/dist/interface/system/create.js.map +1 -1
- package/dist/interface/system/declaration.d.ts +33 -29
- package/dist/interface/system/index.js.map +1 -1
- package/dist/interface/system/input.d.ts +37 -6
- package/dist/interface/system/leaf.d.ts +10 -3
- package/dist/interface/system/name.d.ts +3 -3
- package/dist/interface/system/property.js +1 -0
- package/dist/interface/system/property.js.map +1 -1
- package/dist/interface/system/render.d.ts +35 -16
- package/dist/interface/system/render.js +19 -5
- package/dist/interface/system/render.js.map +1 -1
- package/dist/interface/system/resolve.d.ts +68 -0
- package/dist/interface/system/resolve.js +138 -0
- package/dist/interface/system/resolve.js.map +1 -0
- package/dist/interface/system/system.d.ts +5 -3
- package/dist/interface/system/system.js.map +1 -1
- package/dist/interface/system/threads.d.ts +8 -7
- package/dist/interface/system/values-of.d.ts +17 -0
- package/dist/interface/system/values-of.js.map +1 -0
- package/dist/interface/system/values.d.ts +12 -12
- package/dist/interface/thread/of.d.ts +4 -2
- package/dist/interface/trait/key.d.ts +1 -1
- package/dist/interface/trait/types.d.ts +23 -5
- package/dist/interface/world/create.d.ts +8 -2
- package/dist/interface/world/declarations.d.ts +37 -0
- package/dist/interface/world/declarations.js +2 -0
- package/dist/interface/world/declarations.js.map +1 -0
- package/dist/interface/world/filter.js +1 -0
- package/dist/interface/world/filter.js.map +1 -1
- package/dist/interface/world/join.d.ts +10 -4
- package/dist/interface/world/world.d.ts +31 -17
- package/package.json +18 -5
- package/src/exports.test.ts +149 -44
- package/src/guide/00-keys.md +34 -0
- package/src/guide/00-keys.out +1 -0
- package/src/guide/00-keys.ts +35 -0
- package/src/guide/00-setup.md +24 -0
- package/src/guide/01-resources.md +22 -0
- package/src/guide/01-resources.out +2 -0
- package/src/guide/01-resources.ts +33 -0
- package/src/guide/02-entities.md +19 -0
- package/src/guide/02-entities.out +2 -0
- package/src/guide/02-entities.ts +43 -0
- package/src/guide/03-systems.md +22 -0
- package/src/guide/03-systems.out +5 -0
- package/src/guide/03-systems.ts +68 -0
- package/src/guide/04-ticks.md +18 -0
- package/src/guide/04-ticks.out +3 -0
- package/src/guide/04-ticks.ts +53 -0
- package/src/guide/05-scheduling.md +14 -0
- package/src/guide/05-scheduling.out +2 -0
- package/src/guide/05-scheduling.ts +46 -0
- package/src/guide/06-sync-points.md +14 -0
- package/src/guide/06-sync-points.out +3 -0
- package/src/guide/06-sync-points.ts +42 -0
- package/src/guide/07-change-filters.md +14 -0
- package/src/guide/07-change-filters.out +6 -0
- package/src/guide/07-change-filters.ts +70 -0
- package/src/guide/08-input.md +12 -0
- package/src/guide/08-input.out +1 -0
- package/src/guide/08-input.ts +45 -0
- package/src/guide/09-rules.md +12 -0
- package/src/guide/09-rules.out +2 -0
- package/src/guide/09-rules.ts +50 -0
- package/src/guide/10-finalizers.md +13 -0
- package/src/guide/10-finalizers.out +4 -0
- package/src/guide/10-finalizers.ts +48 -0
- package/src/guide/11-traits.md +16 -0
- package/src/guide/11-traits.out +2 -0
- package/src/guide/11-traits.ts +51 -0
- package/src/guide/11-traits.type-test.ts +11 -13
- package/src/guide/12-lookups.md +14 -0
- package/src/guide/12-lookups.out +3 -0
- package/src/guide/12-lookups.ts +59 -0
- package/src/guide/13-indexes.md +21 -0
- package/src/guide/13-indexes.out +8 -0
- package/src/guide/13-indexes.ts +73 -0
- package/src/guide/14-kernels.md +15 -0
- package/src/guide/14-kernels.out +1 -0
- package/src/guide/14-kernels.ts +48 -0
- package/src/guide/15-reductions.md +12 -0
- package/src/guide/15-reductions.out +1 -0
- package/src/guide/15-reductions.ts +38 -0
- package/src/guide/16-gpu.md +18 -0
- package/src/guide/16-gpu.out +3 -0
- package/src/guide/16-gpu.ts +51 -0
- package/src/guide/17-hierarchies.md +11 -0
- package/src/guide/17-hierarchies.out +1 -0
- package/src/guide/17-hierarchies.ts +40 -0
- package/src/guide/18-identity.md +10 -0
- package/src/guide/18-identity.out +1 -0
- package/src/guide/18-identity.ts +11 -0
- package/src/guide/19-threads.md +16 -0
- package/src/guide/19-threads.out +2 -0
- package/src/guide/19-threads.ts +65 -0
- package/src/guide/20-shared.md +29 -0
- package/src/guide/20-shared.out +4 -0
- package/src/guide/20-shared.ts +118 -0
- package/src/guide/21-dom.md +22 -0
- package/src/guide/21-dom.out +5 -0
- package/src/guide/21-dom.ts +117 -0
- package/src/guide/22-canvas.md +15 -0
- package/src/guide/22-canvas.out +3 -0
- package/src/guide/22-canvas.ts +119 -0
- package/src/guide/CLAUDE.md +40 -25
- package/src/guide/README.md +42 -0
- package/src/guide/guide.test.ts +215 -0
- package/src/implementation/compiler/access.ts +10 -4
- package/src/implementation/compiler/archetypes.test.ts +64 -0
- package/src/implementation/compiler/archetypes.ts +134 -0
- package/src/implementation/compiler/assign.ts +1 -0
- package/src/implementation/compiler/augmentations.test.ts +418 -0
- package/src/implementation/compiler/augmentations.ts +871 -0
- package/src/implementation/compiler/bind.ts +6 -4
- package/src/implementation/compiler/body-access.ts +135 -33
- package/src/implementation/compiler/booleans.ts +1 -0
- package/src/implementation/compiler/branches.ts +1 -0
- package/src/implementation/compiler/calls.ts +14 -3
- package/src/implementation/compiler/columns.ts +21 -5
- package/src/implementation/compiler/compile-kernel.ts +88 -23
- package/src/implementation/compiler/compiler.ts +9 -0
- package/src/implementation/compiler/data.ts +1 -0
- package/src/implementation/compiler/describe.test-helper.ts +97 -0
- package/src/implementation/compiler/describe.test.ts +168 -0
- package/src/implementation/compiler/describe.ts +489 -0
- package/src/implementation/compiler/estree.ts +1 -0
- package/src/implementation/compiler/expression.ts +24 -2
- package/src/implementation/compiler/failure.ts +1 -0
- package/src/implementation/compiler/hygiene.test.ts +4 -11
- package/src/implementation/compiler/identify.test.ts +100 -46
- package/src/implementation/compiler/identify.ts +89 -32
- package/src/implementation/compiler/index.ts +6 -1
- package/src/implementation/compiler/inferred.test.ts +32 -0
- package/src/implementation/compiler/inferred.ts +197 -0
- package/src/implementation/compiler/inline-kernels.test.ts +10 -0
- package/src/implementation/compiler/inline-kernels.ts +21 -0
- package/src/implementation/compiler/input-schemas.test.ts +182 -0
- package/src/implementation/compiler/input-schemas.ts +107 -0
- package/src/implementation/compiler/ir.ts +7 -2
- package/src/implementation/compiler/kernel-id.ts +1 -0
- package/src/implementation/compiler/key.ts +1 -0
- package/src/implementation/compiler/link.test.ts +3 -0
- package/src/implementation/compiler/link.ts +29 -0
- package/src/implementation/compiler/lists.ts +41 -13
- package/src/implementation/compiler/lookups.ts +1 -0
- package/src/implementation/compiler/math.ts +1 -0
- package/src/implementation/compiler/memory-compiler.browser.test.ts +85 -0
- package/src/implementation/compiler/memory-compiler.test.ts +147 -0
- package/src/implementation/compiler/memory-compiler.ts +307 -0
- package/src/implementation/compiler/module-scope.ts +1 -0
- package/src/implementation/compiler/module-value.ts +18 -3
- package/src/implementation/compiler/out.ts +1 -0
- package/src/implementation/compiler/oxc.test-helper.ts +20 -0
- package/src/implementation/compiler/oxc.test.ts +69 -0
- package/src/implementation/compiler/oxc.ts +90 -0
- package/src/implementation/compiler/package-copies.ts +208 -0
- package/src/implementation/compiler/passes.ts +34 -0
- package/src/implementation/compiler/paths.ts +19 -38
- package/src/implementation/compiler/plugin.test.ts +373 -62
- package/src/implementation/compiler/plugin.ts +199 -38
- package/src/implementation/compiler/posix.test.ts +34 -0
- package/src/implementation/compiler/posix.ts +183 -0
- package/src/implementation/compiler/predicates.test.ts +90 -0
- package/src/implementation/compiler/predicates.ts +250 -0
- package/src/implementation/compiler/print.ts +26 -6
- package/src/implementation/compiler/program.ts +4 -1
- package/src/implementation/compiler/public.ts +2 -0
- package/src/implementation/compiler/scalar.ts +1 -0
- package/src/implementation/compiler/scope.ts +1 -0
- package/src/implementation/compiler/serialize.ts +1 -0
- package/src/implementation/compiler/shared-kernels.test.ts +57 -0
- package/src/implementation/compiler/signature.ts +70 -30
- package/src/implementation/compiler/snapshot.ts +5 -2
- package/src/implementation/compiler/source-map.test.ts +1 -0
- package/src/implementation/compiler/source-map.ts +1 -0
- package/src/implementation/compiler/spawns.ts +62 -5
- package/src/implementation/compiler/stamps.ts +30 -8
- package/src/implementation/compiler/statement.ts +1 -0
- package/src/implementation/compiler/subset.md +4 -3
- package/src/implementation/compiler/terminal.ts +1 -0
- package/src/implementation/compiler/transform.test.ts +371 -258
- package/src/implementation/compiler/transform.ts +321 -62
- package/src/implementation/compiler/type-host.test-helper.ts +27 -0
- package/src/implementation/compiler/type-schemas.ts +714 -0
- package/src/implementation/compiler/unit.ts +22 -4
- package/src/implementation/compiler/value.ts +1 -0
- package/src/implementation/compiler/wat.test.ts +135 -0
- package/src/implementation/compiler/wat.ts +365 -0
- package/src/implementation/index.ts +1 -0
- package/src/implementation/world/activate.ts +10 -3
- package/src/implementation/world/archetype.ts +133 -19
- package/src/implementation/world/arrays.test.ts +1 -0
- package/src/implementation/world/arrays.ts +6 -1
- package/src/implementation/world/arrivals.test.ts +89 -0
- package/src/implementation/world/arrivals.ts +165 -0
- package/src/implementation/world/async-loading.test.ts +13 -28
- package/src/implementation/world/attach-kernel.test.ts +10 -2
- package/src/implementation/world/attach-kernel.ts +14 -7
- package/src/implementation/world/batches.test.ts +14 -17
- package/src/implementation/world/batches.ts +67 -8
- package/src/implementation/world/buffer.ts +35 -4
- package/src/implementation/world/builtins.test.ts +5 -10
- package/src/implementation/world/cascade.ts +2 -1
- package/src/implementation/world/cells.ts +1 -0
- package/src/implementation/world/change-blocks.browser.test.ts +76 -0
- package/src/implementation/world/change-blocks.cases.ts +14 -0
- package/src/implementation/world/change-blocks.fixture.ts +70 -0
- package/src/implementation/world/change-blocks.test.ts +264 -0
- package/src/implementation/world/changes-finalizers.test.ts +6 -8
- package/src/implementation/world/check-kernel.ts +46 -32
- package/src/implementation/world/claims.test.ts +1 -0
- package/src/implementation/world/claims.ts +1 -0
- package/src/implementation/world/closure.test.ts +1 -0
- package/src/implementation/world/closure.ts +1 -0
- package/src/implementation/world/command-ring.ts +2 -1
- package/src/implementation/world/command-rings.cases.ts +5 -2
- package/src/implementation/world/command-rings.fixture.ts +27 -36
- package/src/implementation/world/commands.test.ts +84 -43
- package/src/implementation/world/commands.ts +26 -4
- package/src/implementation/world/composite-input.test.ts +17 -15
- package/src/implementation/world/conditions.test.ts +17 -28
- package/src/implementation/world/constant-unions.test.ts +43 -0
- package/src/implementation/world/create.test.ts +50 -71
- package/src/implementation/world/create.ts +486 -250
- package/src/implementation/world/defaults.test.ts +86 -0
- package/src/implementation/world/directories.ts +2 -1
- package/src/implementation/world/directory.test.ts +2 -3
- package/src/implementation/world/dispatch.cases.ts +1 -0
- package/src/implementation/world/dispatch.fixture.ts +16 -25
- package/src/implementation/world/entities.ts +1 -0
- package/src/implementation/world/entity-lookup-workers.cases.ts +1 -0
- package/src/implementation/world/entity-lookup-workers.fixture.ts +9 -16
- package/src/implementation/world/entity-lookups.browser.test.ts +8 -14
- package/src/implementation/world/entity-lookups.test-helper.ts +28 -34
- package/src/implementation/world/entity-lookups.test.ts +9 -16
- package/src/implementation/world/execute.ts +232 -96
- package/src/implementation/world/failing-worker.fixture.ts +3 -0
- package/src/implementation/world/failures.ts +64 -7
- package/src/implementation/world/finalizers.test.ts +33 -49
- package/src/implementation/world/finalizers.ts +46 -14
- package/src/implementation/world/fixtures.test-helper.ts +1 -0
- package/src/implementation/world/generated-code.md +10 -6
- package/src/implementation/world/gpu.browser.test.ts +100 -92
- package/src/implementation/world/gpu.test-helper.ts +12 -0
- package/src/implementation/world/gpu.ts +26 -14
- package/src/implementation/world/holders.ts +1 -0
- package/src/implementation/world/ids-changes.test-helper.ts +4 -0
- package/src/implementation/world/ids-keys.test-helper.ts +21 -0
- package/src/implementation/world/ids.test.ts +12 -49
- package/src/implementation/world/imported-lists.test-helper.ts +2 -6
- package/src/implementation/world/imported-lists.test.ts +4 -5
- package/src/implementation/world/index-buckets.test.ts +276 -0
- package/src/implementation/world/index-build-csp.test.ts +8 -9
- package/src/implementation/world/index-build.cases.ts +1 -0
- package/src/implementation/world/index-build.fixture.ts +12 -15
- package/src/implementation/world/index-build.ts +1 -0
- package/src/implementation/world/index-changed.test.ts +27 -34
- package/src/implementation/world/index-hash.test.ts +34 -0
- package/src/implementation/world/index-hash.ts +454 -74
- package/src/implementation/world/index-joined.test.ts +232 -74
- package/src/implementation/world/index-kernels.test.ts +26 -35
- package/src/implementation/world/index-keyless.test.ts +21 -28
- package/src/implementation/world/index-keys.ts +1 -0
- package/src/implementation/world/index-lookups-csp.test.ts +5 -6
- package/src/implementation/world/index-lookups.ts +28 -22
- package/src/implementation/world/index-order.test.ts +13 -17
- package/src/implementation/world/index-order.ts +1 -0
- package/src/implementation/world/index-readers.ts +1 -0
- package/src/implementation/world/index-sorted.test.ts +1 -0
- package/src/implementation/world/index-sorted.ts +10 -5
- package/src/implementation/world/index-workers.cases.ts +10 -0
- package/src/implementation/world/index-workers.fixture.ts +98 -39
- package/src/implementation/world/indexes.test.ts +62 -74
- package/src/implementation/world/indexes.ts +62 -108
- package/src/implementation/world/input.ts +2 -1
- package/src/implementation/world/intrinsics-coverage.test.ts +1 -0
- package/src/implementation/world/intrinsics.browser.test.ts +22 -62
- package/src/implementation/world/intrinsics.ts +1 -0
- package/src/implementation/world/join.test.ts +182 -43
- package/src/implementation/world/join.ts +112 -59
- package/src/implementation/world/join.type-test.ts +7 -5
- package/src/implementation/world/joined-observer.test.ts +58 -0
- package/src/implementation/world/joined-observer.ts +85 -19
- package/src/implementation/world/joining-worker.fixture.ts +51 -11
- package/src/implementation/world/joining.cases.ts +43 -7
- package/src/implementation/world/joining.fixture.ts +114 -14
- package/src/implementation/world/joining.test-helper.ts +25 -27
- package/src/implementation/world/joining.ts +85 -7
- package/src/implementation/world/journal.ts +8 -4
- package/src/implementation/world/kernel-imports-sparks.test-helper.ts +3 -4
- package/src/implementation/world/kernel-imports-steer.test-helper.ts +1 -0
- package/src/implementation/world/kernel-imports.test.ts +10 -12
- package/src/implementation/world/kernel-indexes.ts +12 -3
- package/src/implementation/world/kernel-lookup.test-helper.ts +6 -10
- package/src/implementation/world/kernel-path.test-helper.ts +2 -4
- package/src/implementation/world/kernel-spawns.test.ts +17 -28
- package/src/implementation/world/kernel-tried.test-helper.ts +31 -0
- package/src/implementation/world/kernel.ts +30 -6
- package/src/implementation/world/kernels-csp.test.ts +5 -5
- package/src/implementation/world/kernels.test.ts +18 -14
- package/src/implementation/world/kernels.ts +82 -13
- package/src/implementation/world/layout-directory.browser.test.ts +18 -28
- package/src/implementation/world/layout-directory.cases.ts +1 -0
- package/src/implementation/world/layout-directory.fixture.ts +18 -28
- package/src/implementation/world/layout-directory.ts +69 -17
- package/src/implementation/world/lifetime.cases.ts +2 -1
- package/src/implementation/world/lifetime.fixture.ts +12 -21
- package/src/implementation/world/lifetime.test-helper.ts +2 -1
- package/src/implementation/world/lifetime.test.ts +7 -14
- package/src/implementation/world/lists.ts +179 -28
- package/src/implementation/world/lookup-keys.ts +10 -9
- package/src/implementation/world/loop.test.ts +19 -8
- package/src/implementation/world/loop.ts +4 -4
- package/src/implementation/world/memory.test.ts +1 -0
- package/src/implementation/world/memory.ts +1 -0
- package/src/implementation/world/mirror.ts +45 -10
- package/src/implementation/world/move-log.test.ts +114 -11
- package/src/implementation/world/move-log.ts +1 -0
- package/src/implementation/world/names.test.ts +31 -31
- package/src/implementation/world/observe-cases.browser.test.ts +11 -11
- package/src/implementation/world/observe-cases.test.ts +49 -95
- package/src/implementation/world/observe-factories.test.ts +17 -19
- package/src/implementation/world/observe-joined-cases.test.ts +34 -45
- package/src/implementation/world/observe-ticks-cases.test.ts +33 -35
- package/src/implementation/world/observe.test-helper.ts +2 -1
- package/src/implementation/world/observed-workers.cases.ts +1 -0
- package/src/implementation/world/observed-workers.fixture.ts +7 -8
- package/src/implementation/world/observer-contained-worker.fixture.ts +4 -3
- package/src/implementation/world/observer-contained.browser.test.ts +1 -0
- package/src/implementation/world/observer-contained.cases.ts +1 -0
- package/src/implementation/world/observer-contained.fixture.ts +3 -7
- package/src/implementation/world/observer-contained.test-helper.ts +7 -8
- package/src/implementation/world/observer-contained.test.ts +11 -19
- package/src/implementation/world/observer-joined-worker.fixture.ts +2 -1
- package/src/implementation/world/observer-joined.cases.ts +1 -0
- package/src/implementation/world/observer-joined.fixture.ts +8 -6
- package/src/implementation/world/observer-joined.test-helper.ts +25 -34
- package/src/implementation/world/observer-joined.test.ts +78 -62
- package/src/implementation/world/observer.browser.test.ts +13 -13
- package/src/implementation/world/observer.test.ts +34 -44
- package/src/implementation/world/observer.ts +3 -3
- package/src/implementation/world/optional-workers.cases.ts +19 -0
- package/src/implementation/world/optional-workers.fixture.ts +55 -0
- package/src/implementation/world/optional.test.ts +351 -0
- package/src/implementation/world/order.ts +1 -0
- package/src/implementation/world/out-of-band.ts +61 -0
- package/src/implementation/world/outcomes.test-helper.ts +138 -0
- package/src/implementation/world/package-id.test-helper.ts +9 -0
- package/src/implementation/world/perf.md +124 -4
- package/src/implementation/world/plan.ts +1 -0
- package/src/implementation/world/platforms.test-helper.ts +1 -0
- package/src/implementation/world/pool-size.cases.ts +18 -0
- package/src/implementation/world/pool-size.fixture.ts +98 -6
- package/src/implementation/world/pool.cases.ts +1 -0
- package/src/implementation/world/pool.fixture.ts +1 -0
- package/src/implementation/world/pool.ts +1 -0
- package/src/implementation/world/port.test.ts +45 -0
- package/src/implementation/world/port.ts +18 -11
- package/src/implementation/world/ports.cases.ts +2 -2
- package/src/implementation/world/ports.fixture.ts +4 -5
- package/src/implementation/world/ports.type-test.ts +1 -0
- package/src/implementation/world/precision.test.ts +174 -0
- package/src/implementation/world/prepared-lookup.ts +1 -0
- package/src/implementation/world/prepared-spawn.ts +14 -10
- package/src/implementation/world/program.ts +1 -0
- package/src/implementation/world/protocol.ts +9 -2
- package/src/implementation/world/publish.ts +1 -0
- package/src/implementation/world/ranges.test.ts +66 -0
- package/src/implementation/world/ranges.ts +98 -32
- package/src/implementation/world/reads.test-helper.ts +1 -0
- package/src/implementation/world/reclaim.test.ts +214 -0
- package/src/implementation/world/reclaim.ts +170 -0
- package/src/implementation/world/reductions.cases.ts +1 -0
- package/src/implementation/world/reductions.fixture.ts +5 -10
- package/src/implementation/world/reductions.test.ts +36 -49
- package/src/implementation/world/reductions.ts +14 -12
- package/src/implementation/world/reevaluation.test-helper.ts +3 -3
- package/src/implementation/world/reevaluation.test.ts +9 -8
- package/src/implementation/world/register.ts +3 -2
- package/src/implementation/world/remote-finalizers-worker.fixture.ts +25 -10
- package/src/implementation/world/remote-finalizers.cases.ts +19 -1
- package/src/implementation/world/remote-finalizers.fixture.ts +86 -11
- package/src/implementation/world/remote-finalizers.test-helper.ts +119 -27
- package/src/implementation/world/remote-finalizers.test.ts +86 -20
- package/src/implementation/world/remote-objects-worker.fixture.ts +2 -1
- package/src/implementation/world/remote-objects.cases.ts +1 -0
- package/src/implementation/world/remote-objects.fixture.ts +3 -1
- package/src/implementation/world/remote-objects.test-helper.ts +9 -10
- package/src/implementation/world/remote-systems.ts +42 -28
- package/src/implementation/world/remote.test.ts +46 -48
- package/src/implementation/world/remote.ts +1 -0
- package/src/implementation/world/removal-worker.fixture.ts +3 -2
- package/src/implementation/world/removal.cases.ts +1 -0
- package/src/implementation/world/removal.fixture.ts +3 -2
- package/src/implementation/world/remove-joined.test.ts +4 -3
- package/src/implementation/world/remove.test-helper.ts +11 -13
- package/src/implementation/world/remove.test.ts +14 -17
- package/src/implementation/world/render-order.browser.test.ts +209 -0
- package/src/implementation/world/render-order.ts +150 -0
- package/src/implementation/world/required.ts +10 -0
- package/src/implementation/world/resources.ts +7 -3
- package/src/implementation/world/rows.test.ts +8 -11
- package/src/implementation/world/rows.ts +99 -30
- package/src/implementation/world/rules.test.ts +38 -39
- package/src/implementation/world/run-results.test.ts +374 -0
- package/src/implementation/world/runner.ts +379 -73
- package/src/implementation/world/schedule.test.ts +65 -67
- package/src/implementation/world/semantics.test.ts +11 -16
- package/src/implementation/world/share.test.ts +4 -3
- package/src/implementation/world/shared-gpu.browser.test.ts +109 -0
- package/src/implementation/world/shared-kernels.test.ts +117 -0
- package/src/implementation/world/shared-workers.cases.ts +20 -0
- package/src/implementation/world/shared-workers.fixture.ts +74 -0
- package/src/implementation/world/shared.test.ts +348 -0
- package/src/implementation/world/shared.ts +316 -0
- package/src/implementation/world/sharing.ts +96 -32
- package/src/implementation/world/staging.ts +53 -10
- package/src/implementation/world/state.ts +180 -23
- package/src/implementation/world/stop-lists.ts +78 -9
- package/src/implementation/world/strings.test.ts +23 -34
- package/src/implementation/world/strings.ts +1 -0
- package/src/implementation/world/structure.ts +6 -2
- package/src/implementation/world/synchronize.test.ts +1 -0
- package/src/implementation/world/synchronize.ts +60 -17
- package/src/implementation/world/tail-blocks.ts +9 -4
- package/src/implementation/world/tails-worker.fixture.ts +9 -13
- package/src/implementation/world/tails.cases.ts +3 -2
- package/src/implementation/world/tails.fixture.ts +5 -2
- package/src/implementation/world/tails.test-helper.ts +48 -41
- package/src/implementation/world/tails.test.ts +24 -29
- package/src/implementation/world/tails.ts +35 -22
- package/src/implementation/world/target.test.ts +10 -13
- package/src/implementation/world/terminal.ts +1 -0
- package/src/implementation/world/thread-directory.ts +85 -16
- package/src/implementation/world/thread-finalizers.ts +128 -22
- package/src/implementation/world/thread-indexes.ts +5 -3
- package/src/implementation/world/thread-observer.ts +60 -13
- package/src/implementation/world/thread-systems-worker.fixture.ts +5 -6
- package/src/implementation/world/thread-systems.cases.ts +15 -2
- package/src/implementation/world/thread-systems.fixture.ts +41 -12
- package/src/implementation/world/thread-systems.test-helper.ts +57 -52
- package/src/implementation/world/thread-systems.test.ts +51 -26
- package/src/implementation/world/thread-systems.ts +398 -84
- package/src/implementation/world/thread-tasks.ts +9 -4
- package/src/implementation/world/threads.browser.test.ts +5 -0
- package/src/implementation/world/threads.test.ts +10 -0
- package/src/implementation/world/ticks.browser.test.ts +3 -4
- package/src/implementation/world/ticks.test.ts +5 -5
- package/src/implementation/world/traits.test.ts +4 -8
- package/src/implementation/world/transfers-worker.fixture.ts +17 -12
- package/src/implementation/world/transfers.cases.ts +1 -0
- package/src/implementation/world/transfers.fixture.ts +18 -25
- package/src/implementation/world/transfers.test-helper.ts +18 -28
- package/src/implementation/world/transfers.test.ts +19 -23
- package/src/implementation/world/transfers.ts +1 -0
- package/src/implementation/world/unidentified-finalizers.test.ts +58 -0
- package/src/implementation/world/up-tree.test.ts +181 -21
- package/src/implementation/world/up-workers.cases.ts +1 -0
- package/src/implementation/world/up-workers.fixture.ts +6 -10
- package/src/implementation/world/up.browser.test.ts +9 -12
- package/src/implementation/world/up.test.ts +56 -42
- package/src/implementation/world/up.ts +299 -71
- package/src/implementation/world/wasm-kernels.test.ts +55 -49
- package/src/implementation/world/wasm.test.ts +200 -22
- package/src/implementation/world/wasm.ts +399 -127
- package/src/implementation/world/wgsl.test.ts +1 -0
- package/src/implementation/world/wgsl.ts +22 -5
- package/src/implementation/world/where.test.ts +342 -0
- package/src/implementation/world/where.ts +236 -0
- package/src/implementation/world/worker-platform.ts +1 -0
- package/src/implementation/world/worker-window.test.ts +43 -0
- package/src/implementation/world/worker-window.ts +43 -0
- package/src/implementation/world/worker.ts +47 -59
- package/src/implementation/world/workers-follow.test.ts +51 -0
- package/src/implementation/world/workers.cases.ts +1 -0
- package/src/implementation/world/workers.fixture.ts +31 -54
- package/src/implementation/world/world-host.fixture.ts +1 -0
- package/src/index.ts +5 -0
- package/src/interface/CLAUDE.md +1 -1
- package/src/interface/component/component.ts +1 -0
- package/src/interface/component/index.ts +1 -1
- package/src/interface/component/key.ts +1 -0
- package/src/interface/component/key.type-test.ts +1 -2
- package/src/interface/component/register.test.ts +27 -34
- package/src/interface/component/types.ts +3 -2
- package/src/interface/component/value.ts +9 -2
- package/src/interface/component/values.ts +1 -0
- package/src/interface/entity/entity.ts +1 -0
- package/src/interface/entity/index.ts +4 -0
- package/src/interface/finalizer/body.ts +12 -11
- package/src/interface/finalizer/create.test.ts +67 -72
- package/src/interface/finalizer/create.ts +52 -22
- package/src/interface/finalizer/created.ts +6 -5
- package/src/interface/finalizer/declaration.ts +28 -9
- package/src/interface/finalizer/finalizer.ts +3 -2
- package/src/interface/finalizer/index.ts +1 -0
- package/src/interface/gpu/accessors.ts +26 -8
- package/src/interface/gpu/gpu.ts +1 -0
- package/src/interface/gpu/gpu.type-test.ts +2 -2
- package/src/interface/gpu/index.ts +1 -0
- package/src/interface/gpu/layout.ts +1 -0
- package/src/interface/gpu/record.ts +1 -0
- package/src/interface/gpu/wgsl.ts +9 -6
- package/src/interface/index.ts +1 -3
- package/src/interface/index.type-test.ts +11 -14
- package/src/interface/indexes/create.test.ts +44 -43
- package/src/interface/indexes/create.ts +24 -16
- package/src/interface/indexes/created.ts +3 -2
- package/src/interface/indexes/declaration.ts +7 -3
- package/src/interface/indexes/index-type.ts +4 -3
- package/src/interface/indexes/index.ts +1 -0
- package/src/interface/indexes/index.type-test.ts +45 -94
- package/src/interface/math/f32/default.ts +6 -0
- package/src/interface/math/f32/index.ts +5 -1
- package/src/interface/math/f32/public.ts +2 -0
- package/src/interface/math/f32/round-half-even.ts +1 -0
- package/src/interface/math/f32/schema.ts +1 -0
- package/src/interface/math/i32/default.ts +6 -0
- package/src/interface/math/i32/index.ts +5 -1
- package/src/interface/math/i32/public.ts +2 -0
- package/src/interface/math/i32/schema.ts +1 -0
- package/src/interface/math/i32/shift-right.ts +1 -0
- package/src/interface/math/index.ts +1 -0
- package/src/interface/math/intrinsic.ts +1 -0
- package/src/interface/math/mat4x4/add.ts +1 -0
- package/src/interface/math/mat4x4/determinant.ts +1 -0
- package/src/interface/math/mat4x4/identity.ts +1 -0
- package/src/interface/math/mat4x4/index.ts +4 -1
- package/src/interface/math/mat4x4/inverse.ts +1 -0
- package/src/interface/math/mat4x4/look-at.test.ts +1 -0
- package/src/interface/math/mat4x4/look-at.ts +1 -0
- package/src/interface/math/mat4x4/multiply-vec3.ts +1 -0
- package/src/interface/math/mat4x4/multiply-vec4.ts +1 -0
- package/src/interface/math/mat4x4/multiply.ts +1 -0
- package/src/interface/math/mat4x4/orthographic.ts +1 -0
- package/src/interface/math/mat4x4/perspective.ts +1 -0
- package/src/interface/math/mat4x4/public.ts +2 -0
- package/src/interface/math/mat4x4/rotation-x.ts +1 -0
- package/src/interface/math/mat4x4/rotation-y.ts +1 -0
- package/src/interface/math/mat4x4/rotation-z.ts +1 -0
- package/src/interface/math/mat4x4/rotation.test.ts +1 -0
- package/src/interface/math/mat4x4/scale.ts +1 -0
- package/src/interface/math/mat4x4/scaling.ts +1 -0
- package/src/interface/math/mat4x4/schema.ts +1 -0
- package/src/interface/math/mat4x4/subtract.ts +1 -0
- package/src/interface/math/mat4x4/translation.ts +1 -0
- package/src/interface/math/mat4x4/transpose.ts +1 -0
- package/src/interface/math/mat4x4/zero.ts +1 -0
- package/src/interface/math/math.type-test.ts +24 -1
- package/src/interface/math/quat/add.ts +1 -0
- package/src/interface/math/quat/align-to.ts +1 -0
- package/src/interface/math/quat/conjugate.ts +1 -0
- package/src/interface/math/quat/distance.ts +1 -0
- package/src/interface/math/quat/dot.ts +1 -0
- package/src/interface/math/quat/from-axis-angle.ts +1 -0
- package/src/interface/math/quat/from-euler.ts +1 -0
- package/src/interface/math/quat/identity.ts +1 -0
- package/src/interface/math/quat/index.ts +5 -1
- package/src/interface/math/quat/inverse.ts +1 -0
- package/src/interface/math/quat/length-squared.ts +1 -0
- package/src/interface/math/quat/length.ts +1 -0
- package/src/interface/math/quat/lerp.ts +1 -0
- package/src/interface/math/quat/look-at.ts +1 -0
- package/src/interface/math/quat/multiply.ts +1 -0
- package/src/interface/math/quat/negate.ts +1 -0
- package/src/interface/math/quat/normalize.ts +1 -0
- package/src/interface/math/quat/public.ts +2 -0
- package/src/interface/math/quat/rotate-vec3.ts +1 -0
- package/src/interface/math/quat/scale.ts +1 -0
- package/src/interface/math/quat/schema.ts +1 -0
- package/src/interface/math/quat/slerp.ts +1 -0
- package/src/interface/math/quat/subtract.ts +1 -0
- package/src/interface/math/quat/to-axis-angle.ts +1 -0
- package/src/interface/math/quat/to-euler.ts +1 -0
- package/src/interface/math/quat/to-mat4.ts +1 -0
- package/src/interface/math/semantics.test.ts +1 -0
- package/src/interface/math/u32/count-leading-zeros.ts +1 -0
- package/src/interface/math/u32/count-one-bits.ts +1 -0
- package/src/interface/math/u32/count-trailing-zeros.ts +1 -0
- package/src/interface/math/u32/default.ts +6 -0
- package/src/interface/math/u32/index.ts +5 -1
- package/src/interface/math/u32/public.ts +2 -0
- package/src/interface/math/u32/reverse-bits.ts +1 -0
- package/src/interface/math/u32/schema.ts +1 -0
- package/src/interface/math/u32/shift-right.ts +1 -0
- package/src/interface/math/vec2/f32/abs.ts +1 -0
- package/src/interface/math/vec2/f32/acos.ts +1 -0
- package/src/interface/math/vec2/f32/acosh.ts +1 -0
- package/src/interface/math/vec2/f32/add.ts +1 -0
- package/src/interface/math/vec2/f32/asin.ts +1 -0
- package/src/interface/math/vec2/f32/asinh.ts +1 -0
- package/src/interface/math/vec2/f32/atan.ts +1 -0
- package/src/interface/math/vec2/f32/atanh.ts +1 -0
- package/src/interface/math/vec2/f32/ceil.ts +1 -0
- package/src/interface/math/vec2/f32/clamp.ts +1 -0
- package/src/interface/math/vec2/f32/cos.ts +1 -0
- package/src/interface/math/vec2/f32/cosh.ts +1 -0
- package/src/interface/math/vec2/f32/distance.ts +1 -0
- package/src/interface/math/vec2/f32/dot.ts +1 -0
- package/src/interface/math/vec2/f32/equals.ts +1 -0
- package/src/interface/math/vec2/f32/exp.ts +1 -0
- package/src/interface/math/vec2/f32/exp2.ts +1 -0
- package/src/interface/math/vec2/f32/f32.ts +5 -1
- package/src/interface/math/vec2/f32/faceforward.ts +1 -0
- package/src/interface/math/vec2/f32/floor.ts +1 -0
- package/src/interface/math/vec2/f32/fract.ts +1 -0
- package/src/interface/math/vec2/f32/length.ts +1 -0
- package/src/interface/math/vec2/f32/log.ts +1 -0
- package/src/interface/math/vec2/f32/log2.ts +1 -0
- package/src/interface/math/vec2/f32/max.ts +1 -0
- package/src/interface/math/vec2/f32/min.ts +1 -0
- package/src/interface/math/vec2/f32/mix.ts +1 -0
- package/src/interface/math/vec2/f32/mod.ts +1 -0
- package/src/interface/math/vec2/f32/modf.ts +1 -0
- package/src/interface/math/vec2/f32/negate.ts +1 -0
- package/src/interface/math/vec2/f32/normalize.ts +1 -0
- package/src/interface/math/vec2/f32/pow.ts +1 -0
- package/src/interface/math/vec2/f32/public.ts +2 -0
- package/src/interface/math/vec2/f32/reflect.ts +1 -0
- package/src/interface/math/vec2/f32/refract.ts +1 -0
- package/src/interface/math/vec2/f32/round.ts +1 -0
- package/src/interface/math/vec2/f32/scale.ts +1 -0
- package/src/interface/math/vec2/f32/schema.ts +1 -0
- package/src/interface/math/vec2/f32/sign.ts +1 -0
- package/src/interface/math/vec2/f32/sin.ts +1 -0
- package/src/interface/math/vec2/f32/sinh.ts +1 -0
- package/src/interface/math/vec2/f32/smoothstep.ts +1 -0
- package/src/interface/math/vec2/f32/sqrt.ts +1 -0
- package/src/interface/math/vec2/f32/step.ts +1 -0
- package/src/interface/math/vec2/f32/subtract.ts +1 -0
- package/src/interface/math/vec2/f32/tan.ts +1 -0
- package/src/interface/math/vec2/f32/tanh.ts +1 -0
- package/src/interface/math/vec2/f32/trunc.ts +1 -0
- package/src/interface/math/vec2/f32/zero.ts +1 -0
- package/src/interface/math/vec2/i32/abs.ts +1 -0
- package/src/interface/math/vec2/i32/add.ts +1 -0
- package/src/interface/math/vec2/i32/bitwise-and.ts +1 -0
- package/src/interface/math/vec2/i32/bitwise-not.ts +1 -0
- package/src/interface/math/vec2/i32/bitwise-or.ts +1 -0
- package/src/interface/math/vec2/i32/bitwise-xor.ts +1 -0
- package/src/interface/math/vec2/i32/clamp.ts +1 -0
- package/src/interface/math/vec2/i32/count-leading-zeros.ts +1 -0
- package/src/interface/math/vec2/i32/count-one-bits.ts +1 -0
- package/src/interface/math/vec2/i32/count-trailing-zeros.ts +1 -0
- package/src/interface/math/vec2/i32/equals.ts +1 -0
- package/src/interface/math/vec2/i32/i32.ts +5 -1
- package/src/interface/math/vec2/i32/max.ts +1 -0
- package/src/interface/math/vec2/i32/min.ts +1 -0
- package/src/interface/math/vec2/i32/negate.ts +1 -0
- package/src/interface/math/vec2/i32/public.ts +2 -0
- package/src/interface/math/vec2/i32/reverse-bits.ts +1 -0
- package/src/interface/math/vec2/i32/scale.ts +1 -0
- package/src/interface/math/vec2/i32/schema.ts +1 -0
- package/src/interface/math/vec2/i32/shift-left.ts +1 -0
- package/src/interface/math/vec2/i32/shift-right.ts +1 -0
- package/src/interface/math/vec2/i32/subtract.ts +1 -0
- package/src/interface/math/vec2/i32/zero.ts +1 -0
- package/src/interface/math/vec2/index.ts +1 -0
- package/src/interface/math/vec2/public.ts +2 -0
- package/src/interface/math/vec2/u32/add.ts +1 -0
- package/src/interface/math/vec2/u32/bitwise-and.ts +1 -0
- package/src/interface/math/vec2/u32/bitwise-not.ts +1 -0
- package/src/interface/math/vec2/u32/bitwise-or.ts +1 -0
- package/src/interface/math/vec2/u32/bitwise-xor.ts +1 -0
- package/src/interface/math/vec2/u32/clamp.ts +1 -0
- package/src/interface/math/vec2/u32/count-leading-zeros.ts +1 -0
- package/src/interface/math/vec2/u32/count-one-bits.ts +1 -0
- package/src/interface/math/vec2/u32/count-trailing-zeros.ts +1 -0
- package/src/interface/math/vec2/u32/equals.ts +1 -0
- package/src/interface/math/vec2/u32/max.ts +1 -0
- package/src/interface/math/vec2/u32/min.ts +1 -0
- package/src/interface/math/vec2/u32/negate.ts +1 -0
- package/src/interface/math/vec2/u32/public.ts +2 -0
- package/src/interface/math/vec2/u32/reverse-bits.ts +1 -0
- package/src/interface/math/vec2/u32/scale.ts +1 -0
- package/src/interface/math/vec2/u32/schema.ts +1 -0
- package/src/interface/math/vec2/u32/shift-left.ts +1 -0
- package/src/interface/math/vec2/u32/shift-right.ts +1 -0
- package/src/interface/math/vec2/u32/subtract.ts +1 -0
- package/src/interface/math/vec2/u32/u32.ts +5 -1
- package/src/interface/math/vec2/u32/zero.ts +1 -0
- package/src/interface/math/vec3/f32/abs.ts +1 -0
- package/src/interface/math/vec3/f32/acos.ts +1 -0
- package/src/interface/math/vec3/f32/acosh.ts +1 -0
- package/src/interface/math/vec3/f32/add.ts +1 -0
- package/src/interface/math/vec3/f32/asin.ts +1 -0
- package/src/interface/math/vec3/f32/asinh.ts +1 -0
- package/src/interface/math/vec3/f32/atan.ts +1 -0
- package/src/interface/math/vec3/f32/atanh.ts +1 -0
- package/src/interface/math/vec3/f32/ceil.ts +1 -0
- package/src/interface/math/vec3/f32/clamp.ts +1 -0
- package/src/interface/math/vec3/f32/cos.ts +1 -0
- package/src/interface/math/vec3/f32/cosh.ts +1 -0
- package/src/interface/math/vec3/f32/cross.ts +1 -0
- package/src/interface/math/vec3/f32/distance-squared.ts +1 -0
- package/src/interface/math/vec3/f32/distance.ts +1 -0
- package/src/interface/math/vec3/f32/dot.ts +1 -0
- package/src/interface/math/vec3/f32/equals.ts +1 -0
- package/src/interface/math/vec3/f32/exp.ts +1 -0
- package/src/interface/math/vec3/f32/exp2.ts +1 -0
- package/src/interface/math/vec3/f32/f32.ts +5 -1
- package/src/interface/math/vec3/f32/faceforward.ts +1 -0
- package/src/interface/math/vec3/f32/floor.ts +1 -0
- package/src/interface/math/vec3/f32/fract.ts +1 -0
- package/src/interface/math/vec3/f32/length-squared.ts +1 -0
- package/src/interface/math/vec3/f32/length.ts +1 -0
- package/src/interface/math/vec3/f32/log.ts +1 -0
- package/src/interface/math/vec3/f32/log2.ts +1 -0
- package/src/interface/math/vec3/f32/max.ts +1 -0
- package/src/interface/math/vec3/f32/min.ts +1 -0
- package/src/interface/math/vec3/f32/mix.ts +1 -0
- package/src/interface/math/vec3/f32/mod.ts +1 -0
- package/src/interface/math/vec3/f32/modf.ts +1 -0
- package/src/interface/math/vec3/f32/multiply.ts +1 -0
- package/src/interface/math/vec3/f32/negate.ts +1 -0
- package/src/interface/math/vec3/f32/normalize.ts +1 -0
- package/src/interface/math/vec3/f32/one.ts +1 -0
- package/src/interface/math/vec3/f32/pow.ts +1 -0
- package/src/interface/math/vec3/f32/public.ts +2 -0
- package/src/interface/math/vec3/f32/random.ts +1 -0
- package/src/interface/math/vec3/f32/reflect.ts +1 -0
- package/src/interface/math/vec3/f32/refract.ts +1 -0
- package/src/interface/math/vec3/f32/round.ts +1 -0
- package/src/interface/math/vec3/f32/scale.ts +1 -0
- package/src/interface/math/vec3/f32/schema.ts +1 -0
- package/src/interface/math/vec3/f32/sign.ts +1 -0
- package/src/interface/math/vec3/f32/sin.ts +1 -0
- package/src/interface/math/vec3/f32/sinh.ts +1 -0
- package/src/interface/math/vec3/f32/smoothstep.ts +1 -0
- package/src/interface/math/vec3/f32/sqrt.ts +1 -0
- package/src/interface/math/vec3/f32/step.ts +1 -0
- package/src/interface/math/vec3/f32/subtract.ts +1 -0
- package/src/interface/math/vec3/f32/tan.ts +1 -0
- package/src/interface/math/vec3/f32/tanh.ts +1 -0
- package/src/interface/math/vec3/f32/trunc.ts +1 -0
- package/src/interface/math/vec3/f32/zero.ts +1 -0
- package/src/interface/math/vec3/i32/abs.ts +1 -0
- package/src/interface/math/vec3/i32/add.ts +1 -0
- package/src/interface/math/vec3/i32/bitwise-and.ts +1 -0
- package/src/interface/math/vec3/i32/bitwise-not.ts +1 -0
- package/src/interface/math/vec3/i32/bitwise-or.ts +1 -0
- package/src/interface/math/vec3/i32/bitwise-xor.ts +1 -0
- package/src/interface/math/vec3/i32/clamp.ts +1 -0
- package/src/interface/math/vec3/i32/count-leading-zeros.ts +1 -0
- package/src/interface/math/vec3/i32/count-one-bits.ts +1 -0
- package/src/interface/math/vec3/i32/count-trailing-zeros.ts +1 -0
- package/src/interface/math/vec3/i32/equals.ts +1 -0
- package/src/interface/math/vec3/i32/i32.ts +5 -1
- package/src/interface/math/vec3/i32/max.ts +1 -0
- package/src/interface/math/vec3/i32/min.ts +1 -0
- package/src/interface/math/vec3/i32/multiply.ts +1 -0
- package/src/interface/math/vec3/i32/negate.ts +1 -0
- package/src/interface/math/vec3/i32/one.ts +1 -0
- package/src/interface/math/vec3/i32/public.ts +2 -0
- package/src/interface/math/vec3/i32/reverse-bits.ts +1 -0
- package/src/interface/math/vec3/i32/scale.ts +1 -0
- package/src/interface/math/vec3/i32/schema.ts +1 -0
- package/src/interface/math/vec3/i32/shift-left.ts +1 -0
- package/src/interface/math/vec3/i32/shift-right.ts +1 -0
- package/src/interface/math/vec3/i32/subtract.ts +1 -0
- package/src/interface/math/vec3/i32/zero.ts +1 -0
- package/src/interface/math/vec3/index.ts +1 -0
- package/src/interface/math/vec3/public.ts +2 -0
- package/src/interface/math/vec3/u32/add.ts +1 -0
- package/src/interface/math/vec3/u32/bitwise-and.ts +1 -0
- package/src/interface/math/vec3/u32/bitwise-not.ts +1 -0
- package/src/interface/math/vec3/u32/bitwise-or.ts +1 -0
- package/src/interface/math/vec3/u32/bitwise-xor.ts +1 -0
- package/src/interface/math/vec3/u32/clamp.ts +1 -0
- package/src/interface/math/vec3/u32/count-leading-zeros.ts +1 -0
- package/src/interface/math/vec3/u32/count-one-bits.ts +1 -0
- package/src/interface/math/vec3/u32/count-trailing-zeros.ts +1 -0
- package/src/interface/math/vec3/u32/equals.ts +1 -0
- package/src/interface/math/vec3/u32/max.ts +1 -0
- package/src/interface/math/vec3/u32/min.ts +1 -0
- package/src/interface/math/vec3/u32/multiply.ts +1 -0
- package/src/interface/math/vec3/u32/negate.ts +1 -0
- package/src/interface/math/vec3/u32/one.ts +1 -0
- package/src/interface/math/vec3/u32/public.ts +2 -0
- package/src/interface/math/vec3/u32/reverse-bits.ts +1 -0
- package/src/interface/math/vec3/u32/scale.ts +1 -0
- package/src/interface/math/vec3/u32/schema.ts +1 -0
- package/src/interface/math/vec3/u32/shift-left.ts +1 -0
- package/src/interface/math/vec3/u32/shift-right.ts +1 -0
- package/src/interface/math/vec3/u32/subtract.ts +1 -0
- package/src/interface/math/vec3/u32/u32.ts +5 -1
- package/src/interface/math/vec3/u32/volume.ts +1 -0
- package/src/interface/math/vec3/u32/zero.ts +1 -0
- package/src/interface/math/vec4/f32/abs.ts +1 -0
- package/src/interface/math/vec4/f32/acos.ts +1 -0
- package/src/interface/math/vec4/f32/acosh.ts +1 -0
- package/src/interface/math/vec4/f32/add.ts +1 -0
- package/src/interface/math/vec4/f32/asin.ts +1 -0
- package/src/interface/math/vec4/f32/asinh.ts +1 -0
- package/src/interface/math/vec4/f32/atan.ts +1 -0
- package/src/interface/math/vec4/f32/atanh.ts +1 -0
- package/src/interface/math/vec4/f32/ceil.ts +1 -0
- package/src/interface/math/vec4/f32/clamp.ts +1 -0
- package/src/interface/math/vec4/f32/cos.ts +1 -0
- package/src/interface/math/vec4/f32/cosh.ts +1 -0
- package/src/interface/math/vec4/f32/default.ts +6 -0
- package/src/interface/math/vec4/f32/distance.ts +1 -0
- package/src/interface/math/vec4/f32/dot.ts +1 -0
- package/src/interface/math/vec4/f32/exp.ts +1 -0
- package/src/interface/math/vec4/f32/exp2.ts +1 -0
- package/src/interface/math/vec4/f32/f32.ts +5 -1
- package/src/interface/math/vec4/f32/faceforward.ts +1 -0
- package/src/interface/math/vec4/f32/floor.ts +1 -0
- package/src/interface/math/vec4/f32/fract.ts +1 -0
- package/src/interface/math/vec4/f32/length.ts +1 -0
- package/src/interface/math/vec4/f32/log.ts +1 -0
- package/src/interface/math/vec4/f32/log2.ts +1 -0
- package/src/interface/math/vec4/f32/max.ts +1 -0
- package/src/interface/math/vec4/f32/min.ts +1 -0
- package/src/interface/math/vec4/f32/mix.ts +1 -0
- package/src/interface/math/vec4/f32/mod.ts +1 -0
- package/src/interface/math/vec4/f32/modf.ts +1 -0
- package/src/interface/math/vec4/f32/multiply.ts +1 -0
- package/src/interface/math/vec4/f32/negate.ts +1 -0
- package/src/interface/math/vec4/f32/normalize.ts +1 -0
- package/src/interface/math/vec4/f32/pow.ts +1 -0
- package/src/interface/math/vec4/f32/public.ts +2 -0
- package/src/interface/math/vec4/f32/reflect.ts +1 -0
- package/src/interface/math/vec4/f32/refract.ts +1 -0
- package/src/interface/math/vec4/f32/round.ts +1 -0
- package/src/interface/math/vec4/f32/scale.ts +1 -0
- package/src/interface/math/vec4/f32/schema.ts +1 -0
- package/src/interface/math/vec4/f32/sign.ts +1 -0
- package/src/interface/math/vec4/f32/sin.ts +1 -0
- package/src/interface/math/vec4/f32/sinh.ts +1 -0
- package/src/interface/math/vec4/f32/smoothstep.ts +1 -0
- package/src/interface/math/vec4/f32/sqrt.ts +1 -0
- package/src/interface/math/vec4/f32/step.ts +1 -0
- package/src/interface/math/vec4/f32/subtract.ts +1 -0
- package/src/interface/math/vec4/f32/tan.ts +1 -0
- package/src/interface/math/vec4/f32/tanh.ts +1 -0
- package/src/interface/math/vec4/f32/trunc.ts +1 -0
- package/src/interface/math/vec4/i32/abs.ts +1 -0
- package/src/interface/math/vec4/i32/add.ts +1 -0
- package/src/interface/math/vec4/i32/bitwise-and.ts +1 -0
- package/src/interface/math/vec4/i32/bitwise-not.ts +1 -0
- package/src/interface/math/vec4/i32/bitwise-or.ts +1 -0
- package/src/interface/math/vec4/i32/bitwise-xor.ts +1 -0
- package/src/interface/math/vec4/i32/clamp.ts +1 -0
- package/src/interface/math/vec4/i32/count-leading-zeros.ts +1 -0
- package/src/interface/math/vec4/i32/count-one-bits.ts +1 -0
- package/src/interface/math/vec4/i32/count-trailing-zeros.ts +1 -0
- package/src/interface/math/vec4/i32/equals.ts +1 -0
- package/src/interface/math/vec4/i32/i32.ts +5 -1
- package/src/interface/math/vec4/i32/max.ts +1 -0
- package/src/interface/math/vec4/i32/min.ts +1 -0
- package/src/interface/math/vec4/i32/multiply.ts +1 -0
- package/src/interface/math/vec4/i32/negate.ts +1 -0
- package/src/interface/math/vec4/i32/one.ts +1 -0
- package/src/interface/math/vec4/i32/public.ts +2 -0
- package/src/interface/math/vec4/i32/reverse-bits.ts +1 -0
- package/src/interface/math/vec4/i32/scale.ts +1 -0
- package/src/interface/math/vec4/i32/schema.ts +1 -0
- package/src/interface/math/vec4/i32/shift-left.ts +1 -0
- package/src/interface/math/vec4/i32/shift-right.ts +1 -0
- package/src/interface/math/vec4/i32/subtract.ts +1 -0
- package/src/interface/math/vec4/i32/zero.ts +1 -0
- package/src/interface/math/vec4/index.ts +1 -0
- package/src/interface/math/vec4/public.ts +2 -0
- package/src/interface/math/vec4/u32/add.ts +1 -0
- package/src/interface/math/vec4/u32/bitwise-and.ts +1 -0
- package/src/interface/math/vec4/u32/bitwise-not.ts +1 -0
- package/src/interface/math/vec4/u32/bitwise-or.ts +1 -0
- package/src/interface/math/vec4/u32/bitwise-xor.ts +1 -0
- package/src/interface/math/vec4/u32/clamp.ts +1 -0
- package/src/interface/math/vec4/u32/count-leading-zeros.ts +1 -0
- package/src/interface/math/vec4/u32/count-one-bits.ts +1 -0
- package/src/interface/math/vec4/u32/count-trailing-zeros.ts +1 -0
- package/src/interface/math/vec4/u32/equals.ts +1 -0
- package/src/interface/math/vec4/u32/max.ts +1 -0
- package/src/interface/math/vec4/u32/min.ts +1 -0
- package/src/interface/math/vec4/u32/multiply.ts +1 -0
- package/src/interface/math/vec4/u32/negate.ts +1 -0
- package/src/interface/math/vec4/u32/one.ts +1 -0
- package/src/interface/math/vec4/u32/public.ts +2 -0
- package/src/interface/math/vec4/u32/reverse-bits.ts +1 -0
- package/src/interface/math/vec4/u32/scale.ts +1 -0
- package/src/interface/math/vec4/u32/schema.ts +1 -0
- package/src/interface/math/vec4/u32/shift-left.ts +1 -0
- package/src/interface/math/vec4/u32/shift-right.ts +1 -0
- package/src/interface/math/vec4/u32/subtract.ts +1 -0
- package/src/interface/math/vec4/u32/u32.ts +5 -1
- package/src/interface/math/vec4/u32/zero.ts +1 -0
- package/src/interface/platform/platform.ts +1 -0
- package/src/interface/registry/archetypes.test.ts +50 -0
- package/src/interface/registry/archetypes.ts +45 -9
- package/src/interface/registry/declarations.ts +107 -13
- package/src/interface/registry/declared.test.ts +40 -0
- package/src/interface/registry/finalizer-order.ts +4 -3
- package/src/interface/registry/ids.test-helper.ts +35 -1
- package/src/interface/registry/ids.test.ts +43 -56
- package/src/interface/registry/ids.ts +46 -0
- package/src/interface/registry/index.ts +4 -3
- package/src/interface/registry/indexes.ts +3 -2
- package/src/interface/registry/items.ts +17 -47
- package/src/interface/registry/layout.test.ts +20 -0
- package/src/interface/registry/layout.ts +11 -3
- package/src/interface/registry/names.test.ts +16 -18
- package/src/interface/registry/names.ts +62 -42
- package/src/interface/registry/program.ts +1 -0
- package/src/interface/registry/reduction.ts +1 -0
- package/src/interface/registry/schedule.ts +10 -14
- package/src/interface/registry/schemas.ts +58 -0
- package/src/interface/registry/strata.ts +1 -0
- package/src/interface/registry/threads.ts +3 -2
- package/src/interface/registry/traits.ts +2 -1
- package/src/interface/registry/written.ts +1 -0
- package/src/interface/resource/condition.ts +1 -0
- package/src/interface/resource/index.ts +1 -1
- package/src/interface/resource/key.ts +1 -0
- package/src/interface/resource/reduction.ts +1 -0
- package/src/interface/resource/register.test.ts +42 -56
- package/src/interface/resource/resource.ts +1 -0
- package/src/interface/resource/types.ts +5 -1
- package/src/interface/resource/value.ts +1 -0
- package/src/interface/resource/written.ts +1 -0
- package/src/interface/resources/always.ts +3 -2
- package/src/interface/resources/cadence.ts +4 -3
- package/src/interface/resources/clock.ts +5 -3
- package/src/interface/resources/gpu-device.ts +3 -2
- package/src/interface/resources/index.ts +1 -0
- package/src/interface/resources/wake.ts +3 -2
- package/src/interface/resources/workers.ts +3 -2
- package/src/interface/rule/create.ts +9 -7
- package/src/interface/rule/created.ts +3 -2
- package/src/interface/rule/declaration.ts +7 -3
- package/src/interface/rule/index.ts +1 -0
- package/src/interface/rule/rule.ts +1 -0
- package/src/interface/rule/rule.type-test.ts +17 -27
- package/src/interface/schema/is-struct.ts +12 -0
- package/src/interface/schema/schema.ts +23 -1
- package/src/interface/schema/schema.type-test.ts +18 -16
- package/src/interface/schema/schemas.type-test.ts +1 -0
- package/src/interface/system/access.ts +68 -28
- package/src/interface/system/body.ts +53 -23
- package/src/interface/system/check.ts +82 -44
- package/src/interface/system/commands.ts +50 -5
- package/src/interface/system/commands.type-test.ts +2 -8
- package/src/interface/system/composite-declaration.ts +1 -2
- package/src/interface/system/composite-input.type-test.ts +13 -29
- package/src/interface/system/composite.ts +1 -0
- package/src/interface/system/conditions.type-test.ts +11 -22
- package/src/interface/system/create-resolved.ts +21 -0
- package/src/interface/system/create.test.ts +96 -116
- package/src/interface/system/create.ts +121 -94
- package/src/interface/system/declaration.ts +33 -25
- package/src/interface/system/definition.ts +1 -0
- package/src/interface/system/index.ts +1 -0
- package/src/interface/system/input.ts +35 -4
- package/src/interface/system/leaf.ts +10 -3
- package/src/interface/system/lists.type-test.ts +53 -0
- package/src/interface/system/name.ts +4 -3
- package/src/interface/system/optional.type-test.ts +51 -0
- package/src/interface/system/property.ts +1 -0
- package/src/interface/system/render.ts +45 -20
- package/src/interface/system/resolve.test.ts +49 -0
- package/src/interface/system/resolve.ts +165 -0
- package/src/interface/system/shared.type-test.ts +205 -0
- package/src/interface/system/struct.ts +1 -0
- package/src/interface/system/system.ts +5 -3
- package/src/interface/system/system.type-test.ts +160 -197
- package/src/interface/system/threads.ts +9 -8
- package/src/interface/system/threads.type-test.ts +29 -60
- package/src/interface/system/up.type-test.ts +15 -28
- package/src/interface/system/values-of.ts +17 -0
- package/src/interface/system/values.ts +15 -12
- package/src/interface/thread/of.ts +4 -3
- package/src/interface/thread/thread.ts +1 -0
- package/src/interface/thread/thread.type-test.ts +3 -68
- package/src/interface/trait/key.ts +2 -1
- package/src/interface/trait/trait.type-test.ts +4 -77
- package/src/interface/trait/types.ts +19 -6
- package/src/interface/tsconfig.json +1 -1
- package/src/interface/world/create.ts +9 -2
- package/src/interface/world/declarations.ts +34 -0
- package/src/interface/world/filter.ts +1 -0
- package/src/interface/world/index.ts +1 -0
- package/src/interface/world/join.ts +11 -4
- package/src/interface/world/loop.type-test.ts +15 -10
- package/src/interface/world/run.type-test.ts +87 -0
- package/src/interface/world/share.type-test.ts +8 -2
- package/src/interface/world/world.ts +32 -17
- package/src/interface/world/world.type-test.ts +6 -10
- package/src/observe/compare.ts +1 -0
- package/src/observe/entity.ts +21 -13
- package/src/observe/index.ts +1 -0
- package/src/observe/members.ts +1 -0
- package/src/observe/observe.ts +1 -0
- package/src/observe/observe.type-test.ts +1 -4
- package/src/observe/plans.ts +1 -0
- package/src/observe/query.ts +1 -0
- package/src/observe/resource.ts +5 -4
- package/src/observe/select.ts +13 -12
- package/src/observe/to-promise.ts +1 -0
- package/src/observe/tsconfig.json +1 -1
- package/src/observe/values.ts +1 -0
- package/src/observe/world-state.ts +41 -34
- package/src/observe-imports.test.ts +1 -0
- package/src/perftest/benchmark.ts +1 -0
- package/src/perftest/benchmarks.ts +24 -8
- package/src/perftest/editor.ts +126 -0
- package/src/perftest/filters.ts +124 -0
- package/src/perftest/finalized.ts +72 -24
- package/src/perftest/flat.ts +16 -26
- package/src/perftest/growth.ts +7 -15
- package/src/perftest/handoff.ts +30 -37
- package/src/perftest/hierarchy.ts +23 -40
- package/src/perftest/indexes.ts +132 -64
- package/src/perftest/invariants.ts +63 -0
- package/src/perftest/joined.ts +13 -5
- package/src/perftest/journal.ts +55 -0
- package/src/perftest/keys.ts +1 -0
- package/src/perftest/log.ts +6 -6
- package/src/perftest/loop.ts +2 -1
- package/src/perftest/observed-gpu.ts +6 -7
- package/src/perftest/observed.ts +6 -12
- package/src/perftest/observer.ts +5 -4
- package/src/perftest/optional.ts +102 -0
- package/src/perftest/particles.ts +13 -20
- package/src/perftest/placed.ts +1 -0
- package/src/perftest/reads.ts +13 -18
- package/src/perftest/remote.ts +26 -28
- package/src/perftest/render-order.ts +86 -0
- package/src/perftest/run.ts +1 -0
- package/src/perftest/shared.ts +416 -0
- package/src/perftest/strings.ts +14 -12
- package/src/perftest/structural.ts +32 -46
- package/src/perftest/suite.perf-browser-test.ts +3 -0
- package/src/perftest/suite.perf-test.ts +1 -0
- package/src/perftest/suite.ts +41 -59
- package/src/perftest/systems.ts +4 -6
- package/src/perftest/tails.ts +40 -48
- package/src/perftest/transfers.ts +25 -20
- package/src/perftest/uploads.ts +11 -13
- package/src/perftest/values.ts +8 -12
- package/src/perftest/wake.ts +1 -0
- package/src/world.test.ts +10 -10
- package/dist/implementation/compiler/exact.d.ts +0 -24
- package/dist/implementation/compiler/exact.js +0 -64
- package/dist/implementation/compiler/exact.js.map +0 -1
- package/dist/implementation/world/reports.d.ts +0 -63
- package/dist/implementation/world/reports.js +0 -180
- package/dist/implementation/world/reports.js.map +0 -1
- package/dist/interface/archetype/archetype.d.ts +0 -2
- package/dist/interface/archetype/archetype.js +0 -2
- package/dist/interface/archetype/archetype.js.map +0 -1
- package/dist/interface/archetype/create.d.ts +0 -7
- package/dist/interface/archetype/create.js +0 -11
- package/dist/interface/archetype/create.js.map +0 -1
- package/dist/interface/archetype/index.d.ts +0 -1
- package/dist/interface/archetype/index.js +0 -2
- package/dist/interface/archetype/index.js.map +0 -1
- package/dist/interface/archetype/values-of.d.ts +0 -17
- package/dist/interface/archetype/values-of.js.map +0 -1
- package/dist/interface/component/declaration.d.ts +0 -74
- package/dist/interface/component/declaration.js +0 -2
- package/dist/interface/component/declaration.js.map +0 -1
- package/dist/interface/component/register.d.ts +0 -23
- package/dist/interface/component/register.js +0 -6
- package/dist/interface/component/register.js.map +0 -1
- package/dist/interface/finalizer/name.d.ts +0 -6
- package/dist/interface/finalizer/name.js +0 -2
- package/dist/interface/finalizer/name.js.map +0 -1
- package/dist/interface/indexes/name.d.ts +0 -5
- package/dist/interface/indexes/name.js +0 -2
- package/dist/interface/indexes/name.js.map +0 -1
- package/dist/interface/report/components.d.ts +0 -38
- package/dist/interface/report/components.js +0 -48
- package/dist/interface/report/components.js.map +0 -1
- package/dist/interface/report/failure.d.ts +0 -29
- package/dist/interface/report/failure.js +0 -2
- package/dist/interface/report/failure.js.map +0 -1
- package/dist/interface/report/index.d.ts +0 -5
- package/dist/interface/report/index.js +0 -6
- package/dist/interface/report/index.js.map +0 -1
- package/dist/interface/report/report.d.ts +0 -12
- package/dist/interface/report/report.js +0 -2
- package/dist/interface/report/report.js.map +0 -1
- package/dist/interface/resource/declaration.d.ts +0 -31
- package/dist/interface/resource/declaration.js +0 -2
- package/dist/interface/resource/declaration.js.map +0 -1
- package/dist/interface/resource/register.d.ts +0 -13
- package/dist/interface/resource/register.js +0 -6
- package/dist/interface/resource/register.js.map +0 -1
- package/dist/interface/rule/name.d.ts +0 -6
- package/dist/interface/rule/name.js +0 -2
- package/dist/interface/rule/name.js.map +0 -1
- package/dist/interface/schema/is-data.d.ts +0 -19
- package/dist/interface/schema/is-data.js +0 -2
- package/dist/interface/schema/is-data.js.map +0 -1
- package/dist/interface/trait/index.d.ts +0 -1
- package/dist/interface/trait/index.js +0 -2
- package/dist/interface/trait/index.js.map +0 -1
- package/dist/interface/trait/register.d.ts +0 -7
- package/dist/interface/trait/register.js +0 -8
- package/dist/interface/trait/register.js.map +0 -1
- package/dist/interface/trait/required.d.ts +0 -10
- package/dist/interface/trait/required.js +0 -2
- package/dist/interface/trait/required.js.map +0 -1
- package/dist/interface/trait/symbol-keys.d.ts +0 -16
- package/dist/interface/trait/symbol-keys.js +0 -2
- package/dist/interface/trait/symbol-keys.js.map +0 -1
- package/dist/interface/trait/trait.d.ts +0 -2
- package/dist/interface/trait/trait.js +0 -2
- package/dist/interface/trait/trait.js.map +0 -1
- package/src/guide/01-resources.test.ts +0 -44
- package/src/guide/02-entities.test.ts +0 -57
- package/src/guide/03-systems.test.ts +0 -87
- package/src/guide/04-ticks.test.ts +0 -73
- package/src/guide/05-scheduling.test.ts +0 -60
- package/src/guide/06-sync-points.test.ts +0 -59
- package/src/guide/07-change-filters.test.ts +0 -87
- package/src/guide/08-input.test.ts +0 -47
- package/src/guide/09-rules.test.ts +0 -57
- package/src/guide/10-finalizers.test.ts +0 -64
- package/src/guide/11-traits.test.ts +0 -58
- package/src/guide/13-indexes.test.ts +0 -95
- package/src/guide/guide.md +0 -551
- package/src/implementation/compiler/exact.ts +0 -77
- package/src/implementation/world/reports.test-helper.ts +0 -117
- package/src/implementation/world/reports.test.ts +0 -167
- package/src/implementation/world/reports.ts +0 -203
- package/src/interface/archetype/archetype.ts +0 -3
- package/src/interface/archetype/archetype.type-test.ts +0 -37
- package/src/interface/archetype/create.test.ts +0 -40
- package/src/interface/archetype/create.ts +0 -12
- package/src/interface/archetype/index.ts +0 -1
- package/src/interface/archetype/values-of.ts +0 -16
- package/src/interface/component/declaration.ts +0 -67
- package/src/interface/component/declaration.type-test.ts +0 -87
- package/src/interface/component/register.ts +0 -28
- package/src/interface/finalizer/name.ts +0 -6
- package/src/interface/indexes/name.ts +0 -5
- package/src/interface/report/components.ts +0 -69
- package/src/interface/report/failure.ts +0 -26
- package/src/interface/report/index.ts +0 -8
- package/src/interface/report/report.ts +0 -11
- package/src/interface/report/report.type-test.ts +0 -63
- package/src/interface/resource/declaration.ts +0 -29
- package/src/interface/resource/declaration.type-test.ts +0 -89
- package/src/interface/resource/register.ts +0 -18
- package/src/interface/rule/name.ts +0 -6
- package/src/interface/schema/is-data.ts +0 -25
- package/src/interface/trait/index.ts +0 -1
- package/src/interface/trait/register.ts +0 -9
- package/src/interface/trait/required.ts +0 -7
- package/src/interface/trait/symbol-keys.ts +0 -19
- package/src/interface/trait/symbol-keys.type-test.ts +0 -14
- package/src/interface/trait/trait.ts +0 -3
- package/src/samples/particles/build.test.ts +0 -23
- package/src/samples/particles/gpu/main.ts +0 -96
- package/src/samples/particles/gpu/particles.ts +0 -138
- package/src/samples/particles/index.html +0 -22
- package/src/samples/particles/particles.test.ts +0 -31
- package/src/samples/particles/particles.ts +0 -85
- package/src/samples/particles/particles.type-test.ts +0 -7
- package/src/samples/todo/README.md +0 -174
- package/src/samples/todo/app/app.browser.test.ts +0 -215
- package/src/samples/todo/app/app.ts +0 -30
- package/src/samples/todo/app/log-failures.test.ts +0 -28
- package/src/samples/todo/app/log-failures.ts +0 -7
- package/src/samples/todo/app/main.ts +0 -4
- package/src/samples/todo/app/profile.perf-browser-test.ts +0 -100
- package/src/samples/todo/app/proportional.browser.test.ts +0 -157
- package/src/samples/todo/app/todo.perf-browser-test.ts +0 -207
- package/src/samples/todo/build.test.ts +0 -23
- package/src/samples/todo/features/completion/data.ts +0 -5
- package/src/samples/todo/features/completion/dom.browser.test.ts +0 -53
- package/src/samples/todo/features/completion/dom.ts +0 -39
- package/src/samples/todo/features/completion/elements/elements.browser.test.ts +0 -68
- package/src/samples/todo/features/completion/elements/todo-summary.ts +0 -82
- package/src/samples/todo/features/completion/elements/todo-toggle-all.ts +0 -69
- package/src/samples/todo/features/completion/events.ts +0 -7
- package/src/samples/todo/features/completion/feature.ts +0 -13
- package/src/samples/todo/features/completion/model.test.ts +0 -40
- package/src/samples/todo/features/completion/model.ts +0 -21
- package/src/samples/todo/features/filter/data.ts +0 -16
- package/src/samples/todo/features/filter/dom.browser.test.ts +0 -84
- package/src/samples/todo/features/filter/dom.ts +0 -63
- package/src/samples/todo/features/filter/elements/elements.browser.test.ts +0 -43
- package/src/samples/todo/features/filter/elements/todo-filters.ts +0 -70
- package/src/samples/todo/features/filter/events.ts +0 -4
- package/src/samples/todo/features/filter/feature.ts +0 -12
- package/src/samples/todo/features/filter/model.test.ts +0 -18
- package/src/samples/todo/features/filter/model.ts +0 -10
- package/src/samples/todo/features/generate/elements/elements.browser.test.ts +0 -18
- package/src/samples/todo/features/generate/elements/todo-generate.ts +0 -36
- package/src/samples/todo/features/generate/events.ts +0 -4
- package/src/samples/todo/features/generate/feature.ts +0 -11
- package/src/samples/todo/features/generate/model.test.ts +0 -13
- package/src/samples/todo/features/generate/model.ts +0 -19
- package/src/samples/todo/features/index.ts +0 -4
- package/src/samples/todo/features/todos/data.ts +0 -31
- package/src/samples/todo/features/todos/dom.browser.test.ts +0 -205
- package/src/samples/todo/features/todos/dom.ts +0 -90
- package/src/samples/todo/features/todos/elements/elements.browser.test.ts +0 -211
- package/src/samples/todo/features/todos/elements/todo-entry.ts +0 -45
- package/src/samples/todo/features/todos/elements/todo-list.ts +0 -93
- package/src/samples/todo/features/todos/elements/todo-row.ts +0 -138
- package/src/samples/todo/features/todos/events.ts +0 -11
- package/src/samples/todo/features/todos/feature.ts +0 -14
- package/src/samples/todo/features/todos/model.test.ts +0 -77
- package/src/samples/todo/features/todos/model.ts +0 -80
- package/src/samples/todo/features/todos/todos.test-helper.ts +0 -34
- package/src/samples/todo/imports.test.ts +0 -113
- package/src/samples/todo/index.html +0 -51
- package/src/samples/todo/shared/attach.browser.test.ts +0 -73
- package/src/samples/todo/shared/attach.ts +0 -32
- package/src/samples/todo/shared/connect.ts +0 -21
- package/src/samples/todo/shared/elements/define.ts +0 -7
- package/src/samples/todo/shared/elements/elements.test-helper.ts +0 -28
- package/src/samples/todo/shared/feature.ts +0 -20
- package/src/samples/todo/shared/ticks.test-helper.ts +0 -25
- package/src/samples/transfers/build.test.ts +0 -22
- package/src/samples/transfers/index.html +0 -18
- package/src/samples/transfers/loader.ts +0 -42
- package/src/samples/transfers/main.ts +0 -46
- package/src/samples/transfers/sprites.ts +0 -96
- package/src/samples/transfers/world.ts +0 -11
- /package/dist/interface/{archetype → system}/values-of.js +0 -0
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
1
2
|
import type { Entity } from '../../interface/entity/entity.js';
|
|
2
3
|
import type { Commands } from '../../interface/system/commands.js';
|
|
3
4
|
import type { Leaf } from '../../interface/system/leaf.js';
|
|
4
|
-
import type {
|
|
5
|
-
import { declarationOf, definitionOf, firstKeyOf, indexOfLookup, isLeaf, itemOfId, kindOf, labelOf, programFinalizers, threadOfDeclaration, watchedBy } from '../../interface/registry/index.js';
|
|
5
|
+
import type { SystemLookupLists } from '../../interface/system/access.js';
|
|
6
|
+
import { declarationOf, definitionOf, firstKeyOf, indexOfLookup, isLeaf, itemOfId, kindOf, labelOf, programFinalizers, threadOfDeclaration, watchedBy, whyUnregistered } from '../../interface/registry/index.js';
|
|
6
7
|
import { layoutOf, objectLayout, viewsOf, type Layout, type Views } from '../../interface/registry/layout.js';
|
|
7
8
|
import type { StringStore } from './strings.js';
|
|
8
9
|
import { stampChanged, writeOf } from './archetype.js';
|
|
9
10
|
import { emptyViews } from './arrays.js';
|
|
11
|
+
import { arrivalsPosition, createDebts, membershipOf, type ArrivalsView } from './arrivals.js';
|
|
10
12
|
import { readCell, writeCell } from './cells.js';
|
|
11
13
|
import {
|
|
12
14
|
beginCommand, createRingWriter, dropCommand, encoderOf, endSegment, localNumbers, objectStart, putComponent, putNull, putSlot, putStart, putValue,
|
|
@@ -23,22 +25,25 @@ import type { WorkerError } from './protocol.js';
|
|
|
23
25
|
import { forEachPassingRange, type Filter } from './ranges.js';
|
|
24
26
|
import { combine, contributed, identityOf, reductionTargetsOf, type ReductionTarget } from './reductions.js';
|
|
25
27
|
import { changedRowOf, emptyRow, rowBinderOf, type RowHost } from './rows.js';
|
|
28
|
+
import { requiredOf } from './required.js';
|
|
26
29
|
import type { Since } from './index-lookups.js';
|
|
27
|
-
import { createBatch, positionalSpawner, type Positional, type SpawnBatch } from './staging.js';
|
|
30
|
+
import { createBatch, noValues, positionalSpawner, type Positional, type SpawnBatch } from './staging.js';
|
|
28
31
|
import { createThreadFinalizers } from './thread-finalizers.js';
|
|
32
|
+
import { createThreadWhere } from './where.js';
|
|
29
33
|
import { createThreadIndex, type ThreadIndex } from './thread-indexes.js';
|
|
30
34
|
import type { EntityViews, ThreadArchetype, ThreadDirectory, ThreadStorage } from './thread-directory.js';
|
|
31
35
|
import { keptSorted } from './index-keys.js';
|
|
32
|
-
import { chunkShift } from './kernel.js';
|
|
36
|
+
import { blockShift, chunkShift } from './kernel.js';
|
|
33
37
|
import {
|
|
34
38
|
doneWord, endWord, headExecuted, headRan, progressWord, snapshotFlagsWord, snapshotLayout, snapshotOffsetWord, snapshotResourceArchetypeWord,
|
|
35
39
|
snapshotResourceRowWord, snapshotRowsWord, snapshotCapacityWord, snapshotted, tailBlockWords, tailChunk, waitingWord,
|
|
36
40
|
} from './tail-blocks.js';
|
|
37
41
|
import { defaultOf, type Key } from './state.js';
|
|
42
|
+
import { isThenable, returnedPromise } from './failures.js';
|
|
38
43
|
import {
|
|
39
44
|
completionCapacityWord, completionMessage, completionOffsetWord, completionSystems, executedFlag, failedFlag, payloadCapacityWord, payloadCount,
|
|
40
45
|
payloadInput, payloadOffsetWord, payloadSequence, payloadSystems, ranFlag, resultEnd, resultFields, resultFlags, resultStart, ringBaseWord, ringCapacityWord,
|
|
41
|
-
payloadSync, ringCursorWord, ringNeededWord, spilledFlag, systemFields, systemFolds, systemIndex, systemLastRun, systemTail, systemTick, systemTier,
|
|
46
|
+
payloadSync, ringCursorWord, ringNeededWord, spilledFlag, systemFields, systemFolds, systemIndex, systemLastRun, systemTail, systemTick, systemTier, systemValued, valuedFlag,
|
|
42
47
|
taskDoneWord, taskFailedWord, taskPostedWord,
|
|
43
48
|
} from './thread-tasks.js';
|
|
44
49
|
|
|
@@ -93,11 +98,16 @@ type CommandKey = {
|
|
|
93
98
|
readonly start: unknown;
|
|
94
99
|
/** Whether it's declared `transfer`, so a staged value whose command drops is released. */
|
|
95
100
|
readonly transfer: boolean;
|
|
101
|
+
/** Whether it's shared, so only the world's thread spawns and adds it: its value chooses the archetype. */
|
|
102
|
+
readonly shared: boolean;
|
|
96
103
|
};
|
|
97
104
|
|
|
98
105
|
/** The system that ran a task's commands, for their checks' errors. */
|
|
99
106
|
type Running = { error: unknown };
|
|
100
107
|
|
|
108
|
+
/** Whether a task's mirror is current, or why not (`bringCurrent`). */
|
|
109
|
+
type Readiness = "current" | "moved" | "held";
|
|
110
|
+
|
|
101
111
|
/**
|
|
102
112
|
* Runs the systems the world places on this thread, as tasks it posts in the task block: each task's systems in order,
|
|
103
113
|
* after replaying the mirror through the task's sync, writing each system's commands and spawns as a segment of the
|
|
@@ -105,7 +115,7 @@ type Running = { error: unknown };
|
|
|
105
115
|
*/
|
|
106
116
|
export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
107
117
|
const { mirror, control, directory } = host;
|
|
108
|
-
const { viewed, rows: rowHost, numbers, refreshEntities, archetypeAt, countOf, resourceRow, tableCount } = directory;
|
|
118
|
+
const { viewed, rows: rowHost, numbers, refreshEntities, archetypeAt, countOf, arrivals, resourceRow, tableCount } = directory;
|
|
109
119
|
const refreshMemory = (): void => { directory.refresh(); };
|
|
110
120
|
const runners: (ThreadRunner | null | undefined)[] = [];
|
|
111
121
|
const inputs = new Map<number, unknown>();
|
|
@@ -128,8 +138,8 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
128
138
|
const batches = new Map<string, SpawnBatch>();
|
|
129
139
|
const usedBatches: SpawnBatch[] = [];
|
|
130
140
|
/** Spawners by list, and by the numbers of a list's components in its order, for lists made again each call. */
|
|
131
|
-
const spawners = new WeakMap<readonly unknown[], (values
|
|
132
|
-
const spawnersByNumbers = new Map<string, (values
|
|
141
|
+
const spawners = new WeakMap<readonly unknown[], (values?: object) => Entity>();
|
|
142
|
+
const spawnersByNumbers = new Map<string, (values?: object) => Entity>();
|
|
133
143
|
|
|
134
144
|
/** A key a command names: checked as the world's commands check it, numbered by the world's number or this thread's. */
|
|
135
145
|
const commandKeyOf = (key: unknown): CommandKey => {
|
|
@@ -143,7 +153,7 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
143
153
|
return known;
|
|
144
154
|
}
|
|
145
155
|
const declaration = declarationOf(key);
|
|
146
|
-
if (declaration === undefined || kindOf(key) !== "component") throw new Error(kindOf(key) === "resource" ? `"${labelOf(key)}" is a resource, not a component.` : `"${labelOf(key)}" has no registered schema
|
|
156
|
+
if (declaration === undefined || kindOf(key) !== "component") throw new Error(kindOf(key) === "resource" ? `"${labelOf(key)}" is a resource, not a component.` : `"${labelOf(key)}" has no registered schema: ${whyUnregistered(key)}.`);
|
|
147
157
|
if (declaration.derived === true) throw new Error(`"${labelOf(key)}" is derived, so only rules add and remove it.`);
|
|
148
158
|
const layout = layoutOf(declaration.type);
|
|
149
159
|
const own = ownObject(key);
|
|
@@ -155,6 +165,7 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
155
165
|
: layout.kind === "object" && !own ? `"${labelOf(key)}" lives on thread "${thread ?? "world"}", so a command on another thread gives it only its start or null.` : null,
|
|
156
166
|
start: layout.kind === "constant" ? layout.value : defaultOf(key),
|
|
157
167
|
transfer: declaration.transfer === true,
|
|
168
|
+
shared: declaration.shared === true,
|
|
158
169
|
};
|
|
159
170
|
commandKeys.set(first, entry);
|
|
160
171
|
commandKeys.set(key, entry);
|
|
@@ -185,11 +196,18 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
185
196
|
return true;
|
|
186
197
|
};
|
|
187
198
|
|
|
199
|
+
/** A key a spawn or add gives a value: never a shared component's, whose value chooses an archetype, which only the world's thread does. */
|
|
200
|
+
const givenKeyOf = (key: unknown): CommandKey => {
|
|
201
|
+
const entry = commandKeyOf(key);
|
|
202
|
+
if (entry.shared) throw new Error(`"${labelOf(key)}" is shared: its value chooses an archetype, so only the world's thread spawns and adds it.`);
|
|
203
|
+
return entry;
|
|
204
|
+
};
|
|
205
|
+
|
|
188
206
|
/** Spawns this thread stages of a list's components, into a batch per set, reserving entities in blocks. */
|
|
189
|
-
const spawnerOf = (list: readonly unknown[]): ((values
|
|
207
|
+
const spawnerOf = (list: readonly unknown[]): ((values?: object) => Entity) => {
|
|
190
208
|
const known = spawners.get(list);
|
|
191
209
|
if (known !== undefined) return known;
|
|
192
|
-
const listed = list.map(
|
|
210
|
+
const listed = list.map(givenKeyOf);
|
|
193
211
|
const ids = listed.map(entry => entry.number);
|
|
194
212
|
const order = ids.join(",");
|
|
195
213
|
const same = spawnersByNumbers.get(order);
|
|
@@ -217,7 +235,7 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
217
235
|
const positional: Positional = positionalSpawner(reserving, reserveFrom, target, ids, listed.map(entry => entry.layout.kind === "object" || entry.layout.kind === "string" ? objectStart : entry.start));
|
|
218
236
|
const keysOfList = list.filter((key): key is Key => typeof key === "symbol");
|
|
219
237
|
const args: unknown[] = new Array<unknown>(keysOfList.length);
|
|
220
|
-
const spawn = (values: object): Entity => {
|
|
238
|
+
const spawn = (values: object = noValues): Entity => {
|
|
221
239
|
for (let k = 0; k < keysOfList.length; k++) args[k] = Reflect.get(values, keysOfList[k]);
|
|
222
240
|
if (!usedBatches.includes(target)) usedBatches.push(target);
|
|
223
241
|
return Reflect.apply(positional, undefined, args);
|
|
@@ -227,19 +245,49 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
227
245
|
return spawn;
|
|
228
246
|
};
|
|
229
247
|
|
|
248
|
+
/**
|
|
249
|
+
* Spawns of a list with constants, which no shared component is among: the same function for one list's components
|
|
250
|
+
* and one constants object, found by its identity here, reading each component's value from the constants or else
|
|
251
|
+
* from what each spawn gives, and failing its system for one given in both.
|
|
252
|
+
*/
|
|
253
|
+
const presetSpawners = new WeakMap<(values?: object) => Entity, WeakMap<object, (values?: object) => Entity>>();
|
|
254
|
+
const presetSpawnerOf = (list: readonly unknown[], preset: object): ((values?: object) => Entity) => {
|
|
255
|
+
const spawn = spawnerOf(list);
|
|
256
|
+
let byPreset = presetSpawners.get(spawn);
|
|
257
|
+
if (byPreset === undefined) presetSpawners.set(spawn, byPreset = new WeakMap());
|
|
258
|
+
const known = byPreset.get(preset);
|
|
259
|
+
if (known !== undefined) return known;
|
|
260
|
+
const keysOfList = list.filter((key): key is Key => typeof key === "symbol");
|
|
261
|
+
const merged: { [key: string | symbol]: unknown } = {};
|
|
262
|
+
const spawned = (values: object = noValues): Entity => {
|
|
263
|
+
for (const key of keysOfList) {
|
|
264
|
+
const constant: unknown = Reflect.get(preset, key);
|
|
265
|
+
const given: unknown = Reflect.get(values, key);
|
|
266
|
+
if (constant !== undefined && given !== undefined) throw new Error(`A spawn gives "${labelOf(key)}" in both its calls: each component's value comes from one.`);
|
|
267
|
+
merged[key] = constant === undefined ? given : constant;
|
|
268
|
+
}
|
|
269
|
+
return spawn(merged);
|
|
270
|
+
};
|
|
271
|
+
byPreset.set(preset, spawned);
|
|
272
|
+
return spawned;
|
|
273
|
+
};
|
|
274
|
+
|
|
230
275
|
const empty = {};
|
|
231
276
|
const commands: Commands = {
|
|
232
|
-
|
|
277
|
+
// A second parameter rather than a rest one, which would allocate an array each call.
|
|
278
|
+
spawn: (components: readonly unknown[], preset?: unknown) => {
|
|
279
|
+
return typeof preset === "object" && preset !== null ? presetSpawnerOf(components, preset) : spawnerOf(components);
|
|
280
|
+
},
|
|
233
281
|
despawn: entity => beginCommand(writer, despawnCommand, entity),
|
|
234
282
|
add: (entity: number, components: symbol | readonly symbol[], values?: unknown) => {
|
|
235
283
|
if (typeof components === "symbol") {
|
|
236
|
-
const key =
|
|
284
|
+
const key = givenKeyOf(components);
|
|
237
285
|
beginCommand(writer, addCommand, entity);
|
|
238
286
|
if (!putOne(key, entity, values)) dropCommand(writer);
|
|
239
287
|
return;
|
|
240
288
|
}
|
|
241
289
|
// Every key is checked before anything is written.
|
|
242
|
-
for (let k = 0; k < components.length; k++)
|
|
290
|
+
for (let k = 0; k < components.length; k++) givenKeyOf(components[k]);
|
|
243
291
|
const given = typeof values === "object" && values !== null ? values : empty;
|
|
244
292
|
beginCommand(writer, addCommand, entity);
|
|
245
293
|
let crosses = true;
|
|
@@ -281,8 +329,8 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
281
329
|
};
|
|
282
330
|
|
|
283
331
|
const runnerHost: RunnerHost = {
|
|
284
|
-
rows: rowHost, archetypeAt, countOf, tableCount, resourceRow, refreshEntities, commands, mirror,
|
|
285
|
-
refresh: directory.refresh,
|
|
332
|
+
rows: rowHost, archetypeAt, countOf, arrivals, tableCount, resourceRow, refreshEntities, commands, mirror,
|
|
333
|
+
refresh: directory.refresh, replaced: directory.replaced,
|
|
286
334
|
numberOf: directory.numberOf,
|
|
287
335
|
layoutOf: directory.layoutOf,
|
|
288
336
|
strings: directory.strings,
|
|
@@ -358,18 +406,25 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
358
406
|
}));
|
|
359
407
|
};
|
|
360
408
|
|
|
361
|
-
/**
|
|
362
|
-
|
|
409
|
+
/**
|
|
410
|
+
* Brings the mirror up to the last published sync, which runs the finalizers of its stops: `"moved"` when its
|
|
411
|
+
* rebuild found a sync point applying before or during it, so it can rebuild once that's applied, and `"held"`
|
|
412
|
+
* while it waits for something else.
|
|
413
|
+
*/
|
|
414
|
+
const bringCurrent = (): Readiness => {
|
|
363
415
|
const replayed = replay(mirror);
|
|
364
|
-
if (replayed === "held") return
|
|
365
|
-
|
|
416
|
+
if (replayed === "held") return "held";
|
|
417
|
+
if (replayed !== "lapped") return "current";
|
|
418
|
+
const rebuilt = rebuild(mirror);
|
|
419
|
+
return rebuilt === "rebuilt" ? "current" : rebuilt;
|
|
366
420
|
};
|
|
421
|
+
const current = (): boolean => bringCurrent() === "current";
|
|
367
422
|
|
|
368
423
|
/** Whether a task can run: its systems known here, its input arrived, and the mirror through its sync. */
|
|
369
|
-
const ready = (payload: Float64Array, count: number):
|
|
370
|
-
for (let k = 0; k < count; k++) if (runners[payload[payloadSystems + k * systemFields + systemIndex]] === undefined) return
|
|
371
|
-
if (payload[payloadInput] !== 0 && !inputs.has(payload[payloadSequence])) return
|
|
372
|
-
return
|
|
424
|
+
const ready = (payload: Float64Array, count: number): Readiness => {
|
|
425
|
+
for (let k = 0; k < count; k++) if (runners[payload[payloadSystems + k * systemFields + systemIndex]] === undefined) return "held";
|
|
426
|
+
if (payload[payloadInput] !== 0 && !inputs.has(payload[payloadSequence])) return "held";
|
|
427
|
+
return bringCurrent();
|
|
373
428
|
};
|
|
374
429
|
|
|
375
430
|
/** Views of the payload and completion, kept while the world keeps them where they are. */
|
|
@@ -427,15 +482,47 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
427
482
|
return control;
|
|
428
483
|
};
|
|
429
484
|
|
|
430
|
-
/**
|
|
485
|
+
/**
|
|
486
|
+
* A task waiting for a sync point to finish applying, to rebuild its mirror, runs once it has. One whose rebuild
|
|
487
|
+
* found a sync point applied during it runs again after a turn of the event loop: nothing else may wake this thread
|
|
488
|
+
* before the task is done, and sync points overlapping every rebuild mustn't keep it from its event loop.
|
|
489
|
+
*/
|
|
431
490
|
let structureWaited = false;
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
491
|
+
const retried = (): void => {
|
|
492
|
+
structureWaited = false;
|
|
493
|
+
process();
|
|
494
|
+
};
|
|
495
|
+
const retryAfterStructure = (moved: boolean): void => {
|
|
496
|
+
if (structureWaited) return;
|
|
497
|
+
if (applying(mirror)) {
|
|
498
|
+
structureWaited = true;
|
|
499
|
+
void waitStructure(mirror).then(retried);
|
|
500
|
+
}
|
|
501
|
+
else if (moved) {
|
|
502
|
+
structureWaited = true;
|
|
503
|
+
setTimeout(retried, 0);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Posts a task's message. A value that can't be posted, as one holding a function, fails its system instead, and
|
|
509
|
+
* the message goes again without values.
|
|
510
|
+
*/
|
|
511
|
+
const postCompleted = (sequence: number, errors: [number, WorkerError][] | null, spills: [number, Uint8Array][] | null, values: [number, unknown][] | null, transfer: ArrayBuffer[] | null): void => {
|
|
512
|
+
const extra = stamps.length > 0 ? { stamps: [...stamps] } : {};
|
|
513
|
+
try {
|
|
514
|
+
host.post({ protocol: protocolName, kind: "completed", sequence, errors: errors ?? [], spills: spills ?? [], ...values === null ? {} : { values }, ...extra }, transfer ?? []);
|
|
515
|
+
}
|
|
516
|
+
catch (error) {
|
|
517
|
+
if (values === null) throw error;
|
|
518
|
+
const failed = errors ?? [];
|
|
519
|
+
for (const [k] of values) {
|
|
520
|
+
const at = completionSystems + k * resultFields + resultFlags;
|
|
521
|
+
completion[at] = (completion[at] & ~valuedFlag) | failedFlag;
|
|
522
|
+
failed.push([k, errorOf(new Error(`Its value can't be posted to the world's thread: ${error instanceof Error ? error.message : String(error)}`))]);
|
|
523
|
+
}
|
|
524
|
+
host.post({ protocol: protocolName, kind: "completed", sequence, errors: failed, spills: spills ?? [], ...extra }, transfer ?? []);
|
|
525
|
+
}
|
|
439
526
|
};
|
|
440
527
|
|
|
441
528
|
const runTask = (posted: number): void => {
|
|
@@ -444,8 +531,9 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
444
531
|
const count = payload[payloadCount];
|
|
445
532
|
const sequence = payload[payloadSequence];
|
|
446
533
|
pending = sequence;
|
|
447
|
-
|
|
448
|
-
|
|
534
|
+
const readiness = ready(payload, count);
|
|
535
|
+
if (readiness !== "current") {
|
|
536
|
+
retryAfterStructure(readiness === "moved");
|
|
449
537
|
return;
|
|
450
538
|
}
|
|
451
539
|
pending = -1;
|
|
@@ -456,6 +544,7 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
456
544
|
let errors: [number, WorkerError][] | null = null;
|
|
457
545
|
let spills: [number, Uint8Array][] | null = null;
|
|
458
546
|
let transfer: ArrayBuffer[] | null = null;
|
|
547
|
+
let values: [number, unknown][] | null = null;
|
|
459
548
|
let failedTier = -1;
|
|
460
549
|
const folds = completionSystems + count * resultFields;
|
|
461
550
|
stamps.length = 0;
|
|
@@ -489,6 +578,11 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
489
578
|
flags |= failedFlag;
|
|
490
579
|
(errors ??= []).push([k, errorOf(outcome.error)]);
|
|
491
580
|
}
|
|
581
|
+
else if (outcome.value !== undefined && payload[base + systemValued] !== 0) {
|
|
582
|
+
flags |= valuedFlag;
|
|
583
|
+
(values ??= []).push([k, outcome.value]);
|
|
584
|
+
}
|
|
585
|
+
outcome.value = undefined;
|
|
492
586
|
completion[result + resultFlags] = flags;
|
|
493
587
|
continue;
|
|
494
588
|
}
|
|
@@ -498,6 +592,11 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
498
592
|
if (outcome.executed) flags |= executedFlag;
|
|
499
593
|
if (outcome.ran) flags |= ranFlag;
|
|
500
594
|
error = outcome.error ?? running.error;
|
|
595
|
+
if (error === undefined && outcome.value !== undefined && payload[base + systemValued] !== 0) {
|
|
596
|
+
flags |= valuedFlag;
|
|
597
|
+
(values ??= []).push([k, outcome.value]);
|
|
598
|
+
}
|
|
599
|
+
outcome.value = undefined;
|
|
501
600
|
}
|
|
502
601
|
try {
|
|
503
602
|
const extent = writeSegment();
|
|
@@ -520,9 +619,9 @@ export const createThreadSystems = (host: ThreadSystemsHost) => {
|
|
|
520
619
|
else if (runner !== null && runner !== undefined && (flags & ranFlag) !== 0) runner.writeFolds(completion, folds + payload[base + systemFolds]);
|
|
521
620
|
completion[result + resultFlags] = flags;
|
|
522
621
|
}
|
|
523
|
-
const message = errors !== null || spills !== null || stamps.length > 0 || host.numbered() !== numberedBefore || !host.worldWaits;
|
|
622
|
+
const message = errors !== null || spills !== null || values !== null || stamps.length > 0 || host.numbered() !== numberedBefore || !host.worldWaits;
|
|
524
623
|
completion[completionMessage] = message ? 1 : 0;
|
|
525
|
-
if (message)
|
|
624
|
+
if (message) postCompleted(sequence, errors, spills, values, transfer);
|
|
526
625
|
Atomics.store(control, taskDoneWord, posted);
|
|
527
626
|
Atomics.notify(control, taskDoneWord);
|
|
528
627
|
};
|
|
@@ -565,6 +664,8 @@ export type RunnerHost = {
|
|
|
565
664
|
readonly rows: RowHost & { tick: number };
|
|
566
665
|
readonly archetypeAt: (id: number) => ThreadArchetype | undefined;
|
|
567
666
|
readonly countOf: (archetype: ThreadArchetype) => number;
|
|
667
|
+
/** The ring of rows' moves between archetypes, which `where`'s points per archetype read (`arrivals.ts`). */
|
|
668
|
+
readonly arrivals: () => ArrivalsView | null;
|
|
568
669
|
readonly tableCount: () => number;
|
|
569
670
|
readonly resourceRow: () => { readonly archetype: ThreadArchetype; readonly row: number } | null;
|
|
570
671
|
readonly refreshEntities: () => EntityViews;
|
|
@@ -573,14 +674,23 @@ export type RunnerHost = {
|
|
|
573
674
|
readonly layoutOf: (key: Key) => Layout | undefined;
|
|
574
675
|
/** This thread's objects, null where it fills none. */
|
|
575
676
|
readonly mirror: Mirror | null;
|
|
576
|
-
/** Views of the memory again, once it grew: its buffer. */
|
|
677
|
+
/** Views of the memory again, once it grew, and `replaced` moved on if a view may have: its buffer. */
|
|
577
678
|
readonly refresh: () => ArrayBufferLike;
|
|
679
|
+
/** Moved on by `refresh` once any archetype's view may have changed, which index lookups' rows check (`thread-directory.ts`). */
|
|
680
|
+
readonly replaced: { readonly count: number };
|
|
578
681
|
/** The records strings' columns name. */
|
|
579
682
|
readonly strings: StringStore;
|
|
580
683
|
};
|
|
581
684
|
|
|
582
685
|
/** One run's outcome: whether it took its tick, ran its rows, and its error. */
|
|
583
|
-
|
|
686
|
+
/** A body's value, or a throw failing its system when it's a promise or another thenable, which nothing awaits. */
|
|
687
|
+
const notThenable = (value: unknown): unknown => {
|
|
688
|
+
if (isThenable(value)) throw new Error(returnedPromise);
|
|
689
|
+
return value;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
/** How a run of a system went: for one without components, what its body returned too. */
|
|
693
|
+
export type Outcome = { executed: boolean; ran: boolean; error: unknown; value: unknown };
|
|
584
694
|
|
|
585
695
|
export type ThreadRunner = {
|
|
586
696
|
/** Runs it once, at the tick its host's rows stamp with. */
|
|
@@ -606,28 +716,130 @@ type ThreadCell = { storage: ThreadStorage | undefined; row: number };
|
|
|
606
716
|
export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: ReadonlyMap<string, number> = noRecords): ThreadRunner => {
|
|
607
717
|
const { declaration } = leaf;
|
|
608
718
|
// Method parameters are bivariant, so the runtime can see any leaf's body with erased parameter types.
|
|
609
|
-
const system: { body(subject: unknown, context?: unknown):
|
|
719
|
+
const system: { body(subject: unknown, context?: unknown, input?: unknown): unknown } = leaf;
|
|
610
720
|
const { components: query, resources } = declaration;
|
|
611
721
|
const numberOf = host.numberOf;
|
|
612
|
-
const required =
|
|
722
|
+
const required = requiredOf(query).map(numberOf);
|
|
613
723
|
const excluded = (query?.not ?? []).map(numberOf);
|
|
614
724
|
const addedIds = (query?.added ?? []).map(numberOf);
|
|
615
725
|
const changedIds = (query?.changed ?? []).map(numberOf);
|
|
616
726
|
const resourceChanged = (resources?.changed ?? []).map(numberOf);
|
|
617
727
|
const filtered = addedIds.length + changedIds.length + resourceChanged.length > 0;
|
|
618
|
-
const bindRow = rowBinderOf<ThreadArchetype>(host.rows, numberOf, query?.read ?? [], query?.write ?? []);
|
|
728
|
+
const bindRow = rowBinderOf<ThreadArchetype>(host.rows, numberOf, query?.read ?? [], query?.write ?? [], query?.optional);
|
|
619
729
|
const matches: number[] = [];
|
|
620
730
|
let checked = 0;
|
|
731
|
+
/** Its `where`, run here as on the world's thread (`where.ts`); null without one. */
|
|
732
|
+
const where = query?.where === undefined ? null : createThreadWhere({ archetypeAt: host.archetypeAt, numberOf, resourceRow: host.resourceRow, tick: () => host.rows.tick - 1 }, query.where, query.whereReads ?? []);
|
|
733
|
+
/** With `where` and change filters, each match's own last run, as on the world's thread. */
|
|
734
|
+
const pointed = where !== null && filtered;
|
|
735
|
+
const points: number[] = [];
|
|
736
|
+
/** By archetype id, its match, or -1. */
|
|
737
|
+
const matchOf: number[] = [];
|
|
738
|
+
/** Its `lastRun` as of its run here: a new match's point, and a non-match's, whose rows it never saw. */
|
|
739
|
+
let latest = 0;
|
|
740
|
+
/** What archetypes owe for rows moved in from others, as on the world's thread. */
|
|
741
|
+
const debts = pointed ? createDebts(points, matchOf, arrivalsPosition(host.arrivals())) : null;
|
|
742
|
+
const oldestPoint = (): number => {
|
|
743
|
+
let oldest = latest;
|
|
744
|
+
for (let m = 0; m < matches.length; m++) if (points[m] < oldest) oldest = points[m];
|
|
745
|
+
return oldest;
|
|
746
|
+
};
|
|
747
|
+
/** By match, its archetype's generation as matched: reused for other values (`reclaim.ts`), it's matched anew. */
|
|
748
|
+
const generations: number[] = [];
|
|
749
|
+
/**
|
|
750
|
+
* The world's count of archetypes reclaimed and reused as it last looked, which it follows as it changes; null before
|
|
751
|
+
* its first look, which sees every archetype as it is.
|
|
752
|
+
*/
|
|
753
|
+
let followed: number | null = null;
|
|
754
|
+
const isMatch = (archetype: ThreadArchetype): boolean => {
|
|
755
|
+
const has = (id: number): boolean => archetype.components.includes(id);
|
|
756
|
+
return !archetype.resource && !archetype.reclaimed && required.every(has) && !excluded.some(has);
|
|
757
|
+
};
|
|
758
|
+
const addMatch = (id: number, archetype: ThreadArchetype): void => {
|
|
759
|
+
const m = matches.length;
|
|
760
|
+
points[m] = latest;
|
|
761
|
+
generations[m] = archetype.generation;
|
|
762
|
+
matchOf[id] = m;
|
|
763
|
+
matches.push(id);
|
|
764
|
+
};
|
|
765
|
+
const moveMatch = (from: number, to: number): void => {
|
|
766
|
+
const id = matches[from];
|
|
767
|
+
matches[to] = id;
|
|
768
|
+
points[to] = points[from];
|
|
769
|
+
generations[to] = generations[from];
|
|
770
|
+
matchOf[id] = to;
|
|
771
|
+
where?.move(from, to);
|
|
772
|
+
};
|
|
773
|
+
const swapMatches = (a: number, b: number): void => {
|
|
774
|
+
if (a === b) return;
|
|
775
|
+
const first = matches[a];
|
|
776
|
+
const point = points[a];
|
|
777
|
+
const generation = generations[a];
|
|
778
|
+
matches[a] = matches[b];
|
|
779
|
+
points[a] = points[b];
|
|
780
|
+
generations[a] = generations[b];
|
|
781
|
+
matchOf[matches[a]] = a;
|
|
782
|
+
matches[b] = first;
|
|
783
|
+
points[b] = point;
|
|
784
|
+
generations[b] = generation;
|
|
785
|
+
matchOf[first] = b;
|
|
786
|
+
where?.swapped(a, b);
|
|
787
|
+
};
|
|
788
|
+
/** As on the world's thread: one evaluated by `where` stays among those evaluated. */
|
|
789
|
+
const removeMatch = (m: number): void => {
|
|
790
|
+
matchOf[matches[m]] = -1;
|
|
791
|
+
let hole = m;
|
|
792
|
+
if (where !== null && m < where.evaluated) {
|
|
793
|
+
const edge = where.evaluated - 1;
|
|
794
|
+
if (edge !== hole) moveMatch(edge, hole);
|
|
795
|
+
hole = edge;
|
|
796
|
+
where.forgetLast();
|
|
797
|
+
}
|
|
798
|
+
const last = matches.length - 1;
|
|
799
|
+
if (hole !== last) moveMatch(last, hole);
|
|
800
|
+
matches.length = points.length = generations.length = last;
|
|
801
|
+
};
|
|
802
|
+
/**
|
|
803
|
+
* Once archetypes were reclaimed or reused: each match reclaimed leaves, each reused is matched anew, and each it
|
|
804
|
+
* has seen and doesn't match is matched once reused, reading every record it has seen. Arrivals are read first, as
|
|
805
|
+
* on the world's thread.
|
|
806
|
+
*/
|
|
807
|
+
const followMembership = (): void => {
|
|
808
|
+
debts?.read(host.arrivals(), host.rows.tick, host.tableCount(), latest, oldestPoint);
|
|
809
|
+
for (let m = matches.length - 1; m >= 0; m--) {
|
|
810
|
+
const archetype = host.archetypeAt(matches[m]);
|
|
811
|
+
if (archetype === undefined || archetype.reclaimed) removeMatch(m);
|
|
812
|
+
else if (archetype.generation !== generations[m]) {
|
|
813
|
+
points[m] = latest;
|
|
814
|
+
generations[m] = archetype.generation;
|
|
815
|
+
if (where !== null && m < where.evaluated) {
|
|
816
|
+
swapMatches(m, where.evaluated - 1);
|
|
817
|
+
where.forgetLast();
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
for (let id = 0; id < checked; id++) {
|
|
822
|
+
if ((matchOf[id] ?? -1) >= 0) continue;
|
|
823
|
+
const archetype = host.archetypeAt(id);
|
|
824
|
+
if (archetype !== undefined && isMatch(archetype)) addMatch(id, archetype);
|
|
825
|
+
}
|
|
826
|
+
};
|
|
621
827
|
const refreshMatches = (): void => {
|
|
828
|
+
const membership = membershipOf(host.arrivals());
|
|
829
|
+
if (followed === null) followed = membership;
|
|
830
|
+
else if (membership !== followed) {
|
|
831
|
+
followed = membership;
|
|
832
|
+
followMembership();
|
|
833
|
+
}
|
|
622
834
|
for (const count = host.tableCount(); checked < count; checked++) {
|
|
623
835
|
const archetype = host.archetypeAt(checked);
|
|
624
836
|
if (archetype === undefined) break;
|
|
625
|
-
|
|
626
|
-
if (
|
|
837
|
+
matchOf[checked] = -1;
|
|
838
|
+
if (isMatch(archetype)) addMatch(checked, archetype);
|
|
627
839
|
}
|
|
628
840
|
};
|
|
629
841
|
const ownInput = inputFor(leaf);
|
|
630
|
-
const targets: readonly ReductionTarget[] = reductionTargetsOf(host.layoutOf, declaration);
|
|
842
|
+
const targets: readonly ReductionTarget[] = reductionTargetsOf(host.layoutOf, leaf.name, declaration);
|
|
631
843
|
const reduced = targets.map(target => new Float64Array(target.leaves.length));
|
|
632
844
|
|
|
633
845
|
// The context: resources, lookups, reductions, input and commands, each under its own key when declared.
|
|
@@ -677,10 +889,10 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
677
889
|
if (index === undefined || record === undefined) found = entityLookupOf(host, declared, lookupSince);
|
|
678
890
|
else {
|
|
679
891
|
const reads = declared.read ?? [];
|
|
680
|
-
const threadIndex = createThreadIndex(host.rows, host.archetypeAt, {
|
|
892
|
+
const threadIndex = createThreadIndex(host.rows, host.archetypeAt, host.replaced, {
|
|
681
893
|
layouts: index.declaration.key.map(key => {
|
|
682
894
|
const layout = host.layoutOf(key);
|
|
683
|
-
if (layout === undefined) throw new Error(`"${labelOf(key)}" has no registered schema
|
|
895
|
+
if (layout === undefined) throw new Error(`"${labelOf(key)}" has no registered schema: ${whyUnregistered(key)}.`);
|
|
684
896
|
return layout;
|
|
685
897
|
}),
|
|
686
898
|
sorted: keptSorted(index.declaration),
|
|
@@ -711,14 +923,14 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
711
923
|
});
|
|
712
924
|
Object.defineProperty(value, "reduce", { value: reducers, enumerable: true });
|
|
713
925
|
}
|
|
714
|
-
if (declaration.input !== undefined) value.input = undefined;
|
|
715
926
|
// A tail is terminal, so its context has no commands.
|
|
716
|
-
const tailValue:
|
|
927
|
+
const tailValue: object = own();
|
|
717
928
|
for (const name of Object.getOwnPropertyNames(value)) {
|
|
718
929
|
const descriptor = Object.getOwnPropertyDescriptor(value, name);
|
|
719
|
-
if (descriptor !== undefined
|
|
930
|
+
if (descriptor !== undefined) Object.defineProperty(tailValue, name, descriptor);
|
|
720
931
|
}
|
|
721
|
-
|
|
932
|
+
/** The current run's input, which the body takes after its context; kept until the next run, as its context is. */
|
|
933
|
+
let runInput: unknown;
|
|
722
934
|
Object.defineProperty(value, "commands", { value: host.commands, enumerable: true });
|
|
723
935
|
|
|
724
936
|
/** Resolves resource cells for a run: they move only at sync points. */
|
|
@@ -763,11 +975,11 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
763
975
|
const filters: Filter[] = [];
|
|
764
976
|
for (const id of addedIds) {
|
|
765
977
|
const storage = archetype.storageById[id];
|
|
766
|
-
if (storage !== undefined) filters.push({ ticks: storage.added, chunks: storage.chunkAdded });
|
|
978
|
+
if (storage !== undefined) filters.push({ ticks: storage.added, chunks: storage.chunkAdded, blocks: storage.blockAdded });
|
|
767
979
|
}
|
|
768
980
|
for (const id of changedIds) {
|
|
769
981
|
const storage = archetype.storageById[id];
|
|
770
|
-
if (storage !== undefined) filters.push({ ticks: storage.changed, chunks: storage.chunkChanged });
|
|
982
|
+
if (storage !== undefined) filters.push({ ticks: storage.changed, chunks: storage.chunkChanged, blocks: storage.blockChanged });
|
|
771
983
|
}
|
|
772
984
|
filterCache.set(archetype.id, { archetype, filters });
|
|
773
985
|
return filters;
|
|
@@ -776,28 +988,29 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
776
988
|
const runBody = (archetype: ThreadArchetype, count: number, since: number): void => {
|
|
777
989
|
const row = bindRow(archetype);
|
|
778
990
|
const subject = row.value;
|
|
991
|
+
const input = runInput;
|
|
779
992
|
const filters = filtersOf(archetype);
|
|
780
993
|
if (since < 0 || filters.length === 0) {
|
|
781
994
|
for (let index = 0; index < count; index++) {
|
|
782
995
|
row.index = index;
|
|
783
|
-
system.body(subject, value);
|
|
996
|
+
system.body(subject, value, input);
|
|
784
997
|
}
|
|
785
998
|
return;
|
|
786
999
|
}
|
|
787
1000
|
forEachPassingRange(filters, since, 0, count, (start, end) => {
|
|
788
1001
|
for (let index = start; index < end; index++) {
|
|
789
1002
|
row.index = index;
|
|
790
|
-
system.body(subject, value);
|
|
1003
|
+
system.body(subject, value, input);
|
|
791
1004
|
}
|
|
792
1005
|
});
|
|
793
1006
|
};
|
|
794
1007
|
|
|
795
|
-
const outcome: Outcome = { executed: false, ran: false, error: undefined };
|
|
1008
|
+
const outcome: Outcome = { executed: false, ran: false, error: undefined, value: undefined };
|
|
796
1009
|
/** Set once its system is removed on this thread: no row runs from then on. */
|
|
797
1010
|
let halted = false;
|
|
798
1011
|
const run = (lastRun: number, input: unknown): Outcome => {
|
|
799
1012
|
outcome.executed = outcome.ran = false;
|
|
800
|
-
outcome.error = undefined;
|
|
1013
|
+
outcome.error = outcome.value = undefined;
|
|
801
1014
|
lookupSince.value = lastRun;
|
|
802
1015
|
try {
|
|
803
1016
|
// A system whose conditions don't hold is skipped, successfully, and keeps its `lastRun`.
|
|
@@ -808,23 +1021,41 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
808
1021
|
const since = !filtered || resourcesChanged ? -1 : lastRun;
|
|
809
1022
|
bind();
|
|
810
1023
|
if (threadIndexes.length !== 0) {
|
|
1024
|
+
// Settles the count after `ready()` or `current()` may have rebuilt the mirror, since `runTask` settles before them.
|
|
811
1025
|
const buffer = host.refresh();
|
|
812
1026
|
for (let k = 0; k < threadIndexes.length; k++) threadIndexes[k].refresh(buffer);
|
|
813
1027
|
}
|
|
814
|
-
|
|
1028
|
+
runInput = ownInput(input);
|
|
815
1029
|
if (query === undefined) {
|
|
816
1030
|
outcome.ran = since < 0;
|
|
817
|
-
if (outcome.ran) system.body(value);
|
|
1031
|
+
if (outcome.ran) outcome.value = notThenable(system.body(value, runInput));
|
|
818
1032
|
return outcome;
|
|
819
1033
|
}
|
|
820
|
-
if (since >= 0 && addedIds.length + changedIds.length === 0) return outcome;
|
|
1034
|
+
if (since >= 0 && addedIds.length + changedIds.length === 0 && !pointed) return outcome;
|
|
821
1035
|
outcome.ran = true;
|
|
1036
|
+
latest = lastRun;
|
|
822
1037
|
refreshMatches();
|
|
823
|
-
|
|
824
|
-
|
|
1038
|
+
debts?.read(host.arrivals(), host.rows.tick, host.tableCount(), latest, oldestPoint);
|
|
1039
|
+
if (where !== null) where.refresh(matches);
|
|
1040
|
+
const list = where === null ? matches : where.passing;
|
|
1041
|
+
const listed = where === null ? matches.length : where.count;
|
|
1042
|
+
for (let k = 0; k < listed; k++) {
|
|
1043
|
+
const archetype = host.archetypeAt(list[k]);
|
|
825
1044
|
if (archetype === undefined) continue;
|
|
1045
|
+
let from = since;
|
|
1046
|
+
if (pointed && where !== null) {
|
|
1047
|
+
const m = where.indices[k];
|
|
1048
|
+
if (since >= 0) {
|
|
1049
|
+
// Rows moved in since its point count as changed since their old archetype's.
|
|
1050
|
+
const point = debts?.sinceOf(list[k], points[m]) ?? points[m];
|
|
1051
|
+
from = resourceChanged.length > 0 && resourcesChangedSince(point) ? -1 : point;
|
|
1052
|
+
}
|
|
1053
|
+
points[m] = host.rows.tick;
|
|
1054
|
+
debts?.settle(list[k]);
|
|
1055
|
+
if (from >= 0 && addedIds.length + changedIds.length === 0) continue;
|
|
1056
|
+
}
|
|
826
1057
|
const count = host.countOf(archetype);
|
|
827
|
-
if (count > 0) runBody(archetype, count,
|
|
1058
|
+
if (count > 0) runBody(archetype, count, from);
|
|
828
1059
|
}
|
|
829
1060
|
}
|
|
830
1061
|
catch (error) {
|
|
@@ -837,6 +1068,8 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
837
1068
|
// thread's, which it reads from its mirror at the snapshot's rows.
|
|
838
1069
|
const readKeys = query?.read ?? [];
|
|
839
1070
|
const writeKeys = query?.write ?? [];
|
|
1071
|
+
/** Its optional components, which rows from a snapshot have only where their archetype does. */
|
|
1072
|
+
const optionalNumbers = (query?.optional ?? []).map(numberOf);
|
|
840
1073
|
const linearReads: { readonly number: number; readonly layout: Columned }[] = [];
|
|
841
1074
|
const constantReads: { readonly number: number; readonly layout: Layout }[] = [];
|
|
842
1075
|
for (const key of readKeys) {
|
|
@@ -845,6 +1078,8 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
845
1078
|
if (layout?.kind === "linear" || layout?.kind === "string") linearReads.push({ number: numberOf(key), layout });
|
|
846
1079
|
else if (layout?.kind === "constant") constantReads.push({ number: numberOf(key), layout });
|
|
847
1080
|
}
|
|
1081
|
+
/** The shared components it reads, whose values a snapshot's rows take from their archetypes. */
|
|
1082
|
+
const sharedReads = constantReads.flatMap(({ number, layout }) => layout.kind === "constant" && layout.shared === true ? [number] : []);
|
|
848
1083
|
const objectKeys = [...new Set([...readKeys, ...writeKeys])].filter(key => host.layoutOf(key)?.kind === "object").map(numberOf);
|
|
849
1084
|
const writtenObjects = new Set(writeKeys.map(numberOf));
|
|
850
1085
|
const snapshotResources = resourceKeys.flatMap((key, k) => {
|
|
@@ -866,22 +1101,25 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
866
1101
|
const runRows = (archetype: ThreadArchetype, start: number, end: number, since: number): void => {
|
|
867
1102
|
const row = bindRow(archetype);
|
|
868
1103
|
const subject = row.value;
|
|
1104
|
+
const input = runInput;
|
|
869
1105
|
const filters = filtersOf(archetype);
|
|
870
1106
|
if (since < 0 || filters.length === 0) {
|
|
871
1107
|
for (let index = start; index < end && !halted; index++) {
|
|
872
1108
|
row.index = index;
|
|
873
|
-
system.body(subject, tailValue);
|
|
1109
|
+
system.body(subject, tailValue, input);
|
|
874
1110
|
}
|
|
875
1111
|
return;
|
|
876
1112
|
}
|
|
877
1113
|
forEachPassingRange(filters, since, start, end, (first, last) => {
|
|
878
1114
|
for (let index = first; index < last && !halted; index++) {
|
|
879
1115
|
row.index = index;
|
|
880
|
-
system.body(subject, tailValue);
|
|
1116
|
+
system.body(subject, tailValue, input);
|
|
881
1117
|
}
|
|
882
1118
|
});
|
|
883
1119
|
};
|
|
884
1120
|
|
|
1121
|
+
/** By match as of the head, with `where`: the tick its rows pass after, -2 for one `where` skips. */
|
|
1122
|
+
const tailSinces: number[] = [];
|
|
885
1123
|
/** Runs positions `from` to `to` where their rows are, over the archetypes as of the head. */
|
|
886
1124
|
const runPositions = (from: number, to: number, since: number): void => {
|
|
887
1125
|
let base = 0;
|
|
@@ -890,7 +1128,8 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
890
1128
|
const start = Math.max(from - 1 - base, 0);
|
|
891
1129
|
const end = Math.min(to - 1 - base, count);
|
|
892
1130
|
const archetype = tailArchetypes[m];
|
|
893
|
-
|
|
1131
|
+
const passing = where === null ? since : tailSinces[m];
|
|
1132
|
+
if (end > start && archetype !== undefined && passing !== -2) runRows(archetype, start, end, passing);
|
|
894
1133
|
base += count;
|
|
895
1134
|
if (base >= to - 1) return;
|
|
896
1135
|
}
|
|
@@ -953,10 +1192,10 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
953
1192
|
if ((flags & headExecuted) === 0) return;
|
|
954
1193
|
outcome.executed = true;
|
|
955
1194
|
outcome.ran = (flags & headRan) !== 0;
|
|
956
|
-
|
|
1195
|
+
runInput = ownInput(input);
|
|
957
1196
|
if (!outcome.ran) return;
|
|
958
1197
|
if (query === undefined) {
|
|
959
|
-
system.body(tailValue);
|
|
1198
|
+
outcome.value = notThenable(system.body(tailValue, runInput));
|
|
960
1199
|
writeBackResources(ownResources, resourceArchetype, resourceRow, tick, at, stamps);
|
|
961
1200
|
return;
|
|
962
1201
|
}
|
|
@@ -969,7 +1208,8 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
969
1208
|
linearReads.forEach(({ number, layout: linear }, k) => {
|
|
970
1209
|
storageById[number] = localStorage(number, linear, viewsOf(buffer, offset + placed.columns[k], rows * linear.stride), [], 0, host.strings);
|
|
971
1210
|
});
|
|
972
|
-
|
|
1211
|
+
// A shared component's value is each row's archetype's, bound a run of one archetype's rows at a time.
|
|
1212
|
+
for (const { number, layout: constant } of constantReads) if (constant.kind !== "constant" || constant.shared !== true) storageById[number] = localStorage(number, constant, emptyViews, [], 0, host.strings);
|
|
973
1213
|
const objects: { readonly number: number; readonly storage: ThreadStorage }[] = [];
|
|
974
1214
|
for (const number of objectKeys) {
|
|
975
1215
|
const values = new Array<unknown>(rows);
|
|
@@ -987,12 +1227,56 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
987
1227
|
}
|
|
988
1228
|
let first = 0;
|
|
989
1229
|
while (first < rows && positions[first] < position) first++;
|
|
990
|
-
|
|
991
|
-
const
|
|
1230
|
+
// With `where`, rows of archetypes it skips don't run: the copy holds every matched row then (`headOf`).
|
|
1231
|
+
const skipped = where === null ? null : new Set(matches.filter((_, m) => tailSinces[m] === -2));
|
|
1232
|
+
const copied = (storages: readonly (ThreadStorage | undefined)[]): ThreadArchetype =>
|
|
1233
|
+
({ id: -1, entities, storageById: storages, record: -1, version: -1, mirrored: null, components: [], resource: false, reclaimed: false, generation: 0 });
|
|
1234
|
+
const ownedInput = runInput;
|
|
992
1235
|
try {
|
|
993
|
-
|
|
994
|
-
row
|
|
995
|
-
|
|
1236
|
+
if (optionalNumbers.length === 0 && sharedReads.length === 0) {
|
|
1237
|
+
const row = bindRow(copied(storageById));
|
|
1238
|
+
const subject = row.value;
|
|
1239
|
+
for (let index = first; index < rows && !halted; index++) {
|
|
1240
|
+
if (skipped !== null && skipped.has(archetypeIds[index])) continue;
|
|
1241
|
+
row.index = index;
|
|
1242
|
+
system.body(subject, tailValue, ownedInput);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
else {
|
|
1246
|
+
// Rows of archetypes that lack optional components run in a row without them, a run of one archetype's rows
|
|
1247
|
+
// at a time, and every archetype with the same ones shares its copy of the snapshot's columns; with
|
|
1248
|
+
// shared components, each archetype has its own, holding its values.
|
|
1249
|
+
const byPattern = new Map<number, ThreadArchetype>();
|
|
1250
|
+
for (let index = first; index < rows && !halted;) {
|
|
1251
|
+
const id = archetypeIds[index];
|
|
1252
|
+
let end = index + 1;
|
|
1253
|
+
while (end < rows && archetypeIds[end] === id) end++;
|
|
1254
|
+
if (skipped !== null && skipped.has(id)) {
|
|
1255
|
+
index = end;
|
|
1256
|
+
continue;
|
|
1257
|
+
}
|
|
1258
|
+
const components = host.archetypeAt(id)?.components ?? [];
|
|
1259
|
+
let pattern = 0;
|
|
1260
|
+
for (let k = 0; k < optionalNumbers.length; k++) if (components.includes(optionalNumbers[k])) pattern |= 1 << k;
|
|
1261
|
+
const key = sharedReads.length === 0 ? pattern : -1 - id;
|
|
1262
|
+
let archetype = byPattern.get(key);
|
|
1263
|
+
if (archetype === undefined) {
|
|
1264
|
+
const storages: (ThreadStorage | undefined)[] = [...storageById];
|
|
1265
|
+
optionalNumbers.forEach((number, k) => { if ((pattern & (1 << k)) === 0) storages[number] = undefined; });
|
|
1266
|
+
const viewed = sharedReads.length === 0 ? undefined : host.archetypeAt(id);
|
|
1267
|
+
for (const number of sharedReads) {
|
|
1268
|
+
const layout = viewed?.storageById[number]?.layout;
|
|
1269
|
+
storages[number] = layout === undefined ? undefined : localStorage(number, layout, emptyViews, [], 0, host.strings);
|
|
1270
|
+
}
|
|
1271
|
+
byPattern.set(key, archetype = copied(storages));
|
|
1272
|
+
}
|
|
1273
|
+
const row = bindRow(archetype);
|
|
1274
|
+
const subject = row.value;
|
|
1275
|
+
for (; index < end && !halted; index++) {
|
|
1276
|
+
row.index = index;
|
|
1277
|
+
system.body(subject, tailValue, ownedInput);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
996
1280
|
}
|
|
997
1281
|
}
|
|
998
1282
|
finally {
|
|
@@ -1031,7 +1315,7 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
1031
1315
|
*/
|
|
1032
1316
|
const runTail = (lastRun: number, input: unknown, control: Int32Array, sync: number, at: number, stamps: number[], first?: number, outcomeAt?: number): Outcome => {
|
|
1033
1317
|
outcome.executed = outcome.ran = false;
|
|
1034
|
-
outcome.error = undefined;
|
|
1318
|
+
outcome.error = outcome.value = undefined;
|
|
1035
1319
|
lookupSince.value = lastRun;
|
|
1036
1320
|
let claimed = first ?? Atomics.add(control, progressWord, tailChunk);
|
|
1037
1321
|
const end = Atomics.load(control, endWord);
|
|
@@ -1051,21 +1335,41 @@ export const createThreadRunner = (host: RunnerHost, leaf: Leaf, records: Readon
|
|
|
1051
1335
|
const resourcesChanged = resourceChanged.length > 0 && resourcesChangedSince(lastRun);
|
|
1052
1336
|
const since = !filtered || resourcesChanged ? -1 : lastRun;
|
|
1053
1337
|
bind();
|
|
1054
|
-
|
|
1338
|
+
runInput = ownInput(input);
|
|
1055
1339
|
if (query === undefined) {
|
|
1056
1340
|
outcome.ran = since < 0;
|
|
1057
|
-
if (outcome.ran) system.body(tailValue);
|
|
1341
|
+
if (outcome.ran) outcome.value = notThenable(system.body(tailValue, runInput));
|
|
1058
1342
|
return outcome;
|
|
1059
1343
|
}
|
|
1060
|
-
if (since >= 0 && addedIds.length + changedIds.length === 0) return outcome;
|
|
1344
|
+
if (since >= 0 && addedIds.length + changedIds.length === 0 && !pointed) return outcome;
|
|
1061
1345
|
outcome.ran = true;
|
|
1346
|
+
latest = lastRun;
|
|
1062
1347
|
refreshMatches();
|
|
1348
|
+
debts?.read(host.arrivals(), host.rows.tick, host.tableCount(), latest, oldestPoint);
|
|
1063
1349
|
tailArchetypes.length = tailCounts.length = 0;
|
|
1064
1350
|
for (let m = 0; m < matches.length; m++) {
|
|
1065
1351
|
const archetype = host.archetypeAt(matches[m]);
|
|
1066
1352
|
tailArchetypes.push(archetype);
|
|
1067
1353
|
tailCounts.push(archetype === undefined ? 0 : host.countOf(archetype));
|
|
1068
1354
|
}
|
|
1355
|
+
if (where !== null) {
|
|
1356
|
+
where.refresh(matches);
|
|
1357
|
+
for (let m = 0; m < matches.length; m++) tailSinces[m] = -2;
|
|
1358
|
+
for (let k = 0; k < where.count; k++) {
|
|
1359
|
+
const m = where.indices[k];
|
|
1360
|
+
const archetype = tailArchetypes[m];
|
|
1361
|
+
let from = since;
|
|
1362
|
+
if (pointed && since >= 0 && archetype !== undefined) {
|
|
1363
|
+
const point = debts?.sinceOf(matches[m], points[m]) ?? points[m];
|
|
1364
|
+
from = resourceChanged.length > 0 && resourcesChangedSince(point) ? -1 : point;
|
|
1365
|
+
}
|
|
1366
|
+
if (pointed) {
|
|
1367
|
+
points[m] = host.rows.tick;
|
|
1368
|
+
debts?.settle(matches[m]);
|
|
1369
|
+
}
|
|
1370
|
+
tailSinces[m] = pointed && from >= 0 && addedIds.length + changedIds.length === 0 ? -2 : from;
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1069
1373
|
let from = 1;
|
|
1070
1374
|
for (;;) {
|
|
1071
1375
|
const to = Math.min(claimed + tailChunk, end);
|
|
@@ -1105,16 +1409,25 @@ type Columned = Extract<Layout, { readonly stride: number }>;
|
|
|
1105
1409
|
/** A storage over a snapshot's column, or of values only this thread holds, with ticks of its own for `ticked` rows. */
|
|
1106
1410
|
const localStorage = (component: number, layout: Layout, views: Views, values: unknown[], ticked: number, strings: StringStore): ThreadStorage => {
|
|
1107
1411
|
const chunks = ticked === 0 ? 0 : (ticked >> chunkShift) + 1;
|
|
1412
|
+
const blocks = ticked === 0 ? 0 : (ticked >> blockShift) + 1;
|
|
1108
1413
|
return {
|
|
1109
1414
|
component, layout, views, strings: layout.kind === "string" ? strings : null, values, ...writeOf(layout), tags: noTags, ticked: ticked > 0,
|
|
1110
1415
|
added: ticked === 0 ? noTicks : new Float64Array(ticked), changed: ticked === 0 ? noTicks : new Float64Array(ticked),
|
|
1111
1416
|
chunkAdded: chunks === 0 ? noTicks : new Float64Array(chunks), chunkChanged: chunks === 0 ? noTicks : new Float64Array(chunks),
|
|
1417
|
+
blockAdded: blocks === 0 ? noTicks : new Float64Array(blocks), blockChanged: blocks === 0 ? noTicks : new Float64Array(blocks),
|
|
1112
1418
|
};
|
|
1113
1419
|
};
|
|
1114
1420
|
|
|
1421
|
+
/** What a lookup reads and requires: its reads but its optional components, which an entity it finds may lack. */
|
|
1422
|
+
const requiredReads = (host: RunnerHost, lookup: SystemLookupLists): readonly number[] => {
|
|
1423
|
+
const optional = "optional" in lookup ? lookup.optional ?? [] : [];
|
|
1424
|
+
return (lookup.read ?? []).filter(key => !optional.includes(key)).map(host.numberOf);
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1115
1427
|
/** A lookup returning `read` values keyed by component, from this thread's views. */
|
|
1116
|
-
const lookupOf = (host: RunnerHost, lookup:
|
|
1428
|
+
const lookupOf = (host: RunnerHost, lookup: SystemLookupLists) => {
|
|
1117
1429
|
const read = (lookup.read ?? []).map(host.numberOf);
|
|
1430
|
+
const required = requiredReads(host, lookup);
|
|
1118
1431
|
const has = ("has" in lookup ? lookup.has ?? [] : []).map(host.numberOf);
|
|
1119
1432
|
const not = ("not" in lookup ? lookup.not ?? [] : []).map(host.numberOf);
|
|
1120
1433
|
const keys = lookup.read ?? [];
|
|
@@ -1125,7 +1438,7 @@ const lookupOf = (host: RunnerHost, lookup: SystemLookup) => {
|
|
|
1125
1438
|
const archetype = host.archetypeAt(table.archetype[index]);
|
|
1126
1439
|
if (archetype === undefined || archetype.resource) return null;
|
|
1127
1440
|
const { components } = archetype;
|
|
1128
|
-
for (const id of
|
|
1441
|
+
for (const id of required) if (!components.includes(id)) return null;
|
|
1129
1442
|
for (const id of has) if (!components.includes(id)) return null;
|
|
1130
1443
|
for (const id of not) if (components.includes(id)) return null;
|
|
1131
1444
|
const row = table.row[index];
|
|
@@ -1139,7 +1452,7 @@ const lookupOf = (host: RunnerHost, lookup: SystemLookup) => {
|
|
|
1139
1452
|
};
|
|
1140
1453
|
|
|
1141
1454
|
/** A lookup reading nothing, from this thread's views: the shared empty row for every entity it finds. */
|
|
1142
|
-
const emptyLookupOf = (host: RunnerHost, lookup:
|
|
1455
|
+
const emptyLookupOf = (host: RunnerHost, lookup: SystemLookupLists) => {
|
|
1143
1456
|
const has = ("has" in lookup ? lookup.has ?? [] : []).map(host.numberOf);
|
|
1144
1457
|
const not = ("not" in lookup ? lookup.not ?? [] : []).map(host.numberOf);
|
|
1145
1458
|
return (entity: Entity): object | null => {
|
|
@@ -1160,8 +1473,9 @@ const emptyLookupOf = (host: RunnerHost, lookup: SystemLookup) => {
|
|
|
1160
1473
|
* a component `watched` names may have changed in it after `since`. A GPU kernel's column stamps reach this thread as
|
|
1161
1474
|
* row ticks; a component keeping no ticks counts as changed.
|
|
1162
1475
|
*/
|
|
1163
|
-
const changedLookupOf = (host: RunnerHost, lookup:
|
|
1476
|
+
const changedLookupOf = (host: RunnerHost, lookup: SystemLookupLists, watched: readonly Key[], since: Since) => {
|
|
1164
1477
|
const read = (lookup.read ?? []).map(host.numberOf);
|
|
1478
|
+
const required = requiredReads(host, lookup);
|
|
1165
1479
|
const has = ("has" in lookup ? lookup.has ?? [] : []).map(host.numberOf);
|
|
1166
1480
|
const not = ("not" in lookup ? lookup.not ?? [] : []).map(host.numberOf);
|
|
1167
1481
|
const ids = watched.map(host.numberOf);
|
|
@@ -1174,7 +1488,7 @@ const changedLookupOf = (host: RunnerHost, lookup: SystemLookup, watched: readon
|
|
|
1174
1488
|
const archetype = host.archetypeAt(table.archetype[index]);
|
|
1175
1489
|
if (archetype === undefined || archetype.resource) return null;
|
|
1176
1490
|
const { components, storageById } = archetype;
|
|
1177
|
-
for (const id of
|
|
1491
|
+
for (const id of required) if (!components.includes(id)) return null;
|
|
1178
1492
|
for (const id of has) if (!components.includes(id)) return null;
|
|
1179
1493
|
for (const id of not) if (components.includes(id)) return null;
|
|
1180
1494
|
const row = table.row[index];
|
|
@@ -1193,7 +1507,7 @@ const changedLookupOf = (host: RunnerHost, lookup: SystemLookup, watched: readon
|
|
|
1193
1507
|
};
|
|
1194
1508
|
|
|
1195
1509
|
/** The lookup by entity a declaration chooses, once: with `changed`, reading nothing, or reading values. */
|
|
1196
|
-
const entityLookupOf = (host: RunnerHost, lookup:
|
|
1510
|
+
const entityLookupOf = (host: RunnerHost, lookup: SystemLookupLists, since: Since) => {
|
|
1197
1511
|
const watched = "index" in lookup ? undefined : lookup.changed;
|
|
1198
1512
|
if (watched !== undefined) return changedLookupOf(host, lookup, watched, since);
|
|
1199
1513
|
return (lookup.read ?? []).length === 0 ? emptyLookupOf(host, lookup) : lookupOf(host, lookup);
|