@adobe/ecs 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/dist/implementation/compiler/access.d.ts +6 -0
- package/dist/implementation/compiler/access.js +155 -0
- package/dist/implementation/compiler/access.js.map +1 -0
- package/dist/implementation/compiler/assign.d.ts +7 -0
- package/dist/implementation/compiler/assign.js +162 -0
- package/dist/implementation/compiler/assign.js.map +1 -0
- package/dist/implementation/compiler/bind.d.ts +9 -0
- package/dist/implementation/compiler/bind.js +82 -0
- package/dist/implementation/compiler/bind.js.map +1 -0
- package/dist/implementation/compiler/body-access.d.ts +15 -0
- package/dist/implementation/compiler/body-access.js +377 -0
- package/dist/implementation/compiler/body-access.js.map +1 -0
- package/dist/implementation/compiler/booleans.d.ts +8 -0
- package/dist/implementation/compiler/booleans.js +35 -0
- package/dist/implementation/compiler/booleans.js.map +1 -0
- package/dist/implementation/compiler/branches.d.ts +16 -0
- package/dist/implementation/compiler/branches.js +38 -0
- package/dist/implementation/compiler/branches.js.map +1 -0
- package/dist/implementation/compiler/calls.d.ts +6 -0
- package/dist/implementation/compiler/calls.js +390 -0
- package/dist/implementation/compiler/calls.js.map +1 -0
- package/dist/implementation/compiler/columns.d.ts +20 -0
- package/dist/implementation/compiler/columns.js +37 -0
- package/dist/implementation/compiler/columns.js.map +1 -0
- package/dist/implementation/compiler/compile-kernel.d.ts +14 -0
- package/dist/implementation/compiler/compile-kernel.js +139 -0
- package/dist/implementation/compiler/compile-kernel.js.map +1 -0
- package/dist/implementation/compiler/data.d.ts +30 -0
- package/dist/implementation/compiler/data.js +77 -0
- package/dist/implementation/compiler/data.js.map +1 -0
- package/dist/implementation/compiler/estree.d.ts +18 -0
- package/dist/implementation/compiler/estree.js +62 -0
- package/dist/implementation/compiler/estree.js.map +1 -0
- package/dist/implementation/compiler/exact.d.ts +24 -0
- package/dist/implementation/compiler/exact.js +64 -0
- package/dist/implementation/compiler/exact.js.map +1 -0
- package/dist/implementation/compiler/expression.d.ts +6 -0
- package/dist/implementation/compiler/expression.js +129 -0
- package/dist/implementation/compiler/expression.js.map +1 -0
- package/dist/implementation/compiler/failure.d.ts +27 -0
- package/dist/implementation/compiler/failure.js +24 -0
- package/dist/implementation/compiler/failure.js.map +1 -0
- package/dist/implementation/compiler/identify.d.ts +33 -0
- package/dist/implementation/compiler/identify.js +149 -0
- package/dist/implementation/compiler/identify.js.map +1 -0
- package/dist/implementation/compiler/index.d.ts +1 -0
- package/dist/implementation/compiler/index.js +2 -0
- package/dist/implementation/compiler/index.js.map +1 -0
- package/dist/implementation/compiler/ir.d.ts +214 -0
- package/dist/implementation/compiler/ir.js +28 -0
- package/dist/implementation/compiler/ir.js.map +1 -0
- package/dist/implementation/compiler/kernel-id.d.ts +17 -0
- package/dist/implementation/compiler/kernel-id.js +27 -0
- package/dist/implementation/compiler/kernel-id.js.map +1 -0
- package/dist/implementation/compiler/key.d.ts +21 -0
- package/dist/implementation/compiler/key.js +21 -0
- package/dist/implementation/compiler/key.js.map +1 -0
- package/dist/implementation/compiler/link.d.ts +70 -0
- package/dist/implementation/compiler/link.js +169 -0
- package/dist/implementation/compiler/link.js.map +1 -0
- package/dist/implementation/compiler/lists.d.ts +39 -0
- package/dist/implementation/compiler/lists.js +189 -0
- package/dist/implementation/compiler/lists.js.map +1 -0
- package/dist/implementation/compiler/lookups.d.ts +24 -0
- package/dist/implementation/compiler/lookups.js +118 -0
- package/dist/implementation/compiler/lookups.js.map +1 -0
- package/dist/implementation/compiler/math.d.ts +3 -0
- package/dist/implementation/compiler/math.js +9 -0
- package/dist/implementation/compiler/math.js.map +1 -0
- package/dist/implementation/compiler/module-scope.d.ts +53 -0
- package/dist/implementation/compiler/module-scope.js +121 -0
- package/dist/implementation/compiler/module-scope.js.map +1 -0
- package/dist/implementation/compiler/module-value.d.ts +15 -0
- package/dist/implementation/compiler/module-value.js +124 -0
- package/dist/implementation/compiler/module-value.js.map +1 -0
- package/dist/implementation/compiler/out.d.ts +4 -0
- package/dist/implementation/compiler/out.js +2 -0
- package/dist/implementation/compiler/out.js.map +1 -0
- package/dist/implementation/compiler/paths.d.ts +14 -0
- package/dist/implementation/compiler/paths.js +29 -0
- package/dist/implementation/compiler/paths.js.map +1 -0
- package/dist/implementation/compiler/plugin.d.ts +2 -0
- package/dist/implementation/compiler/plugin.js +225 -0
- package/dist/implementation/compiler/plugin.js.map +1 -0
- package/dist/implementation/compiler/print.d.ts +12 -0
- package/dist/implementation/compiler/print.js +96 -0
- package/dist/implementation/compiler/print.js.map +1 -0
- package/dist/implementation/compiler/program.d.ts +10 -0
- package/dist/implementation/compiler/program.js +255 -0
- package/dist/implementation/compiler/program.js.map +1 -0
- package/dist/implementation/compiler/scalar.d.ts +8 -0
- package/dist/implementation/compiler/scalar.js +47 -0
- package/dist/implementation/compiler/scalar.js.map +1 -0
- package/dist/implementation/compiler/scope.d.ts +24 -0
- package/dist/implementation/compiler/scope.js +4 -0
- package/dist/implementation/compiler/scope.js.map +1 -0
- package/dist/implementation/compiler/serialize.d.ts +2 -0
- package/dist/implementation/compiler/serialize.js +14 -0
- package/dist/implementation/compiler/serialize.js.map +1 -0
- package/dist/implementation/compiler/signature.d.ts +45 -0
- package/dist/implementation/compiler/signature.js +150 -0
- package/dist/implementation/compiler/signature.js.map +1 -0
- package/dist/implementation/compiler/snapshot.d.ts +21 -0
- package/dist/implementation/compiler/snapshot.js +18 -0
- package/dist/implementation/compiler/snapshot.js.map +1 -0
- package/dist/implementation/compiler/source-map.d.ts +34 -0
- package/dist/implementation/compiler/source-map.js +130 -0
- package/dist/implementation/compiler/source-map.js.map +1 -0
- package/dist/implementation/compiler/spawns.d.ts +29 -0
- package/dist/implementation/compiler/spawns.js +102 -0
- package/dist/implementation/compiler/spawns.js.map +1 -0
- package/dist/implementation/compiler/stamps.d.ts +6 -0
- package/dist/implementation/compiler/stamps.js +25 -0
- package/dist/implementation/compiler/stamps.js.map +1 -0
- package/dist/implementation/compiler/statement.d.ts +7 -0
- package/dist/implementation/compiler/statement.js +112 -0
- package/dist/implementation/compiler/statement.js.map +1 -0
- package/dist/implementation/compiler/terminal.d.ts +8 -0
- package/dist/implementation/compiler/terminal.js +51 -0
- package/dist/implementation/compiler/terminal.js.map +1 -0
- package/dist/implementation/compiler/transform.d.ts +31 -0
- package/dist/implementation/compiler/transform.js +227 -0
- package/dist/implementation/compiler/transform.js.map +1 -0
- package/dist/implementation/compiler/unit.d.ts +91 -0
- package/dist/implementation/compiler/unit.js +39 -0
- package/dist/implementation/compiler/unit.js.map +1 -0
- package/dist/implementation/compiler/value.d.ts +115 -0
- package/dist/implementation/compiler/value.js +9 -0
- package/dist/implementation/compiler/value.js.map +1 -0
- package/dist/implementation/index.d.ts +2 -0
- package/dist/implementation/index.js +3 -0
- package/dist/implementation/index.js.map +1 -0
- package/dist/implementation/world/activate.d.ts +21 -0
- package/dist/implementation/world/activate.js +132 -0
- package/dist/implementation/world/activate.js.map +1 -0
- package/dist/implementation/world/archetype.d.ts +136 -0
- package/dist/implementation/world/archetype.js +313 -0
- package/dist/implementation/world/archetype.js.map +1 -0
- package/dist/implementation/world/arrays.d.ts +24 -0
- package/dist/implementation/world/arrays.js +31 -0
- package/dist/implementation/world/arrays.js.map +1 -0
- package/dist/implementation/world/attach-kernel.d.ts +9 -0
- package/dist/implementation/world/attach-kernel.js +22 -0
- package/dist/implementation/world/attach-kernel.js.map +1 -0
- package/dist/implementation/world/batches.d.ts +15 -0
- package/dist/implementation/world/batches.js +144 -0
- package/dist/implementation/world/batches.js.map +1 -0
- package/dist/implementation/world/buffer.d.ts +60 -0
- package/dist/implementation/world/buffer.js +105 -0
- package/dist/implementation/world/buffer.js.map +1 -0
- package/dist/implementation/world/cascade.d.ts +28 -0
- package/dist/implementation/world/cascade.js +139 -0
- package/dist/implementation/world/cascade.js.map +1 -0
- package/dist/implementation/world/cells.d.ts +7 -0
- package/dist/implementation/world/cells.js +22 -0
- package/dist/implementation/world/cells.js.map +1 -0
- package/dist/implementation/world/check-kernel.d.ts +10 -0
- package/dist/implementation/world/check-kernel.js +102 -0
- package/dist/implementation/world/check-kernel.js.map +1 -0
- package/dist/implementation/world/claims.d.ts +13 -0
- package/dist/implementation/world/claims.js +50 -0
- package/dist/implementation/world/claims.js.map +1 -0
- package/dist/implementation/world/closure.d.ts +12 -0
- package/dist/implementation/world/closure.js +43 -0
- package/dist/implementation/world/closure.js.map +1 -0
- package/dist/implementation/world/command-ring.d.ts +97 -0
- package/dist/implementation/world/command-ring.js +438 -0
- package/dist/implementation/world/command-ring.js.map +1 -0
- package/dist/implementation/world/commands.d.ts +25 -0
- package/dist/implementation/world/commands.js +74 -0
- package/dist/implementation/world/commands.js.map +1 -0
- package/dist/implementation/world/create.d.ts +61 -0
- package/dist/implementation/world/create.js +787 -0
- package/dist/implementation/world/create.js.map +1 -0
- package/dist/implementation/world/directories.d.ts +28 -0
- package/dist/implementation/world/directories.js +67 -0
- package/dist/implementation/world/directories.js.map +1 -0
- package/dist/implementation/world/entities.d.ts +77 -0
- package/dist/implementation/world/entities.js +137 -0
- package/dist/implementation/world/entities.js.map +1 -0
- package/dist/implementation/world/execute.d.ts +36 -0
- package/dist/implementation/world/execute.js +616 -0
- package/dist/implementation/world/execute.js.map +1 -0
- package/dist/implementation/world/failures.d.ts +10 -0
- package/dist/implementation/world/failures.js +5 -0
- package/dist/implementation/world/failures.js.map +1 -0
- package/dist/implementation/world/finalizers.d.ts +63 -0
- package/dist/implementation/world/finalizers.js +408 -0
- package/dist/implementation/world/finalizers.js.map +1 -0
- package/dist/implementation/world/gpu.d.ts +64 -0
- package/dist/implementation/world/gpu.js +317 -0
- package/dist/implementation/world/gpu.js.map +1 -0
- package/dist/implementation/world/holders.d.ts +21 -0
- package/dist/implementation/world/holders.js +65 -0
- package/dist/implementation/world/holders.js.map +1 -0
- package/dist/implementation/world/index-build.d.ts +88 -0
- package/dist/implementation/world/index-build.js +404 -0
- package/dist/implementation/world/index-build.js.map +1 -0
- package/dist/implementation/world/index-hash.d.ts +99 -0
- package/dist/implementation/world/index-hash.js +440 -0
- package/dist/implementation/world/index-hash.js.map +1 -0
- package/dist/implementation/world/index-keys.d.ts +75 -0
- package/dist/implementation/world/index-keys.js +251 -0
- package/dist/implementation/world/index-keys.js.map +1 -0
- package/dist/implementation/world/index-lookups.d.ts +76 -0
- package/dist/implementation/world/index-lookups.js +567 -0
- package/dist/implementation/world/index-lookups.js.map +1 -0
- package/dist/implementation/world/index-order.d.ts +21 -0
- package/dist/implementation/world/index-order.js +174 -0
- package/dist/implementation/world/index-order.js.map +1 -0
- package/dist/implementation/world/index-readers.d.ts +101 -0
- package/dist/implementation/world/index-readers.js +341 -0
- package/dist/implementation/world/index-readers.js.map +1 -0
- package/dist/implementation/world/index-sorted.d.ts +120 -0
- package/dist/implementation/world/index-sorted.js +631 -0
- package/dist/implementation/world/index-sorted.js.map +1 -0
- package/dist/implementation/world/indexes.d.ts +139 -0
- package/dist/implementation/world/indexes.js +1174 -0
- package/dist/implementation/world/indexes.js.map +1 -0
- package/dist/implementation/world/input.d.ts +3 -0
- package/dist/implementation/world/input.js +17 -0
- package/dist/implementation/world/input.js.map +1 -0
- package/dist/implementation/world/intrinsics.d.ts +5 -0
- package/dist/implementation/world/intrinsics.js +33 -0
- package/dist/implementation/world/intrinsics.js.map +1 -0
- package/dist/implementation/world/join.d.ts +23 -0
- package/dist/implementation/world/join.js +709 -0
- package/dist/implementation/world/join.js.map +1 -0
- package/dist/implementation/world/joined-observer.d.ts +179 -0
- package/dist/implementation/world/joined-observer.js +758 -0
- package/dist/implementation/world/joined-observer.js.map +1 -0
- package/dist/implementation/world/joining.d.ts +338 -0
- package/dist/implementation/world/joining.js +143 -0
- package/dist/implementation/world/joining.js.map +1 -0
- package/dist/implementation/world/journal.d.ts +21 -0
- package/dist/implementation/world/journal.js +22 -0
- package/dist/implementation/world/journal.js.map +1 -0
- package/dist/implementation/world/kernel-indexes.d.ts +30 -0
- package/dist/implementation/world/kernel-indexes.js +172 -0
- package/dist/implementation/world/kernel-indexes.js.map +1 -0
- package/dist/implementation/world/kernel.d.ts +358 -0
- package/dist/implementation/world/kernel.js +3 -0
- package/dist/implementation/world/kernel.js.map +1 -0
- package/dist/implementation/world/kernels.d.ts +80 -0
- package/dist/implementation/world/kernels.js +284 -0
- package/dist/implementation/world/kernels.js.map +1 -0
- package/dist/implementation/world/layout-directory.d.ts +107 -0
- package/dist/implementation/world/layout-directory.js +218 -0
- package/dist/implementation/world/layout-directory.js.map +1 -0
- package/dist/implementation/world/lists.d.ts +56 -0
- package/dist/implementation/world/lists.js +118 -0
- package/dist/implementation/world/lists.js.map +1 -0
- package/dist/implementation/world/lookup-keys.d.ts +19 -0
- package/dist/implementation/world/lookup-keys.js +48 -0
- package/dist/implementation/world/lookup-keys.js.map +1 -0
- package/dist/implementation/world/loop.d.ts +73 -0
- package/dist/implementation/world/loop.js +253 -0
- package/dist/implementation/world/loop.js.map +1 -0
- package/dist/implementation/world/memory.d.ts +40 -0
- package/dist/implementation/world/memory.js +64 -0
- package/dist/implementation/world/memory.js.map +1 -0
- package/dist/implementation/world/mirror.d.ts +112 -0
- package/dist/implementation/world/mirror.js +542 -0
- package/dist/implementation/world/mirror.js.map +1 -0
- package/dist/implementation/world/move-log.d.ts +107 -0
- package/dist/implementation/world/move-log.js +165 -0
- package/dist/implementation/world/move-log.js.map +1 -0
- package/dist/implementation/world/observer.d.ts +16 -0
- package/dist/implementation/world/observer.js +131 -0
- package/dist/implementation/world/observer.js.map +1 -0
- package/dist/implementation/world/order.d.ts +38 -0
- package/dist/implementation/world/order.js +323 -0
- package/dist/implementation/world/order.js.map +1 -0
- package/dist/implementation/world/plan.d.ts +50 -0
- package/dist/implementation/world/plan.js +20 -0
- package/dist/implementation/world/plan.js.map +1 -0
- package/dist/implementation/world/pool.d.ts +70 -0
- package/dist/implementation/world/pool.js +263 -0
- package/dist/implementation/world/pool.js.map +1 -0
- package/dist/implementation/world/port.d.ts +61 -0
- package/dist/implementation/world/port.js +104 -0
- package/dist/implementation/world/port.js.map +1 -0
- package/dist/implementation/world/prepared-lookup.d.ts +11 -0
- package/dist/implementation/world/prepared-lookup.js +98 -0
- package/dist/implementation/world/prepared-lookup.js.map +1 -0
- package/dist/implementation/world/prepared-spawn.d.ts +39 -0
- package/dist/implementation/world/prepared-spawn.js +115 -0
- package/dist/implementation/world/prepared-spawn.js.map +1 -0
- package/dist/implementation/world/program.d.ts +11 -0
- package/dist/implementation/world/program.js +12 -0
- package/dist/implementation/world/program.js.map +1 -0
- package/dist/implementation/world/protocol.d.ts +185 -0
- package/dist/implementation/world/protocol.js +41 -0
- package/dist/implementation/world/protocol.js.map +1 -0
- package/dist/implementation/world/publish.d.ts +9 -0
- package/dist/implementation/world/publish.js +28 -0
- package/dist/implementation/world/publish.js.map +1 -0
- package/dist/implementation/world/ranges.d.ts +11 -0
- package/dist/implementation/world/ranges.js +47 -0
- package/dist/implementation/world/ranges.js.map +1 -0
- package/dist/implementation/world/reductions.d.ts +32 -0
- package/dist/implementation/world/reductions.js +92 -0
- package/dist/implementation/world/reductions.js.map +1 -0
- package/dist/implementation/world/register.d.ts +64 -0
- package/dist/implementation/world/register.js +368 -0
- package/dist/implementation/world/register.js.map +1 -0
- package/dist/implementation/world/remote-systems.d.ts +139 -0
- package/dist/implementation/world/remote-systems.js +551 -0
- package/dist/implementation/world/remote-systems.js.map +1 -0
- package/dist/implementation/world/remote.d.ts +25 -0
- package/dist/implementation/world/remote.js +137 -0
- package/dist/implementation/world/remote.js.map +1 -0
- package/dist/implementation/world/reports.d.ts +63 -0
- package/dist/implementation/world/reports.js +180 -0
- package/dist/implementation/world/reports.js.map +1 -0
- package/dist/implementation/world/resources.d.ts +20 -0
- package/dist/implementation/world/resources.js +63 -0
- package/dist/implementation/world/resources.js.map +1 -0
- package/dist/implementation/world/rows.d.ts +108 -0
- package/dist/implementation/world/rows.js +479 -0
- package/dist/implementation/world/rows.js.map +1 -0
- package/dist/implementation/world/runner.d.ts +123 -0
- package/dist/implementation/world/runner.js +1014 -0
- package/dist/implementation/world/runner.js.map +1 -0
- package/dist/implementation/world/sharing.d.ts +47 -0
- package/dist/implementation/world/sharing.js +548 -0
- package/dist/implementation/world/sharing.js.map +1 -0
- package/dist/implementation/world/staging.d.ts +60 -0
- package/dist/implementation/world/staging.js +169 -0
- package/dist/implementation/world/staging.js.map +1 -0
- package/dist/implementation/world/state.d.ts +261 -0
- package/dist/implementation/world/state.js +335 -0
- package/dist/implementation/world/state.js.map +1 -0
- package/dist/implementation/world/stop-lists.d.ts +114 -0
- package/dist/implementation/world/stop-lists.js +250 -0
- package/dist/implementation/world/stop-lists.js.map +1 -0
- package/dist/implementation/world/strings.d.ts +48 -0
- package/dist/implementation/world/strings.js +213 -0
- package/dist/implementation/world/strings.js.map +1 -0
- package/dist/implementation/world/structure.d.ts +39 -0
- package/dist/implementation/world/structure.js +39 -0
- package/dist/implementation/world/structure.js.map +1 -0
- package/dist/implementation/world/synchronize.d.ts +32 -0
- package/dist/implementation/world/synchronize.js +868 -0
- package/dist/implementation/world/synchronize.js.map +1 -0
- package/dist/implementation/world/tail-blocks.d.ts +40 -0
- package/dist/implementation/world/tail-blocks.js +54 -0
- package/dist/implementation/world/tail-blocks.js.map +1 -0
- package/dist/implementation/world/tails.d.ts +114 -0
- package/dist/implementation/world/tails.js +441 -0
- package/dist/implementation/world/tails.js.map +1 -0
- package/dist/implementation/world/terminal.d.ts +7 -0
- package/dist/implementation/world/terminal.js +12 -0
- package/dist/implementation/world/terminal.js.map +1 -0
- package/dist/implementation/world/thread-directory.d.ts +66 -0
- package/dist/implementation/world/thread-directory.js +173 -0
- package/dist/implementation/world/thread-directory.js.map +1 -0
- package/dist/implementation/world/thread-finalizers.d.ts +52 -0
- package/dist/implementation/world/thread-finalizers.js +266 -0
- package/dist/implementation/world/thread-finalizers.js.map +1 -0
- package/dist/implementation/world/thread-indexes.d.ts +26 -0
- package/dist/implementation/world/thread-indexes.js +71 -0
- package/dist/implementation/world/thread-indexes.js.map +1 -0
- package/dist/implementation/world/thread-observer.d.ts +41 -0
- package/dist/implementation/world/thread-observer.js +181 -0
- package/dist/implementation/world/thread-observer.js.map +1 -0
- package/dist/implementation/world/thread-systems.d.ts +113 -0
- package/dist/implementation/world/thread-systems.js +1169 -0
- package/dist/implementation/world/thread-systems.js.map +1 -0
- package/dist/implementation/world/thread-tasks.d.ts +61 -0
- package/dist/implementation/world/thread-tasks.js +69 -0
- package/dist/implementation/world/thread-tasks.js.map +1 -0
- package/dist/implementation/world/transfers.d.ts +30 -0
- package/dist/implementation/world/transfers.js +101 -0
- package/dist/implementation/world/transfers.js.map +1 -0
- package/dist/implementation/world/up.d.ts +32 -0
- package/dist/implementation/world/up.js +723 -0
- package/dist/implementation/world/up.js.map +1 -0
- package/dist/implementation/world/wasm.d.ts +112 -0
- package/dist/implementation/world/wasm.js +2159 -0
- package/dist/implementation/world/wasm.js.map +1 -0
- package/dist/implementation/world/wgsl.d.ts +20 -0
- package/dist/implementation/world/wgsl.js +485 -0
- package/dist/implementation/world/wgsl.js.map +1 -0
- package/dist/implementation/world/worker-platform.d.ts +37 -0
- package/dist/implementation/world/worker-platform.js +80 -0
- package/dist/implementation/world/worker-platform.js.map +1 -0
- package/dist/implementation/world/worker.d.ts +1 -0
- package/dist/implementation/world/worker.js +510 -0
- package/dist/implementation/world/worker.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/interface/archetype/archetype.d.ts +2 -0
- package/dist/interface/archetype/archetype.js +2 -0
- package/dist/interface/archetype/archetype.js.map +1 -0
- package/dist/interface/archetype/create.d.ts +7 -0
- package/dist/interface/archetype/create.js +11 -0
- package/dist/interface/archetype/create.js.map +1 -0
- package/dist/interface/archetype/index.d.ts +1 -0
- package/dist/interface/archetype/index.js +2 -0
- package/dist/interface/archetype/index.js.map +1 -0
- package/dist/interface/archetype/values-of.d.ts +17 -0
- package/dist/interface/archetype/values-of.js +2 -0
- package/dist/interface/archetype/values-of.js.map +1 -0
- package/dist/interface/component/component.d.ts +2 -0
- package/dist/interface/component/component.js +2 -0
- package/dist/interface/component/component.js.map +1 -0
- package/dist/interface/component/declaration.d.ts +74 -0
- package/dist/interface/component/declaration.js +2 -0
- package/dist/interface/component/declaration.js.map +1 -0
- package/dist/interface/component/index.d.ts +3 -0
- package/dist/interface/component/index.js +2 -0
- package/dist/interface/component/index.js.map +1 -0
- package/dist/interface/component/key.d.ts +2 -0
- package/dist/interface/component/key.js +2 -0
- package/dist/interface/component/key.js.map +1 -0
- package/dist/interface/component/register.d.ts +23 -0
- package/dist/interface/component/register.js +6 -0
- package/dist/interface/component/register.js.map +1 -0
- package/dist/interface/component/types.d.ts +6 -0
- package/dist/interface/component/types.js +2 -0
- package/dist/interface/component/types.js.map +1 -0
- package/dist/interface/component/value.d.ts +34 -0
- package/dist/interface/component/value.js +2 -0
- package/dist/interface/component/value.js.map +1 -0
- package/dist/interface/component/values.d.ts +6 -0
- package/dist/interface/component/values.js +2 -0
- package/dist/interface/component/values.js.map +1 -0
- package/dist/interface/entity/entity.d.ts +9 -0
- package/dist/interface/entity/entity.js +2 -0
- package/dist/interface/entity/entity.js.map +1 -0
- package/dist/interface/entity/index.d.ts +8 -0
- package/dist/interface/entity/index.js +5 -0
- package/dist/interface/entity/index.js.map +1 -0
- package/dist/interface/finalizer/body.d.ts +50 -0
- package/dist/interface/finalizer/body.js +2 -0
- package/dist/interface/finalizer/body.js.map +1 -0
- package/dist/interface/finalizer/create.d.ts +43 -0
- package/dist/interface/finalizer/create.js +97 -0
- package/dist/interface/finalizer/create.js.map +1 -0
- package/dist/interface/finalizer/created.d.ts +16 -0
- package/dist/interface/finalizer/created.js +2 -0
- package/dist/interface/finalizer/created.js.map +1 -0
- package/dist/interface/finalizer/declaration.d.ts +38 -0
- package/dist/interface/finalizer/declaration.js +2 -0
- package/dist/interface/finalizer/declaration.js.map +1 -0
- package/dist/interface/finalizer/finalizer.d.ts +8 -0
- package/dist/interface/finalizer/finalizer.js +2 -0
- package/dist/interface/finalizer/finalizer.js.map +1 -0
- package/dist/interface/finalizer/index.d.ts +1 -0
- package/dist/interface/finalizer/index.js +2 -0
- package/dist/interface/finalizer/index.js.map +1 -0
- package/dist/interface/finalizer/name.d.ts +6 -0
- package/dist/interface/finalizer/name.js +2 -0
- package/dist/interface/finalizer/name.js.map +1 -0
- package/dist/interface/gpu/accessors.d.ts +14 -0
- package/dist/interface/gpu/accessors.js +70 -0
- package/dist/interface/gpu/accessors.js.map +1 -0
- package/dist/interface/gpu/gpu.d.ts +3 -0
- package/dist/interface/gpu/gpu.js +2 -0
- package/dist/interface/gpu/gpu.js.map +1 -0
- package/dist/interface/gpu/index.d.ts +2 -0
- package/dist/interface/gpu/index.js +3 -0
- package/dist/interface/gpu/index.js.map +1 -0
- package/dist/interface/gpu/layout.d.ts +5 -0
- package/dist/interface/gpu/layout.js +21 -0
- package/dist/interface/gpu/layout.js.map +1 -0
- package/dist/interface/gpu/record.d.ts +5 -0
- package/dist/interface/gpu/record.js +6 -0
- package/dist/interface/gpu/record.js.map +1 -0
- package/dist/interface/gpu/wgsl.d.ts +8 -0
- package/dist/interface/gpu/wgsl.js +20 -0
- package/dist/interface/gpu/wgsl.js.map +1 -0
- package/dist/interface/index.d.ts +19 -0
- package/dist/interface/index.js +14 -0
- package/dist/interface/index.js.map +1 -0
- package/dist/interface/indexes/create.d.ts +30 -0
- package/dist/interface/indexes/create.js +79 -0
- package/dist/interface/indexes/create.js.map +1 -0
- package/dist/interface/indexes/created.d.ts +7 -0
- package/dist/interface/indexes/created.js +2 -0
- package/dist/interface/indexes/created.js.map +1 -0
- package/dist/interface/indexes/declaration.d.ts +13 -0
- package/dist/interface/indexes/declaration.js +2 -0
- package/dist/interface/indexes/declaration.js.map +1 -0
- package/dist/interface/indexes/index-type.d.ts +12 -0
- package/dist/interface/indexes/index-type.js +2 -0
- package/dist/interface/indexes/index-type.js.map +1 -0
- package/dist/interface/indexes/index.d.ts +1 -0
- package/dist/interface/indexes/index.js +2 -0
- package/dist/interface/indexes/index.js.map +1 -0
- package/dist/interface/indexes/name.d.ts +5 -0
- package/dist/interface/indexes/name.js +2 -0
- package/dist/interface/indexes/name.js.map +1 -0
- package/dist/interface/math/f32/index.d.ts +2 -0
- package/dist/interface/math/f32/index.js +2 -0
- package/dist/interface/math/f32/index.js.map +1 -0
- 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 -0
- package/dist/interface/math/f32/round-half-even.d.ts +2 -0
- package/dist/interface/math/f32/round-half-even.js +6 -0
- package/dist/interface/math/f32/round-half-even.js.map +1 -0
- package/dist/interface/math/f32/schema.d.ts +4 -0
- package/dist/interface/math/f32/schema.js +2 -0
- package/dist/interface/math/f32/schema.js.map +1 -0
- package/dist/interface/math/i32/index.d.ts +3 -0
- package/dist/interface/math/i32/index.js +2 -0
- package/dist/interface/math/i32/index.js.map +1 -0
- package/dist/interface/math/i32/public.d.ts +2 -0
- package/dist/interface/math/i32/public.js +3 -0
- package/dist/interface/math/i32/public.js.map +1 -0
- package/dist/interface/math/i32/schema.d.ts +5 -0
- package/dist/interface/math/i32/schema.js +2 -0
- package/dist/interface/math/i32/schema.js.map +1 -0
- package/dist/interface/math/i32/shift-right.d.ts +2 -0
- package/dist/interface/math/i32/shift-right.js +2 -0
- package/dist/interface/math/i32/shift-right.js.map +1 -0
- package/dist/interface/math/index.d.ts +8 -0
- package/dist/interface/math/index.js +9 -0
- package/dist/interface/math/index.js.map +1 -0
- package/dist/interface/math/intrinsic.d.ts +13 -0
- package/dist/interface/math/intrinsic.js +10 -0
- package/dist/interface/math/intrinsic.js.map +1 -0
- package/dist/interface/math/mat4x4/add.d.ts +2 -0
- package/dist/interface/math/mat4x4/add.js +8 -0
- package/dist/interface/math/mat4x4/add.js.map +1 -0
- package/dist/interface/math/mat4x4/determinant.d.ts +2 -0
- package/dist/interface/math/mat4x4/determinant.js +18 -0
- package/dist/interface/math/mat4x4/determinant.js.map +1 -0
- package/dist/interface/math/mat4x4/identity.d.ts +2 -0
- package/dist/interface/math/mat4x4/identity.js +7 -0
- package/dist/interface/math/mat4x4/identity.js.map +1 -0
- package/dist/interface/math/mat4x4/index.d.ts +24 -0
- package/dist/interface/math/mat4x4/index.js +24 -0
- package/dist/interface/math/mat4x4/index.js.map +1 -0
- package/dist/interface/math/mat4x4/inverse.d.ts +2 -0
- package/dist/interface/math/mat4x4/inverse.js +40 -0
- package/dist/interface/math/mat4x4/inverse.js.map +1 -0
- package/dist/interface/math/mat4x4/look-at.d.ts +3 -0
- package/dist/interface/math/mat4x4/look-at.js +22 -0
- package/dist/interface/math/mat4x4/look-at.js.map +1 -0
- package/dist/interface/math/mat4x4/multiply-vec3.d.ts +3 -0
- package/dist/interface/math/mat4x4/multiply-vec3.js +6 -0
- package/dist/interface/math/mat4x4/multiply-vec3.js.map +1 -0
- package/dist/interface/math/mat4x4/multiply-vec4.d.ts +3 -0
- package/dist/interface/math/mat4x4/multiply-vec4.js +8 -0
- package/dist/interface/math/mat4x4/multiply-vec4.js.map +1 -0
- package/dist/interface/math/mat4x4/multiply.d.ts +3 -0
- package/dist/interface/math/mat4x4/multiply.js +21 -0
- package/dist/interface/math/mat4x4/multiply.js.map +1 -0
- package/dist/interface/math/mat4x4/orthographic.d.ts +2 -0
- package/dist/interface/math/mat4x4/orthographic.js +12 -0
- package/dist/interface/math/mat4x4/orthographic.js.map +1 -0
- package/dist/interface/math/mat4x4/perspective.d.ts +2 -0
- package/dist/interface/math/mat4x4/perspective.js +22 -0
- package/dist/interface/math/mat4x4/perspective.js.map +1 -0
- package/dist/interface/math/mat4x4/public.d.ts +20 -0
- package/dist/interface/math/mat4x4/public.js +21 -0
- package/dist/interface/math/mat4x4/public.js.map +1 -0
- package/dist/interface/math/mat4x4/rotation-x.d.ts +2 -0
- package/dist/interface/math/mat4x4/rotation-x.js +11 -0
- package/dist/interface/math/mat4x4/rotation-x.js.map +1 -0
- package/dist/interface/math/mat4x4/rotation-y.d.ts +2 -0
- package/dist/interface/math/mat4x4/rotation-y.js +11 -0
- package/dist/interface/math/mat4x4/rotation-y.js.map +1 -0
- package/dist/interface/math/mat4x4/rotation-z.d.ts +2 -0
- package/dist/interface/math/mat4x4/rotation-z.js +11 -0
- package/dist/interface/math/mat4x4/rotation-z.js.map +1 -0
- package/dist/interface/math/mat4x4/scale.d.ts +2 -0
- package/dist/interface/math/mat4x4/scale.js +8 -0
- package/dist/interface/math/mat4x4/scale.js.map +1 -0
- package/dist/interface/math/mat4x4/scaling.d.ts +2 -0
- package/dist/interface/math/mat4x4/scaling.js +7 -0
- package/dist/interface/math/mat4x4/scaling.js.map +1 -0
- package/dist/interface/math/mat4x4/schema.d.ts +9 -0
- package/dist/interface/math/mat4x4/schema.js +3 -0
- package/dist/interface/math/mat4x4/schema.js.map +1 -0
- package/dist/interface/math/mat4x4/subtract.d.ts +2 -0
- package/dist/interface/math/mat4x4/subtract.js +8 -0
- package/dist/interface/math/mat4x4/subtract.js.map +1 -0
- package/dist/interface/math/mat4x4/translation.d.ts +2 -0
- package/dist/interface/math/mat4x4/translation.js +7 -0
- package/dist/interface/math/mat4x4/translation.js.map +1 -0
- package/dist/interface/math/mat4x4/transpose.d.ts +2 -0
- package/dist/interface/math/mat4x4/transpose.js +8 -0
- package/dist/interface/math/mat4x4/transpose.js.map +1 -0
- package/dist/interface/math/mat4x4/zero.d.ts +2 -0
- package/dist/interface/math/mat4x4/zero.js +7 -0
- package/dist/interface/math/mat4x4/zero.js.map +1 -0
- package/dist/interface/math/quat/add.d.ts +2 -0
- package/dist/interface/math/quat/add.js +8 -0
- package/dist/interface/math/quat/add.js.map +1 -0
- package/dist/interface/math/quat/align-to.d.ts +12 -0
- package/dist/interface/math/quat/align-to.js +42 -0
- package/dist/interface/math/quat/align-to.js.map +1 -0
- package/dist/interface/math/quat/conjugate.d.ts +2 -0
- package/dist/interface/math/quat/conjugate.js +2 -0
- package/dist/interface/math/quat/conjugate.js.map +1 -0
- package/dist/interface/math/quat/distance.d.ts +2 -0
- package/dist/interface/math/quat/distance.js +4 -0
- package/dist/interface/math/quat/distance.js.map +1 -0
- package/dist/interface/math/quat/dot.d.ts +2 -0
- package/dist/interface/math/quat/dot.js +3 -0
- package/dist/interface/math/quat/dot.js.map +1 -0
- package/dist/interface/math/quat/from-axis-angle.d.ts +3 -0
- package/dist/interface/math/quat/from-axis-angle.js +13 -0
- package/dist/interface/math/quat/from-axis-angle.js.map +1 -0
- package/dist/interface/math/quat/from-euler.d.ts +2 -0
- package/dist/interface/math/quat/from-euler.js +15 -0
- package/dist/interface/math/quat/from-euler.js.map +1 -0
- package/dist/interface/math/quat/identity.d.ts +2 -0
- package/dist/interface/math/quat/identity.js +2 -0
- package/dist/interface/math/quat/identity.js.map +1 -0
- package/dist/interface/math/quat/index.d.ts +2 -0
- package/dist/interface/math/quat/index.js +2 -0
- package/dist/interface/math/quat/index.js.map +1 -0
- package/dist/interface/math/quat/inverse.d.ts +2 -0
- package/dist/interface/math/quat/inverse.js +10 -0
- package/dist/interface/math/quat/inverse.js.map +1 -0
- package/dist/interface/math/quat/length-squared.d.ts +2 -0
- package/dist/interface/math/quat/length-squared.js +2 -0
- package/dist/interface/math/quat/length-squared.js.map +1 -0
- package/dist/interface/math/quat/length.d.ts +2 -0
- package/dist/interface/math/quat/length.js +3 -0
- package/dist/interface/math/quat/length.js.map +1 -0
- package/dist/interface/math/quat/lerp.d.ts +2 -0
- package/dist/interface/math/quat/lerp.js +7 -0
- package/dist/interface/math/quat/lerp.js.map +1 -0
- package/dist/interface/math/quat/look-at.d.ts +3 -0
- package/dist/interface/math/quat/look-at.js +49 -0
- package/dist/interface/math/quat/look-at.js.map +1 -0
- package/dist/interface/math/quat/multiply.d.ts +2 -0
- package/dist/interface/math/quat/multiply.js +7 -0
- package/dist/interface/math/quat/multiply.js.map +1 -0
- package/dist/interface/math/quat/negate.d.ts +2 -0
- package/dist/interface/math/quat/negate.js +3 -0
- package/dist/interface/math/quat/negate.js.map +1 -0
- package/dist/interface/math/quat/normalize.d.ts +2 -0
- package/dist/interface/math/quat/normalize.js +7 -0
- package/dist/interface/math/quat/normalize.js.map +1 -0
- package/dist/interface/math/quat/public.d.ts +24 -0
- package/dist/interface/math/quat/public.js +25 -0
- package/dist/interface/math/quat/public.js.map +1 -0
- package/dist/interface/math/quat/rotate-vec3.d.ts +3 -0
- package/dist/interface/math/quat/rotate-vec3.js +14 -0
- package/dist/interface/math/quat/rotate-vec3.js.map +1 -0
- package/dist/interface/math/quat/scale.d.ts +2 -0
- package/dist/interface/math/quat/scale.js +3 -0
- package/dist/interface/math/quat/scale.js.map +1 -0
- package/dist/interface/math/quat/schema.d.ts +9 -0
- package/dist/interface/math/quat/schema.js +3 -0
- package/dist/interface/math/quat/schema.js.map +1 -0
- package/dist/interface/math/quat/slerp.d.ts +2 -0
- package/dist/interface/math/quat/slerp.js +21 -0
- package/dist/interface/math/quat/slerp.js.map +1 -0
- package/dist/interface/math/quat/subtract.d.ts +2 -0
- package/dist/interface/math/quat/subtract.js +8 -0
- package/dist/interface/math/quat/subtract.js.map +1 -0
- package/dist/interface/math/quat/to-axis-angle.d.ts +6 -0
- package/dist/interface/math/quat/to-axis-angle.js +12 -0
- package/dist/interface/math/quat/to-axis-angle.js.map +1 -0
- package/dist/interface/math/quat/to-euler.d.ts +3 -0
- package/dist/interface/math/quat/to-euler.js +21 -0
- package/dist/interface/math/quat/to-euler.js.map +1 -0
- package/dist/interface/math/quat/to-mat4.d.ts +8 -0
- package/dist/interface/math/quat/to-mat4.js +24 -0
- package/dist/interface/math/quat/to-mat4.js.map +1 -0
- package/dist/interface/math/u32/count-leading-zeros.d.ts +2 -0
- package/dist/interface/math/u32/count-leading-zeros.js +3 -0
- package/dist/interface/math/u32/count-leading-zeros.js.map +1 -0
- package/dist/interface/math/u32/count-one-bits.d.ts +2 -0
- package/dist/interface/math/u32/count-one-bits.js +9 -0
- package/dist/interface/math/u32/count-one-bits.js.map +1 -0
- package/dist/interface/math/u32/count-trailing-zeros.d.ts +2 -0
- package/dist/interface/math/u32/count-trailing-zeros.js +6 -0
- package/dist/interface/math/u32/count-trailing-zeros.js.map +1 -0
- package/dist/interface/math/u32/index.d.ts +3 -0
- package/dist/interface/math/u32/index.js +2 -0
- package/dist/interface/math/u32/index.js.map +1 -0
- package/dist/interface/math/u32/public.d.ts +6 -0
- package/dist/interface/math/u32/public.js +7 -0
- package/dist/interface/math/u32/public.js.map +1 -0
- package/dist/interface/math/u32/reverse-bits.d.ts +2 -0
- package/dist/interface/math/u32/reverse-bits.js +10 -0
- package/dist/interface/math/u32/reverse-bits.js.map +1 -0
- package/dist/interface/math/u32/schema.d.ts +5 -0
- package/dist/interface/math/u32/schema.js +2 -0
- package/dist/interface/math/u32/schema.js.map +1 -0
- package/dist/interface/math/u32/shift-right.d.ts +2 -0
- package/dist/interface/math/u32/shift-right.js +2 -0
- package/dist/interface/math/u32/shift-right.js.map +1 -0
- package/dist/interface/math/vec2/f32/abs.d.ts +2 -0
- package/dist/interface/math/vec2/f32/abs.js +3 -0
- package/dist/interface/math/vec2/f32/abs.js.map +1 -0
- package/dist/interface/math/vec2/f32/acos.d.ts +2 -0
- package/dist/interface/math/vec2/f32/acos.js +3 -0
- package/dist/interface/math/vec2/f32/acos.js.map +1 -0
- package/dist/interface/math/vec2/f32/acosh.d.ts +2 -0
- package/dist/interface/math/vec2/f32/acosh.js +3 -0
- package/dist/interface/math/vec2/f32/acosh.js.map +1 -0
- package/dist/interface/math/vec2/f32/add.d.ts +2 -0
- package/dist/interface/math/vec2/f32/add.js +3 -0
- package/dist/interface/math/vec2/f32/add.js.map +1 -0
- package/dist/interface/math/vec2/f32/asin.d.ts +2 -0
- package/dist/interface/math/vec2/f32/asin.js +3 -0
- package/dist/interface/math/vec2/f32/asin.js.map +1 -0
- package/dist/interface/math/vec2/f32/asinh.d.ts +2 -0
- package/dist/interface/math/vec2/f32/asinh.js +3 -0
- package/dist/interface/math/vec2/f32/asinh.js.map +1 -0
- package/dist/interface/math/vec2/f32/atan.d.ts +2 -0
- package/dist/interface/math/vec2/f32/atan.js +3 -0
- package/dist/interface/math/vec2/f32/atan.js.map +1 -0
- package/dist/interface/math/vec2/f32/atanh.d.ts +2 -0
- package/dist/interface/math/vec2/f32/atanh.js +3 -0
- package/dist/interface/math/vec2/f32/atanh.js.map +1 -0
- package/dist/interface/math/vec2/f32/ceil.d.ts +2 -0
- package/dist/interface/math/vec2/f32/ceil.js +3 -0
- package/dist/interface/math/vec2/f32/ceil.js.map +1 -0
- package/dist/interface/math/vec2/f32/clamp.d.ts +2 -0
- package/dist/interface/math/vec2/f32/clamp.js +5 -0
- package/dist/interface/math/vec2/f32/clamp.js.map +1 -0
- package/dist/interface/math/vec2/f32/cos.d.ts +2 -0
- package/dist/interface/math/vec2/f32/cos.js +3 -0
- package/dist/interface/math/vec2/f32/cos.js.map +1 -0
- package/dist/interface/math/vec2/f32/cosh.d.ts +2 -0
- package/dist/interface/math/vec2/f32/cosh.js +3 -0
- package/dist/interface/math/vec2/f32/cosh.js.map +1 -0
- package/dist/interface/math/vec2/f32/distance.d.ts +2 -0
- package/dist/interface/math/vec2/f32/distance.js +5 -0
- package/dist/interface/math/vec2/f32/distance.js.map +1 -0
- package/dist/interface/math/vec2/f32/dot.d.ts +2 -0
- package/dist/interface/math/vec2/f32/dot.js +3 -0
- package/dist/interface/math/vec2/f32/dot.js.map +1 -0
- package/dist/interface/math/vec2/f32/equals.d.ts +2 -0
- package/dist/interface/math/vec2/f32/equals.js +2 -0
- package/dist/interface/math/vec2/f32/equals.js.map +1 -0
- package/dist/interface/math/vec2/f32/exp.d.ts +2 -0
- package/dist/interface/math/vec2/f32/exp.js +3 -0
- package/dist/interface/math/vec2/f32/exp.js.map +1 -0
- package/dist/interface/math/vec2/f32/exp2.d.ts +2 -0
- package/dist/interface/math/vec2/f32/exp2.js +3 -0
- package/dist/interface/math/vec2/f32/exp2.js.map +1 -0
- package/dist/interface/math/vec2/f32/f32.d.ts +2 -0
- package/dist/interface/math/vec2/f32/f32.js +2 -0
- package/dist/interface/math/vec2/f32/f32.js.map +1 -0
- package/dist/interface/math/vec2/f32/faceforward.d.ts +2 -0
- package/dist/interface/math/vec2/f32/faceforward.js +5 -0
- package/dist/interface/math/vec2/f32/faceforward.js.map +1 -0
- package/dist/interface/math/vec2/f32/floor.d.ts +2 -0
- package/dist/interface/math/vec2/f32/floor.js +3 -0
- package/dist/interface/math/vec2/f32/floor.js.map +1 -0
- package/dist/interface/math/vec2/f32/fract.d.ts +2 -0
- package/dist/interface/math/vec2/f32/fract.js +3 -0
- package/dist/interface/math/vec2/f32/fract.js.map +1 -0
- package/dist/interface/math/vec2/f32/length.d.ts +2 -0
- package/dist/interface/math/vec2/f32/length.js +3 -0
- package/dist/interface/math/vec2/f32/length.js.map +1 -0
- package/dist/interface/math/vec2/f32/log.d.ts +2 -0
- package/dist/interface/math/vec2/f32/log.js +3 -0
- package/dist/interface/math/vec2/f32/log.js.map +1 -0
- package/dist/interface/math/vec2/f32/log2.d.ts +2 -0
- package/dist/interface/math/vec2/f32/log2.js +3 -0
- package/dist/interface/math/vec2/f32/log2.js.map +1 -0
- package/dist/interface/math/vec2/f32/max.d.ts +2 -0
- package/dist/interface/math/vec2/f32/max.js +3 -0
- package/dist/interface/math/vec2/f32/max.js.map +1 -0
- package/dist/interface/math/vec2/f32/min.d.ts +2 -0
- package/dist/interface/math/vec2/f32/min.js +3 -0
- package/dist/interface/math/vec2/f32/min.js.map +1 -0
- package/dist/interface/math/vec2/f32/mix.d.ts +2 -0
- package/dist/interface/math/vec2/f32/mix.js +6 -0
- package/dist/interface/math/vec2/f32/mix.js.map +1 -0
- package/dist/interface/math/vec2/f32/mod.d.ts +2 -0
- package/dist/interface/math/vec2/f32/mod.js +2 -0
- package/dist/interface/math/vec2/f32/mod.js.map +1 -0
- package/dist/interface/math/vec2/f32/modf.d.ts +5 -0
- package/dist/interface/math/vec2/f32/modf.js +5 -0
- package/dist/interface/math/vec2/f32/modf.js.map +1 -0
- package/dist/interface/math/vec2/f32/negate.d.ts +2 -0
- package/dist/interface/math/vec2/f32/negate.js +3 -0
- package/dist/interface/math/vec2/f32/negate.js.map +1 -0
- package/dist/interface/math/vec2/f32/normalize.d.ts +2 -0
- package/dist/interface/math/vec2/f32/normalize.js +5 -0
- package/dist/interface/math/vec2/f32/normalize.js.map +1 -0
- package/dist/interface/math/vec2/f32/pow.d.ts +3 -0
- package/dist/interface/math/vec2/f32/pow.js +7 -0
- package/dist/interface/math/vec2/f32/pow.js.map +1 -0
- package/dist/interface/math/vec2/f32/public.d.ts +47 -0
- package/dist/interface/math/vec2/f32/public.js +48 -0
- package/dist/interface/math/vec2/f32/public.js.map +1 -0
- package/dist/interface/math/vec2/f32/reflect.d.ts +2 -0
- package/dist/interface/math/vec2/f32/reflect.js +9 -0
- package/dist/interface/math/vec2/f32/reflect.js.map +1 -0
- package/dist/interface/math/vec2/f32/refract.d.ts +2 -0
- package/dist/interface/math/vec2/f32/refract.js +14 -0
- package/dist/interface/math/vec2/f32/refract.js.map +1 -0
- package/dist/interface/math/vec2/f32/round.d.ts +2 -0
- package/dist/interface/math/vec2/f32/round.js +4 -0
- package/dist/interface/math/vec2/f32/round.js.map +1 -0
- package/dist/interface/math/vec2/f32/scale.d.ts +2 -0
- package/dist/interface/math/vec2/f32/scale.js +3 -0
- package/dist/interface/math/vec2/f32/scale.js.map +1 -0
- package/dist/interface/math/vec2/f32/schema.d.ts +9 -0
- package/dist/interface/math/vec2/f32/schema.js +3 -0
- package/dist/interface/math/vec2/f32/schema.js.map +1 -0
- package/dist/interface/math/vec2/f32/sign.d.ts +2 -0
- package/dist/interface/math/vec2/f32/sign.js +3 -0
- package/dist/interface/math/vec2/f32/sign.js.map +1 -0
- package/dist/interface/math/vec2/f32/sin.d.ts +2 -0
- package/dist/interface/math/vec2/f32/sin.js +3 -0
- package/dist/interface/math/vec2/f32/sin.js.map +1 -0
- package/dist/interface/math/vec2/f32/sinh.d.ts +2 -0
- package/dist/interface/math/vec2/f32/sinh.js +3 -0
- package/dist/interface/math/vec2/f32/sinh.js.map +1 -0
- package/dist/interface/math/vec2/f32/smoothstep.d.ts +2 -0
- package/dist/interface/math/vec2/f32/smoothstep.js +7 -0
- package/dist/interface/math/vec2/f32/smoothstep.js.map +1 -0
- package/dist/interface/math/vec2/f32/sqrt.d.ts +2 -0
- package/dist/interface/math/vec2/f32/sqrt.js +3 -0
- package/dist/interface/math/vec2/f32/sqrt.js.map +1 -0
- package/dist/interface/math/vec2/f32/step.d.ts +2 -0
- package/dist/interface/math/vec2/f32/step.js +6 -0
- package/dist/interface/math/vec2/f32/step.js.map +1 -0
- package/dist/interface/math/vec2/f32/subtract.d.ts +2 -0
- package/dist/interface/math/vec2/f32/subtract.js +3 -0
- package/dist/interface/math/vec2/f32/subtract.js.map +1 -0
- package/dist/interface/math/vec2/f32/tan.d.ts +2 -0
- package/dist/interface/math/vec2/f32/tan.js +3 -0
- package/dist/interface/math/vec2/f32/tan.js.map +1 -0
- package/dist/interface/math/vec2/f32/tanh.d.ts +2 -0
- package/dist/interface/math/vec2/f32/tanh.js +3 -0
- package/dist/interface/math/vec2/f32/tanh.js.map +1 -0
- package/dist/interface/math/vec2/f32/trunc.d.ts +2 -0
- package/dist/interface/math/vec2/f32/trunc.js +3 -0
- package/dist/interface/math/vec2/f32/trunc.js.map +1 -0
- package/dist/interface/math/vec2/f32/zero.d.ts +2 -0
- package/dist/interface/math/vec2/f32/zero.js +2 -0
- package/dist/interface/math/vec2/f32/zero.js.map +1 -0
- package/dist/interface/math/vec2/i32/abs.d.ts +2 -0
- package/dist/interface/math/vec2/i32/abs.js +3 -0
- package/dist/interface/math/vec2/i32/abs.js.map +1 -0
- package/dist/interface/math/vec2/i32/add.d.ts +2 -0
- package/dist/interface/math/vec2/i32/add.js +3 -0
- package/dist/interface/math/vec2/i32/add.js.map +1 -0
- package/dist/interface/math/vec2/i32/bitwise-and.d.ts +2 -0
- package/dist/interface/math/vec2/i32/bitwise-and.js +3 -0
- package/dist/interface/math/vec2/i32/bitwise-and.js.map +1 -0
- package/dist/interface/math/vec2/i32/bitwise-not.d.ts +2 -0
- package/dist/interface/math/vec2/i32/bitwise-not.js +3 -0
- package/dist/interface/math/vec2/i32/bitwise-not.js.map +1 -0
- package/dist/interface/math/vec2/i32/bitwise-or.d.ts +2 -0
- package/dist/interface/math/vec2/i32/bitwise-or.js +3 -0
- package/dist/interface/math/vec2/i32/bitwise-or.js.map +1 -0
- package/dist/interface/math/vec2/i32/bitwise-xor.d.ts +2 -0
- package/dist/interface/math/vec2/i32/bitwise-xor.js +3 -0
- package/dist/interface/math/vec2/i32/bitwise-xor.js.map +1 -0
- package/dist/interface/math/vec2/i32/clamp.d.ts +2 -0
- package/dist/interface/math/vec2/i32/clamp.js +5 -0
- package/dist/interface/math/vec2/i32/clamp.js.map +1 -0
- package/dist/interface/math/vec2/i32/count-leading-zeros.d.ts +2 -0
- package/dist/interface/math/vec2/i32/count-leading-zeros.js +7 -0
- package/dist/interface/math/vec2/i32/count-leading-zeros.js.map +1 -0
- package/dist/interface/math/vec2/i32/count-one-bits.d.ts +2 -0
- package/dist/interface/math/vec2/i32/count-one-bits.js +7 -0
- package/dist/interface/math/vec2/i32/count-one-bits.js.map +1 -0
- package/dist/interface/math/vec2/i32/count-trailing-zeros.d.ts +2 -0
- package/dist/interface/math/vec2/i32/count-trailing-zeros.js +7 -0
- package/dist/interface/math/vec2/i32/count-trailing-zeros.js.map +1 -0
- package/dist/interface/math/vec2/i32/equals.d.ts +2 -0
- package/dist/interface/math/vec2/i32/equals.js +2 -0
- package/dist/interface/math/vec2/i32/equals.js.map +1 -0
- package/dist/interface/math/vec2/i32/i32.d.ts +3 -0
- package/dist/interface/math/vec2/i32/i32.js +2 -0
- package/dist/interface/math/vec2/i32/i32.js.map +1 -0
- package/dist/interface/math/vec2/i32/max.d.ts +2 -0
- package/dist/interface/math/vec2/i32/max.js +3 -0
- package/dist/interface/math/vec2/i32/max.js.map +1 -0
- package/dist/interface/math/vec2/i32/min.d.ts +2 -0
- package/dist/interface/math/vec2/i32/min.js +3 -0
- package/dist/interface/math/vec2/i32/min.js.map +1 -0
- package/dist/interface/math/vec2/i32/negate.d.ts +2 -0
- package/dist/interface/math/vec2/i32/negate.js +3 -0
- package/dist/interface/math/vec2/i32/negate.js.map +1 -0
- package/dist/interface/math/vec2/i32/public.d.ts +21 -0
- package/dist/interface/math/vec2/i32/public.js +22 -0
- package/dist/interface/math/vec2/i32/public.js.map +1 -0
- package/dist/interface/math/vec2/i32/reverse-bits.d.ts +2 -0
- package/dist/interface/math/vec2/i32/reverse-bits.js +4 -0
- package/dist/interface/math/vec2/i32/reverse-bits.js.map +1 -0
- package/dist/interface/math/vec2/i32/scale.d.ts +3 -0
- package/dist/interface/math/vec2/i32/scale.js +3 -0
- package/dist/interface/math/vec2/i32/scale.js.map +1 -0
- package/dist/interface/math/vec2/i32/schema.d.ts +10 -0
- package/dist/interface/math/vec2/i32/schema.js +3 -0
- package/dist/interface/math/vec2/i32/schema.js.map +1 -0
- package/dist/interface/math/vec2/i32/shift-left.d.ts +2 -0
- package/dist/interface/math/vec2/i32/shift-left.js +2 -0
- package/dist/interface/math/vec2/i32/shift-left.js.map +1 -0
- package/dist/interface/math/vec2/i32/shift-right.d.ts +2 -0
- package/dist/interface/math/vec2/i32/shift-right.js +6 -0
- package/dist/interface/math/vec2/i32/shift-right.js.map +1 -0
- package/dist/interface/math/vec2/i32/subtract.d.ts +2 -0
- package/dist/interface/math/vec2/i32/subtract.js +3 -0
- package/dist/interface/math/vec2/i32/subtract.js.map +1 -0
- package/dist/interface/math/vec2/i32/zero.d.ts +2 -0
- package/dist/interface/math/vec2/i32/zero.js +2 -0
- package/dist/interface/math/vec2/i32/zero.js.map +1 -0
- package/dist/interface/math/vec2/index.d.ts +4 -0
- package/dist/interface/math/vec2/index.js +2 -0
- package/dist/interface/math/vec2/index.js.map +1 -0
- package/dist/interface/math/vec2/public.d.ts +4 -0
- package/dist/interface/math/vec2/public.js +5 -0
- package/dist/interface/math/vec2/public.js.map +1 -0
- package/dist/interface/math/vec2/u32/add.d.ts +2 -0
- package/dist/interface/math/vec2/u32/add.js +6 -0
- package/dist/interface/math/vec2/u32/add.js.map +1 -0
- package/dist/interface/math/vec2/u32/bitwise-and.d.ts +2 -0
- package/dist/interface/math/vec2/u32/bitwise-and.js +6 -0
- package/dist/interface/math/vec2/u32/bitwise-and.js.map +1 -0
- package/dist/interface/math/vec2/u32/bitwise-not.d.ts +2 -0
- package/dist/interface/math/vec2/u32/bitwise-not.js +3 -0
- package/dist/interface/math/vec2/u32/bitwise-not.js.map +1 -0
- package/dist/interface/math/vec2/u32/bitwise-or.d.ts +2 -0
- package/dist/interface/math/vec2/u32/bitwise-or.js +6 -0
- package/dist/interface/math/vec2/u32/bitwise-or.js.map +1 -0
- package/dist/interface/math/vec2/u32/bitwise-xor.d.ts +2 -0
- package/dist/interface/math/vec2/u32/bitwise-xor.js +6 -0
- package/dist/interface/math/vec2/u32/bitwise-xor.js.map +1 -0
- package/dist/interface/math/vec2/u32/clamp.d.ts +2 -0
- package/dist/interface/math/vec2/u32/clamp.js +5 -0
- package/dist/interface/math/vec2/u32/clamp.js.map +1 -0
- package/dist/interface/math/vec2/u32/count-leading-zeros.d.ts +2 -0
- package/dist/interface/math/vec2/u32/count-leading-zeros.js +7 -0
- package/dist/interface/math/vec2/u32/count-leading-zeros.js.map +1 -0
- package/dist/interface/math/vec2/u32/count-one-bits.d.ts +2 -0
- package/dist/interface/math/vec2/u32/count-one-bits.js +7 -0
- package/dist/interface/math/vec2/u32/count-one-bits.js.map +1 -0
- package/dist/interface/math/vec2/u32/count-trailing-zeros.d.ts +2 -0
- package/dist/interface/math/vec2/u32/count-trailing-zeros.js +7 -0
- package/dist/interface/math/vec2/u32/count-trailing-zeros.js.map +1 -0
- package/dist/interface/math/vec2/u32/equals.d.ts +2 -0
- package/dist/interface/math/vec2/u32/equals.js +2 -0
- package/dist/interface/math/vec2/u32/equals.js.map +1 -0
- package/dist/interface/math/vec2/u32/max.d.ts +2 -0
- package/dist/interface/math/vec2/u32/max.js +6 -0
- package/dist/interface/math/vec2/u32/max.js.map +1 -0
- package/dist/interface/math/vec2/u32/min.d.ts +2 -0
- package/dist/interface/math/vec2/u32/min.js +6 -0
- package/dist/interface/math/vec2/u32/min.js.map +1 -0
- package/dist/interface/math/vec2/u32/negate.d.ts +2 -0
- package/dist/interface/math/vec2/u32/negate.js +2 -0
- package/dist/interface/math/vec2/u32/negate.js.map +1 -0
- package/dist/interface/math/vec2/u32/public.d.ts +20 -0
- package/dist/interface/math/vec2/u32/public.js +21 -0
- package/dist/interface/math/vec2/u32/public.js.map +1 -0
- package/dist/interface/math/vec2/u32/reverse-bits.d.ts +2 -0
- package/dist/interface/math/vec2/u32/reverse-bits.js +7 -0
- package/dist/interface/math/vec2/u32/reverse-bits.js.map +1 -0
- package/dist/interface/math/vec2/u32/scale.d.ts +3 -0
- package/dist/interface/math/vec2/u32/scale.js +3 -0
- package/dist/interface/math/vec2/u32/scale.js.map +1 -0
- package/dist/interface/math/vec2/u32/schema.d.ts +10 -0
- package/dist/interface/math/vec2/u32/schema.js +3 -0
- package/dist/interface/math/vec2/u32/schema.js.map +1 -0
- package/dist/interface/math/vec2/u32/shift-left.d.ts +2 -0
- package/dist/interface/math/vec2/u32/shift-left.js +2 -0
- package/dist/interface/math/vec2/u32/shift-left.js.map +1 -0
- package/dist/interface/math/vec2/u32/shift-right.d.ts +2 -0
- package/dist/interface/math/vec2/u32/shift-right.js +6 -0
- package/dist/interface/math/vec2/u32/shift-right.js.map +1 -0
- package/dist/interface/math/vec2/u32/subtract.d.ts +2 -0
- package/dist/interface/math/vec2/u32/subtract.js +6 -0
- package/dist/interface/math/vec2/u32/subtract.js.map +1 -0
- package/dist/interface/math/vec2/u32/u32.d.ts +3 -0
- package/dist/interface/math/vec2/u32/u32.js +2 -0
- package/dist/interface/math/vec2/u32/u32.js.map +1 -0
- package/dist/interface/math/vec2/u32/zero.d.ts +2 -0
- package/dist/interface/math/vec2/u32/zero.js +2 -0
- package/dist/interface/math/vec2/u32/zero.js.map +1 -0
- package/dist/interface/math/vec3/f32/abs.d.ts +2 -0
- package/dist/interface/math/vec3/f32/abs.js +3 -0
- package/dist/interface/math/vec3/f32/abs.js.map +1 -0
- package/dist/interface/math/vec3/f32/acos.d.ts +2 -0
- package/dist/interface/math/vec3/f32/acos.js +3 -0
- package/dist/interface/math/vec3/f32/acos.js.map +1 -0
- package/dist/interface/math/vec3/f32/acosh.d.ts +2 -0
- package/dist/interface/math/vec3/f32/acosh.js +3 -0
- package/dist/interface/math/vec3/f32/acosh.js.map +1 -0
- package/dist/interface/math/vec3/f32/add.d.ts +2 -0
- package/dist/interface/math/vec3/f32/add.js +7 -0
- package/dist/interface/math/vec3/f32/add.js.map +1 -0
- package/dist/interface/math/vec3/f32/asin.d.ts +2 -0
- package/dist/interface/math/vec3/f32/asin.js +3 -0
- package/dist/interface/math/vec3/f32/asin.js.map +1 -0
- package/dist/interface/math/vec3/f32/asinh.d.ts +2 -0
- package/dist/interface/math/vec3/f32/asinh.js +3 -0
- package/dist/interface/math/vec3/f32/asinh.js.map +1 -0
- package/dist/interface/math/vec3/f32/atan.d.ts +2 -0
- package/dist/interface/math/vec3/f32/atan.js +3 -0
- package/dist/interface/math/vec3/f32/atan.js.map +1 -0
- package/dist/interface/math/vec3/f32/atanh.d.ts +2 -0
- package/dist/interface/math/vec3/f32/atanh.js +3 -0
- package/dist/interface/math/vec3/f32/atanh.js.map +1 -0
- package/dist/interface/math/vec3/f32/ceil.d.ts +2 -0
- package/dist/interface/math/vec3/f32/ceil.js +3 -0
- package/dist/interface/math/vec3/f32/ceil.js.map +1 -0
- package/dist/interface/math/vec3/f32/clamp.d.ts +2 -0
- package/dist/interface/math/vec3/f32/clamp.js +5 -0
- package/dist/interface/math/vec3/f32/clamp.js.map +1 -0
- package/dist/interface/math/vec3/f32/cos.d.ts +2 -0
- package/dist/interface/math/vec3/f32/cos.js +3 -0
- package/dist/interface/math/vec3/f32/cos.js.map +1 -0
- package/dist/interface/math/vec3/f32/cosh.d.ts +2 -0
- package/dist/interface/math/vec3/f32/cosh.js +3 -0
- package/dist/interface/math/vec3/f32/cosh.js.map +1 -0
- package/dist/interface/math/vec3/f32/cross.d.ts +2 -0
- package/dist/interface/math/vec3/f32/cross.js +7 -0
- package/dist/interface/math/vec3/f32/cross.js.map +1 -0
- package/dist/interface/math/vec3/f32/distance-squared.d.ts +2 -0
- package/dist/interface/math/vec3/f32/distance-squared.js +7 -0
- package/dist/interface/math/vec3/f32/distance-squared.js.map +1 -0
- package/dist/interface/math/vec3/f32/distance.d.ts +2 -0
- package/dist/interface/math/vec3/f32/distance.js +5 -0
- package/dist/interface/math/vec3/f32/distance.js.map +1 -0
- package/dist/interface/math/vec3/f32/dot.d.ts +2 -0
- package/dist/interface/math/vec3/f32/dot.js +3 -0
- package/dist/interface/math/vec3/f32/dot.js.map +1 -0
- package/dist/interface/math/vec3/f32/equals.d.ts +2 -0
- package/dist/interface/math/vec3/f32/equals.js +2 -0
- package/dist/interface/math/vec3/f32/equals.js.map +1 -0
- package/dist/interface/math/vec3/f32/exp.d.ts +2 -0
- package/dist/interface/math/vec3/f32/exp.js +3 -0
- package/dist/interface/math/vec3/f32/exp.js.map +1 -0
- package/dist/interface/math/vec3/f32/exp2.d.ts +2 -0
- package/dist/interface/math/vec3/f32/exp2.js +3 -0
- package/dist/interface/math/vec3/f32/exp2.js.map +1 -0
- package/dist/interface/math/vec3/f32/f32.d.ts +2 -0
- package/dist/interface/math/vec3/f32/f32.js +2 -0
- package/dist/interface/math/vec3/f32/f32.js.map +1 -0
- package/dist/interface/math/vec3/f32/faceforward.d.ts +2 -0
- package/dist/interface/math/vec3/f32/faceforward.js +5 -0
- package/dist/interface/math/vec3/f32/faceforward.js.map +1 -0
- package/dist/interface/math/vec3/f32/floor.d.ts +2 -0
- package/dist/interface/math/vec3/f32/floor.js +3 -0
- package/dist/interface/math/vec3/f32/floor.js.map +1 -0
- package/dist/interface/math/vec3/f32/fract.d.ts +2 -0
- package/dist/interface/math/vec3/f32/fract.js +7 -0
- package/dist/interface/math/vec3/f32/fract.js.map +1 -0
- package/dist/interface/math/vec3/f32/length-squared.d.ts +2 -0
- package/dist/interface/math/vec3/f32/length-squared.js +3 -0
- package/dist/interface/math/vec3/f32/length-squared.js.map +1 -0
- package/dist/interface/math/vec3/f32/length.d.ts +2 -0
- package/dist/interface/math/vec3/f32/length.js +3 -0
- package/dist/interface/math/vec3/f32/length.js.map +1 -0
- package/dist/interface/math/vec3/f32/log.d.ts +2 -0
- package/dist/interface/math/vec3/f32/log.js +3 -0
- package/dist/interface/math/vec3/f32/log.js.map +1 -0
- package/dist/interface/math/vec3/f32/log2.d.ts +2 -0
- package/dist/interface/math/vec3/f32/log2.js +3 -0
- package/dist/interface/math/vec3/f32/log2.js.map +1 -0
- package/dist/interface/math/vec3/f32/max.d.ts +2 -0
- package/dist/interface/math/vec3/f32/max.js +7 -0
- package/dist/interface/math/vec3/f32/max.js.map +1 -0
- package/dist/interface/math/vec3/f32/min.d.ts +2 -0
- package/dist/interface/math/vec3/f32/min.js +7 -0
- package/dist/interface/math/vec3/f32/min.js.map +1 -0
- package/dist/interface/math/vec3/f32/mix.d.ts +2 -0
- package/dist/interface/math/vec3/f32/mix.js +7 -0
- package/dist/interface/math/vec3/f32/mix.js.map +1 -0
- package/dist/interface/math/vec3/f32/mod.d.ts +2 -0
- package/dist/interface/math/vec3/f32/mod.js +6 -0
- package/dist/interface/math/vec3/f32/mod.js.map +1 -0
- package/dist/interface/math/vec3/f32/modf.d.ts +5 -0
- package/dist/interface/math/vec3/f32/modf.js +5 -0
- package/dist/interface/math/vec3/f32/modf.js.map +1 -0
- package/dist/interface/math/vec3/f32/multiply.d.ts +5 -0
- package/dist/interface/math/vec3/f32/multiply.js +10 -0
- package/dist/interface/math/vec3/f32/multiply.js.map +1 -0
- package/dist/interface/math/vec3/f32/negate.d.ts +2 -0
- package/dist/interface/math/vec3/f32/negate.js +3 -0
- package/dist/interface/math/vec3/f32/negate.js.map +1 -0
- package/dist/interface/math/vec3/f32/normalize.d.ts +2 -0
- package/dist/interface/math/vec3/f32/normalize.js +5 -0
- package/dist/interface/math/vec3/f32/normalize.js.map +1 -0
- package/dist/interface/math/vec3/f32/one.d.ts +2 -0
- package/dist/interface/math/vec3/f32/one.js +2 -0
- package/dist/interface/math/vec3/f32/one.js.map +1 -0
- package/dist/interface/math/vec3/f32/pow.d.ts +3 -0
- package/dist/interface/math/vec3/f32/pow.js +8 -0
- package/dist/interface/math/vec3/f32/pow.js.map +1 -0
- package/dist/interface/math/vec3/f32/public.d.ts +53 -0
- package/dist/interface/math/vec3/f32/public.js +54 -0
- package/dist/interface/math/vec3/f32/public.js.map +1 -0
- package/dist/interface/math/vec3/f32/random.d.ts +2 -0
- package/dist/interface/math/vec3/f32/random.js +4 -0
- package/dist/interface/math/vec3/f32/random.js.map +1 -0
- package/dist/interface/math/vec3/f32/reflect.d.ts +2 -0
- package/dist/interface/math/vec3/f32/reflect.js +9 -0
- package/dist/interface/math/vec3/f32/reflect.js.map +1 -0
- package/dist/interface/math/vec3/f32/refract.d.ts +2 -0
- package/dist/interface/math/vec3/f32/refract.js +14 -0
- package/dist/interface/math/vec3/f32/refract.js.map +1 -0
- package/dist/interface/math/vec3/f32/round.d.ts +2 -0
- package/dist/interface/math/vec3/f32/round.js +8 -0
- package/dist/interface/math/vec3/f32/round.js.map +1 -0
- package/dist/interface/math/vec3/f32/scale.d.ts +2 -0
- package/dist/interface/math/vec3/f32/scale.js +3 -0
- package/dist/interface/math/vec3/f32/scale.js.map +1 -0
- package/dist/interface/math/vec3/f32/schema.d.ts +9 -0
- package/dist/interface/math/vec3/f32/schema.js +3 -0
- package/dist/interface/math/vec3/f32/schema.js.map +1 -0
- package/dist/interface/math/vec3/f32/sign.d.ts +2 -0
- package/dist/interface/math/vec3/f32/sign.js +3 -0
- package/dist/interface/math/vec3/f32/sign.js.map +1 -0
- package/dist/interface/math/vec3/f32/sin.d.ts +2 -0
- package/dist/interface/math/vec3/f32/sin.js +3 -0
- package/dist/interface/math/vec3/f32/sin.js.map +1 -0
- package/dist/interface/math/vec3/f32/sinh.d.ts +2 -0
- package/dist/interface/math/vec3/f32/sinh.js +3 -0
- package/dist/interface/math/vec3/f32/sinh.js.map +1 -0
- package/dist/interface/math/vec3/f32/smoothstep.d.ts +2 -0
- package/dist/interface/math/vec3/f32/smoothstep.js +12 -0
- package/dist/interface/math/vec3/f32/smoothstep.js.map +1 -0
- package/dist/interface/math/vec3/f32/sqrt.d.ts +2 -0
- package/dist/interface/math/vec3/f32/sqrt.js +3 -0
- package/dist/interface/math/vec3/f32/sqrt.js.map +1 -0
- package/dist/interface/math/vec3/f32/step.d.ts +2 -0
- package/dist/interface/math/vec3/f32/step.js +7 -0
- package/dist/interface/math/vec3/f32/step.js.map +1 -0
- package/dist/interface/math/vec3/f32/subtract.d.ts +2 -0
- package/dist/interface/math/vec3/f32/subtract.js +7 -0
- package/dist/interface/math/vec3/f32/subtract.js.map +1 -0
- package/dist/interface/math/vec3/f32/tan.d.ts +2 -0
- package/dist/interface/math/vec3/f32/tan.js +3 -0
- package/dist/interface/math/vec3/f32/tan.js.map +1 -0
- package/dist/interface/math/vec3/f32/tanh.d.ts +2 -0
- package/dist/interface/math/vec3/f32/tanh.js +3 -0
- package/dist/interface/math/vec3/f32/tanh.js.map +1 -0
- package/dist/interface/math/vec3/f32/trunc.d.ts +2 -0
- package/dist/interface/math/vec3/f32/trunc.js +3 -0
- package/dist/interface/math/vec3/f32/trunc.js.map +1 -0
- package/dist/interface/math/vec3/f32/zero.d.ts +2 -0
- package/dist/interface/math/vec3/f32/zero.js +2 -0
- package/dist/interface/math/vec3/f32/zero.js.map +1 -0
- package/dist/interface/math/vec3/i32/abs.d.ts +2 -0
- package/dist/interface/math/vec3/i32/abs.js +7 -0
- package/dist/interface/math/vec3/i32/abs.js.map +1 -0
- package/dist/interface/math/vec3/i32/add.d.ts +2 -0
- package/dist/interface/math/vec3/i32/add.js +7 -0
- package/dist/interface/math/vec3/i32/add.js.map +1 -0
- package/dist/interface/math/vec3/i32/bitwise-and.d.ts +2 -0
- package/dist/interface/math/vec3/i32/bitwise-and.js +7 -0
- package/dist/interface/math/vec3/i32/bitwise-and.js.map +1 -0
- package/dist/interface/math/vec3/i32/bitwise-not.d.ts +2 -0
- package/dist/interface/math/vec3/i32/bitwise-not.js +3 -0
- package/dist/interface/math/vec3/i32/bitwise-not.js.map +1 -0
- package/dist/interface/math/vec3/i32/bitwise-or.d.ts +2 -0
- package/dist/interface/math/vec3/i32/bitwise-or.js +7 -0
- package/dist/interface/math/vec3/i32/bitwise-or.js.map +1 -0
- package/dist/interface/math/vec3/i32/bitwise-xor.d.ts +2 -0
- package/dist/interface/math/vec3/i32/bitwise-xor.js +7 -0
- package/dist/interface/math/vec3/i32/bitwise-xor.js.map +1 -0
- package/dist/interface/math/vec3/i32/clamp.d.ts +2 -0
- package/dist/interface/math/vec3/i32/clamp.js +5 -0
- package/dist/interface/math/vec3/i32/clamp.js.map +1 -0
- package/dist/interface/math/vec3/i32/count-leading-zeros.d.ts +2 -0
- package/dist/interface/math/vec3/i32/count-leading-zeros.js +8 -0
- package/dist/interface/math/vec3/i32/count-leading-zeros.js.map +1 -0
- package/dist/interface/math/vec3/i32/count-one-bits.d.ts +2 -0
- package/dist/interface/math/vec3/i32/count-one-bits.js +8 -0
- package/dist/interface/math/vec3/i32/count-one-bits.js.map +1 -0
- package/dist/interface/math/vec3/i32/count-trailing-zeros.d.ts +2 -0
- package/dist/interface/math/vec3/i32/count-trailing-zeros.js +8 -0
- package/dist/interface/math/vec3/i32/count-trailing-zeros.js.map +1 -0
- package/dist/interface/math/vec3/i32/equals.d.ts +2 -0
- package/dist/interface/math/vec3/i32/equals.js +2 -0
- package/dist/interface/math/vec3/i32/equals.js.map +1 -0
- package/dist/interface/math/vec3/i32/i32.d.ts +3 -0
- package/dist/interface/math/vec3/i32/i32.js +2 -0
- package/dist/interface/math/vec3/i32/i32.js.map +1 -0
- package/dist/interface/math/vec3/i32/max.d.ts +2 -0
- package/dist/interface/math/vec3/i32/max.js +7 -0
- package/dist/interface/math/vec3/i32/max.js.map +1 -0
- package/dist/interface/math/vec3/i32/min.d.ts +2 -0
- package/dist/interface/math/vec3/i32/min.js +7 -0
- package/dist/interface/math/vec3/i32/min.js.map +1 -0
- package/dist/interface/math/vec3/i32/multiply.d.ts +2 -0
- package/dist/interface/math/vec3/i32/multiply.js +7 -0
- package/dist/interface/math/vec3/i32/multiply.js.map +1 -0
- package/dist/interface/math/vec3/i32/negate.d.ts +2 -0
- package/dist/interface/math/vec3/i32/negate.js +7 -0
- package/dist/interface/math/vec3/i32/negate.js.map +1 -0
- package/dist/interface/math/vec3/i32/one.d.ts +2 -0
- package/dist/interface/math/vec3/i32/one.js +2 -0
- package/dist/interface/math/vec3/i32/one.js.map +1 -0
- package/dist/interface/math/vec3/i32/public.d.ts +23 -0
- package/dist/interface/math/vec3/i32/public.js +24 -0
- package/dist/interface/math/vec3/i32/public.js.map +1 -0
- package/dist/interface/math/vec3/i32/reverse-bits.d.ts +2 -0
- package/dist/interface/math/vec3/i32/reverse-bits.js +8 -0
- package/dist/interface/math/vec3/i32/reverse-bits.js.map +1 -0
- package/dist/interface/math/vec3/i32/scale.d.ts +3 -0
- package/dist/interface/math/vec3/i32/scale.js +7 -0
- package/dist/interface/math/vec3/i32/scale.js.map +1 -0
- package/dist/interface/math/vec3/i32/schema.d.ts +10 -0
- package/dist/interface/math/vec3/i32/schema.js +3 -0
- package/dist/interface/math/vec3/i32/schema.js.map +1 -0
- package/dist/interface/math/vec3/i32/shift-left.d.ts +2 -0
- package/dist/interface/math/vec3/i32/shift-left.js +2 -0
- package/dist/interface/math/vec3/i32/shift-left.js.map +1 -0
- package/dist/interface/math/vec3/i32/shift-right.d.ts +2 -0
- package/dist/interface/math/vec3/i32/shift-right.js +7 -0
- package/dist/interface/math/vec3/i32/shift-right.js.map +1 -0
- package/dist/interface/math/vec3/i32/subtract.d.ts +2 -0
- package/dist/interface/math/vec3/i32/subtract.js +7 -0
- package/dist/interface/math/vec3/i32/subtract.js.map +1 -0
- package/dist/interface/math/vec3/i32/zero.d.ts +2 -0
- package/dist/interface/math/vec3/i32/zero.js +2 -0
- package/dist/interface/math/vec3/i32/zero.js.map +1 -0
- package/dist/interface/math/vec3/index.d.ts +4 -0
- package/dist/interface/math/vec3/index.js +2 -0
- package/dist/interface/math/vec3/index.js.map +1 -0
- package/dist/interface/math/vec3/public.d.ts +4 -0
- package/dist/interface/math/vec3/public.js +5 -0
- package/dist/interface/math/vec3/public.js.map +1 -0
- package/dist/interface/math/vec3/u32/add.d.ts +2 -0
- package/dist/interface/math/vec3/u32/add.js +7 -0
- package/dist/interface/math/vec3/u32/add.js.map +1 -0
- package/dist/interface/math/vec3/u32/bitwise-and.d.ts +2 -0
- package/dist/interface/math/vec3/u32/bitwise-and.js +7 -0
- package/dist/interface/math/vec3/u32/bitwise-and.js.map +1 -0
- package/dist/interface/math/vec3/u32/bitwise-not.d.ts +2 -0
- package/dist/interface/math/vec3/u32/bitwise-not.js +3 -0
- package/dist/interface/math/vec3/u32/bitwise-not.js.map +1 -0
- package/dist/interface/math/vec3/u32/bitwise-or.d.ts +2 -0
- package/dist/interface/math/vec3/u32/bitwise-or.js +7 -0
- package/dist/interface/math/vec3/u32/bitwise-or.js.map +1 -0
- package/dist/interface/math/vec3/u32/bitwise-xor.d.ts +2 -0
- package/dist/interface/math/vec3/u32/bitwise-xor.js +7 -0
- package/dist/interface/math/vec3/u32/bitwise-xor.js.map +1 -0
- package/dist/interface/math/vec3/u32/clamp.d.ts +2 -0
- package/dist/interface/math/vec3/u32/clamp.js +5 -0
- package/dist/interface/math/vec3/u32/clamp.js.map +1 -0
- package/dist/interface/math/vec3/u32/count-leading-zeros.d.ts +2 -0
- package/dist/interface/math/vec3/u32/count-leading-zeros.js +8 -0
- package/dist/interface/math/vec3/u32/count-leading-zeros.js.map +1 -0
- package/dist/interface/math/vec3/u32/count-one-bits.d.ts +2 -0
- package/dist/interface/math/vec3/u32/count-one-bits.js +8 -0
- package/dist/interface/math/vec3/u32/count-one-bits.js.map +1 -0
- package/dist/interface/math/vec3/u32/count-trailing-zeros.d.ts +2 -0
- package/dist/interface/math/vec3/u32/count-trailing-zeros.js +8 -0
- package/dist/interface/math/vec3/u32/count-trailing-zeros.js.map +1 -0
- package/dist/interface/math/vec3/u32/equals.d.ts +2 -0
- package/dist/interface/math/vec3/u32/equals.js +2 -0
- package/dist/interface/math/vec3/u32/equals.js.map +1 -0
- package/dist/interface/math/vec3/u32/max.d.ts +2 -0
- package/dist/interface/math/vec3/u32/max.js +7 -0
- package/dist/interface/math/vec3/u32/max.js.map +1 -0
- package/dist/interface/math/vec3/u32/min.d.ts +2 -0
- package/dist/interface/math/vec3/u32/min.js +7 -0
- package/dist/interface/math/vec3/u32/min.js.map +1 -0
- package/dist/interface/math/vec3/u32/multiply.d.ts +2 -0
- package/dist/interface/math/vec3/u32/multiply.js +7 -0
- package/dist/interface/math/vec3/u32/multiply.js.map +1 -0
- package/dist/interface/math/vec3/u32/negate.d.ts +2 -0
- package/dist/interface/math/vec3/u32/negate.js +2 -0
- package/dist/interface/math/vec3/u32/negate.js.map +1 -0
- package/dist/interface/math/vec3/u32/one.d.ts +2 -0
- package/dist/interface/math/vec3/u32/one.js +2 -0
- package/dist/interface/math/vec3/u32/one.js.map +1 -0
- package/dist/interface/math/vec3/u32/public.d.ts +23 -0
- package/dist/interface/math/vec3/u32/public.js +24 -0
- package/dist/interface/math/vec3/u32/public.js.map +1 -0
- package/dist/interface/math/vec3/u32/reverse-bits.d.ts +2 -0
- package/dist/interface/math/vec3/u32/reverse-bits.js +8 -0
- package/dist/interface/math/vec3/u32/reverse-bits.js.map +1 -0
- package/dist/interface/math/vec3/u32/scale.d.ts +3 -0
- package/dist/interface/math/vec3/u32/scale.js +7 -0
- package/dist/interface/math/vec3/u32/scale.js.map +1 -0
- package/dist/interface/math/vec3/u32/schema.d.ts +10 -0
- package/dist/interface/math/vec3/u32/schema.js +3 -0
- package/dist/interface/math/vec3/u32/schema.js.map +1 -0
- package/dist/interface/math/vec3/u32/shift-left.d.ts +2 -0
- package/dist/interface/math/vec3/u32/shift-left.js +6 -0
- package/dist/interface/math/vec3/u32/shift-left.js.map +1 -0
- package/dist/interface/math/vec3/u32/shift-right.d.ts +2 -0
- package/dist/interface/math/vec3/u32/shift-right.js +7 -0
- package/dist/interface/math/vec3/u32/shift-right.js.map +1 -0
- package/dist/interface/math/vec3/u32/subtract.d.ts +2 -0
- package/dist/interface/math/vec3/u32/subtract.js +7 -0
- package/dist/interface/math/vec3/u32/subtract.js.map +1 -0
- package/dist/interface/math/vec3/u32/u32.d.ts +3 -0
- package/dist/interface/math/vec3/u32/u32.js +2 -0
- package/dist/interface/math/vec3/u32/u32.js.map +1 -0
- package/dist/interface/math/vec3/u32/volume.d.ts +2 -0
- package/dist/interface/math/vec3/u32/volume.js +2 -0
- package/dist/interface/math/vec3/u32/volume.js.map +1 -0
- package/dist/interface/math/vec3/u32/zero.d.ts +2 -0
- package/dist/interface/math/vec3/u32/zero.js +2 -0
- package/dist/interface/math/vec3/u32/zero.js.map +1 -0
- package/dist/interface/math/vec4/f32/abs.d.ts +2 -0
- package/dist/interface/math/vec4/f32/abs.js +3 -0
- package/dist/interface/math/vec4/f32/abs.js.map +1 -0
- package/dist/interface/math/vec4/f32/acos.d.ts +2 -0
- package/dist/interface/math/vec4/f32/acos.js +3 -0
- package/dist/interface/math/vec4/f32/acos.js.map +1 -0
- package/dist/interface/math/vec4/f32/acosh.d.ts +2 -0
- package/dist/interface/math/vec4/f32/acosh.js +3 -0
- package/dist/interface/math/vec4/f32/acosh.js.map +1 -0
- package/dist/interface/math/vec4/f32/add.d.ts +2 -0
- package/dist/interface/math/vec4/f32/add.js +8 -0
- package/dist/interface/math/vec4/f32/add.js.map +1 -0
- package/dist/interface/math/vec4/f32/asin.d.ts +2 -0
- package/dist/interface/math/vec4/f32/asin.js +3 -0
- package/dist/interface/math/vec4/f32/asin.js.map +1 -0
- package/dist/interface/math/vec4/f32/asinh.d.ts +2 -0
- package/dist/interface/math/vec4/f32/asinh.js +3 -0
- package/dist/interface/math/vec4/f32/asinh.js.map +1 -0
- package/dist/interface/math/vec4/f32/atan.d.ts +2 -0
- package/dist/interface/math/vec4/f32/atan.js +3 -0
- package/dist/interface/math/vec4/f32/atan.js.map +1 -0
- package/dist/interface/math/vec4/f32/atanh.d.ts +2 -0
- package/dist/interface/math/vec4/f32/atanh.js +3 -0
- package/dist/interface/math/vec4/f32/atanh.js.map +1 -0
- package/dist/interface/math/vec4/f32/ceil.d.ts +2 -0
- package/dist/interface/math/vec4/f32/ceil.js +3 -0
- package/dist/interface/math/vec4/f32/ceil.js.map +1 -0
- package/dist/interface/math/vec4/f32/clamp.d.ts +2 -0
- package/dist/interface/math/vec4/f32/clamp.js +5 -0
- package/dist/interface/math/vec4/f32/clamp.js.map +1 -0
- package/dist/interface/math/vec4/f32/cos.d.ts +2 -0
- package/dist/interface/math/vec4/f32/cos.js +3 -0
- package/dist/interface/math/vec4/f32/cos.js.map +1 -0
- package/dist/interface/math/vec4/f32/cosh.d.ts +2 -0
- package/dist/interface/math/vec4/f32/cosh.js +3 -0
- package/dist/interface/math/vec4/f32/cosh.js.map +1 -0
- package/dist/interface/math/vec4/f32/distance.d.ts +2 -0
- package/dist/interface/math/vec4/f32/distance.js +5 -0
- package/dist/interface/math/vec4/f32/distance.js.map +1 -0
- package/dist/interface/math/vec4/f32/dot.d.ts +2 -0
- package/dist/interface/math/vec4/f32/dot.js +3 -0
- package/dist/interface/math/vec4/f32/dot.js.map +1 -0
- package/dist/interface/math/vec4/f32/exp.d.ts +2 -0
- package/dist/interface/math/vec4/f32/exp.js +3 -0
- package/dist/interface/math/vec4/f32/exp.js.map +1 -0
- package/dist/interface/math/vec4/f32/exp2.d.ts +2 -0
- package/dist/interface/math/vec4/f32/exp2.js +3 -0
- package/dist/interface/math/vec4/f32/exp2.js.map +1 -0
- package/dist/interface/math/vec4/f32/f32.d.ts +2 -0
- package/dist/interface/math/vec4/f32/f32.js +2 -0
- package/dist/interface/math/vec4/f32/f32.js.map +1 -0
- package/dist/interface/math/vec4/f32/faceforward.d.ts +2 -0
- package/dist/interface/math/vec4/f32/faceforward.js +5 -0
- package/dist/interface/math/vec4/f32/faceforward.js.map +1 -0
- package/dist/interface/math/vec4/f32/floor.d.ts +2 -0
- package/dist/interface/math/vec4/f32/floor.js +3 -0
- package/dist/interface/math/vec4/f32/floor.js.map +1 -0
- package/dist/interface/math/vec4/f32/fract.d.ts +2 -0
- package/dist/interface/math/vec4/f32/fract.js +8 -0
- package/dist/interface/math/vec4/f32/fract.js.map +1 -0
- package/dist/interface/math/vec4/f32/length.d.ts +2 -0
- package/dist/interface/math/vec4/f32/length.js +3 -0
- package/dist/interface/math/vec4/f32/length.js.map +1 -0
- package/dist/interface/math/vec4/f32/log.d.ts +2 -0
- package/dist/interface/math/vec4/f32/log.js +3 -0
- package/dist/interface/math/vec4/f32/log.js.map +1 -0
- package/dist/interface/math/vec4/f32/log2.d.ts +2 -0
- package/dist/interface/math/vec4/f32/log2.js +3 -0
- package/dist/interface/math/vec4/f32/log2.js.map +1 -0
- package/dist/interface/math/vec4/f32/max.d.ts +2 -0
- package/dist/interface/math/vec4/f32/max.js +8 -0
- package/dist/interface/math/vec4/f32/max.js.map +1 -0
- package/dist/interface/math/vec4/f32/min.d.ts +2 -0
- package/dist/interface/math/vec4/f32/min.js +8 -0
- package/dist/interface/math/vec4/f32/min.js.map +1 -0
- package/dist/interface/math/vec4/f32/mix.d.ts +2 -0
- package/dist/interface/math/vec4/f32/mix.js +8 -0
- package/dist/interface/math/vec4/f32/mix.js.map +1 -0
- package/dist/interface/math/vec4/f32/mod.d.ts +2 -0
- package/dist/interface/math/vec4/f32/mod.js +7 -0
- package/dist/interface/math/vec4/f32/mod.js.map +1 -0
- package/dist/interface/math/vec4/f32/modf.d.ts +5 -0
- package/dist/interface/math/vec4/f32/modf.js +5 -0
- package/dist/interface/math/vec4/f32/modf.js.map +1 -0
- package/dist/interface/math/vec4/f32/multiply.d.ts +2 -0
- package/dist/interface/math/vec4/f32/multiply.js +8 -0
- package/dist/interface/math/vec4/f32/multiply.js.map +1 -0
- package/dist/interface/math/vec4/f32/negate.d.ts +2 -0
- package/dist/interface/math/vec4/f32/negate.js +3 -0
- package/dist/interface/math/vec4/f32/negate.js.map +1 -0
- package/dist/interface/math/vec4/f32/normalize.d.ts +2 -0
- package/dist/interface/math/vec4/f32/normalize.js +5 -0
- package/dist/interface/math/vec4/f32/normalize.js.map +1 -0
- package/dist/interface/math/vec4/f32/pow.d.ts +3 -0
- package/dist/interface/math/vec4/f32/pow.js +9 -0
- package/dist/interface/math/vec4/f32/pow.js.map +1 -0
- package/dist/interface/math/vec4/f32/public.d.ts +46 -0
- package/dist/interface/math/vec4/f32/public.js +47 -0
- package/dist/interface/math/vec4/f32/public.js.map +1 -0
- package/dist/interface/math/vec4/f32/reflect.d.ts +2 -0
- package/dist/interface/math/vec4/f32/reflect.js +9 -0
- package/dist/interface/math/vec4/f32/reflect.js.map +1 -0
- package/dist/interface/math/vec4/f32/refract.d.ts +2 -0
- package/dist/interface/math/vec4/f32/refract.js +14 -0
- package/dist/interface/math/vec4/f32/refract.js.map +1 -0
- package/dist/interface/math/vec4/f32/round.d.ts +2 -0
- package/dist/interface/math/vec4/f32/round.js +9 -0
- package/dist/interface/math/vec4/f32/round.js.map +1 -0
- package/dist/interface/math/vec4/f32/scale.d.ts +2 -0
- package/dist/interface/math/vec4/f32/scale.js +3 -0
- package/dist/interface/math/vec4/f32/scale.js.map +1 -0
- package/dist/interface/math/vec4/f32/schema.d.ts +9 -0
- package/dist/interface/math/vec4/f32/schema.js +3 -0
- package/dist/interface/math/vec4/f32/schema.js.map +1 -0
- package/dist/interface/math/vec4/f32/sign.d.ts +2 -0
- package/dist/interface/math/vec4/f32/sign.js +3 -0
- package/dist/interface/math/vec4/f32/sign.js.map +1 -0
- package/dist/interface/math/vec4/f32/sin.d.ts +2 -0
- package/dist/interface/math/vec4/f32/sin.js +3 -0
- package/dist/interface/math/vec4/f32/sin.js.map +1 -0
- package/dist/interface/math/vec4/f32/sinh.d.ts +2 -0
- package/dist/interface/math/vec4/f32/sinh.js +3 -0
- package/dist/interface/math/vec4/f32/sinh.js.map +1 -0
- package/dist/interface/math/vec4/f32/smoothstep.d.ts +2 -0
- package/dist/interface/math/vec4/f32/smoothstep.js +14 -0
- package/dist/interface/math/vec4/f32/smoothstep.js.map +1 -0
- package/dist/interface/math/vec4/f32/sqrt.d.ts +2 -0
- package/dist/interface/math/vec4/f32/sqrt.js +3 -0
- package/dist/interface/math/vec4/f32/sqrt.js.map +1 -0
- package/dist/interface/math/vec4/f32/step.d.ts +2 -0
- package/dist/interface/math/vec4/f32/step.js +8 -0
- package/dist/interface/math/vec4/f32/step.js.map +1 -0
- package/dist/interface/math/vec4/f32/subtract.d.ts +2 -0
- package/dist/interface/math/vec4/f32/subtract.js +8 -0
- package/dist/interface/math/vec4/f32/subtract.js.map +1 -0
- package/dist/interface/math/vec4/f32/tan.d.ts +2 -0
- package/dist/interface/math/vec4/f32/tan.js +3 -0
- package/dist/interface/math/vec4/f32/tan.js.map +1 -0
- package/dist/interface/math/vec4/f32/tanh.d.ts +2 -0
- package/dist/interface/math/vec4/f32/tanh.js +3 -0
- package/dist/interface/math/vec4/f32/tanh.js.map +1 -0
- package/dist/interface/math/vec4/f32/trunc.d.ts +2 -0
- package/dist/interface/math/vec4/f32/trunc.js +3 -0
- package/dist/interface/math/vec4/f32/trunc.js.map +1 -0
- package/dist/interface/math/vec4/i32/abs.d.ts +2 -0
- package/dist/interface/math/vec4/i32/abs.js +8 -0
- package/dist/interface/math/vec4/i32/abs.js.map +1 -0
- package/dist/interface/math/vec4/i32/add.d.ts +2 -0
- package/dist/interface/math/vec4/i32/add.js +8 -0
- package/dist/interface/math/vec4/i32/add.js.map +1 -0
- package/dist/interface/math/vec4/i32/bitwise-and.d.ts +2 -0
- package/dist/interface/math/vec4/i32/bitwise-and.js +8 -0
- package/dist/interface/math/vec4/i32/bitwise-and.js.map +1 -0
- package/dist/interface/math/vec4/i32/bitwise-not.d.ts +2 -0
- package/dist/interface/math/vec4/i32/bitwise-not.js +3 -0
- package/dist/interface/math/vec4/i32/bitwise-not.js.map +1 -0
- package/dist/interface/math/vec4/i32/bitwise-or.d.ts +2 -0
- package/dist/interface/math/vec4/i32/bitwise-or.js +8 -0
- package/dist/interface/math/vec4/i32/bitwise-or.js.map +1 -0
- package/dist/interface/math/vec4/i32/bitwise-xor.d.ts +2 -0
- package/dist/interface/math/vec4/i32/bitwise-xor.js +8 -0
- package/dist/interface/math/vec4/i32/bitwise-xor.js.map +1 -0
- package/dist/interface/math/vec4/i32/clamp.d.ts +2 -0
- package/dist/interface/math/vec4/i32/clamp.js +5 -0
- package/dist/interface/math/vec4/i32/clamp.js.map +1 -0
- package/dist/interface/math/vec4/i32/count-leading-zeros.d.ts +2 -0
- package/dist/interface/math/vec4/i32/count-leading-zeros.js +9 -0
- package/dist/interface/math/vec4/i32/count-leading-zeros.js.map +1 -0
- package/dist/interface/math/vec4/i32/count-one-bits.d.ts +2 -0
- package/dist/interface/math/vec4/i32/count-one-bits.js +9 -0
- package/dist/interface/math/vec4/i32/count-one-bits.js.map +1 -0
- package/dist/interface/math/vec4/i32/count-trailing-zeros.d.ts +2 -0
- package/dist/interface/math/vec4/i32/count-trailing-zeros.js +9 -0
- package/dist/interface/math/vec4/i32/count-trailing-zeros.js.map +1 -0
- package/dist/interface/math/vec4/i32/equals.d.ts +2 -0
- package/dist/interface/math/vec4/i32/equals.js +2 -0
- package/dist/interface/math/vec4/i32/equals.js.map +1 -0
- package/dist/interface/math/vec4/i32/i32.d.ts +3 -0
- package/dist/interface/math/vec4/i32/i32.js +2 -0
- package/dist/interface/math/vec4/i32/i32.js.map +1 -0
- package/dist/interface/math/vec4/i32/max.d.ts +2 -0
- package/dist/interface/math/vec4/i32/max.js +8 -0
- package/dist/interface/math/vec4/i32/max.js.map +1 -0
- package/dist/interface/math/vec4/i32/min.d.ts +2 -0
- package/dist/interface/math/vec4/i32/min.js +8 -0
- package/dist/interface/math/vec4/i32/min.js.map +1 -0
- package/dist/interface/math/vec4/i32/multiply.d.ts +2 -0
- package/dist/interface/math/vec4/i32/multiply.js +8 -0
- package/dist/interface/math/vec4/i32/multiply.js.map +1 -0
- package/dist/interface/math/vec4/i32/negate.d.ts +2 -0
- package/dist/interface/math/vec4/i32/negate.js +8 -0
- package/dist/interface/math/vec4/i32/negate.js.map +1 -0
- package/dist/interface/math/vec4/i32/one.d.ts +2 -0
- package/dist/interface/math/vec4/i32/one.js +2 -0
- package/dist/interface/math/vec4/i32/one.js.map +1 -0
- package/dist/interface/math/vec4/i32/public.d.ts +23 -0
- package/dist/interface/math/vec4/i32/public.js +24 -0
- package/dist/interface/math/vec4/i32/public.js.map +1 -0
- package/dist/interface/math/vec4/i32/reverse-bits.d.ts +2 -0
- package/dist/interface/math/vec4/i32/reverse-bits.js +9 -0
- package/dist/interface/math/vec4/i32/reverse-bits.js.map +1 -0
- package/dist/interface/math/vec4/i32/scale.d.ts +3 -0
- package/dist/interface/math/vec4/i32/scale.js +8 -0
- package/dist/interface/math/vec4/i32/scale.js.map +1 -0
- package/dist/interface/math/vec4/i32/schema.d.ts +10 -0
- package/dist/interface/math/vec4/i32/schema.js +3 -0
- package/dist/interface/math/vec4/i32/schema.js.map +1 -0
- package/dist/interface/math/vec4/i32/shift-left.d.ts +2 -0
- package/dist/interface/math/vec4/i32/shift-left.js +2 -0
- package/dist/interface/math/vec4/i32/shift-left.js.map +1 -0
- package/dist/interface/math/vec4/i32/shift-right.d.ts +2 -0
- package/dist/interface/math/vec4/i32/shift-right.js +8 -0
- package/dist/interface/math/vec4/i32/shift-right.js.map +1 -0
- package/dist/interface/math/vec4/i32/subtract.d.ts +2 -0
- package/dist/interface/math/vec4/i32/subtract.js +8 -0
- package/dist/interface/math/vec4/i32/subtract.js.map +1 -0
- package/dist/interface/math/vec4/i32/zero.d.ts +2 -0
- package/dist/interface/math/vec4/i32/zero.js +2 -0
- package/dist/interface/math/vec4/i32/zero.js.map +1 -0
- package/dist/interface/math/vec4/index.d.ts +4 -0
- package/dist/interface/math/vec4/index.js +2 -0
- package/dist/interface/math/vec4/index.js.map +1 -0
- package/dist/interface/math/vec4/public.d.ts +4 -0
- package/dist/interface/math/vec4/public.js +5 -0
- package/dist/interface/math/vec4/public.js.map +1 -0
- package/dist/interface/math/vec4/u32/add.d.ts +2 -0
- package/dist/interface/math/vec4/u32/add.js +8 -0
- package/dist/interface/math/vec4/u32/add.js.map +1 -0
- package/dist/interface/math/vec4/u32/bitwise-and.d.ts +2 -0
- package/dist/interface/math/vec4/u32/bitwise-and.js +8 -0
- package/dist/interface/math/vec4/u32/bitwise-and.js.map +1 -0
- package/dist/interface/math/vec4/u32/bitwise-not.d.ts +2 -0
- package/dist/interface/math/vec4/u32/bitwise-not.js +3 -0
- package/dist/interface/math/vec4/u32/bitwise-not.js.map +1 -0
- package/dist/interface/math/vec4/u32/bitwise-or.d.ts +2 -0
- package/dist/interface/math/vec4/u32/bitwise-or.js +8 -0
- package/dist/interface/math/vec4/u32/bitwise-or.js.map +1 -0
- package/dist/interface/math/vec4/u32/bitwise-xor.d.ts +2 -0
- package/dist/interface/math/vec4/u32/bitwise-xor.js +8 -0
- package/dist/interface/math/vec4/u32/bitwise-xor.js.map +1 -0
- package/dist/interface/math/vec4/u32/clamp.d.ts +2 -0
- package/dist/interface/math/vec4/u32/clamp.js +5 -0
- package/dist/interface/math/vec4/u32/clamp.js.map +1 -0
- package/dist/interface/math/vec4/u32/count-leading-zeros.d.ts +2 -0
- package/dist/interface/math/vec4/u32/count-leading-zeros.js +9 -0
- package/dist/interface/math/vec4/u32/count-leading-zeros.js.map +1 -0
- package/dist/interface/math/vec4/u32/count-one-bits.d.ts +2 -0
- package/dist/interface/math/vec4/u32/count-one-bits.js +9 -0
- package/dist/interface/math/vec4/u32/count-one-bits.js.map +1 -0
- package/dist/interface/math/vec4/u32/count-trailing-zeros.d.ts +2 -0
- package/dist/interface/math/vec4/u32/count-trailing-zeros.js +9 -0
- package/dist/interface/math/vec4/u32/count-trailing-zeros.js.map +1 -0
- package/dist/interface/math/vec4/u32/equals.d.ts +2 -0
- package/dist/interface/math/vec4/u32/equals.js +2 -0
- package/dist/interface/math/vec4/u32/equals.js.map +1 -0
- package/dist/interface/math/vec4/u32/max.d.ts +2 -0
- package/dist/interface/math/vec4/u32/max.js +8 -0
- package/dist/interface/math/vec4/u32/max.js.map +1 -0
- package/dist/interface/math/vec4/u32/min.d.ts +2 -0
- package/dist/interface/math/vec4/u32/min.js +8 -0
- package/dist/interface/math/vec4/u32/min.js.map +1 -0
- package/dist/interface/math/vec4/u32/multiply.d.ts +2 -0
- package/dist/interface/math/vec4/u32/multiply.js +8 -0
- package/dist/interface/math/vec4/u32/multiply.js.map +1 -0
- package/dist/interface/math/vec4/u32/negate.d.ts +2 -0
- package/dist/interface/math/vec4/u32/negate.js +2 -0
- package/dist/interface/math/vec4/u32/negate.js.map +1 -0
- package/dist/interface/math/vec4/u32/one.d.ts +2 -0
- package/dist/interface/math/vec4/u32/one.js +2 -0
- package/dist/interface/math/vec4/u32/one.js.map +1 -0
- package/dist/interface/math/vec4/u32/public.d.ts +22 -0
- package/dist/interface/math/vec4/u32/public.js +23 -0
- package/dist/interface/math/vec4/u32/public.js.map +1 -0
- package/dist/interface/math/vec4/u32/reverse-bits.d.ts +2 -0
- package/dist/interface/math/vec4/u32/reverse-bits.js +9 -0
- package/dist/interface/math/vec4/u32/reverse-bits.js.map +1 -0
- package/dist/interface/math/vec4/u32/scale.d.ts +3 -0
- package/dist/interface/math/vec4/u32/scale.js +8 -0
- package/dist/interface/math/vec4/u32/scale.js.map +1 -0
- package/dist/interface/math/vec4/u32/schema.d.ts +10 -0
- package/dist/interface/math/vec4/u32/schema.js +3 -0
- package/dist/interface/math/vec4/u32/schema.js.map +1 -0
- package/dist/interface/math/vec4/u32/shift-left.d.ts +2 -0
- package/dist/interface/math/vec4/u32/shift-left.js +7 -0
- package/dist/interface/math/vec4/u32/shift-left.js.map +1 -0
- package/dist/interface/math/vec4/u32/shift-right.d.ts +2 -0
- package/dist/interface/math/vec4/u32/shift-right.js +8 -0
- package/dist/interface/math/vec4/u32/shift-right.js.map +1 -0
- package/dist/interface/math/vec4/u32/subtract.d.ts +2 -0
- package/dist/interface/math/vec4/u32/subtract.js +8 -0
- package/dist/interface/math/vec4/u32/subtract.js.map +1 -0
- package/dist/interface/math/vec4/u32/u32.d.ts +3 -0
- package/dist/interface/math/vec4/u32/u32.js +2 -0
- package/dist/interface/math/vec4/u32/u32.js.map +1 -0
- package/dist/interface/math/vec4/u32/zero.d.ts +2 -0
- package/dist/interface/math/vec4/u32/zero.js +2 -0
- package/dist/interface/math/vec4/u32/zero.js.map +1 -0
- package/dist/interface/platform/platform.d.ts +28 -0
- package/dist/interface/platform/platform.js +2 -0
- package/dist/interface/platform/platform.js.map +1 -0
- package/dist/interface/registry/archetypes.d.ts +7 -0
- package/dist/interface/registry/archetypes.js +22 -0
- package/dist/interface/registry/archetypes.js.map +1 -0
- package/dist/interface/registry/declarations.d.ts +25 -0
- package/dist/interface/registry/declarations.js +107 -0
- package/dist/interface/registry/declarations.js.map +1 -0
- package/dist/interface/registry/finalizer-order.d.ts +6 -0
- package/dist/interface/registry/finalizer-order.js +66 -0
- package/dist/interface/registry/finalizer-order.js.map +1 -0
- package/dist/interface/registry/ids.d.ts +12 -0
- package/dist/interface/registry/ids.js +28 -0
- package/dist/interface/registry/ids.js.map +1 -0
- package/dist/interface/registry/index.d.ts +29 -0
- package/dist/interface/registry/index.js +16 -0
- package/dist/interface/registry/index.js.map +1 -0
- package/dist/interface/registry/indexes.d.ts +38 -0
- package/dist/interface/registry/indexes.js +63 -0
- package/dist/interface/registry/indexes.js.map +1 -0
- package/dist/interface/registry/items.d.ts +43 -0
- package/dist/interface/registry/items.js +108 -0
- package/dist/interface/registry/items.js.map +1 -0
- package/dist/interface/registry/layout.d.ts +59 -0
- package/dist/interface/registry/layout.js +312 -0
- package/dist/interface/registry/layout.js.map +1 -0
- package/dist/interface/registry/names.d.ts +38 -0
- package/dist/interface/registry/names.js +136 -0
- package/dist/interface/registry/names.js.map +1 -0
- package/dist/interface/registry/program.d.ts +36 -0
- package/dist/interface/registry/program.js +96 -0
- package/dist/interface/registry/program.js.map +1 -0
- package/dist/interface/registry/reduction.d.ts +5 -0
- package/dist/interface/registry/reduction.js +5 -0
- package/dist/interface/registry/reduction.js.map +1 -0
- package/dist/interface/registry/schedule.d.ts +32 -0
- package/dist/interface/registry/schedule.js +207 -0
- package/dist/interface/registry/schedule.js.map +1 -0
- package/dist/interface/registry/schemas.d.ts +13 -0
- package/dist/interface/registry/schemas.js +57 -0
- package/dist/interface/registry/schemas.js.map +1 -0
- package/dist/interface/registry/strata.d.ts +29 -0
- package/dist/interface/registry/strata.js +94 -0
- package/dist/interface/registry/strata.js.map +1 -0
- package/dist/interface/registry/threads.d.ts +34 -0
- package/dist/interface/registry/threads.js +52 -0
- package/dist/interface/registry/threads.js.map +1 -0
- package/dist/interface/registry/traits.d.ts +4 -0
- package/dist/interface/registry/traits.js +10 -0
- package/dist/interface/registry/traits.js.map +1 -0
- package/dist/interface/registry/written.d.ts +4 -0
- package/dist/interface/registry/written.js +13 -0
- package/dist/interface/registry/written.js.map +1 -0
- package/dist/interface/report/components.d.ts +38 -0
- package/dist/interface/report/components.js +48 -0
- package/dist/interface/report/components.js.map +1 -0
- package/dist/interface/report/failure.d.ts +29 -0
- package/dist/interface/report/failure.js +2 -0
- package/dist/interface/report/failure.js.map +1 -0
- package/dist/interface/report/index.d.ts +5 -0
- package/dist/interface/report/index.js +6 -0
- package/dist/interface/report/index.js.map +1 -0
- package/dist/interface/report/report.d.ts +12 -0
- package/dist/interface/report/report.js +2 -0
- package/dist/interface/report/report.js.map +1 -0
- package/dist/interface/resource/condition.d.ts +8 -0
- package/dist/interface/resource/condition.js +2 -0
- package/dist/interface/resource/condition.js.map +1 -0
- package/dist/interface/resource/declaration.d.ts +31 -0
- package/dist/interface/resource/declaration.js +2 -0
- package/dist/interface/resource/declaration.js.map +1 -0
- package/dist/interface/resource/index.d.ts +3 -0
- package/dist/interface/resource/index.js +2 -0
- package/dist/interface/resource/index.js.map +1 -0
- package/dist/interface/resource/key.d.ts +2 -0
- package/dist/interface/resource/key.js +2 -0
- package/dist/interface/resource/key.js.map +1 -0
- package/dist/interface/resource/reduction.d.ts +14 -0
- package/dist/interface/resource/reduction.js +2 -0
- package/dist/interface/resource/reduction.js.map +1 -0
- package/dist/interface/resource/register.d.ts +13 -0
- package/dist/interface/resource/register.js +6 -0
- package/dist/interface/resource/register.js.map +1 -0
- package/dist/interface/resource/resource.d.ts +2 -0
- package/dist/interface/resource/resource.js +2 -0
- package/dist/interface/resource/resource.js.map +1 -0
- package/dist/interface/resource/types.d.ts +3 -0
- package/dist/interface/resource/types.js +2 -0
- package/dist/interface/resource/types.js.map +1 -0
- package/dist/interface/resource/value.d.ts +21 -0
- package/dist/interface/resource/value.js +2 -0
- package/dist/interface/resource/value.js.map +1 -0
- package/dist/interface/resource/written.d.ts +3 -0
- package/dist/interface/resource/written.js +2 -0
- package/dist/interface/resource/written.js.map +1 -0
- package/dist/interface/resources/always.d.ts +9 -0
- package/dist/interface/resources/always.js +5 -0
- package/dist/interface/resources/always.js.map +1 -0
- package/dist/interface/resources/cadence.d.ts +21 -0
- package/dist/interface/resources/cadence.js +17 -0
- package/dist/interface/resources/cadence.js.map +1 -0
- package/dist/interface/resources/clock.d.ts +16 -0
- package/dist/interface/resources/clock.js +10 -0
- package/dist/interface/resources/clock.js.map +1 -0
- package/dist/interface/resources/gpu-device.d.ts +13 -0
- package/dist/interface/resources/gpu-device.js +9 -0
- package/dist/interface/resources/gpu-device.js.map +1 -0
- package/dist/interface/resources/index.d.ts +6 -0
- package/dist/interface/resources/index.js +7 -0
- package/dist/interface/resources/index.js.map +1 -0
- package/dist/interface/resources/wake.d.ts +13 -0
- package/dist/interface/resources/wake.js +8 -0
- package/dist/interface/resources/wake.js.map +1 -0
- package/dist/interface/resources/workers.d.ts +9 -0
- package/dist/interface/resources/workers.js +5 -0
- package/dist/interface/resources/workers.js.map +1 -0
- package/dist/interface/rule/create.d.ts +9 -0
- package/dist/interface/rule/create.js +25 -0
- package/dist/interface/rule/create.js.map +1 -0
- package/dist/interface/rule/created.d.ts +7 -0
- package/dist/interface/rule/created.js +2 -0
- package/dist/interface/rule/created.js.map +1 -0
- package/dist/interface/rule/declaration.d.ts +13 -0
- package/dist/interface/rule/declaration.js +2 -0
- package/dist/interface/rule/declaration.js.map +1 -0
- package/dist/interface/rule/index.d.ts +1 -0
- package/dist/interface/rule/index.js +2 -0
- package/dist/interface/rule/index.js.map +1 -0
- package/dist/interface/rule/name.d.ts +6 -0
- package/dist/interface/rule/name.js +2 -0
- package/dist/interface/rule/name.js.map +1 -0
- package/dist/interface/rule/rule.d.ts +2 -0
- package/dist/interface/rule/rule.js +2 -0
- package/dist/interface/rule/rule.js.map +1 -0
- package/dist/interface/schema/is-data.d.ts +19 -0
- package/dist/interface/schema/is-data.js +2 -0
- package/dist/interface/schema/is-data.js.map +1 -0
- package/dist/interface/schema/is-struct.d.ts +28 -0
- package/dist/interface/schema/is-struct.js +2 -0
- package/dist/interface/schema/is-struct.js.map +1 -0
- package/dist/interface/schema/schema.d.ts +151 -0
- package/dist/interface/schema/schema.js +2 -0
- package/dist/interface/schema/schema.js.map +1 -0
- package/dist/interface/system/access.d.ts +71 -0
- package/dist/interface/system/access.js +2 -0
- package/dist/interface/system/access.js.map +1 -0
- package/dist/interface/system/body.d.ts +56 -0
- package/dist/interface/system/body.js +2 -0
- package/dist/interface/system/body.js.map +1 -0
- package/dist/interface/system/check.d.ts +14 -0
- package/dist/interface/system/check.js +256 -0
- package/dist/interface/system/check.js.map +1 -0
- package/dist/interface/system/commands.d.ts +25 -0
- package/dist/interface/system/commands.js +2 -0
- package/dist/interface/system/commands.js.map +1 -0
- package/dist/interface/system/composite-declaration.d.ts +13 -0
- package/dist/interface/system/composite-declaration.js +2 -0
- package/dist/interface/system/composite-declaration.js.map +1 -0
- package/dist/interface/system/composite.d.ts +8 -0
- package/dist/interface/system/composite.js +2 -0
- package/dist/interface/system/composite.js.map +1 -0
- package/dist/interface/system/create.d.ts +212 -0
- package/dist/interface/system/create.js +29 -0
- package/dist/interface/system/create.js.map +1 -0
- package/dist/interface/system/declaration.d.ts +71 -0
- package/dist/interface/system/declaration.js +2 -0
- package/dist/interface/system/declaration.js.map +1 -0
- package/dist/interface/system/definition.d.ts +4 -0
- package/dist/interface/system/definition.js +2 -0
- package/dist/interface/system/definition.js.map +1 -0
- package/dist/interface/system/index.d.ts +3 -0
- package/dist/interface/system/index.js +3 -0
- package/dist/interface/system/index.js.map +1 -0
- package/dist/interface/system/input.d.ts +28 -0
- package/dist/interface/system/input.js +2 -0
- package/dist/interface/system/input.js.map +1 -0
- package/dist/interface/system/leaf.d.ts +12 -0
- package/dist/interface/system/leaf.js +2 -0
- package/dist/interface/system/leaf.js.map +1 -0
- package/dist/interface/system/name.d.ts +6 -0
- package/dist/interface/system/name.js +2 -0
- package/dist/interface/system/name.js.map +1 -0
- package/dist/interface/system/property.d.ts +4 -0
- package/dist/interface/system/property.js +2 -0
- package/dist/interface/system/property.js.map +1 -0
- package/dist/interface/system/render.d.ts +65 -0
- package/dist/interface/system/render.js +32 -0
- package/dist/interface/system/render.js.map +1 -0
- package/dist/interface/system/struct.d.ts +11 -0
- package/dist/interface/system/struct.js +2 -0
- package/dist/interface/system/struct.js.map +1 -0
- package/dist/interface/system/system.d.ts +10 -0
- package/dist/interface/system/system.js +2 -0
- package/dist/interface/system/system.js.map +1 -0
- package/dist/interface/system/threads.d.ts +46 -0
- package/dist/interface/system/threads.js +2 -0
- package/dist/interface/system/threads.js.map +1 -0
- package/dist/interface/system/values.d.ts +73 -0
- package/dist/interface/system/values.js +2 -0
- package/dist/interface/system/values.js.map +1 -0
- package/dist/interface/thread/of.d.ts +9 -0
- package/dist/interface/thread/of.js +2 -0
- package/dist/interface/thread/of.js.map +1 -0
- package/dist/interface/thread/thread.d.ts +12 -0
- package/dist/interface/thread/thread.js +2 -0
- package/dist/interface/thread/thread.js.map +1 -0
- package/dist/interface/trait/index.d.ts +1 -0
- package/dist/interface/trait/index.js +2 -0
- package/dist/interface/trait/index.js.map +1 -0
- package/dist/interface/trait/key.d.ts +4 -0
- package/dist/interface/trait/key.js +2 -0
- package/dist/interface/trait/key.js.map +1 -0
- package/dist/interface/trait/register.d.ts +7 -0
- package/dist/interface/trait/register.js +8 -0
- package/dist/interface/trait/register.js.map +1 -0
- package/dist/interface/trait/required.d.ts +10 -0
- package/dist/interface/trait/required.js +2 -0
- package/dist/interface/trait/required.js.map +1 -0
- package/dist/interface/trait/symbol-keys.d.ts +16 -0
- package/dist/interface/trait/symbol-keys.js +2 -0
- package/dist/interface/trait/symbol-keys.js.map +1 -0
- package/dist/interface/trait/trait.d.ts +2 -0
- package/dist/interface/trait/trait.js +2 -0
- package/dist/interface/trait/trait.js.map +1 -0
- package/dist/interface/trait/types.d.ts +56 -0
- package/dist/interface/trait/types.js +2 -0
- package/dist/interface/trait/types.js.map +1 -0
- package/dist/interface/world/create.d.ts +15 -0
- package/dist/interface/world/create.js +2 -0
- package/dist/interface/world/create.js.map +1 -0
- package/dist/interface/world/filter.d.ts +8 -0
- package/dist/interface/world/filter.js +2 -0
- package/dist/interface/world/filter.js.map +1 -0
- package/dist/interface/world/index.d.ts +1 -0
- package/dist/interface/world/index.js +2 -0
- package/dist/interface/world/index.js.map +1 -0
- package/dist/interface/world/join.d.ts +11 -0
- package/dist/interface/world/join.js +2 -0
- package/dist/interface/world/join.js.map +1 -0
- package/dist/interface/world/world.d.ts +59 -0
- package/dist/interface/world/world.js +2 -0
- package/dist/interface/world/world.js.map +1 -0
- package/package.json +66 -3
- package/src/exports.test.ts +171 -0
- package/src/guide/01-resources.test.ts +44 -0
- package/src/guide/02-entities.test.ts +57 -0
- package/src/guide/03-systems.test.ts +87 -0
- package/src/guide/04-ticks.test.ts +73 -0
- package/src/guide/05-scheduling.test.ts +60 -0
- package/src/guide/06-sync-points.test.ts +59 -0
- package/src/guide/07-change-filters.test.ts +87 -0
- package/src/guide/08-input.test.ts +47 -0
- package/src/guide/09-rules.test.ts +57 -0
- package/src/guide/10-finalizers.test.ts +64 -0
- package/src/guide/11-traits.test.ts +58 -0
- package/src/guide/11-traits.type-test.ts +27 -0
- package/src/guide/13-indexes.test.ts +95 -0
- package/src/guide/CLAUDE.md +34 -0
- package/src/guide/guide.md +551 -0
- package/src/implementation/compiler/access.ts +143 -0
- package/src/implementation/compiler/assign.ts +167 -0
- package/src/implementation/compiler/bind.ts +87 -0
- package/src/implementation/compiler/body-access.ts +332 -0
- package/src/implementation/compiler/booleans.ts +38 -0
- package/src/implementation/compiler/branches.ts +45 -0
- package/src/implementation/compiler/calls.ts +384 -0
- package/src/implementation/compiler/columns.ts +46 -0
- package/src/implementation/compiler/compile-kernel.ts +139 -0
- package/src/implementation/compiler/data.ts +94 -0
- package/src/implementation/compiler/estree.ts +63 -0
- package/src/implementation/compiler/exact.ts +77 -0
- package/src/implementation/compiler/expression.ts +124 -0
- package/src/implementation/compiler/failure.ts +37 -0
- package/src/implementation/compiler/hygiene.test.ts +73 -0
- package/src/implementation/compiler/identify.test.ts +155 -0
- package/src/implementation/compiler/identify.ts +155 -0
- package/src/implementation/compiler/index.ts +1 -0
- package/src/implementation/compiler/ir.ts +101 -0
- package/src/implementation/compiler/kernel-id.ts +33 -0
- package/src/implementation/compiler/key.ts +32 -0
- package/src/implementation/compiler/link.test.ts +70 -0
- package/src/implementation/compiler/link.ts +202 -0
- package/src/implementation/compiler/lists.ts +202 -0
- package/src/implementation/compiler/lookups.ts +120 -0
- package/src/implementation/compiler/math.ts +9 -0
- package/src/implementation/compiler/module-scope.ts +140 -0
- package/src/implementation/compiler/module-value.ts +121 -0
- package/src/implementation/compiler/out.ts +6 -0
- package/src/implementation/compiler/paths.ts +43 -0
- package/src/implementation/compiler/plugin.test.ts +375 -0
- package/src/implementation/compiler/plugin.ts +223 -0
- package/src/implementation/compiler/print.ts +104 -0
- package/src/implementation/compiler/program.ts +232 -0
- package/src/implementation/compiler/scalar.ts +46 -0
- package/src/implementation/compiler/scope.ts +27 -0
- package/src/implementation/compiler/serialize.ts +10 -0
- package/src/implementation/compiler/signature.ts +170 -0
- package/src/implementation/compiler/snapshot.ts +34 -0
- package/src/implementation/compiler/source-map.test.ts +40 -0
- package/src/implementation/compiler/source-map.ts +134 -0
- package/src/implementation/compiler/spawns.ts +114 -0
- package/src/implementation/compiler/stamps.ts +24 -0
- package/src/implementation/compiler/statement.ts +102 -0
- package/src/implementation/compiler/subset.md +82 -0
- package/src/implementation/compiler/terminal.ts +49 -0
- package/src/implementation/compiler/transform.test.ts +1421 -0
- package/src/implementation/compiler/transform.ts +239 -0
- package/src/implementation/compiler/unit.ts +114 -0
- package/src/implementation/compiler/value.ts +60 -0
- package/src/implementation/index.ts +2 -0
- package/src/implementation/world/activate.ts +127 -0
- package/src/implementation/world/archetype.ts +387 -0
- package/src/implementation/world/arrays.test.ts +24 -0
- package/src/implementation/world/arrays.ts +43 -0
- package/src/implementation/world/async-loading.test.ts +101 -0
- package/src/implementation/world/attach-kernel.test.ts +9 -0
- package/src/implementation/world/attach-kernel.ts +24 -0
- package/src/implementation/world/batches.test.ts +129 -0
- package/src/implementation/world/batches.ts +126 -0
- package/src/implementation/world/buffer.ts +145 -0
- package/src/implementation/world/builtins.test.ts +92 -0
- package/src/implementation/world/cascade.ts +144 -0
- package/src/implementation/world/cells.ts +24 -0
- package/src/implementation/world/changes-finalizers.test.ts +40 -0
- package/src/implementation/world/check-kernel.ts +86 -0
- package/src/implementation/world/claims.test.ts +41 -0
- package/src/implementation/world/claims.ts +50 -0
- package/src/implementation/world/closure.test.ts +39 -0
- package/src/implementation/world/closure.ts +40 -0
- package/src/implementation/world/command-ring.ts +474 -0
- package/src/implementation/world/command-rings.cases.ts +45 -0
- package/src/implementation/world/command-rings.fixture.ts +189 -0
- package/src/implementation/world/commands.test.ts +344 -0
- package/src/implementation/world/commands.ts +78 -0
- package/src/implementation/world/composite-input.test.ts +37 -0
- package/src/implementation/world/conditions.test.ts +124 -0
- package/src/implementation/world/create.test.ts +383 -0
- package/src/implementation/world/create.ts +825 -0
- package/src/implementation/world/directories.ts +86 -0
- package/src/implementation/world/directory.test.ts +54 -0
- package/src/implementation/world/dispatch.cases.ts +32 -0
- package/src/implementation/world/dispatch.fixture.ts +172 -0
- package/src/implementation/world/entities.ts +189 -0
- package/src/implementation/world/entity-lookup-workers.cases.ts +18 -0
- package/src/implementation/world/entity-lookup-workers.fixture.ts +109 -0
- package/src/implementation/world/entity-lookups.browser.test.ts +57 -0
- package/src/implementation/world/entity-lookups.test-helper.ts +201 -0
- package/src/implementation/world/entity-lookups.test.ts +112 -0
- package/src/implementation/world/execute.ts +609 -0
- package/src/implementation/world/failures.ts +14 -0
- package/src/implementation/world/finalizers.test.ts +318 -0
- package/src/implementation/world/finalizers.ts +419 -0
- package/src/implementation/world/fixtures.test-helper.ts +19 -0
- package/src/implementation/world/generated-code.md +140 -0
- package/src/implementation/world/gpu.browser.test.ts +693 -0
- package/src/implementation/world/gpu.ts +393 -0
- package/src/implementation/world/holders.ts +68 -0
- package/src/implementation/world/ids.test.ts +68 -0
- package/src/implementation/world/imported-lists.test-helper.ts +22 -0
- package/src/implementation/world/imported-lists.test.ts +45 -0
- package/src/implementation/world/index-build-csp.test.ts +59 -0
- package/src/implementation/world/index-build.cases.ts +20 -0
- package/src/implementation/world/index-build.fixture.ts +125 -0
- package/src/implementation/world/index-build.ts +458 -0
- package/src/implementation/world/index-changed.test.ts +242 -0
- package/src/implementation/world/index-hash.ts +478 -0
- package/src/implementation/world/index-joined.test.ts +293 -0
- package/src/implementation/world/index-kernels.test.ts +204 -0
- package/src/implementation/world/index-keyless.test.ts +278 -0
- package/src/implementation/world/index-keys.ts +271 -0
- package/src/implementation/world/index-lookups-csp.test.ts +44 -0
- package/src/implementation/world/index-lookups.ts +623 -0
- package/src/implementation/world/index-order.test.ts +154 -0
- package/src/implementation/world/index-order.ts +182 -0
- package/src/implementation/world/index-readers.ts +324 -0
- package/src/implementation/world/index-sorted.test.ts +75 -0
- package/src/implementation/world/index-sorted.ts +651 -0
- package/src/implementation/world/index-workers.cases.ts +17 -0
- package/src/implementation/world/index-workers.fixture.ts +191 -0
- package/src/implementation/world/indexes.test.ts +731 -0
- package/src/implementation/world/indexes.ts +1209 -0
- package/src/implementation/world/input.ts +14 -0
- package/src/implementation/world/intrinsics-coverage.test.ts +25 -0
- package/src/implementation/world/intrinsics.browser.test.ts +584 -0
- package/src/implementation/world/intrinsics.ts +40 -0
- package/src/implementation/world/join.test.ts +170 -0
- package/src/implementation/world/join.ts +676 -0
- package/src/implementation/world/join.type-test.ts +27 -0
- package/src/implementation/world/joined-observer.ts +809 -0
- package/src/implementation/world/joining-worker.fixture.ts +69 -0
- package/src/implementation/world/joining.cases.ts +52 -0
- package/src/implementation/world/joining.fixture.ts +138 -0
- package/src/implementation/world/joining.test-helper.ts +92 -0
- package/src/implementation/world/joining.ts +309 -0
- package/src/implementation/world/journal.ts +36 -0
- package/src/implementation/world/kernel-imports-sparks.test-helper.ts +17 -0
- package/src/implementation/world/kernel-imports-steer.test-helper.ts +9 -0
- package/src/implementation/world/kernel-imports.test.ts +73 -0
- package/src/implementation/world/kernel-indexes.ts +165 -0
- package/src/implementation/world/kernel-lookup.test-helper.ts +30 -0
- package/src/implementation/world/kernel-path.test-helper.ts +20 -0
- package/src/implementation/world/kernel-spawns.test.ts +159 -0
- package/src/implementation/world/kernel.ts +244 -0
- package/src/implementation/world/kernels-csp.test.ts +42 -0
- package/src/implementation/world/kernels.test.ts +78 -0
- package/src/implementation/world/kernels.ts +329 -0
- package/src/implementation/world/layout-directory.browser.test.ts +205 -0
- package/src/implementation/world/layout-directory.cases.ts +37 -0
- package/src/implementation/world/layout-directory.fixture.ts +186 -0
- package/src/implementation/world/layout-directory.ts +230 -0
- package/src/implementation/world/lifetime.cases.ts +18 -0
- package/src/implementation/world/lifetime.fixture.ts +77 -0
- package/src/implementation/world/lifetime.test-helper.ts +78 -0
- package/src/implementation/world/lifetime.test.ts +87 -0
- package/src/implementation/world/lists.ts +152 -0
- package/src/implementation/world/lookup-keys.ts +48 -0
- package/src/implementation/world/loop.test.ts +182 -0
- package/src/implementation/world/loop.ts +295 -0
- package/src/implementation/world/memory.test.ts +41 -0
- package/src/implementation/world/memory.ts +89 -0
- package/src/implementation/world/mirror.ts +603 -0
- package/src/implementation/world/move-log.test.ts +326 -0
- package/src/implementation/world/move-log.ts +215 -0
- package/src/implementation/world/names.test.ts +80 -0
- package/src/implementation/world/observe-cases.browser.test.ts +97 -0
- package/src/implementation/world/observe-cases.test.ts +798 -0
- package/src/implementation/world/observe-factories.test.ts +303 -0
- package/src/implementation/world/observe-joined-cases.test.ts +232 -0
- package/src/implementation/world/observe-ticks-cases.test.ts +213 -0
- package/src/implementation/world/observe.test-helper.ts +13 -0
- package/src/implementation/world/observed-workers.cases.ts +12 -0
- package/src/implementation/world/observed-workers.fixture.ts +55 -0
- package/src/implementation/world/observer-contained-worker.fixture.ts +40 -0
- package/src/implementation/world/observer-contained.browser.test.ts +4 -0
- package/src/implementation/world/observer-contained.cases.ts +16 -0
- package/src/implementation/world/observer-contained.fixture.ts +125 -0
- package/src/implementation/world/observer-contained.test-helper.ts +43 -0
- package/src/implementation/world/observer-contained.test.ts +96 -0
- package/src/implementation/world/observer-joined-worker.fixture.ts +80 -0
- package/src/implementation/world/observer-joined.cases.ts +28 -0
- package/src/implementation/world/observer-joined.fixture.ts +286 -0
- package/src/implementation/world/observer-joined.test-helper.ts +180 -0
- package/src/implementation/world/observer-joined.test.ts +350 -0
- package/src/implementation/world/observer.browser.test.ts +73 -0
- package/src/implementation/world/observer.test.ts +301 -0
- package/src/implementation/world/observer.ts +139 -0
- package/src/implementation/world/order.ts +351 -0
- package/src/implementation/world/perf.md +356 -0
- package/src/implementation/world/plan.md +81 -0
- package/src/implementation/world/plan.ts +71 -0
- package/src/implementation/world/platforms.test-helper.ts +67 -0
- package/src/implementation/world/pool-size.cases.ts +23 -0
- package/src/implementation/world/pool-size.fixture.ts +66 -0
- package/src/implementation/world/pool.cases.ts +30 -0
- package/src/implementation/world/pool.fixture.ts +54 -0
- package/src/implementation/world/pool.ts +323 -0
- package/src/implementation/world/port.ts +141 -0
- package/src/implementation/world/ports.cases.ts +37 -0
- package/src/implementation/world/ports.fixture.ts +107 -0
- package/src/implementation/world/ports.type-test.ts +14 -0
- package/src/implementation/world/prepared-lookup.ts +95 -0
- package/src/implementation/world/prepared-spawn.ts +161 -0
- package/src/implementation/world/program.ts +13 -0
- package/src/implementation/world/protocol.ts +127 -0
- package/src/implementation/world/publish.ts +28 -0
- package/src/implementation/world/ranges.ts +44 -0
- package/src/implementation/world/reads.test-helper.ts +29 -0
- package/src/implementation/world/reductions.cases.ts +22 -0
- package/src/implementation/world/reductions.fixture.ts +65 -0
- package/src/implementation/world/reductions.test.ts +279 -0
- package/src/implementation/world/reductions.ts +105 -0
- package/src/implementation/world/reevaluation.test-helper.ts +16 -0
- package/src/implementation/world/reevaluation.test.ts +32 -0
- package/src/implementation/world/register.ts +412 -0
- package/src/implementation/world/remote-finalizers-worker.fixture.ts +44 -0
- package/src/implementation/world/remote-finalizers.cases.ts +24 -0
- package/src/implementation/world/remote-finalizers.fixture.ts +140 -0
- package/src/implementation/world/remote-finalizers.test-helper.ts +160 -0
- package/src/implementation/world/remote-finalizers.test.ts +188 -0
- package/src/implementation/world/remote-objects-worker.fixture.ts +20 -0
- package/src/implementation/world/remote-objects.cases.ts +16 -0
- package/src/implementation/world/remote-objects.fixture.ts +59 -0
- package/src/implementation/world/remote-objects.test-helper.ts +107 -0
- package/src/implementation/world/remote-systems.ts +627 -0
- package/src/implementation/world/remote.test.ts +186 -0
- package/src/implementation/world/remote.ts +125 -0
- package/src/implementation/world/removal-worker.fixture.ts +20 -0
- package/src/implementation/world/removal.cases.ts +16 -0
- package/src/implementation/world/removal.fixture.ts +95 -0
- package/src/implementation/world/remove-joined.test.ts +181 -0
- package/src/implementation/world/remove.test-helper.ts +84 -0
- package/src/implementation/world/remove.test.ts +194 -0
- package/src/implementation/world/reports.test-helper.ts +117 -0
- package/src/implementation/world/reports.test.ts +167 -0
- package/src/implementation/world/reports.ts +203 -0
- package/src/implementation/world/resources.ts +67 -0
- package/src/implementation/world/rows.test.ts +78 -0
- package/src/implementation/world/rows.ts +515 -0
- package/src/implementation/world/rules.test.ts +243 -0
- package/src/implementation/world/runner.ts +1073 -0
- package/src/implementation/world/schedule.test.ts +124 -0
- package/src/implementation/world/semantics.test.ts +100 -0
- package/src/implementation/world/share.test.ts +17 -0
- package/src/implementation/world/sharing.ts +588 -0
- package/src/implementation/world/staging.ts +196 -0
- package/src/implementation/world/state.ts +521 -0
- package/src/implementation/world/stop-lists.ts +308 -0
- package/src/implementation/world/strings.test.ts +200 -0
- package/src/implementation/world/strings.ts +246 -0
- package/src/implementation/world/structure.ts +70 -0
- package/src/implementation/world/synchronize.test.ts +54 -0
- package/src/implementation/world/synchronize.ts +762 -0
- package/src/implementation/world/tail-blocks.ts +74 -0
- package/src/implementation/world/tails-worker.fixture.ts +66 -0
- package/src/implementation/world/tails.cases.ts +44 -0
- package/src/implementation/world/tails.fixture.ts +254 -0
- package/src/implementation/world/tails.test-helper.ts +166 -0
- package/src/implementation/world/tails.test.ts +114 -0
- package/src/implementation/world/tails.ts +477 -0
- package/src/implementation/world/target.test.ts +73 -0
- package/src/implementation/world/terminal.ts +13 -0
- package/src/implementation/world/thread-directory.ts +210 -0
- package/src/implementation/world/thread-finalizers.ts +318 -0
- package/src/implementation/world/thread-indexes.ts +90 -0
- package/src/implementation/world/thread-observer.ts +234 -0
- package/src/implementation/world/thread-systems-worker.fixture.ts +70 -0
- package/src/implementation/world/thread-systems.cases.ts +41 -0
- package/src/implementation/world/thread-systems.fixture.ts +205 -0
- package/src/implementation/world/thread-systems.test-helper.ts +325 -0
- package/src/implementation/world/thread-systems.test.ts +120 -0
- package/src/implementation/world/thread-systems.ts +1200 -0
- package/src/implementation/world/thread-tasks.ts +75 -0
- package/src/implementation/world/threads.browser.test.ts +46 -0
- package/src/implementation/world/threads.test.ts +73 -0
- package/src/implementation/world/ticks.browser.test.ts +44 -0
- package/src/implementation/world/ticks.test.ts +34 -0
- package/src/implementation/world/traits.test.ts +66 -0
- package/src/implementation/world/transfers-worker.fixture.ts +114 -0
- package/src/implementation/world/transfers.cases.ts +30 -0
- package/src/implementation/world/transfers.fixture.ts +147 -0
- package/src/implementation/world/transfers.test-helper.ts +111 -0
- package/src/implementation/world/transfers.test.ts +157 -0
- package/src/implementation/world/transfers.ts +104 -0
- package/src/implementation/world/up-tree.test.ts +152 -0
- package/src/implementation/world/up-workers.cases.ts +13 -0
- package/src/implementation/world/up-workers.fixture.ts +67 -0
- package/src/implementation/world/up.browser.test.ts +78 -0
- package/src/implementation/world/up.test.ts +284 -0
- package/src/implementation/world/up.ts +684 -0
- package/src/implementation/world/wasm-kernels.test.ts +269 -0
- package/src/implementation/world/wasm.test.ts +381 -0
- package/src/implementation/world/wasm.ts +2093 -0
- package/src/implementation/world/wgsl.test.ts +41 -0
- package/src/implementation/world/wgsl.ts +464 -0
- package/src/implementation/world/worker-platform.ts +105 -0
- package/src/implementation/world/worker.ts +560 -0
- package/src/implementation/world/workers.cases.ts +59 -0
- package/src/implementation/world/workers.fixture.ts +261 -0
- package/src/implementation/world/world-host.fixture.ts +10 -0
- package/src/index.ts +16 -0
- package/src/interface/CLAUDE.md +33 -0
- package/src/interface/archetype/archetype.ts +3 -0
- package/src/interface/archetype/archetype.type-test.ts +37 -0
- package/src/interface/archetype/create.test.ts +40 -0
- package/src/interface/archetype/create.ts +12 -0
- package/src/interface/archetype/index.ts +1 -0
- package/src/interface/archetype/values-of.ts +16 -0
- package/src/interface/component/component.ts +4 -0
- package/src/interface/component/declaration.ts +67 -0
- package/src/interface/component/declaration.type-test.ts +87 -0
- package/src/interface/component/index.ts +3 -0
- package/src/interface/component/key.ts +3 -0
- package/src/interface/component/key.type-test.ts +31 -0
- package/src/interface/component/register.test.ts +124 -0
- package/src/interface/component/register.ts +28 -0
- package/src/interface/component/types.ts +6 -0
- package/src/interface/component/value.ts +34 -0
- package/src/interface/component/values.ts +5 -0
- package/src/interface/entity/entity.ts +9 -0
- package/src/interface/entity/index.ts +8 -0
- package/src/interface/finalizer/body.ts +51 -0
- package/src/interface/finalizer/create.test.ts +148 -0
- package/src/interface/finalizer/create.ts +128 -0
- package/src/interface/finalizer/created.ts +21 -0
- package/src/interface/finalizer/declaration.ts +29 -0
- package/src/interface/finalizer/finalizer.ts +7 -0
- package/src/interface/finalizer/index.ts +1 -0
- package/src/interface/finalizer/name.ts +6 -0
- package/src/interface/gpu/accessors.ts +72 -0
- package/src/interface/gpu/gpu.ts +4 -0
- package/src/interface/gpu/gpu.type-test.ts +27 -0
- package/src/interface/gpu/index.ts +2 -0
- package/src/interface/gpu/layout.ts +22 -0
- package/src/interface/gpu/record.ts +5 -0
- package/src/interface/gpu/wgsl.ts +20 -0
- package/src/interface/index.ts +19 -0
- package/src/interface/index.type-test.ts +55 -0
- package/src/interface/indexes/create.test.ts +145 -0
- package/src/interface/indexes/create.ts +80 -0
- package/src/interface/indexes/created.ts +4 -0
- package/src/interface/indexes/declaration.ts +11 -0
- package/src/interface/indexes/index-type.ts +12 -0
- package/src/interface/indexes/index.ts +1 -0
- package/src/interface/indexes/index.type-test.ts +293 -0
- package/src/interface/indexes/name.ts +5 -0
- package/src/interface/math/f32/index.ts +3 -0
- package/src/interface/math/f32/public.ts +1 -0
- package/src/interface/math/f32/round-half-even.ts +5 -0
- package/src/interface/math/f32/schema.ts +3 -0
- package/src/interface/math/i32/index.ts +4 -0
- package/src/interface/math/i32/public.ts +2 -0
- package/src/interface/math/i32/schema.ts +3 -0
- package/src/interface/math/i32/shift-right.ts +3 -0
- package/src/interface/math/index.ts +8 -0
- package/src/interface/math/intrinsic.ts +18 -0
- package/src/interface/math/mat4x4/add.ts +9 -0
- package/src/interface/math/mat4x4/determinant.ts +26 -0
- package/src/interface/math/mat4x4/identity.ts +8 -0
- package/src/interface/math/mat4x4/index.ts +26 -0
- package/src/interface/math/mat4x4/inverse.ts +49 -0
- package/src/interface/math/mat4x4/look-at.test.ts +13 -0
- package/src/interface/math/mat4x4/look-at.ts +26 -0
- package/src/interface/math/mat4x4/multiply-vec3.ts +8 -0
- package/src/interface/math/mat4x4/multiply-vec4.ts +10 -0
- package/src/interface/math/mat4x4/multiply.ts +22 -0
- package/src/interface/math/mat4x4/orthographic.ts +20 -0
- package/src/interface/math/mat4x4/perspective.ts +20 -0
- package/src/interface/math/mat4x4/public.ts +20 -0
- package/src/interface/math/mat4x4/rotation-x.ts +12 -0
- package/src/interface/math/mat4x4/rotation-y.ts +12 -0
- package/src/interface/math/mat4x4/rotation-z.ts +12 -0
- package/src/interface/math/mat4x4/rotation.test.ts +16 -0
- package/src/interface/math/mat4x4/scale.ts +9 -0
- package/src/interface/math/mat4x4/scaling.ts +8 -0
- package/src/interface/math/mat4x4/schema.ts +4 -0
- package/src/interface/math/mat4x4/subtract.ts +9 -0
- package/src/interface/math/mat4x4/translation.ts +8 -0
- package/src/interface/math/mat4x4/transpose.ts +9 -0
- package/src/interface/math/mat4x4/zero.ts +8 -0
- package/src/interface/math/math.type-test.ts +20 -0
- package/src/interface/math/quat/add.ts +9 -0
- package/src/interface/math/quat/align-to.ts +44 -0
- package/src/interface/math/quat/conjugate.ts +3 -0
- package/src/interface/math/quat/distance.ts +5 -0
- package/src/interface/math/quat/dot.ts +5 -0
- package/src/interface/math/quat/from-axis-angle.ts +14 -0
- package/src/interface/math/quat/from-euler.ts +17 -0
- package/src/interface/math/quat/identity.ts +3 -0
- package/src/interface/math/quat/index.ts +3 -0
- package/src/interface/math/quat/inverse.ts +10 -0
- package/src/interface/math/quat/length-squared.ts +3 -0
- package/src/interface/math/quat/length.ts +4 -0
- package/src/interface/math/quat/lerp.ts +8 -0
- package/src/interface/math/quat/look-at.ts +52 -0
- package/src/interface/math/quat/multiply.ts +8 -0
- package/src/interface/math/quat/negate.ts +4 -0
- package/src/interface/math/quat/normalize.ts +8 -0
- package/src/interface/math/quat/public.ts +24 -0
- package/src/interface/math/quat/rotate-vec3.ts +16 -0
- package/src/interface/math/quat/scale.ts +4 -0
- package/src/interface/math/quat/schema.ts +4 -0
- package/src/interface/math/quat/slerp.ts +26 -0
- package/src/interface/math/quat/subtract.ts +9 -0
- package/src/interface/math/quat/to-axis-angle.ts +14 -0
- package/src/interface/math/quat/to-euler.ts +25 -0
- package/src/interface/math/quat/to-mat4.ts +27 -0
- package/src/interface/math/semantics.test.ts +50 -0
- package/src/interface/math/u32/count-leading-zeros.ts +4 -0
- package/src/interface/math/u32/count-one-bits.ts +10 -0
- package/src/interface/math/u32/count-trailing-zeros.ts +7 -0
- package/src/interface/math/u32/index.ts +4 -0
- package/src/interface/math/u32/public.ts +6 -0
- package/src/interface/math/u32/reverse-bits.ts +11 -0
- package/src/interface/math/u32/schema.ts +3 -0
- package/src/interface/math/u32/shift-right.ts +3 -0
- package/src/interface/math/vec2/f32/abs.ts +4 -0
- package/src/interface/math/vec2/f32/acos.ts +4 -0
- package/src/interface/math/vec2/f32/acosh.ts +4 -0
- package/src/interface/math/vec2/f32/add.ts +4 -0
- package/src/interface/math/vec2/f32/asin.ts +4 -0
- package/src/interface/math/vec2/f32/asinh.ts +4 -0
- package/src/interface/math/vec2/f32/atan.ts +4 -0
- package/src/interface/math/vec2/f32/atanh.ts +4 -0
- package/src/interface/math/vec2/f32/ceil.ts +4 -0
- package/src/interface/math/vec2/f32/clamp.ts +6 -0
- package/src/interface/math/vec2/f32/cos.ts +4 -0
- package/src/interface/math/vec2/f32/cosh.ts +4 -0
- package/src/interface/math/vec2/f32/distance.ts +6 -0
- package/src/interface/math/vec2/f32/dot.ts +4 -0
- package/src/interface/math/vec2/f32/equals.ts +3 -0
- package/src/interface/math/vec2/f32/exp.ts +4 -0
- package/src/interface/math/vec2/f32/exp2.ts +4 -0
- package/src/interface/math/vec2/f32/f32.ts +3 -0
- package/src/interface/math/vec2/f32/faceforward.ts +7 -0
- package/src/interface/math/vec2/f32/floor.ts +4 -0
- package/src/interface/math/vec2/f32/fract.ts +4 -0
- package/src/interface/math/vec2/f32/length.ts +4 -0
- package/src/interface/math/vec2/f32/log.ts +4 -0
- package/src/interface/math/vec2/f32/log2.ts +4 -0
- package/src/interface/math/vec2/f32/max.ts +4 -0
- package/src/interface/math/vec2/f32/min.ts +4 -0
- package/src/interface/math/vec2/f32/mix.ts +7 -0
- package/src/interface/math/vec2/f32/mod.ts +3 -0
- package/src/interface/math/vec2/f32/modf.ts +7 -0
- package/src/interface/math/vec2/f32/negate.ts +4 -0
- package/src/interface/math/vec2/f32/normalize.ts +6 -0
- package/src/interface/math/vec2/f32/pow.ts +8 -0
- package/src/interface/math/vec2/f32/public.ts +47 -0
- package/src/interface/math/vec2/f32/reflect.ts +10 -0
- package/src/interface/math/vec2/f32/refract.ts +15 -0
- package/src/interface/math/vec2/f32/round.ts +5 -0
- package/src/interface/math/vec2/f32/scale.ts +4 -0
- package/src/interface/math/vec2/f32/schema.ts +4 -0
- package/src/interface/math/vec2/f32/sign.ts +4 -0
- package/src/interface/math/vec2/f32/sin.ts +4 -0
- package/src/interface/math/vec2/f32/sinh.ts +4 -0
- package/src/interface/math/vec2/f32/smoothstep.ts +8 -0
- package/src/interface/math/vec2/f32/sqrt.ts +4 -0
- package/src/interface/math/vec2/f32/step.ts +7 -0
- package/src/interface/math/vec2/f32/subtract.ts +4 -0
- package/src/interface/math/vec2/f32/tan.ts +4 -0
- package/src/interface/math/vec2/f32/tanh.ts +4 -0
- package/src/interface/math/vec2/f32/trunc.ts +4 -0
- package/src/interface/math/vec2/f32/zero.ts +3 -0
- package/src/interface/math/vec2/i32/abs.ts +4 -0
- package/src/interface/math/vec2/i32/add.ts +4 -0
- package/src/interface/math/vec2/i32/bitwise-and.ts +4 -0
- package/src/interface/math/vec2/i32/bitwise-not.ts +4 -0
- package/src/interface/math/vec2/i32/bitwise-or.ts +4 -0
- package/src/interface/math/vec2/i32/bitwise-xor.ts +4 -0
- package/src/interface/math/vec2/i32/clamp.ts +6 -0
- package/src/interface/math/vec2/i32/count-leading-zeros.ts +8 -0
- package/src/interface/math/vec2/i32/count-one-bits.ts +8 -0
- package/src/interface/math/vec2/i32/count-trailing-zeros.ts +8 -0
- package/src/interface/math/vec2/i32/equals.ts +3 -0
- package/src/interface/math/vec2/i32/i32.ts +4 -0
- package/src/interface/math/vec2/i32/max.ts +4 -0
- package/src/interface/math/vec2/i32/min.ts +4 -0
- package/src/interface/math/vec2/i32/negate.ts +4 -0
- package/src/interface/math/vec2/i32/public.ts +21 -0
- package/src/interface/math/vec2/i32/reverse-bits.ts +5 -0
- package/src/interface/math/vec2/i32/scale.ts +5 -0
- package/src/interface/math/vec2/i32/schema.ts +4 -0
- package/src/interface/math/vec2/i32/shift-left.ts +3 -0
- package/src/interface/math/vec2/i32/shift-right.ts +7 -0
- package/src/interface/math/vec2/i32/subtract.ts +4 -0
- package/src/interface/math/vec2/i32/zero.ts +3 -0
- package/src/interface/math/vec2/index.ts +6 -0
- package/src/interface/math/vec2/public.ts +4 -0
- package/src/interface/math/vec2/u32/add.ts +7 -0
- package/src/interface/math/vec2/u32/bitwise-and.ts +7 -0
- package/src/interface/math/vec2/u32/bitwise-not.ts +4 -0
- package/src/interface/math/vec2/u32/bitwise-or.ts +7 -0
- package/src/interface/math/vec2/u32/bitwise-xor.ts +7 -0
- package/src/interface/math/vec2/u32/clamp.ts +6 -0
- package/src/interface/math/vec2/u32/count-leading-zeros.ts +8 -0
- package/src/interface/math/vec2/u32/count-one-bits.ts +8 -0
- package/src/interface/math/vec2/u32/count-trailing-zeros.ts +8 -0
- package/src/interface/math/vec2/u32/equals.ts +3 -0
- package/src/interface/math/vec2/u32/max.ts +7 -0
- package/src/interface/math/vec2/u32/min.ts +7 -0
- package/src/interface/math/vec2/u32/negate.ts +3 -0
- package/src/interface/math/vec2/u32/public.ts +20 -0
- package/src/interface/math/vec2/u32/reverse-bits.ts +8 -0
- package/src/interface/math/vec2/u32/scale.ts +5 -0
- package/src/interface/math/vec2/u32/schema.ts +4 -0
- package/src/interface/math/vec2/u32/shift-left.ts +3 -0
- package/src/interface/math/vec2/u32/shift-right.ts +7 -0
- package/src/interface/math/vec2/u32/subtract.ts +7 -0
- package/src/interface/math/vec2/u32/u32.ts +4 -0
- package/src/interface/math/vec2/u32/zero.ts +3 -0
- package/src/interface/math/vec3/f32/abs.ts +4 -0
- package/src/interface/math/vec3/f32/acos.ts +4 -0
- package/src/interface/math/vec3/f32/acosh.ts +4 -0
- package/src/interface/math/vec3/f32/add.ts +8 -0
- package/src/interface/math/vec3/f32/asin.ts +4 -0
- package/src/interface/math/vec3/f32/asinh.ts +4 -0
- package/src/interface/math/vec3/f32/atan.ts +4 -0
- package/src/interface/math/vec3/f32/atanh.ts +4 -0
- package/src/interface/math/vec3/f32/ceil.ts +4 -0
- package/src/interface/math/vec3/f32/clamp.ts +6 -0
- package/src/interface/math/vec3/f32/cos.ts +4 -0
- package/src/interface/math/vec3/f32/cosh.ts +4 -0
- package/src/interface/math/vec3/f32/cross.ts +8 -0
- package/src/interface/math/vec3/f32/distance-squared.ts +8 -0
- package/src/interface/math/vec3/f32/distance.ts +6 -0
- package/src/interface/math/vec3/f32/dot.ts +5 -0
- package/src/interface/math/vec3/f32/equals.ts +3 -0
- package/src/interface/math/vec3/f32/exp.ts +4 -0
- package/src/interface/math/vec3/f32/exp2.ts +4 -0
- package/src/interface/math/vec3/f32/f32.ts +3 -0
- package/src/interface/math/vec3/f32/faceforward.ts +7 -0
- package/src/interface/math/vec3/f32/floor.ts +4 -0
- package/src/interface/math/vec3/f32/fract.ts +8 -0
- package/src/interface/math/vec3/f32/length-squared.ts +4 -0
- package/src/interface/math/vec3/f32/length.ts +4 -0
- package/src/interface/math/vec3/f32/log.ts +4 -0
- package/src/interface/math/vec3/f32/log2.ts +4 -0
- package/src/interface/math/vec3/f32/max.ts +8 -0
- package/src/interface/math/vec3/f32/min.ts +8 -0
- package/src/interface/math/vec3/f32/mix.ts +8 -0
- package/src/interface/math/vec3/f32/mod.ts +7 -0
- package/src/interface/math/vec3/f32/modf.ts +7 -0
- package/src/interface/math/vec3/f32/multiply.ts +11 -0
- package/src/interface/math/vec3/f32/negate.ts +4 -0
- package/src/interface/math/vec3/f32/normalize.ts +6 -0
- package/src/interface/math/vec3/f32/one.ts +3 -0
- package/src/interface/math/vec3/f32/pow.ts +9 -0
- package/src/interface/math/vec3/f32/public.ts +53 -0
- package/src/interface/math/vec3/f32/random.ts +5 -0
- package/src/interface/math/vec3/f32/reflect.ts +10 -0
- package/src/interface/math/vec3/f32/refract.ts +15 -0
- package/src/interface/math/vec3/f32/round.ts +9 -0
- package/src/interface/math/vec3/f32/scale.ts +4 -0
- package/src/interface/math/vec3/f32/schema.ts +4 -0
- package/src/interface/math/vec3/f32/sign.ts +4 -0
- package/src/interface/math/vec3/f32/sin.ts +4 -0
- package/src/interface/math/vec3/f32/sinh.ts +4 -0
- package/src/interface/math/vec3/f32/smoothstep.ts +13 -0
- package/src/interface/math/vec3/f32/sqrt.ts +4 -0
- package/src/interface/math/vec3/f32/step.ts +8 -0
- package/src/interface/math/vec3/f32/subtract.ts +8 -0
- package/src/interface/math/vec3/f32/tan.ts +4 -0
- package/src/interface/math/vec3/f32/tanh.ts +4 -0
- package/src/interface/math/vec3/f32/trunc.ts +4 -0
- package/src/interface/math/vec3/f32/zero.ts +3 -0
- package/src/interface/math/vec3/i32/abs.ts +8 -0
- package/src/interface/math/vec3/i32/add.ts +8 -0
- package/src/interface/math/vec3/i32/bitwise-and.ts +8 -0
- package/src/interface/math/vec3/i32/bitwise-not.ts +4 -0
- package/src/interface/math/vec3/i32/bitwise-or.ts +8 -0
- package/src/interface/math/vec3/i32/bitwise-xor.ts +8 -0
- package/src/interface/math/vec3/i32/clamp.ts +6 -0
- package/src/interface/math/vec3/i32/count-leading-zeros.ts +9 -0
- package/src/interface/math/vec3/i32/count-one-bits.ts +9 -0
- package/src/interface/math/vec3/i32/count-trailing-zeros.ts +9 -0
- package/src/interface/math/vec3/i32/equals.ts +3 -0
- package/src/interface/math/vec3/i32/i32.ts +4 -0
- package/src/interface/math/vec3/i32/max.ts +8 -0
- package/src/interface/math/vec3/i32/min.ts +8 -0
- package/src/interface/math/vec3/i32/multiply.ts +8 -0
- package/src/interface/math/vec3/i32/negate.ts +8 -0
- package/src/interface/math/vec3/i32/one.ts +3 -0
- package/src/interface/math/vec3/i32/public.ts +23 -0
- package/src/interface/math/vec3/i32/reverse-bits.ts +9 -0
- package/src/interface/math/vec3/i32/scale.ts +9 -0
- package/src/interface/math/vec3/i32/schema.ts +4 -0
- package/src/interface/math/vec3/i32/shift-left.ts +3 -0
- package/src/interface/math/vec3/i32/shift-right.ts +8 -0
- package/src/interface/math/vec3/i32/subtract.ts +8 -0
- package/src/interface/math/vec3/i32/zero.ts +3 -0
- package/src/interface/math/vec3/index.ts +6 -0
- package/src/interface/math/vec3/public.ts +4 -0
- package/src/interface/math/vec3/u32/add.ts +8 -0
- package/src/interface/math/vec3/u32/bitwise-and.ts +8 -0
- package/src/interface/math/vec3/u32/bitwise-not.ts +4 -0
- package/src/interface/math/vec3/u32/bitwise-or.ts +8 -0
- package/src/interface/math/vec3/u32/bitwise-xor.ts +8 -0
- package/src/interface/math/vec3/u32/clamp.ts +6 -0
- package/src/interface/math/vec3/u32/count-leading-zeros.ts +9 -0
- package/src/interface/math/vec3/u32/count-one-bits.ts +9 -0
- package/src/interface/math/vec3/u32/count-trailing-zeros.ts +9 -0
- package/src/interface/math/vec3/u32/equals.ts +3 -0
- package/src/interface/math/vec3/u32/max.ts +8 -0
- package/src/interface/math/vec3/u32/min.ts +8 -0
- package/src/interface/math/vec3/u32/multiply.ts +8 -0
- package/src/interface/math/vec3/u32/negate.ts +3 -0
- package/src/interface/math/vec3/u32/one.ts +3 -0
- package/src/interface/math/vec3/u32/public.ts +23 -0
- package/src/interface/math/vec3/u32/reverse-bits.ts +9 -0
- package/src/interface/math/vec3/u32/scale.ts +9 -0
- package/src/interface/math/vec3/u32/schema.ts +4 -0
- package/src/interface/math/vec3/u32/shift-left.ts +7 -0
- package/src/interface/math/vec3/u32/shift-right.ts +8 -0
- package/src/interface/math/vec3/u32/subtract.ts +8 -0
- package/src/interface/math/vec3/u32/u32.ts +4 -0
- package/src/interface/math/vec3/u32/volume.ts +3 -0
- package/src/interface/math/vec3/u32/zero.ts +3 -0
- package/src/interface/math/vec4/f32/abs.ts +4 -0
- package/src/interface/math/vec4/f32/acos.ts +4 -0
- package/src/interface/math/vec4/f32/acosh.ts +4 -0
- package/src/interface/math/vec4/f32/add.ts +9 -0
- package/src/interface/math/vec4/f32/asin.ts +4 -0
- package/src/interface/math/vec4/f32/asinh.ts +4 -0
- package/src/interface/math/vec4/f32/atan.ts +4 -0
- package/src/interface/math/vec4/f32/atanh.ts +4 -0
- package/src/interface/math/vec4/f32/ceil.ts +4 -0
- package/src/interface/math/vec4/f32/clamp.ts +6 -0
- package/src/interface/math/vec4/f32/cos.ts +4 -0
- package/src/interface/math/vec4/f32/cosh.ts +4 -0
- package/src/interface/math/vec4/f32/distance.ts +6 -0
- package/src/interface/math/vec4/f32/dot.ts +5 -0
- package/src/interface/math/vec4/f32/exp.ts +4 -0
- package/src/interface/math/vec4/f32/exp2.ts +4 -0
- package/src/interface/math/vec4/f32/f32.ts +3 -0
- package/src/interface/math/vec4/f32/faceforward.ts +7 -0
- package/src/interface/math/vec4/f32/floor.ts +4 -0
- package/src/interface/math/vec4/f32/fract.ts +9 -0
- package/src/interface/math/vec4/f32/length.ts +4 -0
- package/src/interface/math/vec4/f32/log.ts +4 -0
- package/src/interface/math/vec4/f32/log2.ts +4 -0
- package/src/interface/math/vec4/f32/max.ts +9 -0
- package/src/interface/math/vec4/f32/min.ts +9 -0
- package/src/interface/math/vec4/f32/mix.ts +9 -0
- package/src/interface/math/vec4/f32/mod.ts +8 -0
- package/src/interface/math/vec4/f32/modf.ts +7 -0
- package/src/interface/math/vec4/f32/multiply.ts +9 -0
- package/src/interface/math/vec4/f32/negate.ts +4 -0
- package/src/interface/math/vec4/f32/normalize.ts +6 -0
- package/src/interface/math/vec4/f32/pow.ts +10 -0
- package/src/interface/math/vec4/f32/public.ts +46 -0
- package/src/interface/math/vec4/f32/reflect.ts +10 -0
- package/src/interface/math/vec4/f32/refract.ts +15 -0
- package/src/interface/math/vec4/f32/round.ts +10 -0
- package/src/interface/math/vec4/f32/scale.ts +4 -0
- package/src/interface/math/vec4/f32/schema.ts +4 -0
- package/src/interface/math/vec4/f32/sign.ts +4 -0
- package/src/interface/math/vec4/f32/sin.ts +4 -0
- package/src/interface/math/vec4/f32/sinh.ts +4 -0
- package/src/interface/math/vec4/f32/smoothstep.ts +15 -0
- package/src/interface/math/vec4/f32/sqrt.ts +4 -0
- package/src/interface/math/vec4/f32/step.ts +9 -0
- package/src/interface/math/vec4/f32/subtract.ts +9 -0
- package/src/interface/math/vec4/f32/tan.ts +4 -0
- package/src/interface/math/vec4/f32/tanh.ts +4 -0
- package/src/interface/math/vec4/f32/trunc.ts +4 -0
- package/src/interface/math/vec4/i32/abs.ts +9 -0
- package/src/interface/math/vec4/i32/add.ts +9 -0
- package/src/interface/math/vec4/i32/bitwise-and.ts +9 -0
- package/src/interface/math/vec4/i32/bitwise-not.ts +4 -0
- package/src/interface/math/vec4/i32/bitwise-or.ts +9 -0
- package/src/interface/math/vec4/i32/bitwise-xor.ts +9 -0
- package/src/interface/math/vec4/i32/clamp.ts +6 -0
- package/src/interface/math/vec4/i32/count-leading-zeros.ts +10 -0
- package/src/interface/math/vec4/i32/count-one-bits.ts +10 -0
- package/src/interface/math/vec4/i32/count-trailing-zeros.ts +10 -0
- package/src/interface/math/vec4/i32/equals.ts +4 -0
- package/src/interface/math/vec4/i32/i32.ts +4 -0
- package/src/interface/math/vec4/i32/max.ts +9 -0
- package/src/interface/math/vec4/i32/min.ts +9 -0
- package/src/interface/math/vec4/i32/multiply.ts +9 -0
- package/src/interface/math/vec4/i32/negate.ts +9 -0
- package/src/interface/math/vec4/i32/one.ts +3 -0
- package/src/interface/math/vec4/i32/public.ts +23 -0
- package/src/interface/math/vec4/i32/reverse-bits.ts +10 -0
- package/src/interface/math/vec4/i32/scale.ts +10 -0
- package/src/interface/math/vec4/i32/schema.ts +4 -0
- package/src/interface/math/vec4/i32/shift-left.ts +3 -0
- package/src/interface/math/vec4/i32/shift-right.ts +9 -0
- package/src/interface/math/vec4/i32/subtract.ts +9 -0
- package/src/interface/math/vec4/i32/zero.ts +3 -0
- package/src/interface/math/vec4/index.ts +6 -0
- package/src/interface/math/vec4/public.ts +4 -0
- package/src/interface/math/vec4/u32/add.ts +9 -0
- package/src/interface/math/vec4/u32/bitwise-and.ts +9 -0
- package/src/interface/math/vec4/u32/bitwise-not.ts +4 -0
- package/src/interface/math/vec4/u32/bitwise-or.ts +9 -0
- package/src/interface/math/vec4/u32/bitwise-xor.ts +9 -0
- package/src/interface/math/vec4/u32/clamp.ts +6 -0
- package/src/interface/math/vec4/u32/count-leading-zeros.ts +10 -0
- package/src/interface/math/vec4/u32/count-one-bits.ts +10 -0
- package/src/interface/math/vec4/u32/count-trailing-zeros.ts +10 -0
- package/src/interface/math/vec4/u32/equals.ts +4 -0
- package/src/interface/math/vec4/u32/max.ts +9 -0
- package/src/interface/math/vec4/u32/min.ts +9 -0
- package/src/interface/math/vec4/u32/multiply.ts +9 -0
- package/src/interface/math/vec4/u32/negate.ts +3 -0
- package/src/interface/math/vec4/u32/one.ts +3 -0
- package/src/interface/math/vec4/u32/public.ts +22 -0
- package/src/interface/math/vec4/u32/reverse-bits.ts +10 -0
- package/src/interface/math/vec4/u32/scale.ts +10 -0
- package/src/interface/math/vec4/u32/schema.ts +4 -0
- package/src/interface/math/vec4/u32/shift-left.ts +8 -0
- package/src/interface/math/vec4/u32/shift-right.ts +9 -0
- package/src/interface/math/vec4/u32/subtract.ts +9 -0
- package/src/interface/math/vec4/u32/u32.ts +4 -0
- package/src/interface/math/vec4/u32/zero.ts +3 -0
- package/src/interface/platform/platform.ts +35 -0
- package/src/interface/registry/archetypes.ts +23 -0
- package/src/interface/registry/declarations.ts +102 -0
- package/src/interface/registry/finalizer-order.ts +52 -0
- package/src/interface/registry/ids.test-helper.ts +14 -0
- package/src/interface/registry/ids.test.ts +124 -0
- package/src/interface/registry/ids.ts +30 -0
- package/src/interface/registry/index.ts +29 -0
- package/src/interface/registry/indexes.ts +73 -0
- package/src/interface/registry/items.ts +125 -0
- package/src/interface/registry/layout.test.ts +86 -0
- package/src/interface/registry/layout.ts +364 -0
- package/src/interface/registry/names.test.ts +75 -0
- package/src/interface/registry/names.ts +154 -0
- package/src/interface/registry/program.ts +111 -0
- package/src/interface/registry/reduction.ts +7 -0
- package/src/interface/registry/schedule.ts +215 -0
- package/src/interface/registry/schemas.ts +61 -0
- package/src/interface/registry/strata.ts +93 -0
- package/src/interface/registry/threads.ts +73 -0
- package/src/interface/registry/traits.ts +12 -0
- package/src/interface/registry/written.ts +14 -0
- package/src/interface/report/components.ts +69 -0
- package/src/interface/report/failure.ts +26 -0
- package/src/interface/report/index.ts +8 -0
- package/src/interface/report/report.ts +11 -0
- package/src/interface/report/report.type-test.ts +63 -0
- package/src/interface/resource/condition.ts +8 -0
- package/src/interface/resource/declaration.ts +29 -0
- package/src/interface/resource/declaration.type-test.ts +89 -0
- package/src/interface/resource/index.ts +3 -0
- package/src/interface/resource/key.ts +3 -0
- package/src/interface/resource/reduction.ts +11 -0
- package/src/interface/resource/register.test.ts +107 -0
- package/src/interface/resource/register.ts +18 -0
- package/src/interface/resource/resource.ts +4 -0
- package/src/interface/resource/types.ts +3 -0
- package/src/interface/resource/value.ts +20 -0
- package/src/interface/resource/written.ts +4 -0
- package/src/interface/resources/always.ts +12 -0
- package/src/interface/resources/cadence.ts +27 -0
- package/src/interface/resources/clock.ts +17 -0
- package/src/interface/resources/gpu-device.ts +16 -0
- package/src/interface/resources/index.ts +6 -0
- package/src/interface/resources/wake.ts +15 -0
- package/src/interface/resources/workers.ts +12 -0
- package/src/interface/rule/create.ts +25 -0
- package/src/interface/rule/created.ts +4 -0
- package/src/interface/rule/declaration.ts +11 -0
- package/src/interface/rule/index.ts +1 -0
- package/src/interface/rule/name.ts +6 -0
- package/src/interface/rule/rule.ts +3 -0
- package/src/interface/rule/rule.type-test.ts +117 -0
- package/src/interface/schema/is-data.ts +25 -0
- package/src/interface/schema/is-struct.ts +24 -0
- package/src/interface/schema/schema.ts +168 -0
- package/src/interface/schema/schema.type-test.ts +153 -0
- package/src/interface/schema/schemas.type-test.ts +12 -0
- package/src/interface/system/access.ts +67 -0
- package/src/interface/system/body.ts +49 -0
- package/src/interface/system/check.ts +227 -0
- package/src/interface/system/commands.ts +26 -0
- package/src/interface/system/commands.type-test.ts +93 -0
- package/src/interface/system/composite-declaration.ts +14 -0
- package/src/interface/system/composite-input.type-test.ts +63 -0
- package/src/interface/system/composite.ts +5 -0
- package/src/interface/system/conditions.type-test.ts +68 -0
- package/src/interface/system/create.test.ts +230 -0
- package/src/interface/system/create.ts +181 -0
- package/src/interface/system/declaration.ts +65 -0
- package/src/interface/system/definition.ts +5 -0
- package/src/interface/system/index.ts +3 -0
- package/src/interface/system/input.ts +28 -0
- package/src/interface/system/leaf.ts +13 -0
- package/src/interface/system/name.ts +6 -0
- package/src/interface/system/property.ts +4 -0
- package/src/interface/system/render.ts +81 -0
- package/src/interface/system/struct.ts +9 -0
- package/src/interface/system/system.ts +9 -0
- package/src/interface/system/system.type-test.ts +460 -0
- package/src/interface/system/threads.ts +46 -0
- package/src/interface/system/threads.type-test.ts +114 -0
- package/src/interface/system/up.type-test.ts +80 -0
- package/src/interface/system/values.ts +70 -0
- package/src/interface/thread/of.ts +8 -0
- package/src/interface/thread/thread.ts +13 -0
- package/src/interface/thread/thread.type-test.ts +140 -0
- package/src/interface/trait/index.ts +1 -0
- package/src/interface/trait/key.ts +6 -0
- package/src/interface/trait/register.ts +9 -0
- package/src/interface/trait/required.ts +7 -0
- package/src/interface/trait/symbol-keys.ts +19 -0
- package/src/interface/trait/symbol-keys.type-test.ts +14 -0
- package/src/interface/trait/trait.ts +3 -0
- package/src/interface/trait/trait.type-test.ts +158 -0
- package/src/interface/trait/types.ts +56 -0
- package/src/interface/tsconfig.json +28 -0
- package/src/interface/world/create.ts +15 -0
- package/src/interface/world/filter.ts +9 -0
- package/src/interface/world/index.ts +2 -0
- package/src/interface/world/join.ts +10 -0
- package/src/interface/world/loop.type-test.ts +67 -0
- package/src/interface/world/share.type-test.ts +25 -0
- package/src/interface/world/world.ts +58 -0
- package/src/interface/world/world.type-test.ts +81 -0
- package/src/observe/compare.ts +86 -0
- package/src/observe/entity.ts +224 -0
- package/src/observe/index.ts +1 -0
- package/src/observe/members.ts +42 -0
- package/src/observe/observe.ts +24 -0
- package/src/observe/observe.type-test.ts +88 -0
- package/src/observe/plans.ts +272 -0
- package/src/observe/query.ts +26 -0
- package/src/observe/resource.ts +80 -0
- package/src/observe/select.ts +648 -0
- package/src/observe/to-promise.ts +22 -0
- package/src/observe/tsconfig.json +31 -0
- package/src/observe/values.ts +9 -0
- package/src/observe/world-state.ts +414 -0
- package/src/observe-imports.test.ts +48 -0
- package/src/perftest/benchmark.ts +106 -0
- package/src/perftest/benchmarks.ts +692 -0
- package/src/perftest/finalized.ts +122 -0
- package/src/perftest/flat.ts +67 -0
- package/src/perftest/growth.ts +55 -0
- package/src/perftest/handoff.ts +154 -0
- package/src/perftest/hierarchy.ts +132 -0
- package/src/perftest/indexes.ts +691 -0
- package/src/perftest/joined.ts +95 -0
- package/src/perftest/keys.ts +100 -0
- package/src/perftest/log.ts +126 -0
- package/src/perftest/loop.ts +49 -0
- package/src/perftest/observed-gpu.ts +58 -0
- package/src/perftest/observed.ts +298 -0
- package/src/perftest/observer.ts +57 -0
- package/src/perftest/particles.ts +76 -0
- package/src/perftest/placed.ts +177 -0
- package/src/perftest/reads.ts +210 -0
- package/src/perftest/remote.ts +364 -0
- package/src/perftest/run.ts +43 -0
- package/src/perftest/strings.ts +133 -0
- package/src/perftest/structural.ts +164 -0
- package/src/perftest/suite.perf-browser-test.ts +133 -0
- package/src/perftest/suite.perf-test.ts +7 -0
- package/src/perftest/suite.ts +232 -0
- package/src/perftest/systems.ts +134 -0
- package/src/perftest/tails.ts +306 -0
- package/src/perftest/transfers.ts +93 -0
- package/src/perftest/uploads.ts +82 -0
- package/src/perftest/values.ts +111 -0
- package/src/perftest/wake.ts +40 -0
- package/src/samples/particles/build.test.ts +23 -0
- package/src/samples/particles/gpu/main.ts +96 -0
- package/src/samples/particles/gpu/particles.ts +138 -0
- package/src/samples/particles/index.html +22 -0
- package/src/samples/particles/particles.test.ts +31 -0
- package/src/samples/particles/particles.ts +85 -0
- package/src/samples/particles/particles.type-test.ts +7 -0
- package/src/samples/todo/README.md +174 -0
- package/src/samples/todo/app/app.browser.test.ts +215 -0
- package/src/samples/todo/app/app.ts +30 -0
- package/src/samples/todo/app/log-failures.test.ts +28 -0
- package/src/samples/todo/app/log-failures.ts +7 -0
- package/src/samples/todo/app/main.ts +4 -0
- package/src/samples/todo/app/profile.perf-browser-test.ts +100 -0
- package/src/samples/todo/app/proportional.browser.test.ts +157 -0
- package/src/samples/todo/app/todo.perf-browser-test.ts +207 -0
- package/src/samples/todo/build.test.ts +23 -0
- package/src/samples/todo/features/completion/data.ts +5 -0
- package/src/samples/todo/features/completion/dom.browser.test.ts +53 -0
- package/src/samples/todo/features/completion/dom.ts +39 -0
- package/src/samples/todo/features/completion/elements/elements.browser.test.ts +68 -0
- package/src/samples/todo/features/completion/elements/todo-summary.ts +82 -0
- package/src/samples/todo/features/completion/elements/todo-toggle-all.ts +69 -0
- package/src/samples/todo/features/completion/events.ts +7 -0
- package/src/samples/todo/features/completion/feature.ts +13 -0
- package/src/samples/todo/features/completion/model.test.ts +40 -0
- package/src/samples/todo/features/completion/model.ts +21 -0
- package/src/samples/todo/features/filter/data.ts +16 -0
- package/src/samples/todo/features/filter/dom.browser.test.ts +84 -0
- package/src/samples/todo/features/filter/dom.ts +63 -0
- package/src/samples/todo/features/filter/elements/elements.browser.test.ts +43 -0
- package/src/samples/todo/features/filter/elements/todo-filters.ts +70 -0
- package/src/samples/todo/features/filter/events.ts +4 -0
- package/src/samples/todo/features/filter/feature.ts +12 -0
- package/src/samples/todo/features/filter/model.test.ts +18 -0
- package/src/samples/todo/features/filter/model.ts +10 -0
- package/src/samples/todo/features/generate/elements/elements.browser.test.ts +18 -0
- package/src/samples/todo/features/generate/elements/todo-generate.ts +36 -0
- package/src/samples/todo/features/generate/events.ts +4 -0
- package/src/samples/todo/features/generate/feature.ts +11 -0
- package/src/samples/todo/features/generate/model.test.ts +13 -0
- package/src/samples/todo/features/generate/model.ts +19 -0
- package/src/samples/todo/features/index.ts +4 -0
- package/src/samples/todo/features/todos/data.ts +31 -0
- package/src/samples/todo/features/todos/dom.browser.test.ts +205 -0
- package/src/samples/todo/features/todos/dom.ts +90 -0
- package/src/samples/todo/features/todos/elements/elements.browser.test.ts +211 -0
- package/src/samples/todo/features/todos/elements/todo-entry.ts +45 -0
- package/src/samples/todo/features/todos/elements/todo-list.ts +93 -0
- package/src/samples/todo/features/todos/elements/todo-row.ts +138 -0
- package/src/samples/todo/features/todos/events.ts +11 -0
- package/src/samples/todo/features/todos/feature.ts +14 -0
- package/src/samples/todo/features/todos/model.test.ts +77 -0
- package/src/samples/todo/features/todos/model.ts +80 -0
- package/src/samples/todo/features/todos/todos.test-helper.ts +34 -0
- package/src/samples/todo/imports.test.ts +113 -0
- package/src/samples/todo/index.html +51 -0
- package/src/samples/todo/shared/attach.browser.test.ts +73 -0
- package/src/samples/todo/shared/attach.ts +32 -0
- package/src/samples/todo/shared/connect.ts +21 -0
- package/src/samples/todo/shared/elements/define.ts +7 -0
- package/src/samples/todo/shared/elements/elements.test-helper.ts +28 -0
- package/src/samples/todo/shared/feature.ts +20 -0
- package/src/samples/todo/shared/ticks.test-helper.ts +25 -0
- package/src/samples/transfers/build.test.ts +22 -0
- package/src/samples/transfers/index.html +18 -0
- package/src/samples/transfers/loader.ts +42 -0
- package/src/samples/transfers/main.ts +46 -0
- package/src/samples/transfers/sprites.ts +96 -0
- package/src/samples/transfers/world.ts +11 -0
- package/src/world.test.ts +46 -0
- package/README.md +0 -3
|
@@ -0,0 +1,1421 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { readFile } from 'node:fs/promises';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
5
|
+
import { describe, expect, test } from 'vitest';
|
|
6
|
+
import { parseAst } from 'vite';
|
|
7
|
+
import { chunkShift, type KernelDescription, type KernelModule, type Program } from '../world/kernel.js';
|
|
8
|
+
import { transformKernels } from './transform.js';
|
|
9
|
+
import { createLinker, type LinkHost } from './link.js';
|
|
10
|
+
import { packageIndex } from './paths.js';
|
|
11
|
+
import { locateThroughMap } from './source-map.js';
|
|
12
|
+
import { estreeOf } from './estree.js';
|
|
13
|
+
import { Mat4x4, Quat, Vec3 } from '../../interface/math/index.js';
|
|
14
|
+
import { generateWgsl } from '../world/wgsl.js';
|
|
15
|
+
import { identityOf } from '../world/reductions.js';
|
|
16
|
+
import type { WasmColumn } from '../world/wasm.js';
|
|
17
|
+
|
|
18
|
+
const parse = (code: string) => estreeOf(parseAst(code));
|
|
19
|
+
|
|
20
|
+
const header = `import { System } from "ecs";
|
|
21
|
+
const position = "position";
|
|
22
|
+
const velocity = "velocity";
|
|
23
|
+
const mass = "mass";
|
|
24
|
+
const alive = "alive";
|
|
25
|
+
const score = "score";
|
|
26
|
+
const delta = "delta";
|
|
27
|
+
const target = "target";
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
/** Modules by absolute path, for tests of imports: real files for anything not in `files`, and "ecs" for the package. */
|
|
31
|
+
const host = (files: { readonly [file: string]: string }): LinkHost => ({
|
|
32
|
+
resolve: async (specifier, importer) => {
|
|
33
|
+
if (specifier === "ecs") return packageIndex;
|
|
34
|
+
if (specifier === "external") return { error: "external is external to the build", unreadable: true };
|
|
35
|
+
if (!specifier.startsWith(".")) return { error: `${specifier} can't be resolved from ${importer}` };
|
|
36
|
+
const path = resolve(dirname(importer), specifier);
|
|
37
|
+
const typescript = path.replace(/\.js$/, ".ts");
|
|
38
|
+
return files[typescript] !== undefined || (files[path] === undefined && existsSync(typescript)) ? typescript : path;
|
|
39
|
+
},
|
|
40
|
+
load: async file => {
|
|
41
|
+
const code = files[file] ?? await readFile(file, "utf8");
|
|
42
|
+
if (!file.endsWith(".ts")) return { code };
|
|
43
|
+
const { transformWithOxc } = await import("vite");
|
|
44
|
+
const result = await transformWithOxc(code, file, { lang: "ts", sourcemap: true });
|
|
45
|
+
return { code: result.code, locate: result.map === undefined ? undefined : locateThroughMap(result.code, result.map.mappings) };
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const transform = (source: string, files: { readonly [file: string]: string } = {}) => transformKernels(`${header}${source}`, "/test.js", parse,
|
|
50
|
+
async specifier => specifier === "ecs", index => JSON.stringify(`kernel:${index}`), createLinker(host(files), parse));
|
|
51
|
+
|
|
52
|
+
type Compiled = KernelDescription & KernelModule;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Compiles `source`, which assigns its kernel system to `kernel`: the attached description plus its kernel module's
|
|
56
|
+
* `create`. `imported` gives the values of the bindings `source` imports, since its imports aren't evaluated.
|
|
57
|
+
*/
|
|
58
|
+
const compile = async (source: string, files: { readonly [file: string]: string } = {}, imported: { readonly [name: string]: unknown } = {}): Promise<Compiled> => {
|
|
59
|
+
const result = await transform(source, files);
|
|
60
|
+
if (result === null || "failure" in result) throw new Error(result === null ? "no kernel" : result.failure.message);
|
|
61
|
+
const module = result.code.split("\n").filter(line => !line.startsWith("import ")).join("\n");
|
|
62
|
+
const evaluate = new Function("System", "attachKernel$", "Archetype", ...Object.keys(imported), `${module}\nreturn kernel;`);
|
|
63
|
+
const description: KernelDescription = evaluate({ create: (declaration: unknown, body: unknown) => ({ declaration, body }) }, (_: unknown, attached: unknown) => attached, { create: (list: unknown) => list }, ...Object.values(imported));
|
|
64
|
+
const index = Number(description.url.slice("kernel:".length));
|
|
65
|
+
const kernelModule: KernelModule = new Function(`${result.kernels[index]?.replace("export const create =", "const create =")}\nreturn { create };`)();
|
|
66
|
+
expect(kernelModule.create.toString()).not.toMatch(/\b(position|velocity|mass|alive|score|delta|target)\b/);
|
|
67
|
+
return { ...description, ...kernelModule };
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const failure = async (source: string, files: { readonly [file: string]: string } = {}): Promise<string> => {
|
|
71
|
+
const result = await transform(source, files);
|
|
72
|
+
return result !== null && "failure" in result ? result.failure.message : "compiled";
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
type Fields = { readonly [component: string]: { readonly [path: string]: readonly number[] } };
|
|
76
|
+
type Call = readonly unknown[];
|
|
77
|
+
type Options = {
|
|
78
|
+
readonly resources?: readonly unknown[];
|
|
79
|
+
readonly lookups?: readonly ((entity: number) => readonly unknown[] | null)[];
|
|
80
|
+
readonly args?: unknown;
|
|
81
|
+
readonly booleans?: readonly string[];
|
|
82
|
+
/** Whether the kernel has a `program`; when it does, the program must give the same results as the JS. */
|
|
83
|
+
readonly program?: boolean;
|
|
84
|
+
/** The rows to run, `[start, end)`; all rows by default. */
|
|
85
|
+
readonly range?: readonly [number, number];
|
|
86
|
+
readonly interleaved?: { readonly [component: string]: { readonly stride: number; readonly offsets: { readonly [path: string]: number } } };
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const tick = 7;
|
|
90
|
+
|
|
91
|
+
type Scalar = number | boolean;
|
|
92
|
+
type Signal = { readonly kind: "normal" } | { readonly kind: "branch"; readonly depth: number } | { readonly kind: "next" };
|
|
93
|
+
const normal: Signal = { kind: "normal" };
|
|
94
|
+
|
|
95
|
+
/** A reference interpreter for `Program`: JS number semantics, boolean typing of columns from `booleans`. */
|
|
96
|
+
type Layout = { readonly strides: readonly number[]; readonly offsets: readonly number[] };
|
|
97
|
+
|
|
98
|
+
/** A reference interpreter for `Program`, indexing columns by the layout as the WASM generator does. */
|
|
99
|
+
const interpret = (program: Program, columns: readonly (Float64Array | Uint32Array)[], booleans: readonly boolean[], layout: Layout, start: number, end: number, resources: readonly unknown[], args: unknown,
|
|
100
|
+
lookups: readonly ((entity: number) => readonly unknown[] | null)[], partials: Float64Array): void => {
|
|
101
|
+
const accumulators = program.reductions ?? [];
|
|
102
|
+
/** Accumulators carry from row to row, from their partials and back. */
|
|
103
|
+
const carried = accumulators.map((_, k) => partials[k] ?? NaN);
|
|
104
|
+
const at = (column: number, row: number): number => row * (layout.strides[column] ?? 1) + (layout.offsets[column] ?? 0);
|
|
105
|
+
const scalarAt = (root: unknown, path: readonly (number | string)[]): Scalar => {
|
|
106
|
+
const value = path.reduce<unknown>((item, key) => Reflect.get(Object(item), key), root);
|
|
107
|
+
if (typeof value !== "number" && typeof value !== "boolean") throw new Error(`not a scalar: ${String(value)}`);
|
|
108
|
+
return value;
|
|
109
|
+
};
|
|
110
|
+
for (let row = start; row < end; row++) {
|
|
111
|
+
const locals: Scalar[] = new Array<Scalar>(program.locals).fill(0);
|
|
112
|
+
const handles: (readonly unknown[] | null)[] = new Array<readonly unknown[] | null>(program.handles ?? 0).fill(null);
|
|
113
|
+
const evaluate = (node: Program.Expression): Scalar => {
|
|
114
|
+
switch (node.kind) {
|
|
115
|
+
case "number": case "boolean": return node.value;
|
|
116
|
+
case "column": {
|
|
117
|
+
const value = columns[node.column]?.[at(node.column, row)] ?? NaN;
|
|
118
|
+
return booleans[node.column] === true ? value !== 0 : value;
|
|
119
|
+
}
|
|
120
|
+
case "resource": return scalarAt(resources[node.index], node.path);
|
|
121
|
+
case "args": return scalarAt(args, node.path);
|
|
122
|
+
case "local": return locals[node.local] ?? NaN;
|
|
123
|
+
case "unary": {
|
|
124
|
+
const operand = evaluate(node.operand);
|
|
125
|
+
switch (node.operator) {
|
|
126
|
+
case "-": return -Number(operand);
|
|
127
|
+
case "+": return Number(operand);
|
|
128
|
+
case "!": return !operand;
|
|
129
|
+
case "~": return ~Number(operand);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
case "binary": {
|
|
133
|
+
const left = evaluate(node.left);
|
|
134
|
+
const right = evaluate(node.right);
|
|
135
|
+
const a = Number(left);
|
|
136
|
+
const b = Number(right);
|
|
137
|
+
switch (node.operator) {
|
|
138
|
+
case "+": return a + b;
|
|
139
|
+
case "-": return a - b;
|
|
140
|
+
case "*": return a * b;
|
|
141
|
+
case "/": return a / b;
|
|
142
|
+
case "%": return a % b;
|
|
143
|
+
case "**": return a ** b;
|
|
144
|
+
case "<": return a < b;
|
|
145
|
+
case ">": return a > b;
|
|
146
|
+
case "<=": return a <= b;
|
|
147
|
+
case ">=": return a >= b;
|
|
148
|
+
case "==": return a === b;
|
|
149
|
+
case "!=": return a !== b;
|
|
150
|
+
case "===": return left === right;
|
|
151
|
+
case "!==": return left !== right;
|
|
152
|
+
case "&": return a & b;
|
|
153
|
+
case "|": return a | b;
|
|
154
|
+
case "^": return a ^ b;
|
|
155
|
+
case "<<": return a << b;
|
|
156
|
+
case ">>": return a >> b;
|
|
157
|
+
case ">>>": return a >>> b;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
case "logical": {
|
|
161
|
+
const left = evaluate(node.left);
|
|
162
|
+
return node.operator === "&&" ? (left ? evaluate(node.right) : left) : (left ? left : evaluate(node.right));
|
|
163
|
+
}
|
|
164
|
+
case "conditional": return evaluate(node.test) ? evaluate(node.consequent) : evaluate(node.alternate);
|
|
165
|
+
case "found": return handles[node.handle] !== null;
|
|
166
|
+
case "lookupLeaf": {
|
|
167
|
+
// Not found reads NaN, as the WASM generator does.
|
|
168
|
+
const values = handles[node.handle];
|
|
169
|
+
if (values === null || values === undefined) return NaN;
|
|
170
|
+
return scalarAt(values[node.read], node.path);
|
|
171
|
+
}
|
|
172
|
+
case "math": {
|
|
173
|
+
const method: unknown = Reflect.get(Math, node.name);
|
|
174
|
+
if (typeof method !== "function") throw new Error(`no Math.${node.name}`);
|
|
175
|
+
const result: unknown = Reflect.apply(method, Math, node.arguments.map(item => Number(evaluate(item))));
|
|
176
|
+
return typeof result === "number" ? result : NaN;
|
|
177
|
+
}
|
|
178
|
+
case "lane": return evaluate(node.value);
|
|
179
|
+
case "upFound": case "upLeaf": throw new Error("programs reading up aren't interpreted here");
|
|
180
|
+
case "listLength": case "listChanged": case "rowLeaf": case "rowEntity": throw new Error("lookups through indexes aren't interpreted here");
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const execute = (statements: readonly Program.Statement[]): Signal => {
|
|
184
|
+
for (const statement of statements) {
|
|
185
|
+
const signal = step(statement);
|
|
186
|
+
if (signal.kind !== "normal") return signal;
|
|
187
|
+
}
|
|
188
|
+
return normal;
|
|
189
|
+
};
|
|
190
|
+
const outward = (signal: Signal): Signal => signal.kind === "branch" ? (signal.depth === 0 ? normal : { kind: "branch", depth: signal.depth - 1 }) : signal;
|
|
191
|
+
const step = (statement: Program.Statement): Signal => {
|
|
192
|
+
switch (statement.kind) {
|
|
193
|
+
case "set": locals[statement.local] = evaluate(statement.value); return normal;
|
|
194
|
+
case "store": { const column = columns[statement.column]; if (column) column[at(statement.column, row)] = Number(evaluate(statement.value)); return normal; }
|
|
195
|
+
case "stamp": {
|
|
196
|
+
const column = columns[statement.column];
|
|
197
|
+
const chunks = columns[statement.chunks];
|
|
198
|
+
if (column) column[at(statement.column, row)] = tick;
|
|
199
|
+
if (chunks) chunks[row >> chunkShift] = tick;
|
|
200
|
+
return normal;
|
|
201
|
+
}
|
|
202
|
+
case "if": return execute(evaluate(statement.test) ? statement.consequent : statement.alternate);
|
|
203
|
+
case "block": return outward(execute(statement.body));
|
|
204
|
+
case "loop":
|
|
205
|
+
for (let iteration = 0; iteration < 1e6; iteration++) {
|
|
206
|
+
const signal = execute(statement.body);
|
|
207
|
+
if (signal.kind === "branch" && signal.depth === 0) continue;
|
|
208
|
+
return signal.kind === "normal" ? normal : outward(signal);
|
|
209
|
+
}
|
|
210
|
+
throw new Error("runaway loop");
|
|
211
|
+
case "branch": return { kind: "branch", depth: statement.depth };
|
|
212
|
+
case "branchIf": return evaluate(statement.test) ? { kind: "branch", depth: statement.depth } : normal;
|
|
213
|
+
case "next": return { kind: "next" };
|
|
214
|
+
case "intrinsic": return execute(statement.body);
|
|
215
|
+
case "find": {
|
|
216
|
+
const lookup = lookups[statement.lookup];
|
|
217
|
+
if (lookup === undefined) throw new Error(`no lookup ${statement.lookup}`);
|
|
218
|
+
handles[statement.handle] = lookup(Number(evaluate(statement.entity)));
|
|
219
|
+
return normal;
|
|
220
|
+
}
|
|
221
|
+
case "probe": case "listRow": throw new Error("lookups through indexes aren't interpreted here");
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
accumulators.forEach((local, k) => { locals[local] = carried[k] ?? NaN; });
|
|
225
|
+
execute(program.body);
|
|
226
|
+
accumulators.forEach((local, k) => { carried[k] = Number(locals[local]); });
|
|
227
|
+
}
|
|
228
|
+
carried.forEach((value, k) => { partials[k] = value; });
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
/** Padding in interleaved components, which kernels must never touch. */
|
|
232
|
+
const padding = -12345;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Runs a kernel over hand-built columns; `fields` maps a component to its leaves by JSON path. A component in
|
|
236
|
+
* `options.interleaved` stores its leaves in one array with that stride, at the given offsets per path; others are dense.
|
|
237
|
+
*/
|
|
238
|
+
const run = (description: Compiled, rows: number, fields: Fields, options: Options = {}) => {
|
|
239
|
+
const interleaved = options.interleaved ?? {};
|
|
240
|
+
const layout: Layout = {
|
|
241
|
+
strides: description.columns.map(column => column.kind === "field" ? interleaved[String(column.component)]?.stride ?? 1 : 1),
|
|
242
|
+
offsets: description.columns.map(column => column.kind === "field" ? interleaved[String(column.component)]?.offsets[JSON.stringify(column.path)] ?? 0 : 0),
|
|
243
|
+
};
|
|
244
|
+
const build = () => {
|
|
245
|
+
const shared = new Map<string, Float64Array>();
|
|
246
|
+
return description.columns.map((column, index) => {
|
|
247
|
+
if (column.kind === "entity") return Float64Array.from({ length: rows }, (_, row) => 100 + row);
|
|
248
|
+
if (column.kind === "changed") return new Uint32Array(rows);
|
|
249
|
+
if (column.kind === "chunks") return new Float64Array(Math.ceil(rows / 2 ** chunkShift));
|
|
250
|
+
const component = String(column.component);
|
|
251
|
+
const values = fields[component]?.[JSON.stringify(column.path)] ?? new Array<number>(rows).fill(0);
|
|
252
|
+
const stride = interleaved[component]?.stride;
|
|
253
|
+
if (stride === undefined) return Float64Array.from(values);
|
|
254
|
+
const array = shared.get(component) ?? new Float64Array(rows * stride).fill(padding);
|
|
255
|
+
shared.set(component, array);
|
|
256
|
+
values.forEach((value, row) => { array[row * stride + (layout.offsets[index] ?? 0)] = value; });
|
|
257
|
+
return array;
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
const columns = build();
|
|
261
|
+
const calls: Call[] = [];
|
|
262
|
+
// Records each command start as [kind, entity], and each value or component as [kind, entity, key index, value?].
|
|
263
|
+
let current: readonly [number | "spawn", number] = ["spawn", 0];
|
|
264
|
+
const commands = {
|
|
265
|
+
spawners: description.spawns.map(list => (...values: unknown[]) => {
|
|
266
|
+
current = ["spawn", 999];
|
|
267
|
+
calls.push(current);
|
|
268
|
+
list.forEach((key, k) => calls.push([...current, key, values[k]]));
|
|
269
|
+
return 999;
|
|
270
|
+
}),
|
|
271
|
+
begin: (kind: number, entity: number) => { current = [kind, entity]; calls.push(current); },
|
|
272
|
+
value: (key: number, value: unknown) => { calls.push([...current, key, value]); },
|
|
273
|
+
component: (key: number) => { calls.push([...current, key]); },
|
|
274
|
+
};
|
|
275
|
+
const booleans = description.columns.map(column => column.kind === "field" && (options.booleans ?? []).includes(String(column.component)));
|
|
276
|
+
const [start, end] = options.range ?? [0, rows];
|
|
277
|
+
const partials = Float64Array.from(description.reductions, reduction => identityOf(reduction.operator));
|
|
278
|
+
const interpretedPartials = Float64Array.from(partials);
|
|
279
|
+
description.create(booleans, layout.strides, layout.offsets)(columns, start, end, options.resources ?? [], options.lookups ?? [], description.keys, options.args, commands, tick, partials, 0);
|
|
280
|
+
expect(description.program !== null).toBe(options.program ?? true);
|
|
281
|
+
if (description.program !== null) {
|
|
282
|
+
const interpreted = build();
|
|
283
|
+
interpret(description.program, interpreted, booleans, layout, start, end, options.resources ?? [], options.args, options.lookups ?? [], interpretedPartials);
|
|
284
|
+
expect([...interpretedPartials]).toEqual([...partials]);
|
|
285
|
+
// Bit-identical, including NaN and -0.
|
|
286
|
+
expect(interpreted.map(column => [...column].map(value => Object.is(value, -0) ? "-0" : String(value))))
|
|
287
|
+
.toEqual(columns.map(column => [...column].map(value => Object.is(value, -0) ? "-0" : String(value))));
|
|
288
|
+
}
|
|
289
|
+
const index = (kind: string, component: string, path: readonly (number | string)[] = []) => description.columns.findIndex(column =>
|
|
290
|
+
column.kind === kind && column.kind !== "entity" && column.component === component
|
|
291
|
+
&& (column.kind !== "field" || JSON.stringify(column.path) === JSON.stringify(path)));
|
|
292
|
+
return {
|
|
293
|
+
field: (component: string, path: readonly (number | string)[] = []) => {
|
|
294
|
+
const column = index("field", component, path);
|
|
295
|
+
return Array.from({ length: rows }, (_, row) => columns[column]?.[row * (layout.strides[column] ?? 1) + (layout.offsets[column] ?? 0)]);
|
|
296
|
+
},
|
|
297
|
+
/** A component's whole interleaved array, padding included. */
|
|
298
|
+
array: (component: string) => [...columns[index("field", component, [0])] ?? []],
|
|
299
|
+
changed: (component: string) => [...columns[index("changed", component)] ?? []],
|
|
300
|
+
/** A reduced resource's leaf, folded over the rows from its identity. */
|
|
301
|
+
reduced: (resource: string, path: readonly (number | string)[] = []) =>
|
|
302
|
+
partials[description.reductions.findIndex(reduction => reduction.resource === resource && JSON.stringify(reduction.path) === JSON.stringify(path))],
|
|
303
|
+
chunks: (component: string) => [...columns[index("chunks", component)] ?? []],
|
|
304
|
+
calls,
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
const vec3 = (x: readonly number[], y: readonly number[], z: readonly number[]) => ({ "[0]": x, "[1]": y, "[2]": z });
|
|
309
|
+
|
|
310
|
+
describe("particles", () => {
|
|
311
|
+
test("gravity and integrate", async () => {
|
|
312
|
+
const gravity = await compile(`const kernel = System.create({
|
|
313
|
+
name: "particles/gravity", kernel: "cpu",
|
|
314
|
+
components: { write: [velocity] }, resources: { read: [delta] },
|
|
315
|
+
}, (row, { resources }) => {
|
|
316
|
+
const [x, y, z] = row[velocity];
|
|
317
|
+
row[velocity] = [x, y - 9.8 * resources[delta], z];
|
|
318
|
+
});`);
|
|
319
|
+
const fallen = run(gravity, 2, { velocity: vec3([1, 2], [0, 10], [3, 4]) }, { resources: [0.5] });
|
|
320
|
+
expect([fallen.field("velocity", [0]), fallen.field("velocity", [1]), fallen.field("velocity", [2])]).toEqual([[1, 2], [-4.9, 5.1], [3, 4]]);
|
|
321
|
+
expect(fallen.changed("velocity")).toEqual([tick, tick]);
|
|
322
|
+
expect(gravity.shapes).toEqual([{ component: "velocity", leaves: [[0], [1], [2]] }]);
|
|
323
|
+
expect(gravity.resources).toEqual(["delta"]);
|
|
324
|
+
|
|
325
|
+
const integrate = await compile(`const kernel = System.create({
|
|
326
|
+
name: "particles/integrate", kernel: "cpu",
|
|
327
|
+
components: { read: [velocity], write: [position] }, resources: { read: [delta] }, after: [{ name: "particles/gravity" }],
|
|
328
|
+
}, (row, { resources }) => {
|
|
329
|
+
const [px, py, pz] = row[position];
|
|
330
|
+
const [vx, vy, vz] = row[velocity];
|
|
331
|
+
const t = resources[delta];
|
|
332
|
+
row[position] = [px + vx * t, py + vy * t, pz + vz * t];
|
|
333
|
+
});`);
|
|
334
|
+
const moved = run(integrate, 1, { position: vec3([1], [2], [3]), velocity: vec3([2], [4], [6]) }, { resources: [0.5] });
|
|
335
|
+
expect([moved.field("position", [0]), moved.field("position", [1]), moved.field("position", [2])]).toEqual([[2], [4], [6]]);
|
|
336
|
+
expect(moved.changed("position")).toEqual([tick]);
|
|
337
|
+
expect(integrate.columns.some(column => column.kind === "changed" && column.component === "velocity")).toBe(false);
|
|
338
|
+
// Plain reads: no boolean conversion where it isn't observable.
|
|
339
|
+
for (const kernel of [gravity, integrate]) expect(String(kernel.create)).not.toMatch(/\?|booleans\[/);
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
describe("layout", () => {
|
|
344
|
+
test("interleaved components are read and written at row * stride + offset, leaving padding untouched", async () => {
|
|
345
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [alive], write: [velocity] } }, (row) => {
|
|
346
|
+
const [x, y, z] = row[velocity];
|
|
347
|
+
row[velocity] = [z, row[alive] === true ? y * 10 : y, x];
|
|
348
|
+
});`);
|
|
349
|
+
const result = run(kernel, 2, { velocity: vec3([1, 4], [2, 5], [3, 6]), alive: { "[]": [1, 0] } }, {
|
|
350
|
+
booleans: ["alive"],
|
|
351
|
+
interleaved: { velocity: { stride: 4, offsets: { "[0]": 0, "[1]": 1, "[2]": 2 } }, alive: { stride: 3, offsets: { "[]": 2 } } },
|
|
352
|
+
});
|
|
353
|
+
expect(result.array("velocity")).toEqual([3, 20, 1, padding, 6, 5, 4, padding]);
|
|
354
|
+
expect(result.changed("velocity")).toEqual([tick, tick]);
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
test("stamps set the changed row and its chunk; each changed column is followed by its chunk column", async () => {
|
|
358
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [score] } }, (row) => {
|
|
359
|
+
if (row[mass] > 0) row[score] = 1;
|
|
360
|
+
});`);
|
|
361
|
+
const rows = 2 * 2 ** chunkShift + 5;
|
|
362
|
+
const mass = new Array<number>(rows).fill(0);
|
|
363
|
+
mass[2 ** chunkShift + 3] = 1;
|
|
364
|
+
const result = run(kernel, rows, { mass: { "[]": mass } });
|
|
365
|
+
const changed = kernel.columns.findIndex(column => column.kind === "changed");
|
|
366
|
+
expect(kernel.columns[changed + 1]).toEqual({ kind: "chunks", component: "score" });
|
|
367
|
+
expect(result.chunks("score")).toEqual([0, tick, 0]);
|
|
368
|
+
expect(result.changed("score").flatMap((value, row) => value === 0 ? [] : [row])).toEqual([2 ** chunkShift + 3]);
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
test("an unconditional stamp stamps the call's chunks once; a stamp after return stays per row", async () => {
|
|
372
|
+
const always = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [score] } }, (row) => {
|
|
373
|
+
row[score] = row[mass];
|
|
374
|
+
});`);
|
|
375
|
+
expect(String(always.create)).not.toContain(">> 10] = tick");
|
|
376
|
+
expect(run(always, 3200, {}, { range: [1000, 2100] }).chunks("score")).toEqual([tick, tick, tick, 0]);
|
|
377
|
+
const after = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [score] } }, (row) => {
|
|
378
|
+
if (row[mass] > 0) return;
|
|
379
|
+
row[score] = 1;
|
|
380
|
+
});`);
|
|
381
|
+
expect(String(after.create)).toContain("[i >> 10] = tick");
|
|
382
|
+
const mass = Array.from({ length: 3200 }, (_, row) => row >= 1024 && row < 2048 ? 1 : 0);
|
|
383
|
+
expect(run(after, 3200, { mass: { "[]": mass } }, { range: [1000, 2100] }).chunks("score")).toEqual([tick, 0, tick, 0]);
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
test("indices stay in step when return skips the rest of a row", async () => {
|
|
387
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { write: [velocity] } }, (row) => {
|
|
388
|
+
const [x, y, z] = row[velocity];
|
|
389
|
+
if (x > 1 && x < 5) return;
|
|
390
|
+
row[velocity] = [z, y, x];
|
|
391
|
+
});`);
|
|
392
|
+
const result = run(kernel, 3, { velocity: vec3([1, 4, 7], [2, 5, 8], [3, 6, 9]) }, { interleaved: { velocity: { stride: 4, offsets: { "[0]": 1, "[1]": 2, "[2]": 3 } } } });
|
|
393
|
+
expect(result.array("velocity")).toEqual([padding, 3, 2, 1, padding, 4, 5, 6, padding, 9, 8, 7]);
|
|
394
|
+
expect(result.changed("velocity")).toEqual([tick, 0, tick]);
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
describe("reductions", () => {
|
|
399
|
+
const reducing = (reduce: string, body: string, read = "[position, mass]") => `const total = "total";
|
|
400
|
+
const low = "low";
|
|
401
|
+
const bits = "bits";
|
|
402
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: ${read} }, reduce: { ${reduce} } }, (row, { reduce }) => { ${body} });`;
|
|
403
|
+
const fields = { position: vec3([1, -4, 2], [5, 0, -1], [3, 9, 6]), mass: { "[]": [2, 3, 12] } };
|
|
404
|
+
|
|
405
|
+
test("fold each contribution into its resource, leaf by leaf, from the partial", async () => {
|
|
406
|
+
const kernel = await compile(reducing(`[total]: "+", [low]: "min", [bits]: "|"`, `
|
|
407
|
+
const [x, y, z] = row[position];
|
|
408
|
+
reduce[total](row[mass]);
|
|
409
|
+
reduce[total](1);
|
|
410
|
+
reduce[low]([x, y, z]);
|
|
411
|
+
reduce[bits](row[mass]);
|
|
412
|
+
`));
|
|
413
|
+
const result = run(kernel, 3, fields);
|
|
414
|
+
expect(result.reduced("total")).toBe(2 + 3 + 12 + 3);
|
|
415
|
+
expect([0, 1, 2].map(k => result.reduced("low", [k]))).toEqual([-4, -1, 3]);
|
|
416
|
+
expect(result.reduced("bits")).toBe(2 | 3 | 12);
|
|
417
|
+
expect(kernel.reductions.map(reduction => reduction.operator)).toEqual(["+", "min", "min", "min", "|"]);
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
test("fold the values of inlined functions", async () => {
|
|
421
|
+
const kernel = await compile(`import { Vec3 } from "ecs";\n${reducing(`[low]: "max"`, "reduce[low](Vec3.scale(row[position], 2));", "[position]")}`);
|
|
422
|
+
expect([0, 1, 2].map(k => run(kernel, 3, fields).reduced("low", [k]))).toEqual([4, 10, 18]);
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
test("that can't be compiled fail with the reason", async () => {
|
|
426
|
+
expect(await failure(reducing(`[total]: "+"`, "reduce[total](1, 2);"))).toBe("total takes the one value it reduces");
|
|
427
|
+
expect(await failure(reducing(`[total]: "avg"`, "reduce[total](1);"))).toBe(`a resource is reduced with one of "+", "*", "min", "max", "&", "|", "^"`);
|
|
428
|
+
expect(await failure(reducing(`total: "+"`, "reduce[total](1);"))).toBe(`reduce names each resource as a computed key bound at module scope, as in { [total]: "+" }`);
|
|
429
|
+
expect(await failure(reducing(`[total]: "+"`, "reduce[total](1);").replace(`kernel: "cpu"`, `kernel: "gpu"`))).toBe("a GPU kernel can't use reductions yet");
|
|
430
|
+
expect(await failure(reducing(`[total]: "+"`, "reduce[total](1);").replace("reduce: {", "resources: { read: [total] }, reduce: {"))).toBe("total is reduced, so it can't also be read or filtered on");
|
|
431
|
+
expect(await failure(reducing(`[total]: "+", [total]: "max"`, "reduce[total](1);"))).toBe("total is reduced twice");
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
describe("let locals of component values", () => {
|
|
436
|
+
test("written back whole after a tuple assignment have the tuple's shape", async () => {
|
|
437
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [alive], write: [position] } }, (row) => {
|
|
438
|
+
let v = row[position];
|
|
439
|
+
if (row[alive]) v = [7, 8, 9];
|
|
440
|
+
row[position] = v;
|
|
441
|
+
});`);
|
|
442
|
+
expect(kernel.columns.some(column => column.kind === "field" && column.path.length === 0 && column.component === "position")).toBe(false);
|
|
443
|
+
const result = run(kernel, 2, { position: vec3([1, 4], [2, 5], [3, 6]), alive: { "[]": [1, 0] } });
|
|
444
|
+
expect([0, 1, 2].map(k => result.field("position", [k]))).toEqual([[7, 4], [8, 5], [9, 6]]);
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
describe("binding identity", () => {
|
|
449
|
+
test("a local shadowing a component key is not that component", async () => {
|
|
450
|
+
expect(await failure(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [velocity], write: [position] } }, (row) => {
|
|
451
|
+
const velocity = 1;
|
|
452
|
+
row[position] = row[velocity];
|
|
453
|
+
});`)).toBe("row is indexed by a component in components read or write, or .entity");
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
test("another binding with the same key string is not the declared component", async () => {
|
|
457
|
+
expect(await failure(`const speed = "velocity";
|
|
458
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [velocity], write: [position] } }, (row) => {
|
|
459
|
+
row[position] = row[speed];
|
|
460
|
+
});`)).toBe("speed is not in components read or write");
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
test("a helper parameter shadows a module binding only inside the helper", async () => {
|
|
464
|
+
const kernel = await compile(`const twice = (velocity) => velocity * 2;
|
|
465
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [velocity], write: [position] } }, (row) => {
|
|
466
|
+
row[position] = twice(row[velocity]) + row[velocity];
|
|
467
|
+
});`);
|
|
468
|
+
expect(run(kernel, 1, { velocity: { "[]": [3] } }).field("position")).toEqual([9]);
|
|
469
|
+
});
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
describe("value semantics", () => {
|
|
473
|
+
test("tuple locals are copies, and snapshots read before later writes", async () => {
|
|
474
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { write: [position, score] } }, (row) => {
|
|
475
|
+
const before = row[position];
|
|
476
|
+
let v = [before[0], before[1]];
|
|
477
|
+
const w = v;
|
|
478
|
+
v = [10, v[1]];
|
|
479
|
+
row[position] = [v[0], 20];
|
|
480
|
+
row[score] = w[0] * 100 + before[1] + row[position][1];
|
|
481
|
+
});`);
|
|
482
|
+
const result = run(kernel, 1, { position: { "[0]": [1], "[1]": [2] } });
|
|
483
|
+
expect(result.field("position", [0])).toEqual([10]);
|
|
484
|
+
expect(result.field("score")).toEqual([100 + 2 + 20]);
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
test("whole-value writes evaluate every leaf before storing", async () => {
|
|
488
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { write: [position, score] } }, (row) => {
|
|
489
|
+
row[position] = [row[position][1], row[position][0]];
|
|
490
|
+
let a = 1;
|
|
491
|
+
let b = 2;
|
|
492
|
+
[a, b] = [b, a];
|
|
493
|
+
row[score] = a * 10 + b;
|
|
494
|
+
});`);
|
|
495
|
+
const result = run(kernel, 1, { position: { "[0]": [1], "[1]": [2] } });
|
|
496
|
+
expect([result.field("position", [0]), result.field("position", [1])]).toEqual([[2], [1]]);
|
|
497
|
+
expect(result.field("score")).toEqual([21]);
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
test("struct values and conditional tuples", async () => {
|
|
501
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [position] } }, (row) => {
|
|
502
|
+
const p = row[mass] > 1 ? { x: 1, y: [2, 3] } : { x: 4, y: [5, 6] };
|
|
503
|
+
row[position] = p;
|
|
504
|
+
});`);
|
|
505
|
+
expect(kernel.shapes).toEqual([{ component: "position", leaves: [["x"], ["y", 0], ["y", 1]] }]);
|
|
506
|
+
const result = run(kernel, 2, { mass: { "[]": [2, 0] } });
|
|
507
|
+
expect(result.field("position", ["y", 1])).toEqual([3, 6]);
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
describe("helpers", () => {
|
|
512
|
+
test("block helpers inline hygienically with tuples flowing through", async () => {
|
|
513
|
+
const kernel = await compile(`const scale = (v, s) => {
|
|
514
|
+
const [x, y] = v;
|
|
515
|
+
const k = s * 2;
|
|
516
|
+
return [x * k, y * k];
|
|
517
|
+
};
|
|
518
|
+
const length = ([x, y]) => Math.sqrt(x * x + y * y);
|
|
519
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { write: [position, score] } }, (row) => {
|
|
520
|
+
const k = 100;
|
|
521
|
+
const x = 1;
|
|
522
|
+
row[position] = scale(row[position], 0.5);
|
|
523
|
+
row[score] = length(row[position]) + k + x;
|
|
524
|
+
});`);
|
|
525
|
+
const result = run(kernel, 1, { position: { "[0]": [3], "[1]": [4] } });
|
|
526
|
+
expect([result.field("position", [0]), result.field("position", [1])]).toEqual([[3], [4]]);
|
|
527
|
+
expect(result.field("score")).toEqual([106]);
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
test("recursive helpers are rejected", async () => {
|
|
531
|
+
expect(await failure(`const f = (x) => f(x);
|
|
532
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { write: [score] } }, (row) => { row[score] = f(1); });`))
|
|
533
|
+
.toBe("f is recursive");
|
|
534
|
+
});
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
describe("control flow", () => {
|
|
538
|
+
test("return ends the row, also from inside a loop", async () => {
|
|
539
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [score] } }, (row) => {
|
|
540
|
+
if (row[mass] < 0) return;
|
|
541
|
+
let total = 0;
|
|
542
|
+
for (let i = 0; i < 10; i++) {
|
|
543
|
+
if (i % 2 === 0) continue;
|
|
544
|
+
if (i > row[mass]) return;
|
|
545
|
+
total += i;
|
|
546
|
+
}
|
|
547
|
+
row[score] = total;
|
|
548
|
+
});`);
|
|
549
|
+
expect(run(kernel, 3, { mass: { "[]": [-1, 20, 3] }, score: { "[]": [5, 5, 5] } }).field("score")).toEqual([5, 25, 5]);
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
test("a loop test that inlines a helper is re-evaluated each iteration", async () => {
|
|
553
|
+
const kernel = await compile(`const below = (a, b) => { const limit = b * 2; return a < limit; };
|
|
554
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [score] } }, (row) => {
|
|
555
|
+
let n = 0;
|
|
556
|
+
while (below(n, row[mass])) { n++; }
|
|
557
|
+
let m = 0;
|
|
558
|
+
do { m += 1; } while (m < 3);
|
|
559
|
+
row[score] = n * 10 + m;
|
|
560
|
+
});`);
|
|
561
|
+
expect(run(kernel, 1, { mass: { "[]": [3] } }).field("score")).toEqual([63]);
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
describe("context", () => {
|
|
566
|
+
test("lookups map components to their read index, with null guards", async () => {
|
|
567
|
+
const kernel = await compile(`const half = (value) => { const h = value / 2; return h; };
|
|
568
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [target], write: [position, score] }, lookup: { targets: { read: [mass, position] } } }, (row, { lookup: { targets } }) => {
|
|
569
|
+
const other = targets(row[target]);
|
|
570
|
+
if (other !== null) { row[position] = other[position] - other[mass]; }
|
|
571
|
+
row[score] = (other !== null && half(other[position])) || -1;
|
|
572
|
+
});`);
|
|
573
|
+
expect(kernel.lookups).toEqual(["targets"]);
|
|
574
|
+
const found = (entity: number) => entity === 1 ? [3, 10] : null;
|
|
575
|
+
const result = run(kernel, 2, { target: { "[]": [1, 2] }, position: { "[]": [0, 0] } }, { lookups: [found], program: false });
|
|
576
|
+
expect(result.field("position")).toEqual([7, 0]);
|
|
577
|
+
expect(result.field("score")).toEqual([5, -1]);
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
test("optional lookup access, destructured context groups and input", async () => {
|
|
581
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", input: { type: "number" }, components: { read: [target], write: [score] }, resources: { read: [delta] }, lookup: { targets: { read: [mass] } } }, (row, { resources: { [delta]: d }, lookup: { targets }, input }) => {
|
|
582
|
+
row[score] = (targets(row[target])?.[mass] ?? 0) + d + input;
|
|
583
|
+
});`);
|
|
584
|
+
const found = (entity: number) => entity === 1 ? [3] : null;
|
|
585
|
+
expect(run(kernel, 2, { target: { "[]": [1, 2] } }, { lookups: [found], resources: [10], args: 100, program: false }).field("score")).toEqual([113, 110]);
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
test("context groups reached through the context parameter", async () => {
|
|
589
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", input: { type: "number" }, components: { read: [target], write: [score] }, resources: { read: [delta] }, lookup: { targets: { read: [mass] } } }, (row, context) => {
|
|
590
|
+
const { resources } = context;
|
|
591
|
+
row[score] = (context.lookup.targets(row[target])?.[mass] ?? 0) + resources[delta] + context.input;
|
|
592
|
+
});`);
|
|
593
|
+
const found = (entity: number) => entity === 1 ? [3] : null;
|
|
594
|
+
expect(run(kernel, 2, { target: { "[]": [1, 2] } }, { lookups: [found], resources: [10], args: 100, program: false }).field("score")).toEqual([113, 110]);
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
test("boolean columns read as booleans", async () => {
|
|
598
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [alive], write: [score] } }, (row) => {
|
|
599
|
+
row[score] = row[alive] === true ? 1 : 2;
|
|
600
|
+
});`);
|
|
601
|
+
expect(run(kernel, 2, { alive: { "[]": [1, 0] } }, { booleans: ["alive"] }).field("score")).toEqual([1, 2]);
|
|
602
|
+
expect(run(kernel, 1, { alive: { "[]": [1] } }).field("score")).toEqual([2]);
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
test("boolean reads convert only where observable, including through locals", async () => {
|
|
606
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [alive, mass], write: [score] } }, (row, { commands }) => {
|
|
607
|
+
const flag = row[alive];
|
|
608
|
+
const copy = flag;
|
|
609
|
+
row[score] = (copy === true ? 10 : 20) + row[mass] * 2 + (flag ? 1 : 0);
|
|
610
|
+
commands.spawn([alive, mass])({ [alive]: flag, [mass]: row[mass] });
|
|
611
|
+
});`);
|
|
612
|
+
const result = run(kernel, 2, { alive: { "[]": [1, 0] }, mass: { "[]": [3, 4] } }, { booleans: ["alive"], program: false });
|
|
613
|
+
expect(result.field("score")).toEqual([17, 28]);
|
|
614
|
+
expect(result.calls).toEqual([
|
|
615
|
+
["spawn", 999], ["spawn", 999, 0, true], ["spawn", 999, 1, 3],
|
|
616
|
+
["spawn", 999], ["spawn", 999, 0, false], ["spawn", 999, 1, 4],
|
|
617
|
+
]);
|
|
618
|
+
const source = String(kernel.create);
|
|
619
|
+
// Converted: the snapshot of `flag` (observed through `copy ===` and spawn) and `mass` in the spawn value.
|
|
620
|
+
expect(source.match(/ \? c\d+\[x\d+\] !== 0/g)?.length).toBe(2);
|
|
621
|
+
expect(source.match(/booleans\[/g)?.length).toBe(2);
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
test("a spawn nested in an add's value is issued before the add begins", async () => {
|
|
625
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass] } }, (row, { commands }) => {
|
|
626
|
+
commands.add(row.entity, [target, score], { [target]: commands.spawn([mass])({ [mass]: row[mass] }), [score]: 1 });
|
|
627
|
+
commands.despawn(row.entity);
|
|
628
|
+
});`);
|
|
629
|
+
expect(kernel.keys).toEqual(["mass", "target", "score"]);
|
|
630
|
+
expect(String(kernel.create)).not.toMatch(/\bkeys\[/);
|
|
631
|
+
expect(run(kernel, 1, { mass: { "[]": [5] } }, { program: false }).calls).toEqual([
|
|
632
|
+
["spawn", 999], ["spawn", 999, 0, 5],
|
|
633
|
+
[2, 100], [2, 100, 1, 999], [2, 100, 2, 1],
|
|
634
|
+
[1, 100],
|
|
635
|
+
]);
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
test("commands name components through keys", async () => {
|
|
639
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [position] } }, (row, context) => {
|
|
640
|
+
const { commands } = context;
|
|
641
|
+
const spawned = commands.spawn([position, alive])({ [position]: [row[position][0], 1] });
|
|
642
|
+
commands.add(spawned, score, row.entity);
|
|
643
|
+
commands.add(spawned, alive);
|
|
644
|
+
commands.remove(row.entity, [alive, score]);
|
|
645
|
+
commands.remove(row.entity, mass);
|
|
646
|
+
});`);
|
|
647
|
+
expect(kernel.keys).toEqual(["position", "alive", "score", "mass"]);
|
|
648
|
+
// Only position is given a tuple; registration checks such components are stored in linear memory.
|
|
649
|
+
expect(kernel.structuredValues).toEqual([0]);
|
|
650
|
+
// A component given no value is given undefined, which the runtime writes as the component's start.
|
|
651
|
+
expect(run(kernel, 1, { position: { "[0]": [5] } }, { program: false }).calls).toEqual([
|
|
652
|
+
["spawn", 999], ["spawn", 999, 0, [5, 1]], ["spawn", 999, 1, undefined],
|
|
653
|
+
[2, 999], [2, 999, 2, 100],
|
|
654
|
+
[2, 999], [2, 999, 1, undefined],
|
|
655
|
+
[3, 100], [3, 100, 1], [3, 100, 2],
|
|
656
|
+
[3, 100], [3, 100, 3],
|
|
657
|
+
]);
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
test("commands name lists through module constants: array literals and Archetype.create", async () => {
|
|
661
|
+
const kernel = await compile(`import { Archetype } from "ecs";
|
|
662
|
+
const unit = Archetype.create([position, alive, score]);
|
|
663
|
+
const pair = [mass, score];
|
|
664
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [position] } }, (row, { commands }) => {
|
|
665
|
+
const spawned = commands.spawn(unit)({ [score]: 2, [position]: [row[position][0], 1] });
|
|
666
|
+
commands.add(spawned, pair, { [mass]: 3 });
|
|
667
|
+
commands.remove(row.entity, unit);
|
|
668
|
+
});`);
|
|
669
|
+
expect(kernel.keys).toEqual(["position", "alive", "score", "mass"]);
|
|
670
|
+
expect(kernel.structuredValues).toEqual([0]);
|
|
671
|
+
expect(run(kernel, 1, { position: { "[0]": [5] } }, { program: false }).calls).toEqual([
|
|
672
|
+
["spawn", 999], ["spawn", 999, 0, [5, 1]], ["spawn", 999, 1, undefined], ["spawn", 999, 2, 2],
|
|
673
|
+
[2, 999], [2, 999, 3, 3], [2, 999, 2, undefined],
|
|
674
|
+
[3, 100], [3, 100, 0], [3, 100, 1], [3, 100, 2],
|
|
675
|
+
]);
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
test("kernel declarations list components through module constants", async () => {
|
|
679
|
+
const kernel = await compile(`import { Archetype } from "ecs";
|
|
680
|
+
const moving = Archetype.create([position, velocity]);
|
|
681
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: moving, write: [score] } }, row => {
|
|
682
|
+
row[score] = row[position] + row[velocity];
|
|
683
|
+
});`);
|
|
684
|
+
expect(run(kernel, 2, { position: { "[]": [1, 2] }, velocity: { "[]": [10, 20] } }).field("score")).toEqual([11, 22]);
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
test.each([
|
|
688
|
+
["a value for a component the list doesn't name", "commands.spawn([mass])({ [mass]: 1, [score]: 2 });", "score isn't one of the command's components"],
|
|
689
|
+
["a spawner kept rather than called", "const spawn = commands.spawn([mass]); spawn({ [mass]: 1 });", "a kernel calls the spawner where it gets it, as commands.spawn(components)(values)"],
|
|
690
|
+
["a list holding a spread", "commands.spawn([...pair])({});", "commands.spawn: lists name keys by identifiers bound at module scope"],
|
|
691
|
+
["a list that isn't a module constant", "const list = 1; commands.add(row.entity, list, {});", "commands name components by identifiers bound at module scope"],
|
|
692
|
+
["a component listed twice", "commands.remove(row.entity, [mass, mass]);", "mass is listed twice"],
|
|
693
|
+
["an add with too many arguments", "commands.add(row.entity, mass, 1, 2);", "an add is commands.add(entity, component, value) or commands.add(entity, components, values)"],
|
|
694
|
+
["a remove with rest components", "commands.remove(row.entity, mass, score);", "a remove is commands.remove(entity, component) or commands.remove(entity, components)"],
|
|
695
|
+
])("fail the build for %s", async (_, body, message) => {
|
|
696
|
+
expect(await failure(`const pair = [mass, score];\nconst kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass] } }, (row, { commands }) => { const m = row[mass]; ${body} });`)).toBe(message);
|
|
697
|
+
});
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
describe("program", () => {
|
|
701
|
+
test("input and resource paths are scalars in the program", async () => {
|
|
702
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", input: { type: "object" }, components: { write: [score] }, resources: { read: [delta] } }, (row, { resources: { [delta]: d }, input }) => {
|
|
703
|
+
const [, y] = d;
|
|
704
|
+
row[score] = y * input.scale + Math.max(input.scale, Math.PI) + (input.flag ? 1 : 0);
|
|
705
|
+
});`);
|
|
706
|
+
const result = run(kernel, 1, {}, { resources: [[1, 2]], args: { scale: 3, flag: true } });
|
|
707
|
+
expect(result.field("score")).toEqual([2 * 3 + Math.PI + 1]);
|
|
708
|
+
expect(JSON.stringify(kernel.program)).toContain(`{"kind":"resource","index":0,"path":[1]}`);
|
|
709
|
+
expect(JSON.stringify(kernel.program)).toContain(`{"kind":"args","path":["scale"]}`);
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
test("runtime indexing into a resource has no program", async () => {
|
|
713
|
+
const kernel = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [score] }, resources: { read: [delta] } }, (row, { resources: { [delta]: d } }) => {
|
|
714
|
+
row[score] = d[row[mass]];
|
|
715
|
+
});`);
|
|
716
|
+
expect(run(kernel, 1, { mass: { "[]": [1] } }, { resources: [[5, 6]], program: false }).field("score")).toEqual([6]);
|
|
717
|
+
});
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
describe("composites", () => {
|
|
721
|
+
test("one argument to System.create that isn't a body is a composite, never a kernel", async () => {
|
|
722
|
+
const result = await transform(`const a = System.create({ name: "a" }, () => {});
|
|
723
|
+
const listed = System.create([a]);
|
|
724
|
+
const declared = System.create({ kernel: "cpu", systems: [a], components: { write: [score] } });`);
|
|
725
|
+
expect(result !== null && "failure" in result ? result.failure.message : result?.kernels ?? []).toEqual([]);
|
|
726
|
+
});
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
describe("lookups in the program", () => {
|
|
730
|
+
const targets = (entity: number) => entity === 1 ? [3, [10, 20, 30]] : entity === 2 ? [4, [40, 50, 60]] : null;
|
|
731
|
+
const declaration = (body: string, read = "[target]", lookup = "targets: { read: [mass, position] }") => `const kernel = System.create({ name: "a", kernel: "cpu",
|
|
732
|
+
components: { read: ${read}, write: [score] }, lookup: { ${lookup} } },
|
|
733
|
+
(row, { lookup: { ${lookup.includes("others") ? "targets, others" : "targets"} } }) => { ${body} });`;
|
|
734
|
+
|
|
735
|
+
test("guarded leaf access, early return and a second lookup in its own handle", async () => {
|
|
736
|
+
const kernel = await compile(declaration(`
|
|
737
|
+
const other = targets(row[target]);
|
|
738
|
+
if (other === null) return;
|
|
739
|
+
const [tx, ty] = other[position];
|
|
740
|
+
const second = others(row[mass]);
|
|
741
|
+
const extra = second !== null ? second[position][2] : 0;
|
|
742
|
+
row[score] = tx - other[mass] + ty * 0 + extra;
|
|
743
|
+
`, "[target, mass]", "targets: { read: [mass, position] }, others: { read: [position] }"));
|
|
744
|
+
expect(kernel.program?.handles).toBe(2);
|
|
745
|
+
const others = (entity: number) => entity === 2 ? [[0, 0, 7]] : null;
|
|
746
|
+
expect(run(kernel, 3, { target: { "[]": [1, 2, 3] }, mass: { "[]": [2, 0, 0] }, score: { "[]": [-1, -1, -1] } }, { lookups: [targets, others] }).field("score"))
|
|
747
|
+
.toEqual([10 - 3 + 7, 40 - 4, -1]);
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
test("optional chains read NaN when nothing was found, anywhere", async () => {
|
|
751
|
+
const kernel = await compile(declaration(`row[score] = targets(row[target])?.[position]?.[1] * 2;`, "[target]", "targets: { read: [position] }"));
|
|
752
|
+
expect(kernel.program).not.toBeNull();
|
|
753
|
+
expect(run(kernel, 2, { target: { "[]": [1, 5] } }, { lookups: [entity => targets(entity)?.slice(1) ?? null] }).field("score")).toEqual([40, NaN]);
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
test("guards through && and conditional tests", async () => {
|
|
757
|
+
const kernel = await compile(declaration(`
|
|
758
|
+
const other = targets(row[target]);
|
|
759
|
+
row[score] = other && other[mass] > 3 ? other[position][0] : -other?.[mass];
|
|
760
|
+
`));
|
|
761
|
+
expect(kernel.program).not.toBeNull();
|
|
762
|
+
expect(run(kernel, 3, { target: { "[]": [1, 2, 3] } }, { lookups: [targets, () => null] }).field("score")).toEqual([-3, 40, NaN]);
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
test.each([
|
|
766
|
+
["an unguarded leaf access", `const other = targets(row[target]); row[score] = other[mass];`, "targets: { read: [mass] }"],
|
|
767
|
+
["a lookup result used whole", `const other = targets(row[target]); row[score] = other;`, "targets: { has: [mass] }"],
|
|
768
|
+
["a leaf access after the guard's scope", `const other = targets(row[target]); if (other !== null) { row[score] = 1; } row[score] = other[mass];`, "targets: { read: [mass] }"],
|
|
769
|
+
])("no program for %s", async (_, body, lookup) => {
|
|
770
|
+
const kernel = await compile(declaration(body, "[target]", lookup));
|
|
771
|
+
expect(kernel.program).toBeNull();
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
describe("subset", () => {
|
|
776
|
+
const kernel = (body: string, components = "{ read: [mass], write: [score] }") =>
|
|
777
|
+
`const kernel = System.create({ name: "a", kernel: "cpu", components: ${components} }, (row, { commands }) => { ${body} });`;
|
|
778
|
+
|
|
779
|
+
test.each([
|
|
780
|
+
["row[mass] = 1;", "mass is not in components write"],
|
|
781
|
+
["row[score] = row[score] + row[mass];", "compiled"],
|
|
782
|
+
["const f = () => 1;", "functions can't be created in a kernel; define helpers at module scope"],
|
|
783
|
+
["row[score] = \"a\";", "only number, boolean and null literals are in the kernel subset"],
|
|
784
|
+
["var x = 1;", "use const or let, not var"],
|
|
785
|
+
["return 1;", "a kernel returns nothing; return ends the current row"],
|
|
786
|
+
["row[score] = new Float32Array(1)[0];", "NewExpression is not in the kernel subset"],
|
|
787
|
+
["row[score] = Math.random();", "Math.random is not in the kernel subset"],
|
|
788
|
+
["row[score] = mass;", "mass is a key; use it to index, as in row[mass]"],
|
|
789
|
+
["const v = [1, 2]; row[score] = v[row[mass]];", "tuple elements are indexed by an in-range literal"],
|
|
790
|
+
["let v = [1, 2]; v[0] = 3;", "values are immutable; assign a whole new value to a let local"],
|
|
791
|
+
])("%s", async (body, message) => {
|
|
792
|
+
expect(await failure(kernel(body))).toBe(message);
|
|
793
|
+
});
|
|
794
|
+
|
|
795
|
+
test("component values are written whole", async () => {
|
|
796
|
+
expect(await failure(kernel("row[position][0] = 1;", "{ write: [position] }"))).toBe("component values are immutable; write the whole value");
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
test("GPU kernels", async () => {
|
|
800
|
+
const gpu = (declaration: string, body: string) =>
|
|
801
|
+
`const kernel = System.create({ name: "a", kernel: "gpu", ${declaration} }, (row, context) => { ${body} });`;
|
|
802
|
+
expect(await failure(gpu("components: { read: [mass], write: [score] }", "row[score] = row[mass] * 2;"))).toBe("compiled");
|
|
803
|
+
expect(await failure(gpu("components: { read: [target], write: [score] }, lookup: { targets: { read: [mass] } }", "row[score] = 1;")))
|
|
804
|
+
.toBe("a GPU kernel can't use lookups yet");
|
|
805
|
+
expect(await failure(gpu("components: { write: [score], changed: [mass] }", "row[score] = 1;"))).toBe("a GPU kernel can't use change filters yet");
|
|
806
|
+
expect(await failure(gpu("components: { read: [mass], write: [score] }", "context.commands.despawn(row.entity);")))
|
|
807
|
+
.toBe("a GPU kernel can't issue commands or use values that aren't numbers or booleans");
|
|
808
|
+
expect(await failure(gpu("components: { read: [mass], write: [score] }", "let s = 0; for (let i = 0; i < 3; i++) s += i; row[score] = s;")))
|
|
809
|
+
.toBe("a GPU kernel can't use loops or labeled blocks yet");
|
|
810
|
+
expect(await failure(`const kernel = System.create({ name: "a", kernel: true, components: { write: [score] } }, (row) => {});`))
|
|
811
|
+
.toBe(`kernel must be the literal "cpu" or "gpu"`);
|
|
812
|
+
});
|
|
813
|
+
|
|
814
|
+
test("GPU programs carry their locals' names", async () => {
|
|
815
|
+
const body = "(row) => { const doubled = row[mass] * 2; row[score] = doubled; }";
|
|
816
|
+
const gpu = await compile(`const kernel = System.create({ name: "a", kernel: "gpu", components: { read: [mass], write: [score] } }, ${body});`);
|
|
817
|
+
const cpu = await compile(`const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [score] } }, ${body});`);
|
|
818
|
+
expect(gpu.program?.names).toEqual([expect.stringMatching(/^doubled_\d+$/)]);
|
|
819
|
+
expect(cpu.program?.names).toBeUndefined();
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
test("kernels inside functions", async () => {
|
|
823
|
+
expect(await failure(`const make = () => System.create({ name: "a", kernel: "cpu", components: { write: [score] } }, (row) => {});`))
|
|
824
|
+
.toBe("kernel systems must be declared at module scope");
|
|
825
|
+
});
|
|
826
|
+
|
|
827
|
+
test("failures carry the offending position", async () => {
|
|
828
|
+
const source = kernel("row[mass] = 1;");
|
|
829
|
+
const result = await transform(source);
|
|
830
|
+
const position = `${header}${source}`.indexOf("row[mass] = 1");
|
|
831
|
+
expect(result !== null && "failure" in result ? result.failure.position : -1).toBe(position);
|
|
832
|
+
});
|
|
833
|
+
|
|
834
|
+
test("non-kernel systems that may reach their commands and other modules are left untouched", async () => {
|
|
835
|
+
expect(await transform(`const s = System.create({ name: "a", components: { read: [mass] } }, (row, context) => { const f = () => [row, context]; });`)).toBeNull();
|
|
836
|
+
expect(await transformKernels(`import { System } from "other";\nSystem.create({ name: "a", kernel: "cpu" }, () => {});`, "/x.js", parse, async () => false, () => "")).toBeNull();
|
|
837
|
+
});
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
describe("terminal bodies", () => {
|
|
841
|
+
/** Whether the transform marks a main-thread system's body as one that never reaches its commands. */
|
|
842
|
+
const marked = async (parameters: string, body: string, declaration = `{ name: "a" }`): Promise<boolean> => {
|
|
843
|
+
const result = await transform(`const system = System.create(${declaration}, ${parameters} => { ${body} });`);
|
|
844
|
+
if (result !== null && "failure" in result) throw new Error(result.failure.message);
|
|
845
|
+
const code = result?.code ?? "";
|
|
846
|
+
return code.includes("terminal$((") && code.includes("function terminal$(body)");
|
|
847
|
+
};
|
|
848
|
+
test.each([
|
|
849
|
+
["no context", "(row)", "console.log(row);", `{ name: "a", components: { has: [mass] } }`],
|
|
850
|
+
["a context destructured without commands", "({ resources })", "console.log(resources);", `{ name: "a" }`],
|
|
851
|
+
["a context used only through its other properties", "(context)", "console.log(context.input);", `{ name: "a", input: { type: "number" } }`],
|
|
852
|
+
["a context reaching resources and lookups", "(row, context)", "console.log(context.resources, context.lookup, row);", `{ name: "a", components: { has: [mass] } }`],
|
|
853
|
+
["nested destructuring", "({ resources: { [delta]: d } })", "console.log(d);", `{ name: "a", resources: { read: [delta] } }`],
|
|
854
|
+
])("mark a body with %s", async (_, parameters, body, declaration) => {
|
|
855
|
+
expect(await marked(parameters, body, declaration)).toBe(true);
|
|
856
|
+
});
|
|
857
|
+
test.each([
|
|
858
|
+
["destructured commands", "({ commands })", "commands.despawn(1);"],
|
|
859
|
+
["renamed commands", "({ commands: issue })", "issue.despawn(1);"],
|
|
860
|
+
["the context's commands", "(context)", "context.commands.despawn(1);"],
|
|
861
|
+
["the context's commands by a computed key", "(context)", `context["commands"].despawn(1);`],
|
|
862
|
+
["the context passed on", "(context)", "console.log(context);"],
|
|
863
|
+
["the context aliased", "(context)", "const c = context; console.log(c);"],
|
|
864
|
+
["a rest of the context", "({ ...rest })", "console.log(rest);"],
|
|
865
|
+
["a computed key of the context", "({ [score]: s })", "console.log(s);"],
|
|
866
|
+
["the context redeclared", "(context)", "{ const context = 1; console.log(context); }"],
|
|
867
|
+
["eval", "(context)", "eval('context.commands');"],
|
|
868
|
+
["a rest parameter", "(...parameters)", "console.log(parameters);"],
|
|
869
|
+
])("leave a body unmarked that reaches its commands through %s", async (_, parameters, body) => {
|
|
870
|
+
expect(await marked(parameters, body)).toBe(false);
|
|
871
|
+
});
|
|
872
|
+
test("leave a function body unmarked that uses arguments", async () => {
|
|
873
|
+
const result = await transform(`const system = System.create({ name: "a" }, function () { console.log(arguments); });`);
|
|
874
|
+
expect(result).toBeNull();
|
|
875
|
+
});
|
|
876
|
+
test("mark a system made from its body alone, and no kernel or finalizer", async () => {
|
|
877
|
+
const alone = await transform("const system = System.create(() => { console.log(1); });");
|
|
878
|
+
expect(alone !== null && "code" in alone ? alone.code : "").toContain("System.create(terminal$(() =>");
|
|
879
|
+
const kernel = await transform(`const kernel = System.create({ name: "k", kernel: "cpu", components: { write: [score] } }, (row) => { row[score] = 1; });`);
|
|
880
|
+
expect(kernel !== null && "code" in kernel ? kernel.code : "").not.toContain("terminal$");
|
|
881
|
+
const finalizer = await transformKernels(`import { Finalizer } from "ecs";\nconst f = Finalizer.create({ components: { read: [] } }, () => {});`, "/x.js", parse, async () => true, () => "");
|
|
882
|
+
expect(finalizer).toBeNull();
|
|
883
|
+
});
|
|
884
|
+
});
|
|
885
|
+
|
|
886
|
+
describe("index lookups in main-thread systems", () => {
|
|
887
|
+
/** Runs the transformed body once, recording each lookup as the runtime hook receives it. */
|
|
888
|
+
const looked = async (body: string, parameters = "({ lookup })", lookup = "near: { index: grid }"): Promise<{ readonly code: string; readonly calls: readonly unknown[] }> => {
|
|
889
|
+
const source = `const grid = "grid";\nconst system = System.create({ name: "a", lookup: { ${lookup} } }, ${parameters} => { ${body} });`;
|
|
890
|
+
const result = await transform(source);
|
|
891
|
+
if (result !== null && "failure" in result) return { code: result.failure.message, calls: [] };
|
|
892
|
+
const module = (result?.code ?? `${header}${source}`).split("\n").filter(line => !line.startsWith("import ")).join("\n");
|
|
893
|
+
const calls: unknown[] = [];
|
|
894
|
+
const prepare = (shape: unknown) => ({ find: (lookup: unknown, ...values: unknown[]) => { calls.push(["site", shape, Reflect.apply(String, undefined, [lookup]), values]); return { length: 0 }; } });
|
|
895
|
+
const system = new Function("System", "prepareLookup$", `${module}\nreturn system;`)({ create: (declaration: unknown, run: unknown) => ({ declaration, run }) }, prepare);
|
|
896
|
+
const named = (name: string) => Object.assign((...values: unknown[]) => { calls.push(["call", name, values]); return { length: 0 }; }, { toString: () => name });
|
|
897
|
+
system.run({ lookup: { near: named("near"), due: named("due"), other: named("other") } });
|
|
898
|
+
return { code: result?.code ?? source, calls };
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
test("pass literal tuples and comparisons flattened, through a site of each call", async () => {
|
|
902
|
+
const { calls } = await looked(`const x = 1; lookup.near([x, x + 1]); lookup.near([3, 4]); lookup.near(x); lookup.due(x, { ">=": x, "<": [x, 9] });`, "({ lookup })", "near: { index: grid }, due: { index: grid }");
|
|
903
|
+
expect(calls).toEqual([["site", [2], "near", [1, 2]], ["site", [2], "near", [3, 4]], ["site", [0], "near", [1]], ["site", [0, [[">=", 0], ["<", 2]]], "due", [1, 1, 1, 9]]]);
|
|
904
|
+
});
|
|
905
|
+
|
|
906
|
+
test.each([
|
|
907
|
+
["the context's lookup", "context.lookup.near([1, 2]);", "(context)"],
|
|
908
|
+
["a destructured lookup", "near([1, 2]);", "({ lookup: { near } })"],
|
|
909
|
+
])("rewrite %s", async (_, body, parameters) => {
|
|
910
|
+
const { calls } = await looked(body, parameters);
|
|
911
|
+
expect(calls).toEqual([["site", [2], "near", [1, 2]]]);
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
test.each([
|
|
915
|
+
["a lookup by entity", "lookup.other(1);", "near: { index: grid }, other: { read: [] }"],
|
|
916
|
+
["a spread", "const key = [[1, 2]]; lookup.near(...key);", "near: { index: grid }"],
|
|
917
|
+
["a lookup kept", "const near = lookup.near; near([1, 2]);", "near: { index: grid }"],
|
|
918
|
+
["redeclared lookups", "{ const lookup = {}; } lookup.near([1, 2]);", "near: { index: grid }"],
|
|
919
|
+
["a call inside another's key", "lookup.near(lookup.near(1).length);", "near: { index: grid }"],
|
|
920
|
+
])("leave %s as written", async (_, body, lookup) => {
|
|
921
|
+
const { calls } = await looked(body, "({ lookup })", lookup);
|
|
922
|
+
expect(calls.some(call => Array.isArray(call) && call[0] === "call")).toBe(true);
|
|
923
|
+
});
|
|
924
|
+
});
|
|
925
|
+
|
|
926
|
+
describe("commands in main-thread systems", () => {
|
|
927
|
+
/** Runs the transformed system's body once, recording each spawn's and add's keys and values as the runtime hooks receive them. */
|
|
928
|
+
const spawned = async (body: string, parameters = "({ commands })", declaration = `{ name: "a" }`): Promise<{ readonly code: string; readonly calls: readonly unknown[] }> => {
|
|
929
|
+
const source = `const system = System.create(${declaration}, ${parameters} => { ${body} });`;
|
|
930
|
+
const result = await transform(source);
|
|
931
|
+
if (result !== null && "failure" in result) return { code: result.failure.message, calls: [] };
|
|
932
|
+
const module = (result?.code ?? `${header}${source}`).split("\n").filter(line => !line.startsWith("import ")).join("\n");
|
|
933
|
+
const calls: unknown[] = [];
|
|
934
|
+
const prepare = (keys: () => readonly unknown[]) => ({
|
|
935
|
+
begin: (_: unknown, components: unknown) => (...values: unknown[]) => { calls.push(["prepared", components, keys(), values]); return 0; },
|
|
936
|
+
fallback: () => 0,
|
|
937
|
+
});
|
|
938
|
+
const prepareAdd = (keys: () => readonly unknown[]) => {
|
|
939
|
+
let entity: unknown = undefined;
|
|
940
|
+
let list: unknown = undefined;
|
|
941
|
+
let values: unknown[] = [];
|
|
942
|
+
return {
|
|
943
|
+
begin: (_: unknown, target: unknown, components: unknown) => { entity = target; list = components; values = []; return true; },
|
|
944
|
+
value: (k: number, value: unknown) => { values[k] = value; },
|
|
945
|
+
end: () => { calls.push(["prepared add", list, keys(), entity, values]); },
|
|
946
|
+
fallback: () => {},
|
|
947
|
+
};
|
|
948
|
+
};
|
|
949
|
+
const system = new Function("System", "prepareSpawn$", "prepareAdd$", `${module}\nreturn system;`)({ create: (declaration: unknown, run: unknown) => ({ declaration, run }) }, prepare, prepareAdd);
|
|
950
|
+
const context = { commands: { spawn: (list: unknown) => (values: unknown) => { calls.push(["spawn", list, values]); }, add: (entity: unknown, list: unknown, values: unknown) => { calls.push(["add", entity, list, values]); } } };
|
|
951
|
+
if (parameters.startsWith("(row")) system.run({}, context);
|
|
952
|
+
else system.run(context);
|
|
953
|
+
return { code: result?.code ?? source, calls };
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
test("pass literal values positionally, in source order", async () => {
|
|
957
|
+
const { calls } = await spawned(`let i = 0; commands.spawn([++i, score, mass])({ [position]: [++i, 0, 0], [score]: ++i, [mass]: 3 }); commands.spawn([])({});`);
|
|
958
|
+
expect(calls).toEqual([["prepared", [1, "score", "mass"], ["position", "score", "mass"], [[2, 0, 0], 3, 3]], ["prepared", [], [], []]]);
|
|
959
|
+
});
|
|
960
|
+
|
|
961
|
+
test.each([
|
|
962
|
+
["a string literal key", `commands.spawn([score, mass])({ [score]: 1, "mass": 3 });`],
|
|
963
|
+
["a plain key", "commands.spawn([score, mass])({ [score]: 1, mass: 3 });"],
|
|
964
|
+
["a number key", "commands.spawn([score])({ 1: 3 });"],
|
|
965
|
+
])("fail the build for %s, since component keys are symbols", async (_, body) => {
|
|
966
|
+
const { code, calls } = await spawned(body);
|
|
967
|
+
expect(code).toBe("a command's keys are its components' symbols, as [key]; a plain or string key is never a component's");
|
|
968
|
+
expect(calls).toEqual([]);
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
test.each([
|
|
972
|
+
["the context's commands", "context.commands.spawn([score])({ [score]: 1 });", "(context)", `{ name: "a" }`],
|
|
973
|
+
["renamed commands", "issue.spawn([score])({ [score]: 1 });", "({ commands: issue })", `{ name: "a" }`],
|
|
974
|
+
["a system with components", "commands.spawn([score])({ [score]: 1 });", "(row, { commands })", `{ name: "a", components: { has: [mass] } }`],
|
|
975
|
+
["the context of a system with components", "context.commands.spawn([score])({ [score]: 1 });", "(row, context)", `{ name: "a", components: { has: [mass] } }`],
|
|
976
|
+
])("pass values positionally through %s", async (_, body, parameters, declaration) => {
|
|
977
|
+
const { calls } = await spawned(body, parameters, declaration);
|
|
978
|
+
expect(calls).toEqual([["prepared", ["score"], ["score"], [1]]]);
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
test("pass values positionally in a system made from its body alone", async () => {
|
|
982
|
+
const result = await transform("const system = System.create(({ commands }) => { commands.spawn([score])({ [score]: 1 }); });");
|
|
983
|
+
expect(result !== null && "code" in result ? result.code : null).toContain("spawn$0(commands, [score], 1)");
|
|
984
|
+
});
|
|
985
|
+
|
|
986
|
+
test.each([
|
|
987
|
+
["a value object built first", "const values = { [score]: 1 }; commands.spawn([score])(values);"],
|
|
988
|
+
["a spread", "const values = { [score]: 1 }; commands.spawn([score, mass])({ ...values, [mass]: 2 });"],
|
|
989
|
+
["a key that isn't a module constant", "const key = score; commands.spawn([score])({ [key]: 1 });"],
|
|
990
|
+
["a shadowed key", "const score = \"other\"; commands.spawn([score])({ [score]: 1 });"],
|
|
991
|
+
["redeclared commands", "{ const commands = { spawn: () => {} }; } commands.spawn([score])({ [score]: 1 });"],
|
|
992
|
+
["a spawner kept", "const spawn = commands.spawn([score]); spawn({ [score]: 1 });"],
|
|
993
|
+
])("leave %s as written", async (_, body) => {
|
|
994
|
+
const { calls } = await spawned(body);
|
|
995
|
+
expect(calls.every(call => Array.isArray(call) && call[0] === "spawn")).toBe(true);
|
|
996
|
+
expect(calls.length).toBe(1);
|
|
997
|
+
});
|
|
998
|
+
describe("adds", () => {
|
|
999
|
+
test("pass literal values positionally, after the entity, in source order", async () => {
|
|
1000
|
+
const { code, calls } = await spawned("let i = 0; commands.add(++i, [score, mass, ++i], { [score]: ++i, [mass]: ++i });");
|
|
1001
|
+
expect(code).toContain("prepareAdd$");
|
|
1002
|
+
expect(calls).toEqual([["prepared add", ["score", "mass", 2], ["score", "mass"], 1, [3, 4]]]);
|
|
1003
|
+
});
|
|
1004
|
+
test.each([
|
|
1005
|
+
["a value object built first", "const values = { [score]: 1 }; commands.add(1, [score], values);"],
|
|
1006
|
+
["a spread", "const values = { [score]: 1 }; commands.add(1, [score, mass], { ...values, [mass]: 2 });"],
|
|
1007
|
+
["a key that isn't a module constant", "const key = score; commands.add(1, [score], { [key]: 1 });"],
|
|
1008
|
+
["one component", "commands.add(1, score, 1);"],
|
|
1009
|
+
["one component's object value", `commands.add(1, score, { text: "a", "size": 2 });`],
|
|
1010
|
+
])("leave %s as written", async (_, body) => {
|
|
1011
|
+
const { calls } = await spawned(body);
|
|
1012
|
+
expect(calls).toEqual([["add", 1, expect.anything(), expect.anything()]]);
|
|
1013
|
+
});
|
|
1014
|
+
test("fail the build for a plain or string key", async () => {
|
|
1015
|
+
expect((await spawned(`commands.add(1, [score, mass], { [score]: 1, "mass": 3 });`)).code).toBe("a command's keys are its components' symbols, as [key]; a plain or string key is never a component's");
|
|
1016
|
+
});
|
|
1017
|
+
});
|
|
1018
|
+
});
|
|
1019
|
+
|
|
1020
|
+
describe("helpers that return early", () => {
|
|
1021
|
+
test("take each path's value, with later statements on the paths that fall through", async () => {
|
|
1022
|
+
const kernel = await compile(`const pick = (a, b) => {
|
|
1023
|
+
if (a > b) return [a, 0];
|
|
1024
|
+
const c = b * 2;
|
|
1025
|
+
if (c > 10) {
|
|
1026
|
+
const d = c - 10;
|
|
1027
|
+
return [d, 1];
|
|
1028
|
+
}
|
|
1029
|
+
return [c, 2];
|
|
1030
|
+
};
|
|
1031
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [position] } }, (row) => {
|
|
1032
|
+
const [value, path] = pick(row[mass], 4);
|
|
1033
|
+
row[position] = [value, path, 0];
|
|
1034
|
+
});`);
|
|
1035
|
+
const result = run(kernel, 3, { mass: { "[]": [5, 3, 1] }, position: vec3([0, 0, 0], [0, 0, 0], [0, 0, 0]) });
|
|
1036
|
+
expect([result.field("position", [0]), result.field("position", [1])]).toEqual([[5, 8, 8], [0, 2, 2]]);
|
|
1037
|
+
});
|
|
1038
|
+
});
|
|
1039
|
+
|
|
1040
|
+
describe("math builtins", () => {
|
|
1041
|
+
const math = `import { Vec3, Quat, Mat4x4 } from "ecs";\n`;
|
|
1042
|
+
const points = vec3([1, -2, 0.5], [0, 3, 4], [2, 1, -1]);
|
|
1043
|
+
const at = (row: number): readonly [number, number, number] => [points["[0]"][row], points["[1]"][row], points["[2]"][row]];
|
|
1044
|
+
const results = (result: ReturnType<typeof run>) => [0, 1, 2].map(row => [0, 1, 2].map(k => result.field("position", [k])[row]));
|
|
1045
|
+
|
|
1046
|
+
test("inline as scalar code, nested namespaces and helpers they call included", async () => {
|
|
1047
|
+
const kernel = await compile(`${math}const kernel = System.create({ name: "a", kernel: "cpu", components: { read: [velocity], write: [position, score] } }, (row) => {
|
|
1048
|
+
const p = row[position];
|
|
1049
|
+
const v = row[velocity];
|
|
1050
|
+
row[position] = Vec3.add(Vec3.normalize(Vec3.cross(p, v)), Vec3.F32.scale(Vec3.clamp(v, Vec3.zero, [1, 1, 1]), Vec3.dot(p, v)));
|
|
1051
|
+
row[score] = Vec3.distance(p, v) + Vec3.length(Vec3.mix(p, v, 0.25));
|
|
1052
|
+
});`);
|
|
1053
|
+
const result = run(kernel, 3, { position: points, velocity: vec3([0.5, 1, 2], [1, 0, -1], [3, -2, 0]) });
|
|
1054
|
+
const velocities: readonly (readonly [number, number, number])[] = [[0.5, 1, 3], [1, 0, -2], [2, -1, 0]];
|
|
1055
|
+
const expected = [0, 1, 2].map(row => {
|
|
1056
|
+
const p = at(row);
|
|
1057
|
+
const v = velocities[row];
|
|
1058
|
+
return Vec3.add(Vec3.normalize(Vec3.cross(p, v)), Vec3.scale(Vec3.clamp(v, Vec3.zero, [1, 1, 1]), Vec3.dot(p, v)));
|
|
1059
|
+
});
|
|
1060
|
+
expect(results(result)).toEqual(expected.map(value => [...value]));
|
|
1061
|
+
expect(result.field("score")).toEqual([0, 1, 2].map(row => Vec3.distance(at(row), velocities[row]) + Vec3.length(Vec3.mix(at(row), velocities[row], 0.25))));
|
|
1062
|
+
expect(String(kernel.create)).not.toMatch(/Vec3|normalize|cross/);
|
|
1063
|
+
});
|
|
1064
|
+
|
|
1065
|
+
test("across namespaces: quaternions rotating vectors, and matrices", async () => {
|
|
1066
|
+
const kernel = await compile(`${math}const kernel = System.create({ name: "a", kernel: "cpu", components: { write: [position] } }, (row) => {
|
|
1067
|
+
const q = Quat.fromAxisAngle([0, 0, 1], Math.PI / 2);
|
|
1068
|
+
const m = Mat4x4.multiply(Mat4x4.translation(1, 2, 3), Mat4x4.scaling(2, 2, 2));
|
|
1069
|
+
row[position] = Mat4x4.multiplyVec3(m, Quat.rotateVec3(q, row[position]));
|
|
1070
|
+
});`);
|
|
1071
|
+
const result = run(kernel, 3, { position: points });
|
|
1072
|
+
const q = Quat.fromAxisAngle([0, 0, 1], Math.PI / 2);
|
|
1073
|
+
const m = Mat4x4.multiply(Mat4x4.translation(1, 2, 3), Mat4x4.scaling(2, 2, 2));
|
|
1074
|
+
expect(results(result)).toEqual([0, 1, 2].map(row => [...Mat4x4.multiplyVec3(m, Quat.rotateVec3(q, at(row)))]));
|
|
1075
|
+
});
|
|
1076
|
+
|
|
1077
|
+
test("in GPU kernels, become regions WGSL emits as builtins, and other backends run as the inlined body", async () => {
|
|
1078
|
+
const body = `(row) => { row[position] = Vec3.scale(Vec3.normalize(Vec3.cross(row[position], row[velocity])), Vec3.dot(row[position], row[velocity])); }`;
|
|
1079
|
+
const declaration = `components: { read: [velocity], write: [position] }`;
|
|
1080
|
+
const gpu = await compile(`${math}const kernel = System.create({ name: "a", kernel: "gpu", ${declaration} }, ${body});`);
|
|
1081
|
+
const cpu = await compile(`${math}const kernel = System.create({ name: "a", kernel: "cpu", ${declaration} }, ${body});`);
|
|
1082
|
+
const regions = (gpu.program?.body ?? []).flatMap(statement => statement.kind === "intrinsic" ? [statement.intrinsic.operation] : []);
|
|
1083
|
+
expect(regions).toEqual(["cross", "normalize", "dot", "*"]);
|
|
1084
|
+
expect((cpu.program?.body ?? []).some(statement => statement.kind === "intrinsic")).toBe(false);
|
|
1085
|
+
const fields = { position: points, velocity: vec3([0.5, 1, 2], [1, 0, -1], [3, -2, 0]) };
|
|
1086
|
+
expect(results(run(gpu, 3, fields))).toEqual(results(run(cpu, 3, fields)));
|
|
1087
|
+
const columns = gpu.columns.map((column): WasmColumn => ({ view: column.kind === "field" ? "f32" : "f64", stride: 4, offset: 0, boolean: false, component: 0 }));
|
|
1088
|
+
const shader = gpu.program === null ? "" : generateWgsl(gpu.program, columns, () => "number");
|
|
1089
|
+
const code = typeof shader === "string" ? shader : shader.code;
|
|
1090
|
+
expect(code).toMatch(/(normalize_\d+) = normalize\((cross_\d+)\);/);
|
|
1091
|
+
expect(code).toMatch(/= \(normalize_\d+ \* dot_\d+\);/);
|
|
1092
|
+
});
|
|
1093
|
+
|
|
1094
|
+
test("that leave the kernel subset fail with the function's reason", async () => {
|
|
1095
|
+
expect(await failure(`${math}const kernel = System.create({ name: "a", kernel: "cpu", components: { write: [position] } }, (row) => {
|
|
1096
|
+
row[position] = Vec3.random();
|
|
1097
|
+
});`)).toBe("Math.random is not in the kernel subset");
|
|
1098
|
+
expect(await failure(`${math}const kernel = System.create({ name: "a", kernel: "cpu", components: { write: [position] } }, (row) => {
|
|
1099
|
+
row[position] = Vec3.missing([1, 2, 3]);
|
|
1100
|
+
});`)).toMatch(/^missing isn't exported by .*\/math\/vec3\/public\.ts$/);
|
|
1101
|
+
});
|
|
1102
|
+
});
|
|
1103
|
+
|
|
1104
|
+
describe("imported functions and constants", () => {
|
|
1105
|
+
const kernel = (imports: string, body: string) => `${imports}\nconst kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass], write: [score] } }, (row) => { ${body} });`;
|
|
1106
|
+
const scores = async (source: string, files: { readonly [file: string]: string }) =>
|
|
1107
|
+
run(await compile(source, files), 2, { mass: { "[]": [2, 3] } }).field("score");
|
|
1108
|
+
|
|
1109
|
+
test("inline through named, default, namespace and re-exported imports", async () => {
|
|
1110
|
+
const files = {
|
|
1111
|
+
"/shapes.js": "const TWO = 2;\nexport const twice = (x) => x * TWO;\nexport default function square(x) { return x * x; }\nexport const pair = (x) => [x, x + 1];",
|
|
1112
|
+
"/second.js": "const ONE = 1;\nexport const second = (v) => v[ONE];",
|
|
1113
|
+
"/barrel.js": "export { twice as double } from './shapes.js';\nexport * as Shapes from './shapes.js';\nexport * from './second.js';",
|
|
1114
|
+
};
|
|
1115
|
+
expect(await scores(kernel(`import square, { twice } from "./shapes.js";\nimport * as Barrel from "./barrel.js";`,
|
|
1116
|
+
"row[score] = square(twice(row[mass])) + Barrel.double(1) + Barrel.Shapes.default(3) + Barrel.second(Barrel.Shapes.pair(row[mass]));"), files))
|
|
1117
|
+
.toEqual([16 + 2 + 9 + 3, 36 + 2 + 9 + 4]);
|
|
1118
|
+
});
|
|
1119
|
+
|
|
1120
|
+
test("report the files kernels inline from, also when they fail, so fixing them compiles again", async () => {
|
|
1121
|
+
const result = await transform(kernel(`import { twice } from "./shapes.js";`, "row[score] = twice(row[mass]);"), { "/shapes.js": "export const twice = (x) => x * 2;" });
|
|
1122
|
+
expect(result?.dependencies).toEqual(["/shapes.js"]);
|
|
1123
|
+
const failed = await transform(kernel(`import { twice } from "./shapes.js";`, "row[score] = twice(row[mass]);"), { "/shapes.js": "export const twice = (x) => x * Math.random();" });
|
|
1124
|
+
expect(failed !== null && "failure" in failed).toBe(true);
|
|
1125
|
+
expect(failed?.dependencies).toEqual(["/shapes.js"]);
|
|
1126
|
+
});
|
|
1127
|
+
|
|
1128
|
+
test("that leave the subset fail at the call, with a frame for each inlined function", async () => {
|
|
1129
|
+
const source = kernel(`import { outer } from "./outer.js";`, "row[score] = outer(row[mass]);");
|
|
1130
|
+
const result = await transform(source, {
|
|
1131
|
+
"/outer.js": "import { inner } from './inner.js';\nexport const outer = (x) => inner(x) + 1;",
|
|
1132
|
+
"/inner.ts": "type Unused = {\n readonly a: number;\n};\nexport const inner = (x: number): number =>\n x * Math.random();",
|
|
1133
|
+
});
|
|
1134
|
+
const failure = result !== null && "failure" in result ? result.failure : undefined;
|
|
1135
|
+
expect(failure?.message).toBe("Math.random is not in the kernel subset");
|
|
1136
|
+
expect(failure?.position).toBe(`${header}${source}`.indexOf("outer(row[mass])"));
|
|
1137
|
+
expect(failure?.frames).toEqual([
|
|
1138
|
+
{ name: "inner", file: "/inner.ts", line: 5, column: 9 },
|
|
1139
|
+
{ name: "outer", file: "/outer.js", line: 2, column: 29 },
|
|
1140
|
+
]);
|
|
1141
|
+
});
|
|
1142
|
+
|
|
1143
|
+
test("frame each function of a module that fails inside another of its functions", async () => {
|
|
1144
|
+
const result = await transform(kernel(`import { outer } from "./outer.js";`, "row[score] = outer(row[mass]);"), {
|
|
1145
|
+
"/outer.js": "const inner = (x) => x * Math.random();\nexport const outer = (x) => inner(x) + 1;",
|
|
1146
|
+
});
|
|
1147
|
+
const failure = result !== null && "failure" in result ? result.failure : undefined;
|
|
1148
|
+
expect(failure?.frames).toEqual([
|
|
1149
|
+
{ name: "inner", file: "/outer.js", line: 1, column: 26 },
|
|
1150
|
+
{ name: "outer", file: "/outer.js", line: 2, column: 29 },
|
|
1151
|
+
]);
|
|
1152
|
+
});
|
|
1153
|
+
|
|
1154
|
+
test("fail on recursion across modules, module state, and names they can't resolve", async () => {
|
|
1155
|
+
expect(await failure(kernel(`import { even } from "./even.js";`, "row[score] = even(row[mass]);"), {
|
|
1156
|
+
"/even.js": "import { odd } from './odd.js';\nexport const even = (n) => n === 0 ? 1 : odd(n - 1);",
|
|
1157
|
+
"/odd.js": "import { even } from './even.js';\nexport const odd = (n) => n === 0 ? 0 : even(n - 1);",
|
|
1158
|
+
})).toBe("even is recursive");
|
|
1159
|
+
expect(await failure(kernel(`import { next } from "./counter.js";`, "row[score] = next();"), { "/counter.js": "let count = 0;\nexport const next = () => count;" }))
|
|
1160
|
+
.toBe("count is not a module-scope const");
|
|
1161
|
+
expect(await failure(kernel(`import { missing } from "./shapes.js";`, "row[score] = missing(1);"), { "/shapes.js": "export const twice = (x) => x * 2;" }))
|
|
1162
|
+
.toBe("missing isn't exported by /shapes.js");
|
|
1163
|
+
expect(await failure(kernel(`import { f } from "./both.js";`, "row[score] = f(1);"), {
|
|
1164
|
+
"/both.js": "export * from './a.js';\nexport * from './b.js';", "/a.js": "export const f = (x) => x;", "/b.js": "export const f = (x) => -x;",
|
|
1165
|
+
})).toBe("f is exported by more than one export * of /both.js");
|
|
1166
|
+
expect(await failure(kernel(`import { f } from "lodash";`, "row[score] = f(1);"))).toBe("lodash can't be resolved from /test.js");
|
|
1167
|
+
});
|
|
1168
|
+
});
|
|
1169
|
+
|
|
1170
|
+
describe("imported lists", () => {
|
|
1171
|
+
const files = {
|
|
1172
|
+
"/components.js": `export const health = "health";\nexport const armor = "armor";\nexport const tagged = "tagged";\n`,
|
|
1173
|
+
"/archetypes.js": [
|
|
1174
|
+
`import { Archetype } from "ecs";`,
|
|
1175
|
+
`import { health, armor, tagged } from "./components.js";`,
|
|
1176
|
+
`export const shield = "shield";`,
|
|
1177
|
+
`export const Unit = Archetype.create([health, armor, tagged]);`,
|
|
1178
|
+
`export const Guard = [shield, armor];`,
|
|
1179
|
+
`export const Alias = Unit;`,
|
|
1180
|
+
`export const Computed = [health].concat([armor]);`,
|
|
1181
|
+
`export let Changing = [health];`,
|
|
1182
|
+
`export const Spread = [...Guard];`,
|
|
1183
|
+
].join("\n"),
|
|
1184
|
+
"/barrel.js": `export { Unit as Soldier } from "./archetypes.js";\nexport * from "./archetypes.js";\nexport * as Kinds from "./archetypes.js";\n`,
|
|
1185
|
+
};
|
|
1186
|
+
/** The values the archetypes' module gives its lists, for evaluating the kernel's module. */
|
|
1187
|
+
const Unit = ["health", "armor", "tagged"];
|
|
1188
|
+
const Guard = ["shield", "armor"];
|
|
1189
|
+
const commanding = (imports: string, body: string) =>
|
|
1190
|
+
`${imports}\nconst kernel = System.create({ name: "a", kernel: "cpu", components: { read: [mass] } }, (row, { commands }) => { ${body} });`;
|
|
1191
|
+
|
|
1192
|
+
test("name the keys of a list imported from another module, by the kernel's bindings or else through the list", async () => {
|
|
1193
|
+
const source = commanding(`import { health, armor } from "./components.js";\nimport { Unit, Guard } from "./archetypes.js";`, `
|
|
1194
|
+
const spawned = commands.spawn(Unit)({ [health]: row[mass], [armor]: 2 });
|
|
1195
|
+
commands.add(spawned, Guard, { [armor]: 3 });
|
|
1196
|
+
commands.remove(row.entity, Unit);`);
|
|
1197
|
+
const result = await transform(source, files);
|
|
1198
|
+
expect(result !== null && "code" in result ? result.code : "").toContain("keys: [health, armor, Unit[2], Guard[0]],");
|
|
1199
|
+
expect(result?.dependencies).toEqual(expect.arrayContaining(["/archetypes.js", "/components.js"]));
|
|
1200
|
+
const kernel = await compile(source, files, { health: "health", armor: "armor", Unit, Guard });
|
|
1201
|
+
expect(kernel.keys).toEqual(["health", "armor", "tagged", "shield"]);
|
|
1202
|
+
expect(run(kernel, 1, { mass: { "[]": [5] } }, { program: false }).calls).toEqual([
|
|
1203
|
+
["spawn", 999], ["spawn", 999, 0, 5], ["spawn", 999, 1, 2], ["spawn", 999, 2, undefined],
|
|
1204
|
+
[2, 999], [2, 999, 3, undefined], [2, 999, 1, 3],
|
|
1205
|
+
[3, 100], [3, 100, 0], [3, 100, 1], [3, 100, 2],
|
|
1206
|
+
]);
|
|
1207
|
+
});
|
|
1208
|
+
|
|
1209
|
+
test("follow re-exports, namespace imports and constants naming another list", async () => {
|
|
1210
|
+
const source = commanding(`import { health } from "./components.js";\nimport { Soldier, Alias } from "./barrel.js";\nimport * as Archetypes from "./archetypes.js";\nimport * as Barrel from "./barrel.js";\nconst Local = Alias;`, `
|
|
1211
|
+
commands.spawn(Soldier)({ [health]: row[mass] });
|
|
1212
|
+
commands.spawn(Archetypes.Unit)({ [health]: 2 });
|
|
1213
|
+
commands.add(row.entity, Barrel.Kinds.Guard, {});
|
|
1214
|
+
commands.remove(row.entity, Local);`);
|
|
1215
|
+
const result = await transform(source, files);
|
|
1216
|
+
expect(result !== null && "code" in result ? result.code : result?.failure.message).toContain("keys: [health, Soldier[1], Soldier[2], Barrel.Kinds.Guard[0]],");
|
|
1217
|
+
const kernel = await compile(source, files, { health: "health", Soldier: Unit, Alias: Unit, Archetypes: { Unit, Guard }, Barrel: { Kinds: { Guard } } });
|
|
1218
|
+
expect(kernel.keys).toEqual(["health", "armor", "tagged", "shield"]);
|
|
1219
|
+
expect(run(kernel, 1, { mass: { "[]": [5] } }, { program: false }).calls).toEqual([
|
|
1220
|
+
["spawn", 999], ["spawn", 999, 0, 5], ["spawn", 999, 1, undefined], ["spawn", 999, 2, undefined],
|
|
1221
|
+
["spawn", 999], ["spawn", 999, 0, 2], ["spawn", 999, 1, undefined], ["spawn", 999, 2, undefined],
|
|
1222
|
+
[2, 100], [2, 100, 3, undefined], [2, 100, 1, undefined],
|
|
1223
|
+
[3, 100], [3, 100, 0], [3, 100, 1], [3, 100, 2],
|
|
1224
|
+
]);
|
|
1225
|
+
});
|
|
1226
|
+
|
|
1227
|
+
test("in a declaration, bind keys the list's module defines to the kernel's imports of them, under any name", async () => {
|
|
1228
|
+
const source = `import { shield, Guard } from "./archetypes.js";\nimport { armor as plate } from "./components.js";
|
|
1229
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: Guard, write: [score] } }, (row) => { row[score] = row[shield] * 10 + row[plate]; });`;
|
|
1230
|
+
const kernel = await compile(source, files, { shield: "shield", Guard, plate: "armor" });
|
|
1231
|
+
expect(run(kernel, 2, { shield: { "[]": [1, 2] }, armor: { "[]": [3, 4] } }).field("score")).toEqual([13, 24]);
|
|
1232
|
+
expect(await failure(`import { shield, Guard } from "./archetypes.js";
|
|
1233
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: Guard, write: [score] } }, (row) => { row[score] = row[shield]; });`, files))
|
|
1234
|
+
.toBe("Guard[1] is in components read but never read; remove it, or move it to components has to keep requiring it");
|
|
1235
|
+
});
|
|
1236
|
+
|
|
1237
|
+
test.each([
|
|
1238
|
+
["computed when its module runs", "commands.spawn(Computed)({});", "commands.spawn: Computed is computed when /archetypes.js runs, so the compiler can't read its components; declare it as an array literal, or Archetype.create of one"],
|
|
1239
|
+
["not a const", "commands.spawn(Changing)({});", "commands.spawn: Changing isn't a module-scope const, so the compiler can't read its components"],
|
|
1240
|
+
["holding a spread", "commands.spawn(Spread)({});", "commands.spawn: Spread names a key by something other than an identifier bound at the scope of /archetypes.js"],
|
|
1241
|
+
["not exported", "commands.spawn(Missing)({});", "commands.spawn: Missing isn't exported by /archetypes.js"],
|
|
1242
|
+
["a namespace", "commands.spawn(Archetypes)({});", "commands.spawn: Archetypes is a module namespace, not a list of components"],
|
|
1243
|
+
["a member of a namespace it doesn't export", "commands.remove(row.entity, Archetypes.Missing);", "commands.remove: Missing isn't exported by /archetypes.js"],
|
|
1244
|
+
])("fail the build for a list %s", async (_, body, message) => {
|
|
1245
|
+
expect(await failure(commanding(`import { Computed, Changing, Spread, Missing } from "./archetypes.js";\nimport * as Archetypes from "./archetypes.js";`, body), files)).toBe(message);
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1248
|
+
test("take an imported name as one key when it resolves to a key, followed through namespaces and constants", async () => {
|
|
1249
|
+
const keys = {
|
|
1250
|
+
...files,
|
|
1251
|
+
"/keys.js": [
|
|
1252
|
+
`export const ember = Symbol("ember");`,
|
|
1253
|
+
`export const glow = identify$(Symbol("glow"), "keys.js#glow");`,
|
|
1254
|
+
`export const spark = ember;`,
|
|
1255
|
+
`function identify$(symbol, id) { return symbol; }`,
|
|
1256
|
+
].join("\n"),
|
|
1257
|
+
};
|
|
1258
|
+
const source = commanding(`import { ember, glow, spark } from "./keys.js";\nimport * as Keys from "./keys.js";\nimport { heat } from "external";`, `
|
|
1259
|
+
commands.add(row.entity, ember, row[mass]);
|
|
1260
|
+
commands.add(row.entity, glow, true);
|
|
1261
|
+
commands.remove(row.entity, Keys.ember);
|
|
1262
|
+
commands.remove(row.entity, spark);
|
|
1263
|
+
commands.add(row.entity, heat, 2);`);
|
|
1264
|
+
const result = await transform(source, keys);
|
|
1265
|
+
expect(result !== null && "code" in result ? result.code : result?.failure.message).toContain("keys: [ember, glow, spark, heat],");
|
|
1266
|
+
});
|
|
1267
|
+
|
|
1268
|
+
test.each([
|
|
1269
|
+
["computed when its module runs", "commands.add(row.entity, Computed, {});", "commands.add: Computed is computed when /archetypes.js runs, so the compiler can't tell whether it's a key or a list; declare a key as Symbol(...), or a list as an array literal or Archetype.create of one"],
|
|
1270
|
+
["not a const", "commands.remove(row.entity, Changing);", "commands.remove: Changing isn't a module-scope const, so the compiler can't tell whether it's a key or a list"],
|
|
1271
|
+
["not exported", "commands.remove(row.entity, Missing);", "commands.remove: Missing isn't exported by /archetypes.js"],
|
|
1272
|
+
["a namespace", "commands.add(row.entity, Archetypes, 1);", "commands.add: Archetypes is a module namespace, not a key or a list of components"],
|
|
1273
|
+
["of a module that can't be resolved", "commands.add(row.entity, Lost, 1);", "commands.add: nowhere can't be resolved from /test.js"],
|
|
1274
|
+
])("fail the build for an added or removed name %s", async (_, body, message) => {
|
|
1275
|
+
expect(await failure(commanding(`import { Computed, Changing, Missing } from "./archetypes.js";\nimport * as Archetypes from "./archetypes.js";\nimport { Lost } from "nowhere";`, body), files)).toBe(message);
|
|
1276
|
+
});
|
|
1277
|
+
|
|
1278
|
+
test("fail the build for a list that names a key", async () => {
|
|
1279
|
+
expect(await failure(commanding(`import { health } from "./components.js";`, "commands.spawn(health)({});"), files))
|
|
1280
|
+
.toBe("commands.spawn: health is a key, not a list of components; list it as [health]");
|
|
1281
|
+
});
|
|
1282
|
+
|
|
1283
|
+
test("fail the build for a declaration's list computed when its module runs", async () => {
|
|
1284
|
+
expect(await failure(`import { Computed } from "./archetypes.js";
|
|
1285
|
+
const kernel = System.create({ name: "a", kernel: "cpu", components: { read: Computed, write: [score] } }, (row) => { row[score] = 1; });`, files))
|
|
1286
|
+
.toBe("components.read: Computed is computed when /archetypes.js runs, so the compiler can't read its components; declare it as an array literal, or Archetype.create of one");
|
|
1287
|
+
});
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
describe("declared access", () => {
|
|
1291
|
+
const kernel = (declaration: string, body: string) =>
|
|
1292
|
+
`const kernel = System.create({ name: "a", kernel: "cpu", ${declaration} }, (row, { resources, lookup, reduce }) => { ${body} });`;
|
|
1293
|
+
const system = (declaration: string, body: string) => `const system = System.create({ name: "a", ${declaration} }, ${body});`;
|
|
1294
|
+
|
|
1295
|
+
test("a kernel uses every component and resource it lists", async () => {
|
|
1296
|
+
expect(await failure(kernel("components: { read: [position, velocity], write: [score] }", "row[score] = row[velocity];")))
|
|
1297
|
+
.toBe("position is in components read but never read; remove it, or move it to components has to keep requiring it");
|
|
1298
|
+
expect(await failure(kernel("components: { read: [position], write: [velocity, mass] }", "row[velocity] = row[position];")))
|
|
1299
|
+
.toBe("mass is in components write but never written; remove it, or move it to components read if it's only read");
|
|
1300
|
+
expect(await failure(kernel("components: { write: [score] }, resources: { read: [delta] }", "row[score] = 1;")))
|
|
1301
|
+
.toBe("delta is in resources read but never read; remove it");
|
|
1302
|
+
expect(await failure(kernel("components: { read: [target], write: [score] }, lookup: { targets: { read: [mass, position] } }",
|
|
1303
|
+
"const found = lookup.targets(row[target]); row[score] = found === null ? 0 : found[mass];")))
|
|
1304
|
+
.toBe("position is in lookup.targets read but never read; remove it, or move it to lookup.targets has to keep requiring it");
|
|
1305
|
+
expect(await failure(kernel("components: { read: [mass], has: [alive] }", "const entity = row.entity;")))
|
|
1306
|
+
.toBe("mass is in components read but never read; remove it, or move it to components has to keep requiring it");
|
|
1307
|
+
expect(await failure(kernel("components: { read: [position, mass], write: [score] }, resources: { read: [delta] }",
|
|
1308
|
+
"row[score] = row[mass] * resources[delta] + row[position][0];"))).toBe("compiled");
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
test("a kernel reads every component it lists in up.read, and up holds only those", async () => {
|
|
1312
|
+
const up = (kind: string, read: string, body: string) =>
|
|
1313
|
+
`const kernel = System.create({ name: "a", kernel: "${kind}", components: { read: [mass], write: [score] }, up: { through: target, read: [${read}] } }, (row, { up }) => { ${body} });`;
|
|
1314
|
+
const propagate = "row[score] = (up === null ? 0 : up[score]) + row[mass];";
|
|
1315
|
+
expect(await failure(up("cpu", "score, position", propagate))).toBe("position is in up.read but never read; remove it");
|
|
1316
|
+
expect(await failure(up("cpu", "score", "row[score] = up === null ? row[mass] : up[position];"))).toBe("up is indexed by a component in up.read");
|
|
1317
|
+
expect(await failure(up("gpu", "score", propagate))).toBe("compiled");
|
|
1318
|
+
expect(await failure(up("cpu", "score", propagate))).toBe("compiled");
|
|
1319
|
+
});
|
|
1320
|
+
|
|
1321
|
+
test("a main-thread system uses every component and resource it lists, where its body shows every access", async () => {
|
|
1322
|
+
const unread = "mass is in components read but never read; remove it, or move it to components has to keep requiring it";
|
|
1323
|
+
expect(await failure(system("components: { read: [position, mass], write: [velocity] }", "(row) => { row[velocity] = row[position]; }"))).toBe(unread);
|
|
1324
|
+
expect(await failure(system("components: { read: [position], write: [velocity] }", "(row) => { console.log(row[position]); }")))
|
|
1325
|
+
.toBe("velocity is in components write but never written; remove it, or move it to components read if it's only read");
|
|
1326
|
+
expect(await failure(system("components: { read: [mass] }", "() => {}"))).toBe(unread);
|
|
1327
|
+
expect(await failure(system("components: { read: [mass] }", "(row, { commands }) => commands.despawn(row.entity)"))).toBe(unread);
|
|
1328
|
+
expect(await failure(system("components: { write: [score] }", "(row) => { row[score] += 1; }"))).toBe("compiled");
|
|
1329
|
+
});
|
|
1330
|
+
|
|
1331
|
+
test("a main-thread system uses every resource it lists, through its context's resources however it reaches them", async () => {
|
|
1332
|
+
const unread = "delta is in resources read but never read; remove it";
|
|
1333
|
+
// Without components, the context is the first parameter.
|
|
1334
|
+
expect(await failure(system("resources: { read: [delta], write: [score] }", "(context) => { context.resources[score] = 1; }"))).toBe(unread);
|
|
1335
|
+
expect(await failure(system("resources: { read: [delta], write: [score] }", "({ resources }) => { resources[score] = 1; }"))).toBe(unread);
|
|
1336
|
+
expect(await failure(system("resources: { read: [delta], write: [score] }", "(context) => { const { resources } = context; resources[score] = 1; }"))).toBe(unread);
|
|
1337
|
+
expect(await failure(system("resources: { read: [delta] }, input: { type: \"number\" }", "({ input }) => { console.log(input); }"))).toBe(unread);
|
|
1338
|
+
expect(await failure(system("resources: { write: [score, mass] }", "({ resources }) => { resources[score] = 1; }"))).toBe("mass is in resources write but never written; remove it, or move it to resources read if it's only read");
|
|
1339
|
+
expect(await failure(system("components: { has: [mass] }, resources: { read: [delta], write: [score] }",
|
|
1340
|
+
"(_, context) => { context.resources[score] = context.resources[delta]; }"))).toBe("compiled");
|
|
1341
|
+
expect(await failure(system("resources: { read: [delta] }", "({ resources: { [delta]: d } }) => { console.log(d); }"))).toBe("compiled");
|
|
1342
|
+
});
|
|
1343
|
+
|
|
1344
|
+
test("a system contributes to every resource it reduces", async () => {
|
|
1345
|
+
const totals = `const total = "total";\nconst low = "low";\n`;
|
|
1346
|
+
const missing = "low is in reduce but never contributed to; remove it";
|
|
1347
|
+
expect(await failure(`${totals}${kernel(`components: { read: [mass] }, reduce: { [total]: "+", [low]: "min" }`, "reduce[total](row[mass]);")}`)).toBe(missing);
|
|
1348
|
+
expect(await failure(`${totals}${system(`components: { read: [mass] }, reduce: { [total]: "+", [low]: "min" }`, "(row, { reduce }) => { reduce[total](row[mass]); }")}`)).toBe(missing);
|
|
1349
|
+
expect(await failure(`${totals}${system(`components: { read: [mass] }, reduce: { [total]: "+", [low]: "min" }`, "(row, context) => { context.reduce[total](row[mass]); }")}`)).toBe(missing);
|
|
1350
|
+
expect(await failure(`${totals}${system(`components: { read: [mass] }, reduce: { [total]: "+" }`, "(row, { reduce }) => { const add = reduce[total]; add(row[mass]); }")}`)).toBe("compiled");
|
|
1351
|
+
});
|
|
1352
|
+
|
|
1353
|
+
test("a main-thread system reads every component it lists in a lookup, where its body shows every use of the result", async () => {
|
|
1354
|
+
const looking = (lookup: string, body: string) => system(`components: { read: [target] }, lookup: { targets: { read: ${lookup} } }`, body);
|
|
1355
|
+
const unread = "position is in lookup.targets read but never read; remove it, or move it to lookup.targets has to keep requiring it";
|
|
1356
|
+
expect(await failure(looking("[mass, position]", "(row, context) => { const found = context.lookup.targets(row[target]); if (found !== null) console.log(found[mass]); }"))).toBe(unread);
|
|
1357
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup }) => { console.log(lookup.targets(row[target])?.[mass]); }"))).toBe(unread);
|
|
1358
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup: { targets } }) => { console.log(targets(row[target])?.[mass]); }"))).toBe(unread);
|
|
1359
|
+
expect(await failure(looking("[mass]", "(row, { lookup: { targets } }) => { const found = targets(row[target]); if (!found) return; console.log(found[mass]); }")))
|
|
1360
|
+
.toBe("compiled");
|
|
1361
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup: { targets } }) => { const found = targets(row[target]); console.log(found); }"))).toBe("compiled");
|
|
1362
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup: { targets } }) => { let found = targets(row[target]); console.log(found?.[mass]); }"))).toBe("compiled");
|
|
1363
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup }) => { helper(lookup); console.log(row[target]); }"))).toBe("compiled");
|
|
1364
|
+
});
|
|
1365
|
+
|
|
1366
|
+
test("a main-thread system reads every component it lists in a lookup through an index, from its lists' rows", async () => {
|
|
1367
|
+
const looking = (lookup: string, body: string) => system(`components: { read: [target] }, lookup: { near: { index: grid, read: ${lookup} } }`, body);
|
|
1368
|
+
const unread = "position is in lookup.near read but never read; remove it";
|
|
1369
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup }) => { const near = lookup.near(row[target]); for (let i = 0; i < near.length; i++) console.log(near.at(i)[mass], near.changed); }"))).toBe(unread);
|
|
1370
|
+
expect(await failure(looking("[mass, position]", "(row, context) => { const other = context.lookup.near(row[target]).at(0); console.log(other[mass], other.entity); }"))).toBe(unread);
|
|
1371
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup: { near } }) => { console.log(near(row[target])?.[mass]); }"))).toBe(unread);
|
|
1372
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup }) => { const near = lookup.near(row[target]); console.log(near.at(0)[mass], near.at(1)[position]); }"))).toBe("compiled");
|
|
1373
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup }) => { helper(lookup.near(row[target])); }"))).toBe("compiled");
|
|
1374
|
+
expect(await failure(looking("[mass, position]", "(row, { lookup }) => { const near = lookup.near(row[target]); const all = near.at; console.log(all); }"))).toBe("compiled");
|
|
1375
|
+
});
|
|
1376
|
+
|
|
1377
|
+
test("a main-thread system reads every component it lists through a destructured row", async () => {
|
|
1378
|
+
const unread = "mass is in components read but never read; remove it, or move it to components has to keep requiring it";
|
|
1379
|
+
expect(await failure(system("components: { read: [position, mass] }", "({ [position]: p, entity }) => { console.log(p, entity); }"))).toBe(unread);
|
|
1380
|
+
expect(await failure(system("components: { read: [position, mass] }", "(row) => { const { [position]: p } = row; console.log(p); }"))).toBe(unread);
|
|
1381
|
+
expect(await failure(system("components: { read: [position] }", "({ ...all }) => { console.log(all); }"))).toBe("compiled");
|
|
1382
|
+
});
|
|
1383
|
+
|
|
1384
|
+
test("finalizers are checked as main-thread bodies, in files that import only Finalizer", async () => {
|
|
1385
|
+
const finalizing = (source: string) => transformKernels(source, "/finalizer.js", parse, async specifier => specifier === "ecs", index => JSON.stringify(`kernel:${index}`));
|
|
1386
|
+
const failed = async (source: string) => {
|
|
1387
|
+
const result = await finalizing(source);
|
|
1388
|
+
return result !== null && "failure" in result ? result.failure.message : "compiled";
|
|
1389
|
+
};
|
|
1390
|
+
const header = `import { Finalizer } from "ecs";\nconst handle = "handle";\nconst count = "count";\n`;
|
|
1391
|
+
expect(await failed(`${header}const f = Finalizer.create({ name: "f", components: { read: [handle, count] } }, (row) => { console.log(row[handle]); });`))
|
|
1392
|
+
.toBe("count is in components read but never read; remove it, or move it to components has to keep requiring it");
|
|
1393
|
+
expect(await failed(`${header}const f = Finalizer.changes({ name: "f", resources: { read: [count] } }, (changes, { resources }) => { console.log(changes); });`))
|
|
1394
|
+
.toBe("count is in resources read but never read; remove it");
|
|
1395
|
+
expect(await failed(`${header}const f = Finalizer.changes({ name: "f", resources: { read: [count] } }, (changes, { resources }) => { console.log(changes, resources[count]); });`))
|
|
1396
|
+
.toBe("compiled");
|
|
1397
|
+
expect(await failed(`${header}const f = Finalizer.create({ name: "f", components: { read: [handle] } }, (row) => { console.log(row[handle]); });`)).toBe("compiled");
|
|
1398
|
+
});
|
|
1399
|
+
|
|
1400
|
+
test("a list declared as a module constant is checked as its array literal", async () => {
|
|
1401
|
+
const moving = `const moving = [position, velocity];\n`;
|
|
1402
|
+
expect(await failure(`${moving}${system("components: { read: moving }", "(row) => { console.log(row[position]); }")}`))
|
|
1403
|
+
.toBe("velocity is in components read but never read; remove it, or move it to components has to keep requiring it");
|
|
1404
|
+
expect(await failure(`${moving}${system("components: { read: moving }", "(row) => { console.log(row[position], row[velocity]); }")}`)).toBe("compiled");
|
|
1405
|
+
expect(await failure(`${moving}${kernel("components: { read: moving, write: [score] }", "row[score] = row[position];")}`))
|
|
1406
|
+
.toBe("velocity is in components read but never read; remove it, or move it to components has to keep requiring it");
|
|
1407
|
+
});
|
|
1408
|
+
|
|
1409
|
+
test("a main-thread system whose body hides an access isn't checked", async () => {
|
|
1410
|
+
expect(await failure(system("components: { read: [mass] }", "(row) => { helper(row); }"))).toBe("compiled");
|
|
1411
|
+
expect(await failure(system("components: { read: [mass] }", "(row) => { for (const key of [mass]) console.log(row[key]); }"))).toBe("compiled");
|
|
1412
|
+
expect(await failure(system("components: { read: [mass] }", "(row) => { const mass = \"other\"; console.log(row[mass]); }"))).toBe("compiled");
|
|
1413
|
+
expect(await failure(system("components: { read: [mass] }", "function (row) { console.log(arguments[0][mass]); }"))).toBe("compiled");
|
|
1414
|
+
expect(await failure(system("resources: { read: [delta] }", "({ ...all }) => { console.log(all); }"))).toBe("compiled");
|
|
1415
|
+
expect(await failure(system("resources: { read: [delta] }", "({ resources: { ...all } }) => { console.log(all); }"))).toBe("compiled");
|
|
1416
|
+
expect(await failure(system("resources: { read: [delta] }", "(context) => { helper(context.resources); }"))).toBe("compiled");
|
|
1417
|
+
expect(await failure(system("resources: { read: [delta] }", "(context) => { let r = context.resources; console.log(r); }"))).toBe("compiled");
|
|
1418
|
+
expect(await failure(system("components: { read: [mass] }", "body"))).toBe("compiled");
|
|
1419
|
+
expect(await failure("const decay = (k) => System.create({ name: \"a\", components: { read: [k] } }, (row) => { console.log(row[k]); });")).toBe("compiled");
|
|
1420
|
+
});
|
|
1421
|
+
});
|