@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,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
import { blockShift, chunkShift, type Program } from './kernel.js';
|
|
2
3
|
import type { Reduction } from '../../interface/resource/reduction.js';
|
|
3
4
|
import type { View } from '../../interface/registry/layout.js';
|
|
4
5
|
import { withoutIntrinsics } from './intrinsics.js';
|
|
@@ -24,8 +25,18 @@ export type WasmColumn = {
|
|
|
24
25
|
readonly muted?: boolean;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
|
-
/**
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* A scalar parameter: a leaf of a resource or of `args`, the same for every call of a run, or of the call's archetype's
|
|
30
|
+
* value of a shared component, `KernelDescription.shared[index]`, in `scalars` order.
|
|
31
|
+
*/
|
|
32
|
+
export type WasmScalar =
|
|
33
|
+
| { readonly source: "resource"; readonly index: number; readonly path: readonly (number | string)[] }
|
|
34
|
+
| { readonly source: "args"; readonly path: readonly (number | string)[] }
|
|
35
|
+
| { readonly source: "shared"; readonly index: number; readonly path: readonly (number | string)[] };
|
|
36
|
+
|
|
37
|
+
/** The scalar parameter a resource's, the input's or a shared value's leaf is read from. */
|
|
38
|
+
export const scalarOfExpression = (expression: { readonly kind: "resource" | "shared"; readonly index: number; readonly path: readonly (number | string)[] } | { readonly kind: "args"; readonly path: readonly (number | string)[] }): WasmScalar =>
|
|
39
|
+
expression.kind === "args" ? { source: "args", path: expression.path } : { source: expression.kind, index: expression.index, path: expression.path };
|
|
29
40
|
|
|
30
41
|
/**
|
|
31
42
|
* A lookup's directory in shared memory: one record of `1 + reads + watched` i32 words per archetype id, a match flag,
|
|
@@ -77,7 +88,7 @@ export type WasmKernel = {
|
|
|
77
88
|
readonly scalars: readonly WasmScalar[];
|
|
78
89
|
/** The JS functions it imports, by name. */
|
|
79
90
|
readonly imports: readonly string[];
|
|
80
|
-
/** Whether it runs
|
|
91
|
+
/** Whether it runs rows several at a time with SIMD: in f32 at storage precision, or in f64 as the body computes. */
|
|
81
92
|
readonly vectorized: boolean;
|
|
82
93
|
};
|
|
83
94
|
|
|
@@ -90,16 +101,22 @@ const operations: { readonly [name: string]: (a: number, b: number) => number }
|
|
|
90
101
|
power: (a, b) => a ** b,
|
|
91
102
|
};
|
|
92
103
|
|
|
93
|
-
/**
|
|
94
|
-
export const
|
|
95
|
-
|
|
104
|
+
/** No shared values: a call of a kernel reading none, or before its archetype is known. */
|
|
105
|
+
export const noSharedValues: readonly unknown[] = [];
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Reads a scalar parameter's value from the resources and args of a run, and the shared values of the call's
|
|
109
|
+
* archetype; booleans become 0 or 1.
|
|
110
|
+
*/
|
|
111
|
+
export const scalarValue = (scalar: WasmScalar, resources: readonly unknown[], args: unknown, shared: readonly unknown[] = noSharedValues): number => {
|
|
112
|
+
let value: unknown = scalar.source === "args" ? args : scalar.source === "shared" ? shared[scalar.index] : resources[scalar.index];
|
|
96
113
|
for (const key of scalar.path) value = typeof value === "object" && value !== null ? Reflect.get(value, key) : undefined;
|
|
97
114
|
return Number(value);
|
|
98
115
|
};
|
|
99
116
|
|
|
100
|
-
/** Reads each scalar parameter's value from the resources and args of a run. */
|
|
101
|
-
export const scalarValues = (scalars: readonly WasmScalar[], resources: readonly unknown[], args: unknown): number[] =>
|
|
102
|
-
scalars.map(scalar => scalarValue(scalar, resources, args));
|
|
117
|
+
/** Reads each scalar parameter's value from the resources and args of a run, and a call's shared values. */
|
|
118
|
+
export const scalarValues = (scalars: readonly WasmScalar[], resources: readonly unknown[], args: unknown, shared: readonly unknown[] = noSharedValues): number[] =>
|
|
119
|
+
scalars.map(scalar => scalarValue(scalar, resources, args, shared));
|
|
103
120
|
|
|
104
121
|
/** The `run` export of an instantiated kernel module: `lastRun` below 0 passes every row. */
|
|
105
122
|
export type WasmRun = (start: number, end: number, tick: number, lastRun: number, ...values: number[]) => void;
|
|
@@ -132,7 +149,7 @@ const op = {
|
|
|
132
149
|
i32Const: 0x41, f64Const: 0x44, i32ReinterpretF32: 0xbc, i64ReinterpretF64: 0xbd, i32LtU: 0x49, i32GtU: 0x4b, i32LeU: 0x4d, i32GtS: 0x4a, f64Load2: 0x2b,
|
|
133
150
|
i32Eqz: 0x45, i32GeS: 0x4e,
|
|
134
151
|
f64Eq: 0x61, f64Ne: 0x62, f64Lt: 0x63, f64Gt: 0x64, f64Le: 0x65, f64Ge: 0x66,
|
|
135
|
-
i32Eq: 0x46, i32LtS: 0x48, i32LeS: 0x4c, i32Clz: 0x67, i32Add: 0x6a, i32Sub: 0x6b, i32Mul: 0x6c, i32And: 0x71, i32Or: 0x72, i32Xor: 0x73, i32Shl: 0x74, i32ShrS: 0x75, i32ShrU: 0x76,
|
|
152
|
+
i32Eq: 0x46, i32LtS: 0x48, i32LeS: 0x4c, i32Clz: 0x67, i32Ctz: 0x68, i32Popcnt: 0x69, i32Add: 0x6a, i32Sub: 0x6b, i32Mul: 0x6c, i32And: 0x71, i32Or: 0x72, i32Xor: 0x73, i32Shl: 0x74, i32ShrS: 0x75, i32ShrU: 0x76,
|
|
136
153
|
f64Abs: 0x99, f64Neg: 0x9a, f64Ceil: 0x9b, f64Floor: 0x9c, f64Trunc: 0x9d, f64Sqrt: 0x9f,
|
|
137
154
|
f64Add: 0xa0, f64Sub: 0xa1, f64Mul: 0xa2, f64Div: 0xa3, f64Min: 0xa4, f64Max: 0xa5,
|
|
138
155
|
i32WrapI64: 0xa7, i32GeU: 0x4f, i32Ne: 0x47, i64Const: 0x42, i64ShrU: 0x88, i64RemS: 0x81, f64ConvertI64S: 0xb9, f64Copysign: 0xa6, f32DemoteF64: 0xb6, f64ConvertI32S: 0xb7, f64ConvertI32U: 0xb8, f64PromoteF32: 0xbb,
|
|
@@ -173,8 +190,16 @@ const vector = (items: readonly (readonly number[])[]): number[] => [...unsigned
|
|
|
173
190
|
const section = (id: number, content: readonly number[]): number[] => [id, ...unsigned(content.length), ...content];
|
|
174
191
|
|
|
175
192
|
|
|
176
|
-
/**
|
|
177
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Thrown inside generation when a program needs something WASM can't match exactly, saying what; the JS kernel is used
|
|
195
|
+
* instead. Only failing generation makes one.
|
|
196
|
+
*/
|
|
197
|
+
const reasons = new WeakMap<object, string>();
|
|
198
|
+
const unsupported = (reason: string): Error => {
|
|
199
|
+
const error = new Error(reason);
|
|
200
|
+
reasons.set(error, reason);
|
|
201
|
+
return error;
|
|
202
|
+
};
|
|
178
203
|
/** Thrown when a program can't run four rows at a time; the scalar loop handles every row instead. */
|
|
179
204
|
const notVectorizable = Symbol("notVectorizable");
|
|
180
205
|
|
|
@@ -194,7 +219,19 @@ const rotated = {
|
|
|
194
219
|
*
|
|
195
220
|
* The exported `run(start, end, tick, ...columnAddresses, ...scalars)` processes rows `start` to `end`.
|
|
196
221
|
*/
|
|
197
|
-
export const generateWasm = (
|
|
222
|
+
export const generateWasm = (...parameters: Parameters<typeof generateWasmOrReason>): WasmKernel | null => {
|
|
223
|
+
const generated = generateWasmOrReason(...parameters);
|
|
224
|
+
return typeof generated === "string" ? null : generated;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/** A WAT identifier's characters: a name's others become `_`. */
|
|
228
|
+
const identifierOf = (text: string): string => text.replace(/[^A-Za-z0-9_.]/g, "_");
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* As `generateWasm`, or why exact equivalence can't be guaranteed. `named` appends a name section naming the function,
|
|
232
|
+
* its imports, parameters and locals, for printing it as text; the world never asks for one.
|
|
233
|
+
*/
|
|
234
|
+
export const generateWasmOrReason = (
|
|
198
235
|
source: Program,
|
|
199
236
|
columns: readonly WasmColumn[],
|
|
200
237
|
scalarTypes: (scalar: WasmScalar) => Type | null,
|
|
@@ -209,7 +246,13 @@ export const generateWasm = (
|
|
|
209
246
|
indexLookups: readonly (WasmIndexLookup | null)[] = [],
|
|
210
247
|
/** By probe, its lookup: `KernelDescription.probes[k].lookup`. */
|
|
211
248
|
probeLookups: readonly number[] = [],
|
|
212
|
-
|
|
249
|
+
/**
|
|
250
|
+
* Whether SIMD lanes may compute at storage precision, as only an explicit kernel's may: f32 rounds each step.
|
|
251
|
+
* Without it lanes are f64, two values a vector, promoted from f32 and demoted only on store, as the body computes.
|
|
252
|
+
*/
|
|
253
|
+
storagePrecision = true,
|
|
254
|
+
named = false,
|
|
255
|
+
): WasmKernel | string => {
|
|
213
256
|
const program = withoutIntrinsics(source);
|
|
214
257
|
const scalars: WasmScalar[] = [];
|
|
215
258
|
const scalarIndex = new Map<string, number>();
|
|
@@ -218,7 +261,7 @@ export const generateWasm = (
|
|
|
218
261
|
const key = JSON.stringify(scalar);
|
|
219
262
|
let index = scalarIndex.get(key);
|
|
220
263
|
if (index === undefined) {
|
|
221
|
-
if (scalarTypes(scalar) === null) throw unsupported;
|
|
264
|
+
if (scalarTypes(scalar) === null) throw unsupported("it reads a resource or input value that isn't a number or boolean");
|
|
222
265
|
index = scalars.length;
|
|
223
266
|
scalars.push(scalar);
|
|
224
267
|
scalarIndex.set(key, index);
|
|
@@ -242,7 +285,7 @@ export const generateWasm = (
|
|
|
242
285
|
const lookupOfHandle = new Map<number, number>();
|
|
243
286
|
const claim = (handle: number, lookup: number): void => {
|
|
244
287
|
const existing = lookupOfHandle.get(handle);
|
|
245
|
-
if ((existing !== undefined && existing !== lookup) || lookup >= lookups.length) throw unsupported;
|
|
288
|
+
if ((existing !== undefined && existing !== lookup) || lookup >= lookups.length) throw unsupported("it reads one lookup's result through another lookup");
|
|
246
289
|
lookupOfHandle.set(handle, lookup);
|
|
247
290
|
};
|
|
248
291
|
/** Each probe's lookup, by the probe's index. */
|
|
@@ -252,13 +295,13 @@ export const generateWasm = (
|
|
|
252
295
|
if (statement.kind === "find") claim(statement.handle, statement.lookup);
|
|
253
296
|
else if (statement.kind === "probe") {
|
|
254
297
|
const lookup = lookupOfProbe.get(statement.probe);
|
|
255
|
-
if (lookup === undefined || indexLookups[lookup] === null || indexLookups[lookup] === undefined) throw unsupported;
|
|
298
|
+
if (lookup === undefined || indexLookups[lookup] === null || indexLookups[lookup] === undefined) throw unsupported("it probes a lookup that isn't through an index");
|
|
256
299
|
claim(statement.list, lookup);
|
|
257
300
|
claim(statement.first, lookup);
|
|
258
301
|
}
|
|
259
302
|
else if (statement.kind === "listRow") {
|
|
260
303
|
const lookup = lookupOfHandle.get(statement.list);
|
|
261
|
-
if (lookup === undefined) throw unsupported;
|
|
304
|
+
if (lookup === undefined) throw unsupported("it reads a row of a list no lookup gave");
|
|
262
305
|
claim(statement.row, lookup);
|
|
263
306
|
}
|
|
264
307
|
else if (statement.kind === "if") { collectFinds(statement.consequent); collectFinds(statement.alternate); }
|
|
@@ -273,7 +316,7 @@ export const generateWasm = (
|
|
|
273
316
|
case "number": return "number";
|
|
274
317
|
case "boolean": return "boolean";
|
|
275
318
|
case "column": return columns[expression.column].boolean ? "boolean" : "number";
|
|
276
|
-
case "resource": case "args":
|
|
319
|
+
case "resource": case "args": case "shared": return scalarTypes(scalarOfExpression(expression)) ?? "mixed";
|
|
277
320
|
case "local": return localTypes[expression.local] ?? "number";
|
|
278
321
|
case "unary": return expression.operator === "!" ? "boolean" : "number";
|
|
279
322
|
case "binary": return ["<", ">", "<=", ">=", "==", "!=", "===", "!=="].includes(expression.operator) ? "boolean" : "number";
|
|
@@ -296,7 +339,7 @@ export const generateWasm = (
|
|
|
296
339
|
return leaf?.column.boolean === true ? "boolean" : "number";
|
|
297
340
|
}
|
|
298
341
|
// Regions are inlined before generating.
|
|
299
|
-
case "lane": throw unsupported;
|
|
342
|
+
case "lane": throw unsupported("it reads a GPU builtin's lane");
|
|
300
343
|
}
|
|
301
344
|
};
|
|
302
345
|
const inferLocals = (statements: readonly Statement[]): boolean => {
|
|
@@ -351,18 +394,23 @@ export const generateWasm = (
|
|
|
351
394
|
};
|
|
352
395
|
while (inferIntegral(program.body));
|
|
353
396
|
|
|
354
|
-
// Parameters: start, end, tick, lastRun, column addresses, filter row
|
|
397
|
+
// Parameters: start, end, tick, lastRun, column addresses, filter row, chunk and block tick addresses, scalars, and with reductions the partials address.
|
|
355
398
|
const columnParameter = (column: number): number => 4 + column;
|
|
356
399
|
const filterRowParameter = (filter: number): number => 4 + columns.length + filter;
|
|
357
400
|
const filterChunkParameter = (filter: number): number => 4 + columns.length + filters + filter;
|
|
401
|
+
const filterBlockParameter = (filter: number): number => 4 + columns.length + 2 * filters + filter;
|
|
402
|
+
/** Parameters before the lookups': the fixed four, the columns' and the filters'. */
|
|
403
|
+
const beforeLookups = 4 + columns.length + 3 * filters;
|
|
358
404
|
/**
|
|
359
405
|
* With lookups: the entity table (archetype, row and generation addresses, then its length), then each lookup's
|
|
360
406
|
* directory address and record count, all as f64 so workers pass them like scalars.
|
|
361
407
|
*/
|
|
362
408
|
const lookupParameters = lookups.length === 0 ? 0 : 4 + 2 * lookups.length + (watching ? 1 : 0);
|
|
363
|
-
const lookupParameter = (index: number): number =>
|
|
409
|
+
const lookupParameter = (index: number): number => beforeLookups + index;
|
|
364
410
|
/** For `up`: the rows' and their parents' rows' addresses, whether there's a parent, then each parent column's address. */
|
|
365
411
|
const upMode = program.up === true;
|
|
412
|
+
// Its runner passes an `up` kernel only the rows that pass, and the filter loops step the row, not its list slot.
|
|
413
|
+
if (upMode && filters > 0) throw new Error("A WASM kernel reading `up` takes no change filters: its runner lists only the rows that pass.");
|
|
366
414
|
const upParameters = upMode ? 3 + upColumns.length : 0;
|
|
367
415
|
/** Each lookup through an index's parameters, after the lookup parameters: `indexParameterCount` of them, as f64. */
|
|
368
416
|
const indexOffsets: number[] = [];
|
|
@@ -372,11 +420,16 @@ export const generateWasm = (
|
|
|
372
420
|
const index = indexLookups[lookup];
|
|
373
421
|
if (index !== null && index !== undefined) indexParameters += indexParameterCount(index);
|
|
374
422
|
}
|
|
375
|
-
const indexParameter = (lookup: number, index: number): number =>
|
|
376
|
-
const upParameter = (index: number): number =>
|
|
377
|
-
const scalarParameter = (index: number): number =>
|
|
423
|
+
const indexParameter = (lookup: number, index: number): number => beforeLookups + lookupParameters + indexOffsets[lookup] + index;
|
|
424
|
+
const upParameter = (index: number): number => beforeLookups + lookupParameters + indexParameters + index;
|
|
425
|
+
const scalarParameter = (index: number): number => beforeLookups + lookupParameters + indexParameters + upParameters + index;
|
|
378
426
|
const code: number[] = [];
|
|
379
427
|
const extraLocals: number[] = [];
|
|
428
|
+
/**
|
|
429
|
+
* Values the same for every row that call an import, by the expression: each computed once per call, before the
|
|
430
|
+
* rows, into the local it maps to. They're pure, so computing one a branch skips changes nothing.
|
|
431
|
+
*/
|
|
432
|
+
const hoisted = new Map<Expression, number>();
|
|
380
433
|
let localBase = 0;
|
|
381
434
|
const local = (index: number): number => localBase + index;
|
|
382
435
|
const scratch = (type: number): number => {
|
|
@@ -413,13 +466,17 @@ export const generateWasm = (
|
|
|
413
466
|
};
|
|
414
467
|
|
|
415
468
|
const emit = (expression: Expression): void => {
|
|
469
|
+
const hoistedLocal = hoisted.get(expression);
|
|
470
|
+
if (hoistedLocal !== undefined) {
|
|
471
|
+
code.push(op.localGet, ...unsigned(hoistedLocal));
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
416
474
|
switch (expression.kind) {
|
|
417
475
|
case "number": code.push(op.f64Const, ...float64(expression.value)); return;
|
|
418
476
|
case "boolean": code.push(op.f64Const, ...float64(expression.value ? 1 : 0)); return;
|
|
419
477
|
case "local": code.push(op.localGet, ...unsigned(local(expression.local))); return;
|
|
420
|
-
case "resource": case "args": {
|
|
421
|
-
|
|
422
|
-
code.push(op.localGet, ...unsigned(scalarParameter(scalarOf(scalar))));
|
|
478
|
+
case "resource": case "args": case "shared": {
|
|
479
|
+
code.push(op.localGet, ...unsigned(scalarParameter(scalarOf(scalarOfExpression(expression)))));
|
|
423
480
|
return;
|
|
424
481
|
}
|
|
425
482
|
case "upFound": code.push(op.localGet, ...unsigned(upParameter(2)), op.f64ConvertI32U); return;
|
|
@@ -494,7 +551,7 @@ export const generateWasm = (
|
|
|
494
551
|
const emitMath = (functionName: string, parameters: readonly Expression[]): void => {
|
|
495
552
|
if (!native.has(functionName)) {
|
|
496
553
|
// Imported functions take two f64s; unary ones ignore the second.
|
|
497
|
-
if (parameters.length > 2) throw unsupported;
|
|
554
|
+
if (parameters.length > 2) throw unsupported(`it calls Math.${functionName} with more than two arguments, and WASM imports it taking two`);
|
|
498
555
|
for (const parameter of parameters) emit(parameter);
|
|
499
556
|
for (let i = parameters.length; i < 2; i++) code.push(op.f64Const, ...float64(NaN));
|
|
500
557
|
emitCall(functionName);
|
|
@@ -533,7 +590,7 @@ export const generateWasm = (
|
|
|
533
590
|
default: {
|
|
534
591
|
emit(parameters[0] ?? { kind: "number", value: NaN });
|
|
535
592
|
const unary = { abs: op.f64Abs, sqrt: op.f64Sqrt, floor: op.f64Floor, ceil: op.f64Ceil, trunc: op.f64Trunc }[functionName];
|
|
536
|
-
if (unary === undefined) throw unsupported;
|
|
593
|
+
if (unary === undefined) throw unsupported(`it calls Math.${functionName}, which WASM has no instruction for`);
|
|
537
594
|
code.push(unary);
|
|
538
595
|
}
|
|
539
596
|
}
|
|
@@ -548,7 +605,7 @@ export const generateWasm = (
|
|
|
548
605
|
if (operator === "===" || operator === "!==") {
|
|
549
606
|
const leftType = typeOf(left);
|
|
550
607
|
const rightType = typeOf(right);
|
|
551
|
-
if (leftType === "mixed" || rightType === "mixed") throw unsupported;
|
|
608
|
+
if (leftType === "mixed" || rightType === "mixed") throw unsupported("it compares with === or !== a value that may be a boolean or a number");
|
|
552
609
|
// A boolean never strictly equals a number. Operands are pure, so they needn't be evaluated.
|
|
553
610
|
if (leftType !== rightType) {
|
|
554
611
|
code.push(op.f64Const, ...float64(operator === "===" ? 0 : 1));
|
|
@@ -562,6 +619,19 @@ export const generateWasm = (
|
|
|
562
619
|
code.push(op.localTee, ...unsigned(dividend), ...i64TruncSatF64S, op.i64Const, ...signed(right.value), op.i64RemS, op.f64ConvertI64S, op.localGet, ...unsigned(dividend), op.f64Copysign);
|
|
563
620
|
return;
|
|
564
621
|
}
|
|
622
|
+
// Any dividend by a nonzero integer literal: exactly as above while the dividend is an integer below 2^53 in
|
|
623
|
+
// magnitude, which the row checks, and through the import otherwise.
|
|
624
|
+
if (operator === "%" && right.kind === "number" && right.value !== 0 && integral(right)) {
|
|
625
|
+
const dividend = scratch(f64Type);
|
|
626
|
+
emit(left);
|
|
627
|
+
code.push(op.localTee, ...unsigned(dividend), op.f64Trunc, op.localGet, ...unsigned(dividend), op.f64Eq);
|
|
628
|
+
code.push(op.localGet, ...unsigned(dividend), op.f64Abs, op.f64Const, ...float64(2 ** 53), op.f64Lt, op.i32And);
|
|
629
|
+
code.push(op.if, f64Type, op.localGet, ...unsigned(dividend), ...i64TruncSatF64S, op.i64Const, ...signed(right.value), op.i64RemS, op.f64ConvertI64S, op.localGet, ...unsigned(dividend), op.f64Copysign);
|
|
630
|
+
code.push(op.else, op.localGet, ...unsigned(dividend), op.f64Const, ...float64(right.value));
|
|
631
|
+
emitCall("remainder");
|
|
632
|
+
code.push(op.end);
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
565
635
|
if (operator === "%" || operator === "**") {
|
|
566
636
|
emit(left);
|
|
567
637
|
emit(right);
|
|
@@ -592,7 +662,7 @@ export const generateWasm = (
|
|
|
592
662
|
for (let i = labels.length - 1; i >= 0; i--) {
|
|
593
663
|
if (labels[i] === "program" && ++seen === depth) return labels.length - 1 - i;
|
|
594
664
|
}
|
|
595
|
-
throw unsupported;
|
|
665
|
+
throw unsupported("it branches to a block that isn't there");
|
|
596
666
|
};
|
|
597
667
|
|
|
598
668
|
const store = (column: number, value: Expression | "tick"): void => {
|
|
@@ -610,31 +680,34 @@ export const generateWasm = (
|
|
|
610
680
|
};
|
|
611
681
|
|
|
612
682
|
/**
|
|
613
|
-
* Chunk columns stamped by every row: top-level stamps with no
|
|
614
|
-
* Their chunks are stamped once per call, for the whole
|
|
683
|
+
* Chunk and block columns stamped by every row, by the shift from a row to its element: top-level stamps with no
|
|
684
|
+
* `next` before them, in an unfiltered kernel. Their chunks and blocks are stamped once per call, for the whole
|
|
685
|
+
* range, instead of on each row.
|
|
615
686
|
*/
|
|
616
|
-
const everyRow = new
|
|
617
|
-
// Listed rows needn't be consecutive, so each stamps its own chunk.
|
|
687
|
+
const everyRow = new Map<number, number>();
|
|
688
|
+
// Listed rows needn't be consecutive, so each stamps its own chunk and block.
|
|
618
689
|
if (filters === 0 && !upMode) {
|
|
619
690
|
const ends = (statement: Statement): boolean =>
|
|
620
691
|
statement.kind === "next" || (statement.kind === "if" && (statement.consequent.some(ends) || statement.alternate.some(ends)))
|
|
621
692
|
|| ((statement.kind === "block" || statement.kind === "loop") && statement.body.some(ends));
|
|
622
693
|
for (const statement of program.body) {
|
|
623
694
|
if (ends(statement)) break;
|
|
624
|
-
if (statement.kind
|
|
695
|
+
if (statement.kind !== "stamp") continue;
|
|
696
|
+
if (columns[statement.blocks].muted !== true) everyRow.set(statement.blocks, blockShift);
|
|
697
|
+
if (columns[statement.chunks].muted !== true) everyRow.set(statement.chunks, chunkShift);
|
|
625
698
|
}
|
|
626
699
|
}
|
|
627
|
-
/** Stamps every chunk from `start`'s to `end - 1`'s, for the chunk columns every row stamps. */
|
|
700
|
+
/** Stamps every chunk or block from `start`'s to `end - 1`'s, for the chunk and block columns every row stamps. */
|
|
628
701
|
const stampRangeChunks = (): void => {
|
|
629
|
-
for (const
|
|
702
|
+
for (const [dense, shift] of everyRow) {
|
|
630
703
|
const chunk = scratch(i32Type);
|
|
631
704
|
const last = scratch(i32Type);
|
|
632
|
-
// if (start < end) for (chunk = start >> shift; chunk <= (end - 1) >> shift; chunk++)
|
|
705
|
+
// if (start < end) for (chunk = start >> shift; chunk <= (end - 1) >> shift; chunk++) dense[chunk] = tick
|
|
633
706
|
code.push(op.localGet, 0, op.localGet, 1, op.i32LtS, op.if, 0x40);
|
|
634
|
-
code.push(op.localGet, 0, op.i32Const, ...signed(
|
|
635
|
-
code.push(op.localGet, 1, op.i32Const, 1, op.i32Sub, op.i32Const, ...signed(
|
|
707
|
+
code.push(op.localGet, 0, op.i32Const, ...signed(shift), op.i32ShrU, op.localSet, ...unsigned(chunk));
|
|
708
|
+
code.push(op.localGet, 1, op.i32Const, 1, op.i32Sub, op.i32Const, ...signed(shift), op.i32ShrU, op.localSet, ...unsigned(last));
|
|
636
709
|
code.push(op.loop, 0x40);
|
|
637
|
-
code.push(op.localGet, ...unsigned(columnParameter(
|
|
710
|
+
code.push(op.localGet, ...unsigned(columnParameter(dense)), op.localGet, ...unsigned(chunk), op.i32Const, 3, op.i32Shl, op.i32Add, op.localGet, 2, op.f64Store, 3, 0);
|
|
638
711
|
code.push(op.localGet, ...unsigned(chunk), op.i32Const, 1, op.i32Add, op.localTee, ...unsigned(chunk), op.localGet, ...unsigned(last), op.i32LeS, op.brIf, 0);
|
|
639
712
|
code.push(op.end, op.end);
|
|
640
713
|
}
|
|
@@ -744,12 +817,12 @@ export const generateWasm = (
|
|
|
744
817
|
const emitLookupLeaf = (handle: number, read: number, path: readonly (number | string)[]): void => {
|
|
745
818
|
const lookup = lookupOfHandle.get(handle);
|
|
746
819
|
if (lookup !== undefined && isChanged(lookup, read)) {
|
|
747
|
-
if (path.length > 0) throw unsupported;
|
|
820
|
+
if (path.length > 0) throw unsupported("it reads a field of a lookup's changed flag");
|
|
748
821
|
emitChanged(handle, lookup);
|
|
749
822
|
return;
|
|
750
823
|
}
|
|
751
824
|
const leaf = lookup === undefined ? null : lookups[lookup].leaf(read, path);
|
|
752
|
-
if (leaf === null) throw unsupported;
|
|
825
|
+
if (leaf === null) throw unsupported("it reads a value of a lookup that isn't a number or boolean in linear memory");
|
|
753
826
|
const { view, stride, offset, boolean } = leaf;
|
|
754
827
|
code.push(op.localGet, ...unsigned(handleLocal(handle, "found")), op.if, f64Type);
|
|
755
828
|
labels.push("if");
|
|
@@ -803,7 +876,7 @@ export const generateWasm = (
|
|
|
803
876
|
const indexOf = (handle: number): { readonly lookup: number; readonly index: WasmIndexLookup } => {
|
|
804
877
|
const lookup = lookupOfHandle.get(handle);
|
|
805
878
|
const index = lookup === undefined ? undefined : indexLookups[lookup];
|
|
806
|
-
if (lookup === undefined || index === null || index === undefined) throw unsupported;
|
|
879
|
+
if (lookup === undefined || index === null || index === undefined) throw unsupported("it reads a list of a lookup that isn't through an index");
|
|
807
880
|
return { lookup, index };
|
|
808
881
|
};
|
|
809
882
|
/** A list handle's i32 locals: a hash list's start, length and bucket; a sorted list's runs and cursor. */
|
|
@@ -992,12 +1065,12 @@ export const generateWasm = (
|
|
|
992
1065
|
const emitProbe = (list: number, first: number, probe: number, values: readonly Expression[]): void => {
|
|
993
1066
|
const { lookup, index } = indexOf(list);
|
|
994
1067
|
const plan = index.probe(probe);
|
|
995
|
-
if (plan === null) throw unsupported;
|
|
1068
|
+
if (plan === null) throw unsupported("it looks up an index by a key WASM can't encode");
|
|
996
1069
|
let next = 0;
|
|
997
1070
|
const encode = (targets: readonly WasmKeyValue[]): void => {
|
|
998
1071
|
for (const target of targets) {
|
|
999
1072
|
const value = values[next++];
|
|
1000
|
-
if (value === undefined) throw unsupported;
|
|
1073
|
+
if (value === undefined) throw unsupported("it looks up an index with fewer values than its key has");
|
|
1001
1074
|
emit(value);
|
|
1002
1075
|
encodeKey(lookup, target);
|
|
1003
1076
|
}
|
|
@@ -1072,7 +1145,7 @@ export const generateWasm = (
|
|
|
1072
1145
|
emitBound(lookup, index, comparison.words, false, unequalLow, list);
|
|
1073
1146
|
emitBound(lookup, index, comparison.words, true, unequalHigh, list);
|
|
1074
1147
|
break;
|
|
1075
|
-
default: throw unsupported;
|
|
1148
|
+
default: throw unsupported(`it compares an index's key with ${comparison.operator}, which WASM's lookups don't`);
|
|
1076
1149
|
}
|
|
1077
1150
|
}
|
|
1078
1151
|
// An empty range, and without `!=`'s, one run; with it, the rows before and after the value.
|
|
@@ -1224,7 +1297,7 @@ export const generateWasm = (
|
|
|
1224
1297
|
const emitRowLeaf = (row: number, leaf: number): void => {
|
|
1225
1298
|
const { index } = indexOf(row);
|
|
1226
1299
|
const found = index.rowLeaf(leaf);
|
|
1227
|
-
if (found === null) throw unsupported;
|
|
1300
|
+
if (found === null) throw unsupported("it reads a value of an index's row that isn't stored in linear memory");
|
|
1228
1301
|
// Word 1 is the archetype's entities, so a read's column is at 2 + read.
|
|
1229
1302
|
emitRecordLeaf(row, 2 + found.read, found.column);
|
|
1230
1303
|
};
|
|
@@ -1234,12 +1307,15 @@ export const generateWasm = (
|
|
|
1234
1307
|
emitRecordLeaf(row, 1, { view: "f64", stride: 8, offset: 0, boolean: false });
|
|
1235
1308
|
};
|
|
1236
1309
|
|
|
1237
|
-
/**
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1310
|
+
/**
|
|
1311
|
+
* Sets the chunk or block tick, by `shift`, of the row `rowOffset` rows past the current one, unless it's muted
|
|
1312
|
+
* or every row's is stamped up front.
|
|
1313
|
+
*/
|
|
1314
|
+
const stampDense = (dense: number, shift: number, rowOffset: number): void => {
|
|
1315
|
+
if (columns[dense].muted === true || everyRow.has(dense)) return;
|
|
1316
|
+
code.push(op.localGet, ...unsigned(columnParameter(dense)), op.localGet, ...unsigned(rowLocal));
|
|
1241
1317
|
if (rowOffset !== 0) code.push(op.i32Const, ...signed(rowOffset), op.i32Add);
|
|
1242
|
-
code.push(op.i32Const, ...signed(
|
|
1318
|
+
code.push(op.i32Const, ...signed(shift), op.i32ShrU, op.i32Const, 3, op.i32Shl, op.i32Add, op.localGet, 2, op.f64Store, 3, 0);
|
|
1243
1319
|
};
|
|
1244
1320
|
|
|
1245
1321
|
const statement = (current: Statement): void => {
|
|
@@ -1249,8 +1325,9 @@ export const generateWasm = (
|
|
|
1249
1325
|
// A chunk column stays when its row column is muted, for a component held on the GPU.
|
|
1250
1326
|
case "stamp":
|
|
1251
1327
|
if (columns[current.column].muted !== true) store(current.column, "tick");
|
|
1252
|
-
|
|
1253
|
-
|
|
1328
|
+
stampDense(current.blocks, blockShift, 0);
|
|
1329
|
+
stampDense(current.chunks, chunkShift, 0);
|
|
1330
|
+
return;
|
|
1254
1331
|
case "if":
|
|
1255
1332
|
emit(current.test);
|
|
1256
1333
|
emitTruthy(typeOf(current.test));
|
|
@@ -1284,7 +1361,7 @@ export const generateWasm = (
|
|
|
1284
1361
|
}
|
|
1285
1362
|
};
|
|
1286
1363
|
|
|
1287
|
-
// ---- SIMD.
|
|
1364
|
+
// ---- SIMD. f32 lanes compute at storage precision, so results may differ from the scalar path; f64 lanes don't. ----
|
|
1288
1365
|
|
|
1289
1366
|
const v128Type = 0x7b;
|
|
1290
1367
|
const simd = (operation: number): number[] => [0xfd, ...unsigned(operation)];
|
|
@@ -1293,39 +1370,70 @@ export const generateWasm = (
|
|
|
1293
1370
|
f32Eq: 65, f32Ne: 66, f32Lt: 67, f32Gt: 68, f32Le: 69, f32Ge: 70,
|
|
1294
1371
|
f64Gt: 74, not: 77, and: 78, andNot: 79, or: 80, bitselect: 82, anyTrue: 83,
|
|
1295
1372
|
store32Lane: 90, store64Lane: 91, load32Zero: 92, load64Zero: 93,
|
|
1296
|
-
|
|
1373
|
+
f64Eq: 71, f64Ne: 72, f64Lt: 73, f64Le: 75, f64Ge: 76, f32DemoteF64Zero: 94, f64PromoteLowF32: 95,
|
|
1374
|
+
f32Ceil: 103, f32Floor: 104, f32Trunc: 105, f64Ceil: 116, f64Floor: 117, f64Trunc: 122, i64ExtendLowS: 199, i64ExtendHighS: 200,
|
|
1297
1375
|
f32Abs: 224, f32Neg: 225, f32Sqrt: 227, f32Add: 228, f32Sub: 229, f32Mul: 230, f32Div: 231, f32Min: 232, f32Max: 233,
|
|
1376
|
+
f64Abs: 236, f64Neg: 237, f64Sqrt: 239, f64Add: 240, f64Sub: 241, f64Mul: 242, f64Div: 243, f64Min: 244, f64Max: 245,
|
|
1298
1377
|
} as const;
|
|
1378
|
+
/** f64 lanes: each vector holds two values, each operation the f64 one, so lanes compute as the scalar path does. */
|
|
1379
|
+
const wide = !storagePrecision;
|
|
1380
|
+
/** Bytes of f32 storage one vector covers: four lanes, or two promoted to f64. */
|
|
1381
|
+
const laneBytes = wide ? 8 : 16;
|
|
1299
1382
|
const float32 = (value: number): number[] => [...new Uint8Array(new Float32Array([value]).buffer)];
|
|
1300
|
-
const vectorConstant = (values: readonly number[]): number[] =>
|
|
1383
|
+
const vectorConstant = (values: readonly number[]): number[] => wide
|
|
1384
|
+
? [...simd(vop.const), ...[0, 1].flatMap(lane => float64(values[lane] ?? 0))]
|
|
1385
|
+
: [...simd(vop.const), ...[0, 1, 2, 3].flatMap(lane => float32(values[lane] ?? 0))];
|
|
1301
1386
|
const splatConstant = (value: number): number[] => vectorConstant([value, value, value, value]);
|
|
1302
|
-
const arithmeticVector =
|
|
1303
|
-
|
|
1387
|
+
const arithmeticVector = wide
|
|
1388
|
+
? { "+": vop.f64Add, "-": vop.f64Sub, "*": vop.f64Mul, "/": vop.f64Div }
|
|
1389
|
+
: { "+": vop.f32Add, "-": vop.f32Sub, "*": vop.f32Mul, "/": vop.f32Div };
|
|
1390
|
+
const unaryVector: { readonly [name: string]: number | undefined } = wide
|
|
1391
|
+
? { abs: vop.f64Abs, sqrt: vop.f64Sqrt, floor: vop.f64Floor, ceil: vop.f64Ceil, trunc: vop.f64Trunc }
|
|
1392
|
+
: { abs: vop.f32Abs, sqrt: vop.f32Sqrt, floor: vop.f32Floor, ceil: vop.f32Ceil, trunc: vop.f32Trunc };
|
|
1393
|
+
const negateVector = wide ? vop.f64Neg : vop.f32Neg;
|
|
1394
|
+
const comparisonVector: { readonly [operator: string]: number | undefined } = wide
|
|
1395
|
+
? { "<": vop.f64Lt, ">": vop.f64Gt, "<=": vop.f64Le, ">=": vop.f64Ge, "==": vop.f64Eq, "!=": vop.f64Ne, "===": vop.f64Eq, "!==": vop.f64Ne }
|
|
1396
|
+
: { "<": vop.f32Lt, ">": vop.f32Gt, "<=": vop.f32Le, ">=": vop.f32Ge, "==": vop.f32Eq, "!=": vop.f32Ne, "===": vop.f32Eq, "!==": vop.f32Ne };
|
|
1397
|
+
/** Loads the vector of f32 storage at the address on the stack plus `offset`, as lanes. */
|
|
1398
|
+
const loadLanes = (offset: number): void => {
|
|
1399
|
+
if (wide) code.push(...simd(vop.load64Zero), 2, ...unsigned(offset), ...simd(vop.f64PromoteLowF32));
|
|
1400
|
+
else code.push(...simd(vop.load), 2, ...unsigned(offset));
|
|
1401
|
+
};
|
|
1402
|
+
/** Stores lanes, on the stack after the address, to f32 storage at that address plus `offset`. */
|
|
1403
|
+
const storeLanes = (offset: number): void => {
|
|
1404
|
+
if (wide) code.push(...simd(vop.f32DemoteF64Zero), ...simd(vop.store64Lane), 2, ...unsigned(offset), 0);
|
|
1405
|
+
else code.push(...simd(vop.store), 2, ...unsigned(offset));
|
|
1406
|
+
};
|
|
1304
1407
|
|
|
1305
1408
|
const isArithmetic = (operator: string): operator is keyof typeof arithmeticVector => operator in arithmeticVector;
|
|
1306
|
-
/** A value that's the same for every lane, splatted: demoted to f32, as a lane computes. */
|
|
1409
|
+
/** A value that's the same for every lane, splatted: demoted to f32 for f32 lanes, as a lane computes. */
|
|
1307
1410
|
const emitSplat = (expression: Expression): void => {
|
|
1308
1411
|
emit(expression);
|
|
1309
|
-
code.push(
|
|
1412
|
+
if (wide) code.push(...simd(vop.f64Splat));
|
|
1413
|
+
else code.push(op.f32DemoteF64, ...simd(vop.f32Splat));
|
|
1310
1414
|
};
|
|
1311
|
-
/** `Math` functions with
|
|
1415
|
+
/** `Math` functions with a vector equivalent; `fround` is the identity in f32 and a demotion and promotion in f64. */
|
|
1312
1416
|
const emitVectorMath = (functionName: string, count: number): void => {
|
|
1313
1417
|
if (functionName === "min" || functionName === "max") {
|
|
1314
|
-
|
|
1418
|
+
const operation = functionName === "min" ? (wide ? vop.f64Min : vop.f32Min) : (wide ? vop.f64Max : vop.f32Max);
|
|
1419
|
+
for (let i = 1; i < count; i++) code.push(...simd(operation));
|
|
1315
1420
|
return;
|
|
1316
1421
|
}
|
|
1422
|
+
if (functionName === "fround" && wide) return void code.push(...simd(vop.f32DemoteF64Zero), ...simd(vop.f64PromoteLowF32));
|
|
1317
1423
|
const unary = unaryVector[functionName];
|
|
1318
1424
|
if (unary !== undefined) code.push(...simd(unary));
|
|
1319
1425
|
};
|
|
1320
1426
|
const vectorMath = (functionName: string, count: number): boolean =>
|
|
1321
1427
|
((functionName === "min" || functionName === "max") && count > 0) || ((unaryVector[functionName] !== undefined || functionName === "fround") && count === 1);
|
|
1322
1428
|
|
|
1323
|
-
// ---- Across rows: four rows at a time, for
|
|
1429
|
+
// ---- Across rows: four rows at a time in f32 lanes, two in f64, for programs whose columns are all dense f32. ----
|
|
1324
1430
|
|
|
1325
1431
|
/** The mask of the enclosing `if`s, or null outside any. */
|
|
1326
1432
|
let mask: number | null = null;
|
|
1327
1433
|
const rowsLocals: number[] = [];
|
|
1328
1434
|
const rowsLocal = (index: number): number => rowsLocals[index] ??= scratch(v128Type);
|
|
1435
|
+
/** Rows a pass of the across-rows loops runs at once, which stamps cover. */
|
|
1436
|
+
let groupRows = 4;
|
|
1329
1437
|
|
|
1330
1438
|
const denseAddress = (column: number): void => {
|
|
1331
1439
|
const { view, stride, boolean, component } = columns[column];
|
|
@@ -1335,12 +1443,12 @@ export const generateWasm = (
|
|
|
1335
1443
|
|
|
1336
1444
|
const vectorTruthy = (type: Type): void => {
|
|
1337
1445
|
if (type === "boolean") {
|
|
1338
|
-
code.push(...splatConstant(0), ...simd(vop.f32Ne));
|
|
1446
|
+
code.push(...splatConstant(0), ...simd(comparisonVector["!="] ?? vop.f32Ne));
|
|
1339
1447
|
return;
|
|
1340
1448
|
}
|
|
1341
1449
|
const value = scratch(v128Type);
|
|
1342
|
-
code.push(op.localTee, ...unsigned(value), ...splatConstant(0), ...simd(vop.f32Ne));
|
|
1343
|
-
code.push(op.localGet, ...unsigned(value), op.localGet, ...unsigned(value), ...simd(vop.f32Eq), ...simd(vop.and));
|
|
1450
|
+
code.push(op.localTee, ...unsigned(value), ...splatConstant(0), ...simd(comparisonVector["!="] ?? vop.f32Ne));
|
|
1451
|
+
code.push(op.localGet, ...unsigned(value), op.localGet, ...unsigned(value), ...simd(comparisonVector["=="] ?? vop.f32Eq), ...simd(vop.and));
|
|
1344
1452
|
};
|
|
1345
1453
|
/** A lane mask as a value: 1 where set, 0 elsewhere. */
|
|
1346
1454
|
const maskValue = (): void => {
|
|
@@ -1352,14 +1460,14 @@ export const generateWasm = (
|
|
|
1352
1460
|
case "number": code.push(...splatConstant(expression.value)); return;
|
|
1353
1461
|
case "boolean": code.push(...splatConstant(expression.value ? 1 : 0)); return;
|
|
1354
1462
|
case "local": code.push(op.localGet, ...unsigned(rowsLocal(expression.local))); return;
|
|
1355
|
-
case "resource": case "args": return emitSplat(expression);
|
|
1463
|
+
case "resource": case "args": case "shared": return emitSplat(expression);
|
|
1356
1464
|
case "column":
|
|
1357
1465
|
denseAddress(expression.column);
|
|
1358
|
-
|
|
1466
|
+
loadLanes(columns[expression.column].offset);
|
|
1359
1467
|
return;
|
|
1360
1468
|
case "unary":
|
|
1361
1469
|
rowsEmit(expression.operand);
|
|
1362
|
-
if (expression.operator === "-") code.push(...simd(
|
|
1470
|
+
if (expression.operator === "-") code.push(...simd(negateVector));
|
|
1363
1471
|
else if (expression.operator === "!") {
|
|
1364
1472
|
vectorTruthy(typeOf(expression.operand));
|
|
1365
1473
|
code.push(...simd(vop.not));
|
|
@@ -1372,13 +1480,13 @@ export const generateWasm = (
|
|
|
1372
1480
|
if (operator === "===" || operator === "!==") {
|
|
1373
1481
|
const leftType = typeOf(left);
|
|
1374
1482
|
const rightType = typeOf(right);
|
|
1375
|
-
if (leftType === "mixed" || rightType === "mixed") throw unsupported;
|
|
1483
|
+
if (leftType === "mixed" || rightType === "mixed") throw unsupported("it compares with === or !== a value that may be a boolean or a number");
|
|
1376
1484
|
if (leftType !== rightType) {
|
|
1377
1485
|
code.push(...splatConstant(operator === "===" ? 0 : 1));
|
|
1378
1486
|
return;
|
|
1379
1487
|
}
|
|
1380
1488
|
}
|
|
1381
|
-
const comparison =
|
|
1489
|
+
const comparison = comparisonVector[operator];
|
|
1382
1490
|
if (!isArithmetic(operator) && comparison === undefined) throw notVectorizable;
|
|
1383
1491
|
rowsEmit(left);
|
|
1384
1492
|
rowsEmit(right);
|
|
@@ -1450,28 +1558,33 @@ export const generateWasm = (
|
|
|
1450
1558
|
}
|
|
1451
1559
|
code.push(op.localSet, ...unsigned(value));
|
|
1452
1560
|
denseAddress(current.column);
|
|
1453
|
-
code.push(op.localGet, ...unsigned(value)
|
|
1561
|
+
code.push(op.localGet, ...unsigned(value));
|
|
1562
|
+
storeLanes(columns[current.column].offset);
|
|
1454
1563
|
return;
|
|
1455
1564
|
}
|
|
1456
1565
|
case "stamp": {
|
|
1457
|
-
// Ticks are dense f64:
|
|
1566
|
+
// Ticks are dense f64: each two rows are an f64x2 store; a chunk column stays when its row column is muted.
|
|
1567
|
+
// f64 lanes' masks are already a lane per row; f32 lanes' are extended, two rows a store.
|
|
1458
1568
|
if (columns[current.column].muted !== true) {
|
|
1459
|
-
for (let half = 0; half < 2; half++) {
|
|
1569
|
+
for (let half = 0; half < groupRows / 2; half++) {
|
|
1460
1570
|
const address = (): void => { code.push(op.localGet, ...unsigned(columnParameter(current.column)), op.localGet, ...unsigned(rowLocal), op.i32Const, 3, op.i32Shl, op.i32Add); };
|
|
1461
1571
|
address();
|
|
1462
1572
|
code.push(op.localGet, 2, ...simd(vop.f64Splat));
|
|
1463
1573
|
if (mask !== null) {
|
|
1464
1574
|
address();
|
|
1465
1575
|
code.push(...simd(vop.load), 3, ...unsigned(16 * half));
|
|
1466
|
-
code.push(op.localGet, ...unsigned(mask)
|
|
1576
|
+
code.push(op.localGet, ...unsigned(mask));
|
|
1577
|
+
if (!wide) code.push(...simd(half === 0 ? vop.i64ExtendLowS : vop.i64ExtendHighS));
|
|
1578
|
+
code.push(...simd(vop.bitselect));
|
|
1467
1579
|
}
|
|
1468
1580
|
code.push(...simd(vop.store), 3, ...unsigned(16 * half));
|
|
1469
1581
|
}
|
|
1470
1582
|
}
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1583
|
+
// The group may straddle two chunks or blocks. Under a mask this can stamp one no lane changed, which only costs a scan.
|
|
1584
|
+
stampDense(current.blocks, blockShift, 0);
|
|
1585
|
+
stampDense(current.blocks, blockShift, groupRows - 1);
|
|
1586
|
+
stampDense(current.chunks, chunkShift, 0);
|
|
1587
|
+
stampDense(current.chunks, chunkShift, groupRows - 1);
|
|
1475
1588
|
return;
|
|
1476
1589
|
}
|
|
1477
1590
|
case "if": {
|
|
@@ -1503,15 +1616,16 @@ export const generateWasm = (
|
|
|
1503
1616
|
}
|
|
1504
1617
|
};
|
|
1505
1618
|
|
|
1506
|
-
/** Rows from `start` in groups of
|
|
1619
|
+
/** Rows from `start` in groups of a vector's lanes, up to the last whole group; leaves the row local at the first row not done. */
|
|
1507
1620
|
const rowsLoop = (): void => {
|
|
1621
|
+
groupRows = laneBytes / 4;
|
|
1508
1622
|
const vectorEnd = scratch(i32Type);
|
|
1509
|
-
code.push(op.localGet, 1, op.localGet, 0, op.i32Sub, op.i32Const, ...signed(-
|
|
1623
|
+
code.push(op.localGet, 1, op.localGet, 0, op.i32Sub, op.i32Const, ...signed(-groupRows), op.i32And, op.localGet, 0, op.i32Add, op.localSet, ...unsigned(vectorEnd));
|
|
1510
1624
|
code.push(op.block, 0x40, op.loop, 0x40);
|
|
1511
1625
|
code.push(op.localGet, ...unsigned(rowLocal), op.localGet, ...unsigned(vectorEnd), op.i32GeS, op.brIf, 1);
|
|
1512
1626
|
mask = null;
|
|
1513
1627
|
for (const current of program.body) rowsStatement(current);
|
|
1514
|
-
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const,
|
|
1628
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, ...signed(groupRows), op.i32Add, op.localSet, ...unsigned(rowLocal), op.br, 0);
|
|
1515
1629
|
code.push(op.end, op.end);
|
|
1516
1630
|
};
|
|
1517
1631
|
|
|
@@ -1755,7 +1869,7 @@ export const generateWasm = (
|
|
|
1755
1869
|
return;
|
|
1756
1870
|
case "negate":
|
|
1757
1871
|
emitVectorExpression(expression.operand);
|
|
1758
|
-
code.push(...simd(
|
|
1872
|
+
code.push(...simd(negateVector));
|
|
1759
1873
|
return;
|
|
1760
1874
|
case "math":
|
|
1761
1875
|
for (const parameter of expression.arguments) emitVectorExpression(parameter);
|
|
@@ -1789,13 +1903,71 @@ export const generateWasm = (
|
|
|
1789
1903
|
return groups.size > 0;
|
|
1790
1904
|
};
|
|
1791
1905
|
|
|
1792
|
-
// ---- Across rows for interleaved elements: four rows of a `stride`-byte element are `stride /
|
|
1906
|
+
// ---- Across rows for interleaved elements: four rows of a `stride`-byte element are `4 * stride / laneBytes` whole vectors. ----
|
|
1793
1907
|
|
|
1794
1908
|
type LanePlan = ReturnType<typeof planLanes>;
|
|
1909
|
+
/** Whether a value calls an import: `%` and `**`, which only integers by a literal skip, and most `Math` functions. */
|
|
1910
|
+
const callsImport = (expression: Expression): boolean => {
|
|
1911
|
+
switch (expression.kind) {
|
|
1912
|
+
case "unary": return callsImport(expression.operand);
|
|
1913
|
+
case "binary": return expression.operator === "%" || expression.operator === "**" || callsImport(expression.left) || callsImport(expression.right);
|
|
1914
|
+
case "logical": return callsImport(expression.left) || callsImport(expression.right);
|
|
1915
|
+
case "conditional": return callsImport(expression.test) || callsImport(expression.consequent) || callsImport(expression.alternate);
|
|
1916
|
+
case "math": return !native.has(expression.name) || expression.arguments.some(callsImport);
|
|
1917
|
+
default: return false;
|
|
1918
|
+
}
|
|
1919
|
+
};
|
|
1920
|
+
/** Computes each largest row-independent value calling an import within `statements` into a local of its own. */
|
|
1921
|
+
const hoist = (statements: readonly Statement[]): void => {
|
|
1922
|
+
const visit = (expression: Expression): void => {
|
|
1923
|
+
if (hoisted.has(expression)) return;
|
|
1924
|
+
if (rowIndependent(expression) && callsImport(expression)) {
|
|
1925
|
+
emit(expression);
|
|
1926
|
+
const value = scratch(f64Type);
|
|
1927
|
+
code.push(op.localSet, ...unsigned(value));
|
|
1928
|
+
hoisted.set(expression, value);
|
|
1929
|
+
return;
|
|
1930
|
+
}
|
|
1931
|
+
switch (expression.kind) {
|
|
1932
|
+
case "unary": return visit(expression.operand);
|
|
1933
|
+
case "binary": case "logical":
|
|
1934
|
+
visit(expression.left);
|
|
1935
|
+
visit(expression.right);
|
|
1936
|
+
return;
|
|
1937
|
+
case "conditional":
|
|
1938
|
+
visit(expression.test);
|
|
1939
|
+
visit(expression.consequent);
|
|
1940
|
+
visit(expression.alternate);
|
|
1941
|
+
return;
|
|
1942
|
+
case "math": return expression.arguments.forEach(visit);
|
|
1943
|
+
default: return;
|
|
1944
|
+
}
|
|
1945
|
+
};
|
|
1946
|
+
for (const current of statements) {
|
|
1947
|
+
switch (current.kind) {
|
|
1948
|
+
case "set": case "store": visit(current.value); break;
|
|
1949
|
+
case "if":
|
|
1950
|
+
visit(current.test);
|
|
1951
|
+
hoist(current.consequent);
|
|
1952
|
+
hoist(current.alternate);
|
|
1953
|
+
break;
|
|
1954
|
+
case "block": case "loop": hoist(current.body); break;
|
|
1955
|
+
case "branchIf": visit(current.test); break;
|
|
1956
|
+
case "find": visit(current.entity); break;
|
|
1957
|
+
case "probe": current.values.forEach(visit); break;
|
|
1958
|
+
case "listRow": visit(current.index); break;
|
|
1959
|
+
case "intrinsic":
|
|
1960
|
+
for (const operand of current.operands) operand.forEach(visit);
|
|
1961
|
+
hoist(current.body);
|
|
1962
|
+
break;
|
|
1963
|
+
default: break;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
};
|
|
1795
1967
|
/** Whether a value is the same for every row. */
|
|
1796
1968
|
const rowIndependent = (expression: Expression): boolean => {
|
|
1797
1969
|
switch (expression.kind) {
|
|
1798
|
-
case "number": case "boolean": case "resource": case "args": return true;
|
|
1970
|
+
case "number": case "boolean": case "resource": case "args": case "shared": return true;
|
|
1799
1971
|
case "unary": return rowIndependent(expression.operand);
|
|
1800
1972
|
case "binary": case "logical": return rowIndependent(expression.left) && rowIndependent(expression.right);
|
|
1801
1973
|
case "conditional": return rowIndependent(expression.test) && rowIndependent(expression.consequent) && rowIndependent(expression.alternate);
|
|
@@ -1847,9 +2019,9 @@ export const generateWasm = (
|
|
|
1847
2019
|
}
|
|
1848
2020
|
case "load":
|
|
1849
2021
|
elementAddress(expression.column);
|
|
1850
|
-
|
|
2022
|
+
loadLanes(laneBytes * vector);
|
|
1851
2023
|
return;
|
|
1852
|
-
case "constant": code.push(...vectorConstant([0, 1, 2, 3].map(lane => expression.values[((
|
|
2024
|
+
case "constant": code.push(...vectorConstant([0, 1, 2, 3].map(lane => expression.values[((laneBytes * vector + 4 * lane) % stride) / 4] ?? 0))); return;
|
|
1853
2025
|
case "splat": return emitSplat(expression.expression);
|
|
1854
2026
|
case "binary":
|
|
1855
2027
|
emitElementExpression(expression.left, vector, stride, packVectors);
|
|
@@ -1858,7 +2030,7 @@ export const generateWasm = (
|
|
|
1858
2030
|
return;
|
|
1859
2031
|
case "negate":
|
|
1860
2032
|
emitElementExpression(expression.operand, vector, stride, packVectors);
|
|
1861
|
-
code.push(...simd(
|
|
2033
|
+
code.push(...simd(negateVector));
|
|
1862
2034
|
return;
|
|
1863
2035
|
case "math":
|
|
1864
2036
|
for (const parameter of expression.arguments) emitElementExpression(parameter, vector, stride, packVectors);
|
|
@@ -1873,6 +2045,8 @@ export const generateWasm = (
|
|
|
1873
2045
|
* and each vector's store only touches bytes no other vector reads.
|
|
1874
2046
|
*/
|
|
1875
2047
|
const elementsLoop = ({ groups, packs }: LanePlan): void => {
|
|
2048
|
+
groupRows = 4;
|
|
2049
|
+
const vectors = (stride: number): number => 4 * stride / laneBytes;
|
|
1876
2050
|
const vectorEnd = scratch(i32Type);
|
|
1877
2051
|
code.push(op.localGet, 1, op.localGet, 0, op.i32Sub, op.i32Const, ...signed(-4), op.i32And, op.localGet, 0, op.i32Add, op.localSet, ...unsigned(vectorEnd));
|
|
1878
2052
|
code.push(op.block, 0x40, op.loop, 0x40);
|
|
@@ -1883,23 +2057,25 @@ export const generateWasm = (
|
|
|
1883
2057
|
for (let index = 0; index < body.length; index++) {
|
|
1884
2058
|
const pack = packs.get(index);
|
|
1885
2059
|
if (pack?.used === true) {
|
|
1886
|
-
const
|
|
2060
|
+
const locals = Array.from({ length: vectors(columns[pack.column].stride) }, (_, vector) => {
|
|
1887
2061
|
const local = scratch(v128Type);
|
|
1888
2062
|
elementAddress(pack.column);
|
|
1889
|
-
|
|
2063
|
+
loadLanes(laneBytes * vector);
|
|
2064
|
+
code.push(op.localSet, ...unsigned(local));
|
|
1890
2065
|
return local;
|
|
1891
2066
|
});
|
|
1892
|
-
packVectors.set(pack,
|
|
2067
|
+
packVectors.set(pack, locals);
|
|
1893
2068
|
}
|
|
1894
2069
|
const group = groups.get(index);
|
|
1895
2070
|
if (group !== undefined) {
|
|
1896
2071
|
const { stride } = columns[group.column];
|
|
1897
|
-
for (let vector = 0; vector < stride
|
|
2072
|
+
for (let vector = 0; vector < vectors(stride); vector++) {
|
|
1898
2073
|
const value = scratch(v128Type);
|
|
1899
2074
|
emitElementExpression(group.value, vector, stride, packVectors);
|
|
1900
2075
|
code.push(op.localSet, ...unsigned(value));
|
|
1901
2076
|
elementAddress(group.column);
|
|
1902
|
-
code.push(op.localGet, ...unsigned(value)
|
|
2077
|
+
code.push(op.localGet, ...unsigned(value));
|
|
2078
|
+
storeLanes(laneBytes * vector);
|
|
1903
2079
|
}
|
|
1904
2080
|
index += group.length - 1;
|
|
1905
2081
|
}
|
|
@@ -1910,7 +2086,7 @@ export const generateWasm = (
|
|
|
1910
2086
|
};
|
|
1911
2087
|
|
|
1912
2088
|
try {
|
|
1913
|
-
const parameterCount =
|
|
2089
|
+
const parameterCount = beforeLookups + lookupParameters + indexParameters + upParameters;
|
|
1914
2090
|
collectFinds(program.body);
|
|
1915
2091
|
/** Leaves 1 if any filter's tick at `(row >> shift) * 8` in its `parameter` array is newer than `lastRun`. */
|
|
1916
2092
|
const anyNewer = (parameter: (filter: number) => number, shift: number): void => {
|
|
@@ -1921,36 +2097,88 @@ export const generateWasm = (
|
|
|
1921
2097
|
if (filter > 0) code.push(op.i32Or);
|
|
1922
2098
|
}
|
|
1923
2099
|
};
|
|
1924
|
-
/**
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2100
|
+
/**
|
|
2101
|
+
* i32 locals: the row after the current chunk; the row after the current run of passing blocks, both `start`
|
|
2102
|
+
* before the first; the current chunk's blocks that pass, a bit each; and two temporaries.
|
|
2103
|
+
*/
|
|
2104
|
+
let chunkEnd = 0;
|
|
2105
|
+
let blockEnd = 0;
|
|
2106
|
+
let passingBlocks = 0;
|
|
2107
|
+
let ahead = 0;
|
|
2108
|
+
let skipped = 0;
|
|
2109
|
+
const startChunksAndBlocks = (): void => {
|
|
2110
|
+
chunkEnd = scratch(i32Type);
|
|
2111
|
+
blockEnd = scratch(i32Type);
|
|
2112
|
+
passingBlocks = scratch(i32Type);
|
|
2113
|
+
ahead = scratch(i32Type);
|
|
2114
|
+
skipped = scratch(i32Type);
|
|
2115
|
+
code.push(op.localGet, 0, op.localTee, ...unsigned(chunkEnd), op.localSet, ...unsigned(blockEnd));
|
|
2116
|
+
};
|
|
2117
|
+
const get = (local: number): number[] => [op.localGet, ...unsigned(local)];
|
|
2118
|
+
const set = (local: number): number[] => [op.localSet, ...unsigned(local)];
|
|
2119
|
+
/** Leaves `min(end, ((row >> shift) + count) << shift)`, with `count` on the stack first. */
|
|
2120
|
+
const runEnd = (shift: number, target: number): void => {
|
|
2121
|
+
code.push(...get(rowLocal), op.i32Const, ...signed(shift), op.i32ShrU, op.i32Add, op.i32Const, ...signed(shift), op.i32Shl, ...set(target));
|
|
2122
|
+
code.push(...get(target), op.localGet, 1, ...get(target), op.localGet, 1, op.i32LtS, op.select, ...set(target));
|
|
2123
|
+
};
|
|
2124
|
+
const blocksPerChunk = 2 ** (chunkShift - blockShift);
|
|
2125
|
+
/**
|
|
2126
|
+
* In the outer row loop, at `row`, the first row after the last run of passing blocks: past the current chunk,
|
|
2127
|
+
* skips chunks no filter's chunk tick says changed, and notes which blocks of the next one pass, a bit each;
|
|
2128
|
+
* then skips the blocks that don't pass, and sets `blockEnd` to the end of the run of blocks that do, which the
|
|
2129
|
+
* inner loop runs. A chunk with more than half its blocks passing is one run: ending a run costs more than the
|
|
2130
|
+
* eight-row checks spend on a block between runs.
|
|
2131
|
+
*/
|
|
2132
|
+
const findRun = (): void => {
|
|
2133
|
+
code.push(...get(rowLocal), ...get(chunkEnd), op.i32GeS, op.if, 0x40);
|
|
2134
|
+
code.push(op.i32Const, 1);
|
|
2135
|
+
runEnd(chunkShift, chunkEnd);
|
|
1929
2136
|
anyNewer(filterChunkParameter, chunkShift);
|
|
1930
|
-
code.push(op.i32Eqz, op.if, 0x40);
|
|
1931
|
-
//
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
2137
|
+
code.push(op.i32Eqz, op.if, 0x40, ...get(chunkEnd), ...set(rowLocal), op.br, 2, op.end);
|
|
2138
|
+
// The chunk's blocks that pass, from its first block, `(row >> chunkShift) << (chunkShift - blockShift)`.
|
|
2139
|
+
for (let block = 0; block < blocksPerChunk; block++) {
|
|
2140
|
+
for (let filter = 0; filter < filters; filter++) {
|
|
2141
|
+
code.push(...get(filterBlockParameter(filter)), ...get(rowLocal), op.i32Const, ...signed(chunkShift), op.i32ShrU, op.i32Const, ...signed(chunkShift - blockShift), op.i32Shl);
|
|
2142
|
+
code.push(op.i32Const, ...signed(block), op.i32Add, op.i32Const, 3, op.i32Shl, op.i32Add, op.f64Load, 3, 0, op.localGet, 3, op.f64Gt);
|
|
2143
|
+
if (filter > 0) code.push(op.i32Or);
|
|
2144
|
+
}
|
|
2145
|
+
if (block > 0) code.push(op.i32Const, ...signed(block), op.i32Shl, ...get(passingBlocks), op.i32Or);
|
|
2146
|
+
code.push(...set(passingBlocks));
|
|
2147
|
+
}
|
|
2148
|
+
code.push(...get(passingBlocks), op.i32Popcnt, op.i32Const, ...signed(blocksPerChunk / 2), op.i32GtS, op.if, 0x40);
|
|
2149
|
+
code.push(op.i32Const, ...signed((2 ** blocksPerChunk - 1) | 0), ...set(passingBlocks), op.end);
|
|
2150
|
+
code.push(op.end);
|
|
2151
|
+
// ahead = passingBlocks >> (row's block in its chunk); none ahead skips the rest of the chunk.
|
|
2152
|
+
code.push(...get(passingBlocks), ...get(rowLocal), op.i32Const, ...signed(blockShift), op.i32ShrU, op.i32Const, ...signed(blocksPerChunk - 1), op.i32And, op.i32ShrU, op.localTee, ...unsigned(ahead));
|
|
2153
|
+
code.push(op.i32Eqz, op.if, 0x40, ...get(chunkEnd), ...set(rowLocal), op.br, 1, op.end);
|
|
2154
|
+
// Skips to the next passing block, then runs to the end of the passing blocks after it.
|
|
2155
|
+
code.push(...get(ahead), op.i32Ctz, op.localTee, ...unsigned(skipped), op.if, 0x40);
|
|
2156
|
+
code.push(...get(skipped), ...get(rowLocal), op.i32Const, ...signed(blockShift), op.i32ShrU, op.i32Add, op.i32Const, ...signed(blockShift), op.i32Shl, ...set(rowLocal));
|
|
2157
|
+
code.push(op.end);
|
|
2158
|
+
code.push(...get(ahead), ...get(skipped), op.i32ShrU, op.i32Const, ...signed(-1), op.i32Xor, op.i32Ctz);
|
|
2159
|
+
runEnd(blockShift, blockEnd);
|
|
2160
|
+
code.push(...get(blockEnd), ...get(chunkEnd), ...get(blockEnd), ...get(chunkEnd), op.i32LtS, op.select, ...set(blockEnd));
|
|
2161
|
+
// A row moved to a later block goes round the outer loop, which checks it against `end`.
|
|
2162
|
+
code.push(...get(skipped), op.brIf, 0);
|
|
1935
2163
|
};
|
|
1936
|
-
/** Rows
|
|
1937
|
-
const
|
|
2164
|
+
/** Rows an eight-row skip checks at once: four f64x2 loads of each filter's row ticks. */
|
|
2165
|
+
const eightRows = 8;
|
|
1938
2166
|
/**
|
|
1939
|
-
* With SIMD, at a row that's a multiple of `
|
|
1940
|
-
* two ticks per comparison. Only aligned rows check, so rows that do pass pay one check per
|
|
2167
|
+
* With SIMD, at a row that's a multiple of `eightRows`, skips that many rows when none passes a filter, testing
|
|
2168
|
+
* two ticks per comparison. Only aligned rows check, so rows that do pass pay one check per eight.
|
|
1941
2169
|
*/
|
|
1942
|
-
const
|
|
1943
|
-
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const,
|
|
1944
|
-
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const,
|
|
2170
|
+
const skipEights = (): void => {
|
|
2171
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, eightRows - 1, op.i32And, op.i32Eqz);
|
|
2172
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, eightRows, op.i32Add, op.localGet, 1, op.i32LeS, op.i32And, op.if, 0x40);
|
|
1945
2173
|
for (let filter = 0; filter < filters; filter++) {
|
|
1946
|
-
for (let pair = 0; pair <
|
|
2174
|
+
for (let pair = 0; pair < eightRows / 2; pair++) {
|
|
1947
2175
|
code.push(op.localGet, ...unsigned(filterRowParameter(filter)), op.localGet, ...unsigned(rowLocal), op.i32Const, 3, op.i32Shl, op.i32Add);
|
|
1948
2176
|
code.push(...simd(vop.load), 3, ...unsigned(16 * pair), op.localGet, 3, ...simd(vop.f64Splat), ...simd(vop.f64Gt));
|
|
1949
2177
|
if (filter > 0 || pair > 0) code.push(...simd(vop.or));
|
|
1950
2178
|
}
|
|
1951
2179
|
}
|
|
1952
2180
|
code.push(...simd(vop.anyTrue), op.i32Eqz, op.if, 0x40);
|
|
1953
|
-
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const,
|
|
2181
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, eightRows, op.i32Add, op.localSet, ...unsigned(rowLocal));
|
|
1954
2182
|
code.push(op.br, 2, op.end, op.end);
|
|
1955
2183
|
};
|
|
1956
2184
|
// Scalars are discovered while generating, so code is generated first with locals placed after a provisional scalar count.
|
|
@@ -1965,6 +2193,8 @@ export const generateWasm = (
|
|
|
1965
2193
|
localBase = partialsParameter + (accumulators.length > 0 ? 1 : 0);
|
|
1966
2194
|
rowLocal = scratch(i32Type);
|
|
1967
2195
|
code.push(op.localGet, 0, op.localSet, ...unsigned(rowLocal));
|
|
2196
|
+
hoisted.clear();
|
|
2197
|
+
hoist(program.body);
|
|
1968
2198
|
accumulators.forEach((accumulator, k) => {
|
|
1969
2199
|
code.push(op.localGet, ...unsigned(partialsParameter), op.f64Load, 3, ...unsigned(8 * k), op.localSet, ...unsigned(local(accumulator)));
|
|
1970
2200
|
});
|
|
@@ -1985,10 +2215,13 @@ export const generateWasm = (
|
|
|
1985
2215
|
if (lookupParameters > 0) convertLookupParameters();
|
|
1986
2216
|
if (indexParameters > 0) convertIndexParameters();
|
|
1987
2217
|
stampRangeChunks();
|
|
2218
|
+
if (filters > 0) startChunksAndBlocks();
|
|
1988
2219
|
if (mode === "rows") rowsLoop();
|
|
2220
|
+
let across = false;
|
|
1989
2221
|
if (mode === "lanes") {
|
|
1990
2222
|
const plan = planLanes();
|
|
1991
|
-
|
|
2223
|
+
across = acrossElements(plan);
|
|
2224
|
+
if (across) elementsLoop(plan);
|
|
1992
2225
|
}
|
|
1993
2226
|
// for (; row < end; row++) { block next { body } }, where with `up` the row and its parent's are rows[n] and parents[n].
|
|
1994
2227
|
const slot = rowLocal;
|
|
@@ -1998,12 +2231,16 @@ export const generateWasm = (
|
|
|
1998
2231
|
}
|
|
1999
2232
|
code.push(op.block, 0x40, op.loop, 0x40);
|
|
2000
2233
|
code.push(op.localGet, ...unsigned(slot), op.localGet, 1, op.i32GeS, op.brIf, 1);
|
|
2234
|
+
// With change filters, an outer loop finds each run of passing blocks and an inner one runs its rows.
|
|
2235
|
+
if (filters > 0) {
|
|
2236
|
+
findRun();
|
|
2237
|
+
code.push(op.block, 0x40, op.loop, 0x40, ...get(rowLocal), ...get(blockEnd), op.i32GeS, op.brIf, 1);
|
|
2238
|
+
}
|
|
2001
2239
|
if (upMode) {
|
|
2002
2240
|
code.push(op.localGet, ...unsigned(upParameter(0)), op.localGet, ...unsigned(slot), op.i32Const, 2, op.i32Shl, op.i32Add, op.i32Load, 2, 0, op.localSet, ...unsigned(rowLocal));
|
|
2003
2241
|
code.push(op.localGet, ...unsigned(upParameter(1)), op.localGet, ...unsigned(slot), op.i32Const, 2, op.i32Shl, op.i32Add, op.i32Load, 2, 0, op.localSet, ...unsigned(parentLocal));
|
|
2004
2242
|
}
|
|
2005
|
-
if (filters > 0)
|
|
2006
|
-
if (filters > 0 && simdEnabled && !upMode) skipBlocks();
|
|
2243
|
+
if (filters > 0 && simdEnabled && !upMode) skipEights();
|
|
2007
2244
|
code.push(op.block, 0x40);
|
|
2008
2245
|
// A row that no filter passes goes to the next.
|
|
2009
2246
|
if (filters > 0) {
|
|
@@ -2012,8 +2249,12 @@ export const generateWasm = (
|
|
|
2012
2249
|
}
|
|
2013
2250
|
labels.length = 0;
|
|
2014
2251
|
labels.push("next");
|
|
2015
|
-
|
|
2016
|
-
|
|
2252
|
+
// f64 lanes fuse only across rows: within a row the rest run as scalars, as the body computes.
|
|
2253
|
+
if (mode === "lanes" && !wide) fused = emitLaneBody();
|
|
2254
|
+
else {
|
|
2255
|
+
if (mode === "lanes") fused = across;
|
|
2256
|
+
for (const current of program.body) statement(current);
|
|
2257
|
+
}
|
|
2017
2258
|
labels.pop();
|
|
2018
2259
|
code.push(op.end);
|
|
2019
2260
|
accumulators.forEach((accumulator, k) => {
|
|
@@ -2027,6 +2268,7 @@ export const generateWasm = (
|
|
|
2027
2268
|
});
|
|
2028
2269
|
code.push(op.localGet, ...unsigned(slot), op.i32Const, 1, op.i32Add, op.localSet, ...unsigned(slot), op.br, 0);
|
|
2029
2270
|
code.push(op.end, op.end);
|
|
2271
|
+
if (filters > 0) code.push(op.br, 0, op.end, op.end);
|
|
2030
2272
|
rowLocal = slot;
|
|
2031
2273
|
accumulators.forEach((accumulator, k) => {
|
|
2032
2274
|
const extra = lanes[k];
|
|
@@ -2045,7 +2287,9 @@ export const generateWasm = (
|
|
|
2045
2287
|
// Across-rows mode doesn't filter rows, so filtered kernels fuse within rows instead.
|
|
2046
2288
|
// Accumulators carry from row to row, which neither SIMD mode keeps.
|
|
2047
2289
|
// Listed rows aren't consecutive, so `up` programs run one row at a time.
|
|
2048
|
-
|
|
2290
|
+
// Within a row, f64 lanes would split a component's leaves across vectors, so filtered kernels at the body's
|
|
2291
|
+
// precision run one row at a time.
|
|
2292
|
+
let mode: "rows" | "lanes" | "scalar" = !simdEnabled || accumulators.length > 0 || upMode || (wide && filters > 0) ? "scalar" : filters > 0 ? "lanes" : "rows";
|
|
2049
2293
|
try {
|
|
2050
2294
|
generate(0, mode);
|
|
2051
2295
|
}
|
|
@@ -2060,10 +2304,36 @@ export const generateWasm = (
|
|
|
2060
2304
|
}
|
|
2061
2305
|
const discovered = scalars.length;
|
|
2062
2306
|
generate(discovered, mode);
|
|
2063
|
-
if (scalars.length !== discovered) throw unsupported;
|
|
2307
|
+
if (scalars.length !== discovered) throw unsupported("its resource and input values differ between passes");
|
|
2064
2308
|
const vectorized = mode !== "scalar";
|
|
2065
2309
|
|
|
2066
|
-
|
|
2310
|
+
/** The custom section naming the function, its imports, and each parameter and local the generator knows the role of. */
|
|
2311
|
+
const nameSection = (): number[] => {
|
|
2312
|
+
const parameterNames = ["start", "end", "tick", "lastRun", ...columns.map((_, k) => `c${k}`)];
|
|
2313
|
+
for (const part of ["Rows", "Chunks", "Blocks"]) for (let filter = 0; filter < filters; filter++) parameterNames.push(`filter${filter}${part}`);
|
|
2314
|
+
if (lookupParameters > 0) {
|
|
2315
|
+
parameterNames.push("entityArchetypes", "entityRows", "entityGenerations", "entityCount");
|
|
2316
|
+
lookups.forEach((_, k) => parameterNames.push(`l${k}Directory`, `l${k}Records`));
|
|
2317
|
+
if (watching) parameterNames.push("lookupsSince");
|
|
2318
|
+
}
|
|
2319
|
+
for (let lookup = 0; lookup < lookups.length; lookup++) {
|
|
2320
|
+
const index = indexLookups[lookup];
|
|
2321
|
+
if (index !== null && index !== undefined) for (let k = 0; k < indexParameterCount(index); k++) parameterNames.push(`l${lookup}Index${k}`);
|
|
2322
|
+
}
|
|
2323
|
+
if (upMode) parameterNames.push("rows", "parents", "found", ...upColumns.map((_, k) => `u${k}`));
|
|
2324
|
+
for (const scalar of scalars) parameterNames.push(identifierOf(scalar.source === "args" ? ["input", ...scalar.path].join("_") : [`${scalar.source === "shared" ? "shared" : "r"}${scalar.index}`, ...scalar.path].join("_")));
|
|
2325
|
+
if (accumulators.length > 0) parameterNames.push("partials");
|
|
2326
|
+
const localNames = [
|
|
2327
|
+
...parameterNames,
|
|
2328
|
+
...Array.from({ length: program.locals }, (_, k) => identifierOf(program.names?.[k] ?? `t_${k}`)),
|
|
2329
|
+
...extraLocals.map((_, k) => k === 0 ? "row" : `s${k}`),
|
|
2330
|
+
];
|
|
2331
|
+
const functions = [...imports.map((functionName, k) => [...unsigned(k), ...name(functionName)]), [...unsigned(imports.length), ...name("run")]];
|
|
2332
|
+
const locals = [[...unsigned(imports.length), ...vector(localNames.map((localName, k) => [...unsigned(k), ...name(localName)]))]];
|
|
2333
|
+
// Subsections have a section's form: function names (1), then local names (2).
|
|
2334
|
+
return section(0, [...name("name"), ...section(1, vector(functions)), ...section(2, vector(locals))]);
|
|
2335
|
+
};
|
|
2336
|
+
const parameterTypes = [i32Type, i32Type, f64Type, f64Type, ...columns.map(() => i32Type), ...new Array<number>(3 * filters).fill(i32Type), ...new Array<number>(lookupParameters).fill(f64Type), ...new Array<number>(indexParameters).fill(f64Type), ...new Array<number>(upParameters).fill(i32Type), ...scalars.map(() => f64Type), ...accumulators.length > 0 ? [i32Type] : []];
|
|
2067
2337
|
const localTypesList = [...new Array<number>(program.locals).fill(f64Type)];
|
|
2068
2338
|
// Locals in order: program locals, then extras in creation order; the row index was the first extra.
|
|
2069
2339
|
const declared = [...localTypesList.map(type => [1, type]), ...extraLocals.map(type => [1, type])];
|
|
@@ -2083,11 +2353,13 @@ export const generateWasm = (
|
|
|
2083
2353
|
...section(3, vector([unsigned(0)])),
|
|
2084
2354
|
...section(7, vector([[...name("run"), 0x00, ...unsigned(imports.length)]])),
|
|
2085
2355
|
...section(10, vector([[...unsigned(body.length), ...body]])),
|
|
2356
|
+
...named ? nameSection() : [],
|
|
2086
2357
|
]);
|
|
2087
2358
|
return { bytes, scalars, imports, vectorized };
|
|
2088
2359
|
}
|
|
2089
2360
|
catch (error) {
|
|
2090
|
-
|
|
2361
|
+
const reason = typeof error === "object" && error !== null ? reasons.get(error) : undefined;
|
|
2362
|
+
if (reason !== undefined) return reason;
|
|
2091
2363
|
throw error;
|
|
2092
2364
|
}
|
|
2093
2365
|
};
|