@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,2159 @@
|
|
|
1
|
+
import { chunkShift } from './kernel.js';
|
|
2
|
+
import { withoutIntrinsics } from './intrinsics.js';
|
|
3
|
+
/** The parameters each lookup through an index takes, after the lookup parameters, all as f64. */
|
|
4
|
+
export const indexParameterCount = (lookup) => lookup.kind === "hash" ? 7 + lookup.watched : 11 + lookup.watched;
|
|
5
|
+
/** Math functions with exact native equivalents; the rest are imported from JS so results match bit for bit. */
|
|
6
|
+
const native = new Set(["abs", "sqrt", "floor", "ceil", "trunc", "min", "max", "fround", "imul", "clz32"]);
|
|
7
|
+
/** Imported operations that aren't `Math` functions. */
|
|
8
|
+
const operations = {
|
|
9
|
+
remainder: (a, b) => a % b,
|
|
10
|
+
power: (a, b) => a ** b,
|
|
11
|
+
};
|
|
12
|
+
/** Reads a scalar parameter's value from the resources and args of a run; booleans become 0 or 1. */
|
|
13
|
+
export const scalarValue = (scalar, resources, args) => {
|
|
14
|
+
let value = scalar.source === "args" ? args : resources[scalar.index];
|
|
15
|
+
for (const key of scalar.path)
|
|
16
|
+
value = typeof value === "object" && value !== null ? Reflect.get(value, key) : undefined;
|
|
17
|
+
return Number(value);
|
|
18
|
+
};
|
|
19
|
+
/** Reads each scalar parameter's value from the resources and args of a run. */
|
|
20
|
+
export const scalarValues = (scalars, resources, args) => scalars.map(scalar => scalarValue(scalar, resources, args));
|
|
21
|
+
export const instantiateWasm = async (module, memory, imports) => {
|
|
22
|
+
const instance = await WebAssembly.instantiate(module, { env: { memory }, math: importsOf(imports) });
|
|
23
|
+
const run = instance.exports.run;
|
|
24
|
+
if (typeof run !== "function")
|
|
25
|
+
throw new Error("A WASM kernel has no run export.");
|
|
26
|
+
// The generator always exports `run` with this signature.
|
|
27
|
+
return run;
|
|
28
|
+
};
|
|
29
|
+
/** The JS functions a kernel's imports name. */
|
|
30
|
+
export const importsOf = (names) => {
|
|
31
|
+
const functions = {};
|
|
32
|
+
for (const name of names) {
|
|
33
|
+
const operation = operations[name];
|
|
34
|
+
const math = Reflect.get(Math, name);
|
|
35
|
+
if (operation !== undefined)
|
|
36
|
+
functions[name] = operation;
|
|
37
|
+
else if (typeof math === "function")
|
|
38
|
+
functions[name] = (...values) => Number(Reflect.apply(math, Math, values));
|
|
39
|
+
}
|
|
40
|
+
return functions;
|
|
41
|
+
};
|
|
42
|
+
// Opcodes.
|
|
43
|
+
const op = {
|
|
44
|
+
block: 0x02, loop: 0x03, if: 0x04, else: 0x05, end: 0x0b, br: 0x0c, brIf: 0x0d, call: 0x10, drop: 0x1a, select: 0x1b,
|
|
45
|
+
localGet: 0x20, localSet: 0x21, localTee: 0x22,
|
|
46
|
+
i32Load: 0x28, f32Load: 0x2a, f64Load: 0x2b, i32Load8u: 0x2d, i32Store: 0x36, f32Store: 0x38, f64Store: 0x39, i32Store8: 0x3a,
|
|
47
|
+
i32Const: 0x41, f64Const: 0x44, i32ReinterpretF32: 0xbc, i64ReinterpretF64: 0xbd, i32LtU: 0x49, i32GtU: 0x4b, i32LeU: 0x4d, i32GtS: 0x4a, f64Load2: 0x2b,
|
|
48
|
+
i32Eqz: 0x45, i32GeS: 0x4e,
|
|
49
|
+
f64Eq: 0x61, f64Ne: 0x62, f64Lt: 0x63, f64Gt: 0x64, f64Le: 0x65, f64Ge: 0x66,
|
|
50
|
+
i32Eq: 0x46, i32LtS: 0x48, i32LeS: 0x4c, i32Clz: 0x67, i32Add: 0x6a, i32Sub: 0x6b, i32Mul: 0x6c, i32And: 0x71, i32Or: 0x72, i32Xor: 0x73, i32Shl: 0x74, i32ShrS: 0x75, i32ShrU: 0x76,
|
|
51
|
+
f64Abs: 0x99, f64Neg: 0x9a, f64Ceil: 0x9b, f64Floor: 0x9c, f64Trunc: 0x9d, f64Sqrt: 0x9f,
|
|
52
|
+
f64Add: 0xa0, f64Sub: 0xa1, f64Mul: 0xa2, f64Div: 0xa3, f64Min: 0xa4, f64Max: 0xa5,
|
|
53
|
+
i32WrapI64: 0xa7, i32GeU: 0x4f, i32Ne: 0x47, i64Const: 0x42, i64ShrU: 0x88, i64RemS: 0x81, f64ConvertI64S: 0xb9, f64Copysign: 0xa6, f32DemoteF64: 0xb6, f64ConvertI32S: 0xb7, f64ConvertI32U: 0xb8, f64PromoteF32: 0xbb,
|
|
54
|
+
};
|
|
55
|
+
const f64Type = 0x7c;
|
|
56
|
+
const i32Type = 0x7f;
|
|
57
|
+
/** Saturating truncations, 0xfc-prefixed opcodes. */
|
|
58
|
+
const i64TruncSatF64S = [0xfc, 0x06];
|
|
59
|
+
const truncations = { i32TruncSatF64U: [0xfc, 0x03], i64TruncSatF64U: [0xfc, 0x07] };
|
|
60
|
+
const unsigned = (value) => {
|
|
61
|
+
const bytes = [];
|
|
62
|
+
do {
|
|
63
|
+
let byte = value & 0x7f;
|
|
64
|
+
value = Math.floor(value / 128);
|
|
65
|
+
if (value !== 0)
|
|
66
|
+
byte |= 0x80;
|
|
67
|
+
bytes.push(byte);
|
|
68
|
+
} while (value !== 0);
|
|
69
|
+
return bytes;
|
|
70
|
+
};
|
|
71
|
+
const signed = (value) => {
|
|
72
|
+
const bytes = [];
|
|
73
|
+
for (;;) {
|
|
74
|
+
const byte = value & 0x7f;
|
|
75
|
+
value >>= 7;
|
|
76
|
+
if ((value === 0 && (byte & 0x40) === 0) || (value === -1 && (byte & 0x40) !== 0))
|
|
77
|
+
return [...bytes, byte];
|
|
78
|
+
bytes.push(byte | 0x80);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const float64 = (value) => [...new Uint8Array(new Float64Array([value]).buffer)];
|
|
82
|
+
const name = (text) => {
|
|
83
|
+
const bytes = [...new TextEncoder().encode(text)];
|
|
84
|
+
return [...unsigned(bytes.length), ...bytes];
|
|
85
|
+
};
|
|
86
|
+
const vector = (items) => [...unsigned(items.length), ...items.flat()];
|
|
87
|
+
const section = (id, content) => [id, ...unsigned(content.length), ...content];
|
|
88
|
+
/** Thrown inside generation when a program needs something WASM can't match exactly; the JS kernel is used instead. */
|
|
89
|
+
const unsupported = Symbol("unsupported");
|
|
90
|
+
/** Thrown when a program can't run four rows at a time; the scalar loop handles every row instead. */
|
|
91
|
+
const notVectorizable = Symbol("notVectorizable");
|
|
92
|
+
const join = (a, b) => a === b ? a : "mixed";
|
|
93
|
+
/** The operators whose folds rotate through lanes: each one's identity, -0 for sums so a sum of -0 stays -0, and its instruction. */
|
|
94
|
+
const rotated = {
|
|
95
|
+
"+": { value: -0, combine: op.f64Add },
|
|
96
|
+
"*": { value: 1, combine: op.f64Mul },
|
|
97
|
+
"min": { value: Infinity, combine: op.f64Min },
|
|
98
|
+
"max": { value: -Infinity, combine: op.f64Max },
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Generates a WASM module for a kernel program, with JS semantics: every value is an f64, and stores
|
|
102
|
+
* convert as typed arrays do. Returns `null` when exact equivalence can't be guaranteed.
|
|
103
|
+
*
|
|
104
|
+
* The exported `run(start, end, tick, ...columnAddresses, ...scalars)` processes rows `start` to `end`.
|
|
105
|
+
*/
|
|
106
|
+
export const generateWasm = (source, columns, scalarTypes, simdEnabled = true, filters = 0, lookups = [],
|
|
107
|
+
/** For a program reading `up`: the columns of the parent's components it reads. */
|
|
108
|
+
upColumns = [],
|
|
109
|
+
/** Each accumulator's operator, in `reductions` order. */
|
|
110
|
+
operators = [],
|
|
111
|
+
/** By lookup, for those through an index, how it reads its index; null for a lookup by entity. */
|
|
112
|
+
indexLookups = [],
|
|
113
|
+
/** By probe, its lookup: `KernelDescription.probes[k].lookup`. */
|
|
114
|
+
probeLookups = []) => {
|
|
115
|
+
const program = withoutIntrinsics(source);
|
|
116
|
+
const scalars = [];
|
|
117
|
+
const scalarIndex = new Map();
|
|
118
|
+
const imports = [];
|
|
119
|
+
const scalarOf = (scalar) => {
|
|
120
|
+
const key = JSON.stringify(scalar);
|
|
121
|
+
let index = scalarIndex.get(key);
|
|
122
|
+
if (index === undefined) {
|
|
123
|
+
if (scalarTypes(scalar) === null)
|
|
124
|
+
throw unsupported;
|
|
125
|
+
index = scalars.length;
|
|
126
|
+
scalars.push(scalar);
|
|
127
|
+
scalarIndex.set(key, index);
|
|
128
|
+
}
|
|
129
|
+
return index;
|
|
130
|
+
};
|
|
131
|
+
const importOf = (functionName) => {
|
|
132
|
+
let index = imports.indexOf(functionName);
|
|
133
|
+
if (index < 0) {
|
|
134
|
+
index = imports.length;
|
|
135
|
+
imports.push(functionName);
|
|
136
|
+
}
|
|
137
|
+
return index;
|
|
138
|
+
};
|
|
139
|
+
/** Whether read `read` of lookup `lookup` is its `changed`, after what it reads. */
|
|
140
|
+
const isChanged = (lookup, read) => (lookups[lookup]?.watched ?? 0) > 0 && read === lookups[lookup]?.reads;
|
|
141
|
+
/** Whether any lookup watches, which then takes its `lastRun` after the other lookup parameters. */
|
|
142
|
+
const watching = lookups.some(lookup => (lookup.watched ?? 0) > 0);
|
|
143
|
+
/** Each handle's lookup, from the `find`s into it; a handle used by two lookups isn't supported. */
|
|
144
|
+
const lookupOfHandle = new Map();
|
|
145
|
+
const claim = (handle, lookup) => {
|
|
146
|
+
const existing = lookupOfHandle.get(handle);
|
|
147
|
+
if ((existing !== undefined && existing !== lookup) || lookup >= lookups.length)
|
|
148
|
+
throw unsupported;
|
|
149
|
+
lookupOfHandle.set(handle, lookup);
|
|
150
|
+
};
|
|
151
|
+
/** Each probe's lookup, by the probe's index. */
|
|
152
|
+
const lookupOfProbe = new Map(probeLookups.map((lookup, probe) => [probe, lookup]));
|
|
153
|
+
const collectFinds = (statements) => {
|
|
154
|
+
for (const statement of statements) {
|
|
155
|
+
if (statement.kind === "find")
|
|
156
|
+
claim(statement.handle, statement.lookup);
|
|
157
|
+
else if (statement.kind === "probe") {
|
|
158
|
+
const lookup = lookupOfProbe.get(statement.probe);
|
|
159
|
+
if (lookup === undefined || indexLookups[lookup] === null || indexLookups[lookup] === undefined)
|
|
160
|
+
throw unsupported;
|
|
161
|
+
claim(statement.list, lookup);
|
|
162
|
+
claim(statement.first, lookup);
|
|
163
|
+
}
|
|
164
|
+
else if (statement.kind === "listRow") {
|
|
165
|
+
const lookup = lookupOfHandle.get(statement.list);
|
|
166
|
+
if (lookup === undefined)
|
|
167
|
+
throw unsupported;
|
|
168
|
+
claim(statement.row, lookup);
|
|
169
|
+
}
|
|
170
|
+
else if (statement.kind === "if") {
|
|
171
|
+
collectFinds(statement.consequent);
|
|
172
|
+
collectFinds(statement.alternate);
|
|
173
|
+
}
|
|
174
|
+
else if (statement.kind === "block" || statement.kind === "loop")
|
|
175
|
+
collectFinds(statement.body);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
// Local types, to a fixed point over assignments.
|
|
179
|
+
const localTypes = new Array(program.locals);
|
|
180
|
+
const typeOf = (expression) => {
|
|
181
|
+
switch (expression.kind) {
|
|
182
|
+
case "number": return "number";
|
|
183
|
+
case "boolean": return "boolean";
|
|
184
|
+
case "column": return columns[expression.column].boolean ? "boolean" : "number";
|
|
185
|
+
case "resource":
|
|
186
|
+
case "args": return scalarTypes(expression.kind === "args" ? { source: "args", path: expression.path } : { source: "resource", index: expression.index, path: expression.path }) ?? "mixed";
|
|
187
|
+
case "local": return localTypes[expression.local] ?? "number";
|
|
188
|
+
case "unary": return expression.operator === "!" ? "boolean" : "number";
|
|
189
|
+
case "binary": return ["<", ">", "<=", ">=", "==", "!=", "===", "!=="].includes(expression.operator) ? "boolean" : "number";
|
|
190
|
+
case "logical": return join(typeOf(expression.left), typeOf(expression.right));
|
|
191
|
+
case "conditional": return join(typeOf(expression.consequent), typeOf(expression.alternate));
|
|
192
|
+
case "math": return "number";
|
|
193
|
+
case "found":
|
|
194
|
+
case "upFound": return "boolean";
|
|
195
|
+
case "upLeaf": return upColumns[expression.column]?.boolean === true ? "boolean" : "number";
|
|
196
|
+
case "lookupLeaf": {
|
|
197
|
+
const lookup = lookupOfHandle.get(expression.handle);
|
|
198
|
+
if (lookup !== undefined && isChanged(lookup, expression.read))
|
|
199
|
+
return "boolean";
|
|
200
|
+
const leaf = lookup === undefined ? null : lookups[lookup]?.leaf(expression.read, expression.path);
|
|
201
|
+
return leaf?.boolean === true ? "boolean" : "number";
|
|
202
|
+
}
|
|
203
|
+
case "listLength":
|
|
204
|
+
case "rowEntity": return "number";
|
|
205
|
+
case "listChanged": return "boolean";
|
|
206
|
+
case "rowLeaf": {
|
|
207
|
+
const lookup = lookupOfHandle.get(expression.handle);
|
|
208
|
+
const leaf = lookup === undefined ? null : indexLookups[lookup]?.rowLeaf(expression.leaf);
|
|
209
|
+
return leaf?.column.boolean === true ? "boolean" : "number";
|
|
210
|
+
}
|
|
211
|
+
// Regions are inlined before generating.
|
|
212
|
+
case "lane": throw unsupported;
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const inferLocals = (statements) => {
|
|
216
|
+
let changed = false;
|
|
217
|
+
for (const statement of statements) {
|
|
218
|
+
if (statement.kind === "set") {
|
|
219
|
+
const type = typeOf(statement.value);
|
|
220
|
+
const current = localTypes[statement.local];
|
|
221
|
+
const next = current === undefined ? type : join(current, type);
|
|
222
|
+
if (next !== current) {
|
|
223
|
+
localTypes[statement.local] = next;
|
|
224
|
+
changed = true;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else if (statement.kind === "if")
|
|
228
|
+
changed = inferLocals(statement.consequent) || inferLocals(statement.alternate) || changed;
|
|
229
|
+
else if (statement.kind === "block" || statement.kind === "loop")
|
|
230
|
+
changed = inferLocals(statement.body) || changed;
|
|
231
|
+
}
|
|
232
|
+
return changed;
|
|
233
|
+
};
|
|
234
|
+
for (let pass = 0; pass < program.locals + 2 && inferLocals(program.body); pass++)
|
|
235
|
+
;
|
|
236
|
+
/** Whether a value is an integer below 2^32 in magnitude: integer column reads, small integer literals, and locals of only those. */
|
|
237
|
+
const accumulators = program.reductions ?? [];
|
|
238
|
+
// Accumulators start at their partials, which needn't be integers.
|
|
239
|
+
const integralLocals = new Array(program.locals).fill(true).map((integral, index) => integral && !accumulators.includes(index));
|
|
240
|
+
const integral = (expression) => {
|
|
241
|
+
switch (expression.kind) {
|
|
242
|
+
case "column": {
|
|
243
|
+
const { view, boolean } = columns[expression.column];
|
|
244
|
+
return !boolean && (view === "i32" || view === "u32" || view === "u8");
|
|
245
|
+
}
|
|
246
|
+
case "upLeaf": {
|
|
247
|
+
const column = upColumns[expression.column];
|
|
248
|
+
return column !== undefined && !column.boolean && (column.view === "i32" || column.view === "u32" || column.view === "u8");
|
|
249
|
+
}
|
|
250
|
+
case "number": return Number.isInteger(expression.value) && Math.abs(expression.value) <= 0x7FFFFFFF;
|
|
251
|
+
case "local": return integralLocals[expression.local];
|
|
252
|
+
default: return false;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
const inferIntegral = (statements) => {
|
|
256
|
+
let changed = false;
|
|
257
|
+
for (const statement of statements) {
|
|
258
|
+
if (statement.kind === "set" && integralLocals[statement.local] && !integral(statement.value)) {
|
|
259
|
+
integralLocals[statement.local] = false;
|
|
260
|
+
changed = true;
|
|
261
|
+
}
|
|
262
|
+
else if (statement.kind === "if")
|
|
263
|
+
changed = inferIntegral(statement.consequent) || inferIntegral(statement.alternate) || changed;
|
|
264
|
+
else if (statement.kind === "block" || statement.kind === "loop")
|
|
265
|
+
changed = inferIntegral(statement.body) || changed;
|
|
266
|
+
}
|
|
267
|
+
return changed;
|
|
268
|
+
};
|
|
269
|
+
while (inferIntegral(program.body))
|
|
270
|
+
;
|
|
271
|
+
// Parameters: start, end, tick, lastRun, column addresses, filter row tick addresses, filter chunk tick addresses, scalars, and with reductions the partials address.
|
|
272
|
+
const columnParameter = (column) => 4 + column;
|
|
273
|
+
const filterRowParameter = (filter) => 4 + columns.length + filter;
|
|
274
|
+
const filterChunkParameter = (filter) => 4 + columns.length + filters + filter;
|
|
275
|
+
/**
|
|
276
|
+
* With lookups: the entity table (archetype, row and generation addresses, then its length), then each lookup's
|
|
277
|
+
* directory address and record count, all as f64 so workers pass them like scalars.
|
|
278
|
+
*/
|
|
279
|
+
const lookupParameters = lookups.length === 0 ? 0 : 4 + 2 * lookups.length + (watching ? 1 : 0);
|
|
280
|
+
const lookupParameter = (index) => 4 + columns.length + 2 * filters + index;
|
|
281
|
+
/** For `up`: the rows' and their parents' rows' addresses, whether there's a parent, then each parent column's address. */
|
|
282
|
+
const upMode = program.up === true;
|
|
283
|
+
const upParameters = upMode ? 3 + upColumns.length : 0;
|
|
284
|
+
/** Each lookup through an index's parameters, after the lookup parameters: `indexParameterCount` of them, as f64. */
|
|
285
|
+
const indexOffsets = [];
|
|
286
|
+
let indexParameters = 0;
|
|
287
|
+
for (let lookup = 0; lookup < lookups.length; lookup++) {
|
|
288
|
+
indexOffsets.push(indexParameters);
|
|
289
|
+
const index = indexLookups[lookup];
|
|
290
|
+
if (index !== null && index !== undefined)
|
|
291
|
+
indexParameters += indexParameterCount(index);
|
|
292
|
+
}
|
|
293
|
+
const indexParameter = (lookup, index) => 4 + columns.length + 2 * filters + lookupParameters + indexOffsets[lookup] + index;
|
|
294
|
+
const upParameter = (index) => 4 + columns.length + 2 * filters + lookupParameters + indexParameters + index;
|
|
295
|
+
const scalarParameter = (index) => 4 + columns.length + 2 * filters + lookupParameters + indexParameters + upParameters + index;
|
|
296
|
+
const code = [];
|
|
297
|
+
const extraLocals = [];
|
|
298
|
+
let localBase = 0;
|
|
299
|
+
const local = (index) => localBase + index;
|
|
300
|
+
const scratch = (type) => {
|
|
301
|
+
extraLocals.push(type);
|
|
302
|
+
return localBase + program.locals + extraLocals.length - 1;
|
|
303
|
+
};
|
|
304
|
+
let rowLocal = 0;
|
|
305
|
+
/** For `up`: the current row's parent row. */
|
|
306
|
+
let parentLocal = 0;
|
|
307
|
+
const address = (column) => {
|
|
308
|
+
code.push(op.localGet, ...unsigned(columnParameter(column)), op.localGet, ...unsigned(rowLocal), op.i32Const, ...signed(columns[column].stride), op.i32Mul, op.i32Add);
|
|
309
|
+
};
|
|
310
|
+
/** Leaves the JS `ToInt32` of the f64 on the stack as an i32: exact for every finite value; NaN and infinities give 0. */
|
|
311
|
+
const emitToInt32 = () => {
|
|
312
|
+
const value = scratch(f64Type);
|
|
313
|
+
code.push(op.localTee, ...unsigned(value));
|
|
314
|
+
code.push(op.localGet, ...unsigned(value), op.f64Const, ...float64(2 ** -32), op.f64Mul, op.f64Trunc, op.f64Const, ...float64(2 ** 32), op.f64Mul, op.f64Sub);
|
|
315
|
+
code.push(...i64TruncSatF64S, op.i32WrapI64);
|
|
316
|
+
};
|
|
317
|
+
/** Leaves 1 (i32) if the f64 on the stack is truthy: not 0, -0 or NaN. */
|
|
318
|
+
const emitTruthy = (type) => {
|
|
319
|
+
if (type === "boolean") {
|
|
320
|
+
code.push(op.f64Const, ...float64(0), op.f64Ne);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
const value = scratch(f64Type);
|
|
324
|
+
code.push(op.localTee, ...unsigned(value), op.f64Const, ...float64(0), op.f64Ne, op.localGet, ...unsigned(value), op.localGet, ...unsigned(value), op.f64Eq, op.i32And);
|
|
325
|
+
};
|
|
326
|
+
const emitCall = (functionName) => {
|
|
327
|
+
code.push(op.call, ...unsigned(importOf(functionName)));
|
|
328
|
+
};
|
|
329
|
+
const emit = (expression) => {
|
|
330
|
+
switch (expression.kind) {
|
|
331
|
+
case "number":
|
|
332
|
+
code.push(op.f64Const, ...float64(expression.value));
|
|
333
|
+
return;
|
|
334
|
+
case "boolean":
|
|
335
|
+
code.push(op.f64Const, ...float64(expression.value ? 1 : 0));
|
|
336
|
+
return;
|
|
337
|
+
case "local":
|
|
338
|
+
code.push(op.localGet, ...unsigned(local(expression.local)));
|
|
339
|
+
return;
|
|
340
|
+
case "resource":
|
|
341
|
+
case "args": {
|
|
342
|
+
const scalar = expression.kind === "args" ? { source: "args", path: expression.path } : { source: "resource", index: expression.index, path: expression.path };
|
|
343
|
+
code.push(op.localGet, ...unsigned(scalarParameter(scalarOf(scalar))));
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
case "upFound":
|
|
347
|
+
code.push(op.localGet, ...unsigned(upParameter(2)), op.f64ConvertI32U);
|
|
348
|
+
return;
|
|
349
|
+
case "upLeaf":
|
|
350
|
+
case "column": {
|
|
351
|
+
const { view, offset, boolean } = expression.kind === "upLeaf" ? upColumns[expression.column] : columns[expression.column];
|
|
352
|
+
if (expression.kind === "upLeaf") {
|
|
353
|
+
code.push(op.localGet, ...unsigned(upParameter(3 + expression.column)), op.localGet, ...unsigned(parentLocal), op.i32Const, ...signed(upColumns[expression.column].stride), op.i32Mul, op.i32Add);
|
|
354
|
+
}
|
|
355
|
+
else
|
|
356
|
+
address(expression.column);
|
|
357
|
+
const memory = (align) => [align, ...unsigned(offset)];
|
|
358
|
+
if (boolean) {
|
|
359
|
+
code.push(view === "u8" ? op.i32Load8u : op.i32Load, ...memory(view === "u8" ? 0 : 2), op.i32Const, 0, 0x47 /* i32.ne */, op.f64ConvertI32U);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
switch (view) {
|
|
363
|
+
case "f32":
|
|
364
|
+
code.push(op.f32Load, ...memory(2), op.f64PromoteF32);
|
|
365
|
+
return;
|
|
366
|
+
case "i32":
|
|
367
|
+
code.push(op.i32Load, ...memory(2), op.f64ConvertI32S);
|
|
368
|
+
return;
|
|
369
|
+
case "u32":
|
|
370
|
+
code.push(op.i32Load, ...memory(2), op.f64ConvertI32U);
|
|
371
|
+
return;
|
|
372
|
+
case "u8":
|
|
373
|
+
code.push(op.i32Load8u, ...memory(0), op.f64ConvertI32U);
|
|
374
|
+
return;
|
|
375
|
+
default:
|
|
376
|
+
code.push(op.f64Load, ...memory(3));
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
case "unary":
|
|
381
|
+
emit(expression.operand);
|
|
382
|
+
if (expression.operator === "-")
|
|
383
|
+
code.push(op.f64Neg);
|
|
384
|
+
else if (expression.operator === "!") {
|
|
385
|
+
emitTruthy(typeOf(expression.operand));
|
|
386
|
+
code.push(op.i32Eqz, op.f64ConvertI32U);
|
|
387
|
+
}
|
|
388
|
+
else if (expression.operator === "~") {
|
|
389
|
+
emitToInt32();
|
|
390
|
+
code.push(op.i32Const, ...signed(-1), op.i32Xor, op.f64ConvertI32S);
|
|
391
|
+
}
|
|
392
|
+
return;
|
|
393
|
+
case "binary": return emitBinary(expression);
|
|
394
|
+
case "logical": {
|
|
395
|
+
const type = typeOf(expression.left);
|
|
396
|
+
const value = scratch(f64Type);
|
|
397
|
+
emit(expression.left);
|
|
398
|
+
code.push(op.localTee, ...unsigned(value));
|
|
399
|
+
emitTruthy(type);
|
|
400
|
+
code.push(op.if, f64Type);
|
|
401
|
+
if (expression.operator === "&&")
|
|
402
|
+
emit(expression.right);
|
|
403
|
+
else
|
|
404
|
+
code.push(op.localGet, ...unsigned(value));
|
|
405
|
+
code.push(op.else);
|
|
406
|
+
if (expression.operator === "&&")
|
|
407
|
+
code.push(op.localGet, ...unsigned(value));
|
|
408
|
+
else
|
|
409
|
+
emit(expression.right);
|
|
410
|
+
code.push(op.end);
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
case "conditional":
|
|
414
|
+
emit(expression.test);
|
|
415
|
+
emitTruthy(typeOf(expression.test));
|
|
416
|
+
code.push(op.if, f64Type);
|
|
417
|
+
emit(expression.consequent);
|
|
418
|
+
code.push(op.else);
|
|
419
|
+
emit(expression.alternate);
|
|
420
|
+
code.push(op.end);
|
|
421
|
+
return;
|
|
422
|
+
case "math": return emitMath(expression.name, expression.arguments);
|
|
423
|
+
case "found":
|
|
424
|
+
code.push(op.localGet, ...unsigned(handleLocal(expression.handle, "found")), op.f64ConvertI32U);
|
|
425
|
+
return;
|
|
426
|
+
case "lookupLeaf": return emitLookupLeaf(expression.handle, expression.read, expression.path);
|
|
427
|
+
case "listLength": return emitListLength(expression.handle);
|
|
428
|
+
case "listChanged": return emitListChanged(expression.handle);
|
|
429
|
+
case "rowLeaf": return emitRowLeaf(expression.handle, expression.leaf);
|
|
430
|
+
case "rowEntity": return emitRowEntity(expression.handle);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
const emitMath = (functionName, parameters) => {
|
|
434
|
+
if (!native.has(functionName)) {
|
|
435
|
+
// Imported functions take two f64s; unary ones ignore the second.
|
|
436
|
+
if (parameters.length > 2)
|
|
437
|
+
throw unsupported;
|
|
438
|
+
for (const parameter of parameters)
|
|
439
|
+
emit(parameter);
|
|
440
|
+
for (let i = parameters.length; i < 2; i++)
|
|
441
|
+
code.push(op.f64Const, ...float64(NaN));
|
|
442
|
+
emitCall(functionName);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
switch (functionName) {
|
|
446
|
+
case "min":
|
|
447
|
+
case "max": {
|
|
448
|
+
if (parameters.length === 0) {
|
|
449
|
+
code.push(op.f64Const, ...float64(functionName === "min" ? Infinity : -Infinity));
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
emit(parameters[0]);
|
|
453
|
+
// JS converts every argument, so `Math.max(x)` is `+x`.
|
|
454
|
+
for (const parameter of parameters.slice(1)) {
|
|
455
|
+
emit(parameter);
|
|
456
|
+
code.push(functionName === "min" ? op.f64Min : op.f64Max);
|
|
457
|
+
}
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
case "imul":
|
|
461
|
+
emit(parameters[0] ?? { kind: "number", value: 0 });
|
|
462
|
+
emitToInt32();
|
|
463
|
+
emit(parameters[1] ?? { kind: "number", value: 0 });
|
|
464
|
+
emitToInt32();
|
|
465
|
+
code.push(op.i32Mul, op.f64ConvertI32S);
|
|
466
|
+
return;
|
|
467
|
+
case "clz32":
|
|
468
|
+
emit(parameters[0] ?? { kind: "number", value: 0 });
|
|
469
|
+
emitToInt32();
|
|
470
|
+
code.push(op.i32Clz, op.f64ConvertI32U);
|
|
471
|
+
return;
|
|
472
|
+
case "fround":
|
|
473
|
+
emit(parameters[0] ?? { kind: "number", value: NaN });
|
|
474
|
+
code.push(op.f32DemoteF64, op.f64PromoteF32);
|
|
475
|
+
return;
|
|
476
|
+
default: {
|
|
477
|
+
emit(parameters[0] ?? { kind: "number", value: NaN });
|
|
478
|
+
const unary = { abs: op.f64Abs, sqrt: op.f64Sqrt, floor: op.f64Floor, ceil: op.f64Ceil, trunc: op.f64Trunc }[functionName];
|
|
479
|
+
if (unary === undefined)
|
|
480
|
+
throw unsupported;
|
|
481
|
+
code.push(unary);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
const comparisons = { "<": op.f64Lt, ">": op.f64Gt, "<=": op.f64Le, ">=": op.f64Ge, "==": op.f64Eq, "!=": op.f64Ne, "===": op.f64Eq, "!==": op.f64Ne };
|
|
486
|
+
const arithmetic = { "+": op.f64Add, "-": op.f64Sub, "*": op.f64Mul, "/": op.f64Div };
|
|
487
|
+
const bitwise = { "&": op.i32And, "|": op.i32Or, "^": op.i32Xor, "<<": op.i32Shl, ">>": op.i32ShrS, ">>>": op.i32ShrU };
|
|
488
|
+
const emitBinary = (expression) => {
|
|
489
|
+
const { operator, left, right } = expression;
|
|
490
|
+
if (operator === "===" || operator === "!==") {
|
|
491
|
+
const leftType = typeOf(left);
|
|
492
|
+
const rightType = typeOf(right);
|
|
493
|
+
if (leftType === "mixed" || rightType === "mixed")
|
|
494
|
+
throw unsupported;
|
|
495
|
+
// A boolean never strictly equals a number. Operands are pure, so they needn't be evaluated.
|
|
496
|
+
if (leftType !== rightType) {
|
|
497
|
+
code.push(op.f64Const, ...float64(operator === "===" ? 0 : 1));
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
// Integers by a nonzero literal: i64 remainder is exact, and copysign gives JS's -0 for a negative dividend.
|
|
502
|
+
if (operator === "%" && integral(left) && right.kind === "number" && right.value !== 0 && integral(right)) {
|
|
503
|
+
const dividend = scratch(f64Type);
|
|
504
|
+
emit(left);
|
|
505
|
+
code.push(op.localTee, ...unsigned(dividend), ...i64TruncSatF64S, op.i64Const, ...signed(right.value), op.i64RemS, op.f64ConvertI64S, op.localGet, ...unsigned(dividend), op.f64Copysign);
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
if (operator === "%" || operator === "**") {
|
|
509
|
+
emit(left);
|
|
510
|
+
emit(right);
|
|
511
|
+
emitCall(operator === "%" ? "remainder" : "power");
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
emit(left);
|
|
515
|
+
if (operator in bitwise) {
|
|
516
|
+
emitToInt32();
|
|
517
|
+
emit(right);
|
|
518
|
+
emitToInt32();
|
|
519
|
+
code.push(bitwise[operator]);
|
|
520
|
+
code.push(operator === ">>>" ? op.f64ConvertI32U : op.f64ConvertI32S);
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
emit(right);
|
|
524
|
+
if (operator in arithmetic) {
|
|
525
|
+
code.push(arithmetic[operator]);
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
code.push(comparisons[operator], op.f64ConvertI32U);
|
|
529
|
+
};
|
|
530
|
+
/** Labels from innermost: program blocks and loops count toward IR depths; `if`s and the row block don't. */
|
|
531
|
+
const labels = [];
|
|
532
|
+
const wasmDepth = (depth) => {
|
|
533
|
+
let seen = -1;
|
|
534
|
+
for (let i = labels.length - 1; i >= 0; i--) {
|
|
535
|
+
if (labels[i] === "program" && ++seen === depth)
|
|
536
|
+
return labels.length - 1 - i;
|
|
537
|
+
}
|
|
538
|
+
throw unsupported;
|
|
539
|
+
};
|
|
540
|
+
const store = (column, value) => {
|
|
541
|
+
const { view, offset } = columns[column];
|
|
542
|
+
address(column);
|
|
543
|
+
if (value === "tick")
|
|
544
|
+
code.push(op.localGet, 2);
|
|
545
|
+
else
|
|
546
|
+
emit(value);
|
|
547
|
+
const memory = (align) => [align, ...unsigned(offset)];
|
|
548
|
+
switch (view) {
|
|
549
|
+
case "f32":
|
|
550
|
+
code.push(op.f32DemoteF64, op.f32Store, ...memory(2));
|
|
551
|
+
return;
|
|
552
|
+
case "i32":
|
|
553
|
+
case "u32":
|
|
554
|
+
emitToInt32();
|
|
555
|
+
code.push(op.i32Store, ...memory(2));
|
|
556
|
+
return;
|
|
557
|
+
case "u8":
|
|
558
|
+
emitToInt32();
|
|
559
|
+
code.push(op.i32Store8, ...memory(0));
|
|
560
|
+
return;
|
|
561
|
+
default:
|
|
562
|
+
code.push(op.f64Store, ...memory(3));
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
/**
|
|
567
|
+
* Chunk columns stamped by every row: top-level stamps with no `next` before them, in an unfiltered kernel.
|
|
568
|
+
* Their chunks are stamped once per call, for the whole range, instead of on each row.
|
|
569
|
+
*/
|
|
570
|
+
const everyRow = new Set();
|
|
571
|
+
// Listed rows needn't be consecutive, so each stamps its own chunk.
|
|
572
|
+
if (filters === 0 && !upMode) {
|
|
573
|
+
const ends = (statement) => statement.kind === "next" || (statement.kind === "if" && (statement.consequent.some(ends) || statement.alternate.some(ends)))
|
|
574
|
+
|| ((statement.kind === "block" || statement.kind === "loop") && statement.body.some(ends));
|
|
575
|
+
for (const statement of program.body) {
|
|
576
|
+
if (ends(statement))
|
|
577
|
+
break;
|
|
578
|
+
if (statement.kind === "stamp" && columns[statement.chunks].muted !== true)
|
|
579
|
+
everyRow.add(statement.chunks);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
/** Stamps every chunk from `start`'s to `end - 1`'s, for the chunk columns every row stamps. */
|
|
583
|
+
const stampRangeChunks = () => {
|
|
584
|
+
for (const chunks of everyRow) {
|
|
585
|
+
const chunk = scratch(i32Type);
|
|
586
|
+
const last = scratch(i32Type);
|
|
587
|
+
// if (start < end) for (chunk = start >> shift; chunk <= (end - 1) >> shift; chunk++) chunks[chunk] = tick
|
|
588
|
+
code.push(op.localGet, 0, op.localGet, 1, op.i32LtS, op.if, 0x40);
|
|
589
|
+
code.push(op.localGet, 0, op.i32Const, ...signed(chunkShift), op.i32ShrU, op.localSet, ...unsigned(chunk));
|
|
590
|
+
code.push(op.localGet, 1, op.i32Const, 1, op.i32Sub, op.i32Const, ...signed(chunkShift), op.i32ShrU, op.localSet, ...unsigned(last));
|
|
591
|
+
code.push(op.loop, 0x40);
|
|
592
|
+
code.push(op.localGet, ...unsigned(columnParameter(chunks)), op.localGet, ...unsigned(chunk), op.i32Const, 3, op.i32Shl, op.i32Add, op.localGet, 2, op.f64Store, 3, 0);
|
|
593
|
+
code.push(op.localGet, ...unsigned(chunk), op.i32Const, 1, op.i32Add, op.localTee, ...unsigned(chunk), op.localGet, ...unsigned(last), op.i32LeS, op.brIf, 0);
|
|
594
|
+
code.push(op.end, op.end);
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
// ---- Lookups: a find checks the entity table and the lookup's directory record; leaves read through the record. ----
|
|
598
|
+
/** i32 locals holding the lookup parameters, converted once per call. */
|
|
599
|
+
let lookupLocals = [];
|
|
600
|
+
const convertLookupParameters = () => {
|
|
601
|
+
lookupLocals = [];
|
|
602
|
+
// The `lastRun` lookups watching compare with stays an f64 parameter.
|
|
603
|
+
for (let index = 0; index < lookupParameters - (watching ? 1 : 0); index++) {
|
|
604
|
+
const target = scratch(i32Type);
|
|
605
|
+
code.push(op.localGet, ...unsigned(lookupParameter(index)), ...truncations.i32TruncSatF64U, op.localSet, ...unsigned(target));
|
|
606
|
+
lookupLocals.push(target);
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
const entityArchetypes = () => lookupLocals[0];
|
|
610
|
+
const entityRows = () => lookupLocals[1];
|
|
611
|
+
const entityGenerations = () => lookupLocals[2];
|
|
612
|
+
const entityCount = () => lookupLocals[3];
|
|
613
|
+
const directory = (lookup) => lookupLocals[4 + 2 * lookup];
|
|
614
|
+
const directoryCount = (lookup) => lookupLocals[5 + 2 * lookup];
|
|
615
|
+
/** Per handle: whether found, the row, and the address of its directory record. */
|
|
616
|
+
const handleLocals = new Map();
|
|
617
|
+
const handleLocal = (handle, part) => {
|
|
618
|
+
const key = `${handle}:${part}`;
|
|
619
|
+
let index = handleLocals.get(key);
|
|
620
|
+
if (index === undefined)
|
|
621
|
+
handleLocals.set(key, index = scratch(i32Type));
|
|
622
|
+
return index;
|
|
623
|
+
};
|
|
624
|
+
const emitFind = (handle, lookup, entity) => {
|
|
625
|
+
const found = handleLocal(handle, "found");
|
|
626
|
+
const row = handleLocal(handle, "row");
|
|
627
|
+
const record = handleLocal(handle, "record");
|
|
628
|
+
const value = scratch(f64Type);
|
|
629
|
+
const wide = scratch(0x7e);
|
|
630
|
+
const generation = scratch(f64Type);
|
|
631
|
+
const index = scratch(i32Type);
|
|
632
|
+
const archetype = scratch(i32Type);
|
|
633
|
+
const words = 1 + lookups[lookup].reads + (lookups[lookup].watched ?? 0);
|
|
634
|
+
code.push(op.i32Const, 0, op.localSet, ...unsigned(found));
|
|
635
|
+
// As JS `locate`: the index is ToUint32 of the entity and the generation is floor(entity / 2^32), compared as
|
|
636
|
+
// numbers, so negative, fractional and NaN entities behave exactly as they do there.
|
|
637
|
+
emit(entity);
|
|
638
|
+
code.push(op.localTee, ...unsigned(value));
|
|
639
|
+
// Real entities are non-negative integers: one i64 gives both parts. Anything else takes the general path.
|
|
640
|
+
code.push(...i64TruncSatF64S, op.localTee, ...unsigned(wide), op.f64ConvertI64S, op.localGet, ...unsigned(value), op.f64Eq);
|
|
641
|
+
code.push(op.localGet, ...unsigned(value), op.f64Const, ...float64(0), op.f64Ge, op.i32And);
|
|
642
|
+
code.push(op.if, 0x40);
|
|
643
|
+
code.push(op.localGet, ...unsigned(wide), op.i32WrapI64, op.localSet, ...unsigned(index));
|
|
644
|
+
code.push(op.localGet, ...unsigned(wide), op.i64Const, 32, op.i64ShrU, op.f64ConvertI64S, op.localSet, ...unsigned(generation));
|
|
645
|
+
code.push(op.else);
|
|
646
|
+
code.push(op.localGet, ...unsigned(value));
|
|
647
|
+
emitToInt32();
|
|
648
|
+
code.push(op.localSet, ...unsigned(index));
|
|
649
|
+
code.push(op.localGet, ...unsigned(value), op.f64Const, ...float64(2 ** -32), op.f64Mul, op.f64Floor, op.localSet, ...unsigned(generation));
|
|
650
|
+
code.push(op.end);
|
|
651
|
+
code.push(op.block, 0x40);
|
|
652
|
+
labels.push("if");
|
|
653
|
+
code.push(op.localGet, ...unsigned(index), op.localGet, ...unsigned(entityCount()), op.i32GeU, op.brIf, 0);
|
|
654
|
+
code.push(op.localGet, ...unsigned(entityGenerations()), op.localGet, ...unsigned(index), op.i32Const, 2, op.i32Shl, op.i32Add, op.i32Load, 2, 0, op.f64ConvertI32U);
|
|
655
|
+
code.push(op.localGet, ...unsigned(generation), op.f64Ne, op.brIf, 0);
|
|
656
|
+
code.push(op.localGet, ...unsigned(entityArchetypes()), op.localGet, ...unsigned(index), op.i32Const, 2, op.i32Shl, op.i32Add, op.i32Load, 2, 0, op.localTee, ...unsigned(archetype));
|
|
657
|
+
code.push(op.i32Const, 0, op.i32LtS, op.brIf, 0);
|
|
658
|
+
code.push(op.localGet, ...unsigned(archetype), op.localGet, ...unsigned(directoryCount(lookup)), op.i32GeS, op.brIf, 0);
|
|
659
|
+
code.push(op.localGet, ...unsigned(directory(lookup)), op.localGet, ...unsigned(archetype), op.i32Const, ...signed(4 * words), op.i32Mul, op.i32Add, op.localTee, ...unsigned(record));
|
|
660
|
+
code.push(op.i32Load, 2, 0, op.i32Eqz, op.brIf, 0);
|
|
661
|
+
code.push(op.localGet, ...unsigned(entityRows()), op.localGet, ...unsigned(index), op.i32Const, 2, op.i32Shl, op.i32Add, op.i32Load, 2, 0, op.localSet, ...unsigned(row));
|
|
662
|
+
code.push(op.i32Const, 1, op.localSet, ...unsigned(found));
|
|
663
|
+
labels.pop();
|
|
664
|
+
code.push(op.end);
|
|
665
|
+
};
|
|
666
|
+
/**
|
|
667
|
+
* A found entity's `changed`: whether a watched component's tick at its row is newer than the lookups' `lastRun`,
|
|
668
|
+
* or one keeps no ticks, as 0 or 1; NaN if nothing was found.
|
|
669
|
+
*/
|
|
670
|
+
const emitChanged = (handle, lookup) => {
|
|
671
|
+
const { reads, watched = 0 } = lookups[lookup];
|
|
672
|
+
const since = lookupParameter(lookupParameters - 1);
|
|
673
|
+
const changed = scratch(i32Type);
|
|
674
|
+
const address = scratch(i32Type);
|
|
675
|
+
code.push(op.localGet, ...unsigned(handleLocal(handle, "found")), op.if, f64Type);
|
|
676
|
+
labels.push("if");
|
|
677
|
+
code.push(op.i32Const, 0, op.localSet, ...unsigned(changed));
|
|
678
|
+
for (let w = 0; w < watched; w++) {
|
|
679
|
+
code.push(op.localGet, ...unsigned(handleLocal(handle, "record")), op.i32Load, 2, ...unsigned(4 * (1 + reads + w)), op.localTee, ...unsigned(address));
|
|
680
|
+
code.push(op.i32Eqz, op.if, i32Type);
|
|
681
|
+
labels.push("if");
|
|
682
|
+
code.push(op.i32Const, 1);
|
|
683
|
+
code.push(op.else);
|
|
684
|
+
code.push(op.localGet, ...unsigned(address), op.localGet, ...unsigned(handleLocal(handle, "row")), op.i32Const, 3, op.i32Shl, op.i32Add, op.f64Load, 3, 0);
|
|
685
|
+
code.push(op.localGet, ...unsigned(since), op.f64Gt);
|
|
686
|
+
code.push(op.end);
|
|
687
|
+
labels.pop();
|
|
688
|
+
code.push(op.localGet, ...unsigned(changed), op.i32Or, op.localSet, ...unsigned(changed));
|
|
689
|
+
}
|
|
690
|
+
code.push(op.localGet, ...unsigned(changed), op.f64ConvertI32U);
|
|
691
|
+
code.push(op.else, op.f64Const, ...float64(NaN), op.end);
|
|
692
|
+
labels.pop();
|
|
693
|
+
};
|
|
694
|
+
const emitLookupLeaf = (handle, read, path) => {
|
|
695
|
+
const lookup = lookupOfHandle.get(handle);
|
|
696
|
+
if (lookup !== undefined && isChanged(lookup, read)) {
|
|
697
|
+
if (path.length > 0)
|
|
698
|
+
throw unsupported;
|
|
699
|
+
emitChanged(handle, lookup);
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
const leaf = lookup === undefined ? null : lookups[lookup].leaf(read, path);
|
|
703
|
+
if (leaf === null)
|
|
704
|
+
throw unsupported;
|
|
705
|
+
const { view, stride, offset, boolean } = leaf;
|
|
706
|
+
code.push(op.localGet, ...unsigned(handleLocal(handle, "found")), op.if, f64Type);
|
|
707
|
+
labels.push("if");
|
|
708
|
+
// The column's address from the record, then the row's element.
|
|
709
|
+
code.push(op.localGet, ...unsigned(handleLocal(handle, "record")), op.i32Load, 2, ...unsigned(4 * (1 + read)));
|
|
710
|
+
code.push(op.localGet, ...unsigned(handleLocal(handle, "row")), op.i32Const, ...signed(stride), op.i32Mul, op.i32Add);
|
|
711
|
+
const memory = (align) => [align, ...unsigned(offset)];
|
|
712
|
+
if (boolean)
|
|
713
|
+
code.push(view === "u8" ? op.i32Load8u : op.i32Load, ...memory(view === "u8" ? 0 : 2), op.i32Const, 0, op.i32Ne, op.f64ConvertI32U);
|
|
714
|
+
else if (view === "f32")
|
|
715
|
+
code.push(op.f32Load, ...memory(2), op.f64PromoteF32);
|
|
716
|
+
else if (view === "i32")
|
|
717
|
+
code.push(op.i32Load, ...memory(2), op.f64ConvertI32S);
|
|
718
|
+
else if (view === "u32")
|
|
719
|
+
code.push(op.i32Load, ...memory(2), op.f64ConvertI32U);
|
|
720
|
+
else if (view === "u8")
|
|
721
|
+
code.push(op.i32Load8u, ...memory(0), op.f64ConvertI32U);
|
|
722
|
+
else
|
|
723
|
+
code.push(op.f64Load, ...memory(3));
|
|
724
|
+
code.push(op.else, op.f64Const, ...float64(NaN), op.end);
|
|
725
|
+
labels.pop();
|
|
726
|
+
};
|
|
727
|
+
// ---- Lookups through indexes: probes of a hash table or searches of a sorted index's blocks, and their lists' rows. ----
|
|
728
|
+
const get = (index) => [op.localGet, ...unsigned(index)];
|
|
729
|
+
const put = (index) => [op.localSet, ...unsigned(index)];
|
|
730
|
+
const tee = (index) => [op.localTee, ...unsigned(index)];
|
|
731
|
+
const constant = (value) => [op.i32Const, ...signed(value | 0)];
|
|
732
|
+
const load = (offset) => [op.i32Load, 2, ...unsigned(offset)];
|
|
733
|
+
/** By lookup through an index, its parameters as locals: addresses and counts as i32, ticks as f64. */
|
|
734
|
+
let indexLocals = [];
|
|
735
|
+
/** Which of a hash index's and a sorted index's parameters are f64. */
|
|
736
|
+
const hashTicks = new Set([5, 6]);
|
|
737
|
+
const sortedTicks = new Set([9, 10]);
|
|
738
|
+
const convertIndexParameters = () => {
|
|
739
|
+
indexLocals = [];
|
|
740
|
+
for (let lookup = 0; lookup < lookups.length; lookup++) {
|
|
741
|
+
const index = indexLookups[lookup];
|
|
742
|
+
const locals = [];
|
|
743
|
+
indexLocals.push(locals);
|
|
744
|
+
if (index === null || index === undefined)
|
|
745
|
+
continue;
|
|
746
|
+
const ticks = index.kind === "hash" ? hashTicks : sortedTicks;
|
|
747
|
+
for (let k = 0; k < indexParameterCount(index); k++) {
|
|
748
|
+
const f64 = ticks.has(k);
|
|
749
|
+
const target = scratch(f64 ? f64Type : i32Type);
|
|
750
|
+
code.push(...get(indexParameter(lookup, k)));
|
|
751
|
+
if (!f64)
|
|
752
|
+
code.push(...truncations.i32TruncSatF64U);
|
|
753
|
+
code.push(...put(target));
|
|
754
|
+
locals.push(target);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
const indexLocal = (lookup, k) => indexLocals[lookup][k];
|
|
759
|
+
/** The lookup a handle is of, and its index's description. */
|
|
760
|
+
const indexOf = (handle) => {
|
|
761
|
+
const lookup = lookupOfHandle.get(handle);
|
|
762
|
+
const index = lookup === undefined ? undefined : indexLookups[lookup];
|
|
763
|
+
if (lookup === undefined || index === null || index === undefined)
|
|
764
|
+
throw unsupported;
|
|
765
|
+
return { lookup, index };
|
|
766
|
+
};
|
|
767
|
+
/** A list handle's i32 locals: a hash list's start, length and bucket; a sorted list's runs and cursor. */
|
|
768
|
+
const listLocal = (handle, part) => {
|
|
769
|
+
const key = `${handle}:list:${part}`;
|
|
770
|
+
let index = handleLocals.get(key);
|
|
771
|
+
if (index === undefined)
|
|
772
|
+
handleLocals.set(key, index = scratch(i32Type));
|
|
773
|
+
return index;
|
|
774
|
+
};
|
|
775
|
+
/** The key's words of a lookup's probes, as i32 locals. */
|
|
776
|
+
const keyLocals = new Map();
|
|
777
|
+
const keyLocal = (lookup, word) => {
|
|
778
|
+
const key = `${lookup}:${word}`;
|
|
779
|
+
let index = keyLocals.get(key);
|
|
780
|
+
if (index === undefined)
|
|
781
|
+
keyLocals.set(key, index = scratch(i32Type));
|
|
782
|
+
return index;
|
|
783
|
+
};
|
|
784
|
+
/** Encodes the f64 on the stack, converted to `value`'s stored type as a store converts it, into the key's words where it goes. */
|
|
785
|
+
const encodeKey = (lookup, value) => {
|
|
786
|
+
const word = keyLocal(lookup, value.word);
|
|
787
|
+
switch (value.scalar) {
|
|
788
|
+
case "i32":
|
|
789
|
+
emitToInt32();
|
|
790
|
+
code.push(...constant(0x80000000), op.i32Xor, ...put(word));
|
|
791
|
+
return;
|
|
792
|
+
case "u32":
|
|
793
|
+
emitToInt32();
|
|
794
|
+
code.push(...put(word));
|
|
795
|
+
return;
|
|
796
|
+
case "boolean":
|
|
797
|
+
emitToInt32();
|
|
798
|
+
code.push(...constant(0xFF), op.i32And, ...constant(0), op.i32Ne, ...put(word));
|
|
799
|
+
return;
|
|
800
|
+
case "f32": {
|
|
801
|
+
const bits = scratch(i32Type);
|
|
802
|
+
code.push(op.f32DemoteF64, op.i32ReinterpretF32, ...tee(bits));
|
|
803
|
+
// NaN last, -0 as +0, a negative's bits flipped, a positive's sign set.
|
|
804
|
+
code.push(...constant(0x7F800000), op.i32And, ...constant(0x7F800000), op.i32Eq);
|
|
805
|
+
code.push(...get(bits), ...constant(0x7FFFFF), op.i32And, ...constant(0), op.i32Ne, op.i32And);
|
|
806
|
+
code.push(op.if, i32Type, ...constant(-1), op.else);
|
|
807
|
+
code.push(...get(bits), ...constant(0x80000000), op.i32Eq, op.if, i32Type, ...constant(0x80000000), op.else);
|
|
808
|
+
code.push(...get(bits), ...constant(31), op.i32ShrU, op.if, i32Type, ...get(bits), ...constant(-1), op.i32Xor, op.else, ...get(bits), ...constant(0x80000000), op.i32Or, op.end);
|
|
809
|
+
code.push(op.end, op.end, ...put(word));
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
default: {
|
|
813
|
+
const wide = scratch(0x7e);
|
|
814
|
+
const high = scratch(i32Type);
|
|
815
|
+
const low = scratch(i32Type);
|
|
816
|
+
const next = keyLocal(lookup, value.word + 1);
|
|
817
|
+
code.push(op.i64ReinterpretF64, ...tee(wide), op.i64Const, 32, op.i64ShrU, op.i32WrapI64, ...put(high));
|
|
818
|
+
code.push(...get(wide), op.i32WrapI64, ...put(low));
|
|
819
|
+
code.push(...get(high), ...constant(0x7FF00000), op.i32And, ...constant(0x7FF00000), op.i32Eq);
|
|
820
|
+
code.push(...get(high), ...constant(0xFFFFF), op.i32And, ...get(low), op.i32Or, ...constant(0), op.i32Ne, op.i32And);
|
|
821
|
+
code.push(op.if, 0x40, ...constant(-1), ...put(word), ...constant(-1), ...put(next), op.else);
|
|
822
|
+
code.push(...get(high), ...constant(0x80000000), op.i32Eq, ...get(low), op.i32Eqz, op.i32And);
|
|
823
|
+
code.push(op.if, 0x40, ...constant(0x80000000), ...put(word), ...constant(0), ...put(next), op.else);
|
|
824
|
+
code.push(...get(high), ...constant(31), op.i32ShrU);
|
|
825
|
+
code.push(op.if, 0x40, ...get(high), ...constant(-1), op.i32Xor, ...put(word), ...get(low), ...constant(-1), op.i32Xor, ...put(next));
|
|
826
|
+
code.push(op.else, ...get(high), ...constant(0x80000000), op.i32Or, ...put(word), ...get(low), ...put(next), op.end);
|
|
827
|
+
code.push(op.end, op.end);
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
/** Points row handle `row` at an entry's archetype and row, found when its archetype holds what the lookup reads. */
|
|
833
|
+
const bindRow = (row, lookup, archetype, entryRow) => {
|
|
834
|
+
const found = handleLocal(row, "found");
|
|
835
|
+
const record = handleLocal(row, "record");
|
|
836
|
+
const words = 1 + lookups[lookup].reads;
|
|
837
|
+
code.push(...constant(0), ...put(found));
|
|
838
|
+
code.push(op.block, 0x40);
|
|
839
|
+
code.push(...get(archetype), ...get(directoryCount(lookup)), op.i32GeU, op.brIf, 0);
|
|
840
|
+
code.push(...get(directory(lookup)), ...get(archetype), ...constant(4 * words), op.i32Mul, op.i32Add, ...tee(record));
|
|
841
|
+
code.push(...load(0), op.i32Eqz, op.brIf, 0);
|
|
842
|
+
code.push(...get(entryRow), ...put(handleLocal(row, "row")), ...constant(1), ...put(found));
|
|
843
|
+
code.push(op.end);
|
|
844
|
+
};
|
|
845
|
+
/** Fenwick tree sum of the lengths of the blocks before position `k` (an i32 local), left on the stack. */
|
|
846
|
+
const emitPrefix = (lookup, k) => {
|
|
847
|
+
const node = scratch(i32Type);
|
|
848
|
+
const sum = scratch(i32Type);
|
|
849
|
+
const counts = indexLocal(lookup, 5);
|
|
850
|
+
code.push(...constant(0), ...put(sum), ...get(k), ...put(node));
|
|
851
|
+
code.push(op.block, 0x40, op.loop, 0x40);
|
|
852
|
+
code.push(...get(node), op.i32Eqz, op.brIf, 1);
|
|
853
|
+
code.push(...get(sum), ...get(counts), ...get(node), ...constant(2), op.i32Shl, op.i32Add, ...load(0), op.i32Add, ...put(sum));
|
|
854
|
+
code.push(...get(node), ...get(node), ...constant(0), ...get(node), op.i32Sub, op.i32And, op.i32Sub, ...put(node), op.br, 0);
|
|
855
|
+
code.push(op.end, op.end, ...get(sum));
|
|
856
|
+
};
|
|
857
|
+
/** The position in `order` of the block holding entry position `position` (an i32 local), into `k`. */
|
|
858
|
+
const emitBlockAt = (lookup, position, k) => {
|
|
859
|
+
const remaining = scratch(i32Type);
|
|
860
|
+
const step = scratch(i32Type);
|
|
861
|
+
const next = scratch(i32Type);
|
|
862
|
+
const blocks = indexLocal(lookup, 1);
|
|
863
|
+
const counts = indexLocal(lookup, 5);
|
|
864
|
+
code.push(...constant(0), ...put(k), ...get(position), ...put(remaining));
|
|
865
|
+
// The largest power of two at most `blocks`, or 0 without blocks.
|
|
866
|
+
code.push(...get(blocks), op.i32Eqz, op.if, i32Type, ...constant(0), op.else, ...constant(1), ...constant(31), ...get(blocks), op.i32Clz, op.i32Sub, op.i32Shl, op.end, ...put(step));
|
|
867
|
+
code.push(op.block, 0x40, op.loop, 0x40);
|
|
868
|
+
code.push(...get(step), op.i32Eqz, op.brIf, 1);
|
|
869
|
+
code.push(...get(k), ...get(step), op.i32Add, ...tee(next), ...get(blocks), op.i32LeU);
|
|
870
|
+
code.push(op.if, 0x40);
|
|
871
|
+
code.push(...get(counts), ...get(next), ...constant(2), op.i32Shl, op.i32Add, ...load(0), ...get(remaining), op.i32LeU);
|
|
872
|
+
code.push(op.if, 0x40, ...get(next), ...put(k), ...get(remaining), ...get(counts), ...get(next), ...constant(2), op.i32Shl, op.i32Add, ...load(0), op.i32Sub, ...put(remaining), op.end);
|
|
873
|
+
code.push(op.end);
|
|
874
|
+
code.push(...get(step), ...constant(1), op.i32ShrU, ...put(step), op.br, 0);
|
|
875
|
+
code.push(op.end, op.end);
|
|
876
|
+
};
|
|
877
|
+
/**
|
|
878
|
+
* Leaves 1 when the key at `address` (an i32 local) passes against the key's first `count` words: after them, or
|
|
879
|
+
* with `after` false, not before them, comparing unsigned words in order.
|
|
880
|
+
*/
|
|
881
|
+
const emitPasses = (lookup, address, count, after) => {
|
|
882
|
+
const passes = scratch(i32Type);
|
|
883
|
+
const word = scratch(i32Type);
|
|
884
|
+
code.push(...constant(after ? 0 : 1), ...put(passes));
|
|
885
|
+
code.push(op.block, 0x40);
|
|
886
|
+
for (let w = 0; w < count; w++) {
|
|
887
|
+
code.push(...get(address), ...load(4 * w), ...tee(word), ...get(keyLocal(lookup, w)), op.i32Ne);
|
|
888
|
+
code.push(op.if, 0x40, ...get(word), ...get(keyLocal(lookup, w)), op.i32GtU, ...put(passes), op.br, 1, op.end);
|
|
889
|
+
}
|
|
890
|
+
code.push(op.end, ...get(passes));
|
|
891
|
+
};
|
|
892
|
+
/**
|
|
893
|
+
* The first entry position whose key's first `count` words pass, into `result`: a search over the blocks' fences,
|
|
894
|
+
* then within a block. A lower bound leaves the list's cursor at its block.
|
|
895
|
+
*/
|
|
896
|
+
const emitBound = (lookup, index, count, after, result, list) => {
|
|
897
|
+
if (count === 0) {
|
|
898
|
+
code.push(...(after ? get(indexLocal(lookup, 6)) : constant(0)), ...put(result));
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
const low = scratch(i32Type);
|
|
902
|
+
const high = scratch(i32Type);
|
|
903
|
+
const middle = scratch(i32Type);
|
|
904
|
+
const address = scratch(i32Type);
|
|
905
|
+
const block = scratch(i32Type);
|
|
906
|
+
const base = scratch(i32Type);
|
|
907
|
+
const fences = indexLocal(lookup, 0);
|
|
908
|
+
const blocks = indexLocal(lookup, 1);
|
|
909
|
+
const fenceBytes = 4 * (index.words + 1);
|
|
910
|
+
const entryBytes = 4 * index.stride;
|
|
911
|
+
const search = (from, length, at) => {
|
|
912
|
+
code.push(...constant(0), ...put(low));
|
|
913
|
+
length();
|
|
914
|
+
code.push(...put(high));
|
|
915
|
+
code.push(op.block, 0x40, op.loop, 0x40);
|
|
916
|
+
code.push(...get(low), ...get(high), op.i32GeU, op.brIf, 1);
|
|
917
|
+
code.push(...get(low), ...get(high), op.i32Add, ...constant(1), op.i32ShrU, ...put(middle));
|
|
918
|
+
at();
|
|
919
|
+
code.push(...put(address));
|
|
920
|
+
emitPasses(lookup, address, count, after);
|
|
921
|
+
code.push(op.if, 0x40, ...get(middle), ...put(high), op.else, ...get(middle), ...constant(1), op.i32Add, ...put(low), op.end);
|
|
922
|
+
code.push(op.br, 0, op.end, op.end);
|
|
923
|
+
void from;
|
|
924
|
+
};
|
|
925
|
+
search(() => { }, () => code.push(...get(blocks)), () => code.push(...get(fences), ...get(middle), ...constant(fenceBytes), op.i32Mul, op.i32Add));
|
|
926
|
+
// Past the last block: the size.
|
|
927
|
+
code.push(...get(low), ...get(blocks), op.i32GeU, op.if, 0x40, ...get(indexLocal(lookup, 6)), ...put(result), op.else);
|
|
928
|
+
const k = scratch(i32Type);
|
|
929
|
+
code.push(...get(low), ...put(k));
|
|
930
|
+
code.push(...get(indexLocal(lookup, 2)), ...get(k), ...constant(2), op.i32Shl, op.i32Add, ...load(0), ...put(block));
|
|
931
|
+
code.push(...get(indexLocal(lookup, 4)), ...get(block), ...constant(entryBytes * 128), op.i32Mul, op.i32Add, ...put(base));
|
|
932
|
+
search(() => { }, () => code.push(...get(indexLocal(lookup, 3)), ...get(block), ...constant(2), op.i32Shl, op.i32Add, ...load(0)), () => code.push(...get(base), ...get(middle), ...constant(entryBytes), op.i32Mul, op.i32Add));
|
|
933
|
+
emitPrefix(lookup, k);
|
|
934
|
+
if (!after) {
|
|
935
|
+
const first = scratch(i32Type);
|
|
936
|
+
code.push(...tee(first), ...get(low), op.i32Add, ...put(result));
|
|
937
|
+
code.push(...get(k), ...put(listLocal(list, "k")), ...get(first), ...put(listLocal(list, "first")));
|
|
938
|
+
code.push(...get(indexLocal(lookup, 3)), ...get(block), ...constant(2), op.i32Shl, op.i32Add, ...load(0), ...put(listLocal(list, "count")));
|
|
939
|
+
}
|
|
940
|
+
else
|
|
941
|
+
code.push(...get(low), op.i32Add, ...put(result));
|
|
942
|
+
code.push(op.end);
|
|
943
|
+
};
|
|
944
|
+
/** Looks a key up, into list handle `list`, and its first row into `first`. */
|
|
945
|
+
const emitProbe = (list, first, probe, values) => {
|
|
946
|
+
const { lookup, index } = indexOf(list);
|
|
947
|
+
const plan = index.probe(probe);
|
|
948
|
+
if (plan === null)
|
|
949
|
+
throw unsupported;
|
|
950
|
+
let next = 0;
|
|
951
|
+
const encode = (targets) => {
|
|
952
|
+
for (const target of targets) {
|
|
953
|
+
const value = values[next++];
|
|
954
|
+
if (value === undefined)
|
|
955
|
+
throw unsupported;
|
|
956
|
+
emit(value);
|
|
957
|
+
encodeKey(lookup, target);
|
|
958
|
+
}
|
|
959
|
+
};
|
|
960
|
+
encode(plan.values);
|
|
961
|
+
if (index.kind === "hash") {
|
|
962
|
+
const hash = scratch(i32Type);
|
|
963
|
+
const slot = scratch(i32Type);
|
|
964
|
+
const address = scratch(i32Type);
|
|
965
|
+
const filled = scratch(i32Type);
|
|
966
|
+
const base = scratch(i32Type);
|
|
967
|
+
const bucket = listLocal(list, "bucket");
|
|
968
|
+
const slots = indexLocal(lookup, 0);
|
|
969
|
+
const mask = indexLocal(lookup, 1);
|
|
970
|
+
const records = indexLocal(lookup, 2);
|
|
971
|
+
const recordBytes = 4 * index.stride;
|
|
972
|
+
code.push(...constant(0x811C9DC5), ...put(hash));
|
|
973
|
+
for (let w = 0; w < index.words; w++) {
|
|
974
|
+
code.push(...get(hash), ...get(keyLocal(lookup, w)), op.i32Xor, ...constant(0x9E3779B1), op.i32Mul, ...tee(hash), ...get(hash), ...constant(15), op.i32ShrU, op.i32Xor, ...put(hash));
|
|
975
|
+
}
|
|
976
|
+
code.push(...get(hash), ...get(hash), ...constant(16), op.i32ShrU, op.i32Xor, ...constant(0x85EBCA6B), op.i32Mul, ...put(hash));
|
|
977
|
+
code.push(...get(hash), ...get(hash), ...constant(13), op.i32ShrU, op.i32Xor, ...constant(0xC2B2AE35), op.i32Mul, ...put(hash));
|
|
978
|
+
code.push(...get(hash), ...get(hash), ...constant(16), op.i32ShrU, op.i32Xor, ...put(hash));
|
|
979
|
+
code.push(...get(hash), ...get(mask), op.i32And, ...put(slot), ...constant(-1), ...put(bucket));
|
|
980
|
+
code.push(op.block, 0x40, op.loop, 0x40);
|
|
981
|
+
code.push(...get(slots), ...get(slot), ...constant(8), op.i32Mul, op.i32Add, ...tee(address), ...load(4), ...tee(filled), op.i32Eqz, op.brIf, 1);
|
|
982
|
+
code.push(...get(address), ...load(0), ...get(hash), op.i32Eq, op.if, 0x40);
|
|
983
|
+
code.push(...get(records), ...get(filled), ...constant(1), op.i32Sub, ...constant(recordBytes), op.i32Mul, op.i32Add, ...put(base));
|
|
984
|
+
code.push(...constant(1));
|
|
985
|
+
for (let w = 0; w < index.words; w++)
|
|
986
|
+
code.push(...get(base), ...load(16 + 4 * w), ...get(keyLocal(lookup, w)), op.i32Eq, op.i32And);
|
|
987
|
+
code.push(op.if, 0x40, ...get(filled), ...constant(1), op.i32Sub, ...put(bucket), op.br, 3, op.end);
|
|
988
|
+
code.push(op.end);
|
|
989
|
+
code.push(...get(slot), ...constant(1), op.i32Add, ...get(mask), op.i32And, ...put(slot), op.br, 0);
|
|
990
|
+
code.push(op.end, op.end);
|
|
991
|
+
code.push(...get(bucket), ...constant(0), op.i32LtS, op.if, 0x40, ...constant(0), ...put(listLocal(list, "start")), ...constant(0), ...put(listLocal(list, "length")));
|
|
992
|
+
code.push(op.else);
|
|
993
|
+
code.push(...get(records), ...get(bucket), ...constant(recordBytes), op.i32Mul, op.i32Add, ...tee(base), ...load(4), ...put(listLocal(list, "start")));
|
|
994
|
+
code.push(...get(base), ...load(8), ...put(listLocal(list, "length")));
|
|
995
|
+
code.push(op.end);
|
|
996
|
+
}
|
|
997
|
+
else {
|
|
998
|
+
const low = listLocal(list, "low");
|
|
999
|
+
const high = listLocal(list, "high");
|
|
1000
|
+
const second = listLocal(list, "second");
|
|
1001
|
+
const end = listLocal(list, "end");
|
|
1002
|
+
code.push(...constant(0), ...put(second), ...constant(0), ...put(end), ...constant(0), ...put(listLocal(list, "count")));
|
|
1003
|
+
if (plan.comparisons === null) {
|
|
1004
|
+
emitBound(lookup, index, plan.prefixWords, false, low, list);
|
|
1005
|
+
emitBound(lookup, index, plan.prefixWords, true, high, list);
|
|
1006
|
+
}
|
|
1007
|
+
else {
|
|
1008
|
+
emitBound(lookup, index, plan.prefixWords, false, low, list);
|
|
1009
|
+
emitBound(lookup, index, plan.prefixWords, true, high, list);
|
|
1010
|
+
const bound = scratch(i32Type);
|
|
1011
|
+
const unequalLow = scratch(i32Type);
|
|
1012
|
+
const unequalHigh = scratch(i32Type);
|
|
1013
|
+
code.push(...constant(-1), ...put(unequalLow));
|
|
1014
|
+
const raise = () => { code.push(...get(bound), ...get(low), ...get(bound), ...get(low), op.i32GtS, op.select, ...put(low)); };
|
|
1015
|
+
const lower = () => { code.push(...get(bound), ...get(high), ...get(bound), ...get(high), op.i32LtS, op.select, ...put(high)); };
|
|
1016
|
+
for (const comparison of plan.comparisons) {
|
|
1017
|
+
encode(comparison.values);
|
|
1018
|
+
switch (comparison.operator) {
|
|
1019
|
+
case ">=":
|
|
1020
|
+
emitBound(lookup, index, comparison.words, false, bound, list);
|
|
1021
|
+
raise();
|
|
1022
|
+
break;
|
|
1023
|
+
case ">":
|
|
1024
|
+
emitBound(lookup, index, comparison.words, true, bound, list);
|
|
1025
|
+
raise();
|
|
1026
|
+
break;
|
|
1027
|
+
case "<":
|
|
1028
|
+
emitBound(lookup, index, comparison.words, false, bound, list);
|
|
1029
|
+
lower();
|
|
1030
|
+
break;
|
|
1031
|
+
case "<=":
|
|
1032
|
+
emitBound(lookup, index, comparison.words, true, bound, list);
|
|
1033
|
+
lower();
|
|
1034
|
+
break;
|
|
1035
|
+
case "==":
|
|
1036
|
+
emitBound(lookup, index, comparison.words, false, bound, list);
|
|
1037
|
+
raise();
|
|
1038
|
+
emitBound(lookup, index, comparison.words, true, bound, list);
|
|
1039
|
+
lower();
|
|
1040
|
+
break;
|
|
1041
|
+
case "!=":
|
|
1042
|
+
emitBound(lookup, index, comparison.words, false, unequalLow, list);
|
|
1043
|
+
emitBound(lookup, index, comparison.words, true, unequalHigh, list);
|
|
1044
|
+
break;
|
|
1045
|
+
default: throw unsupported;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
// An empty range, and without `!=`'s, one run; with it, the rows before and after the value.
|
|
1049
|
+
code.push(...get(high), ...get(low), op.i32LtS, op.if, 0x40, ...get(low), ...put(high), op.end);
|
|
1050
|
+
code.push(...get(unequalLow), ...constant(0), op.i32GeS, op.if, 0x40);
|
|
1051
|
+
// second = max(low, min(high, unequalHigh)); end = high; high = min(high, max(low, unequalLow))
|
|
1052
|
+
code.push(...get(unequalHigh), ...get(high), ...get(unequalHigh), ...get(high), op.i32LtS, op.select, ...put(second));
|
|
1053
|
+
code.push(...get(second), ...get(low), ...get(second), ...get(low), op.i32GtS, op.select, ...put(second));
|
|
1054
|
+
code.push(...get(high), ...put(end));
|
|
1055
|
+
code.push(...get(unequalLow), ...get(low), ...get(unequalLow), ...get(low), op.i32GtS, op.select, ...put(bound));
|
|
1056
|
+
code.push(...get(bound), ...get(high), ...get(bound), ...get(high), op.i32LtS, op.select, ...put(high));
|
|
1057
|
+
code.push(...get(second), ...get(end), op.i32GeS, op.if, 0x40, ...constant(0), ...put(second), ...constant(0), ...put(end), op.end);
|
|
1058
|
+
code.push(op.end);
|
|
1059
|
+
}
|
|
1060
|
+
// The cursor holds the block of the last lower bound, which needn't be the first row's: `count` 0 marks it unknown.
|
|
1061
|
+
code.push(...constant(0), ...put(listLocal(list, "count")));
|
|
1062
|
+
}
|
|
1063
|
+
emitListRowAt(first, list, () => code.push(op.f64Const, ...float64(0)));
|
|
1064
|
+
};
|
|
1065
|
+
/** How many rows a list holds, as an i32 on the stack. */
|
|
1066
|
+
const emitListCount = (list) => {
|
|
1067
|
+
const { index } = indexOf(list);
|
|
1068
|
+
if (index.kind === "hash")
|
|
1069
|
+
code.push(...get(listLocal(list, "length")));
|
|
1070
|
+
else
|
|
1071
|
+
code.push(...get(listLocal(list, "high")), ...get(listLocal(list, "low")), op.i32Sub, ...get(listLocal(list, "end")), ...get(listLocal(list, "second")), op.i32Sub, op.i32Add);
|
|
1072
|
+
};
|
|
1073
|
+
const emitListLength = (list) => {
|
|
1074
|
+
emitListCount(list);
|
|
1075
|
+
code.push(op.f64ConvertI32U);
|
|
1076
|
+
};
|
|
1077
|
+
/** Points row handle `row` at row `index` (an f64 the callback leaves) of list handle `list`, or at none outside it. */
|
|
1078
|
+
const emitListRowAt = (row, list, index) => {
|
|
1079
|
+
const { lookup, index: structure } = indexOf(list);
|
|
1080
|
+
const value = scratch(f64Type);
|
|
1081
|
+
const position = scratch(i32Type);
|
|
1082
|
+
const archetype = scratch(i32Type);
|
|
1083
|
+
const entryRow = scratch(i32Type);
|
|
1084
|
+
const entry = scratch(i32Type);
|
|
1085
|
+
code.push(...constant(0), ...put(handleLocal(row, "found")));
|
|
1086
|
+
index();
|
|
1087
|
+
code.push(...tee(value), op.f64Const, ...float64(0), op.f64Ge, ...get(value));
|
|
1088
|
+
emitListCount(list);
|
|
1089
|
+
code.push(op.f64ConvertI32U, op.f64Lt, op.i32And, op.if, 0x40);
|
|
1090
|
+
code.push(...get(value), ...truncations.i32TruncSatF64U, ...put(position));
|
|
1091
|
+
if (structure.kind === "hash") {
|
|
1092
|
+
code.push(...get(indexLocal(lookup, 3)), ...get(listLocal(list, "start")), ...get(position), op.i32Add, ...constant(12), op.i32Mul, op.i32Add, ...put(entry));
|
|
1093
|
+
code.push(...get(entry), ...load(4), ...put(archetype), ...get(entry), ...load(8), ...put(entryRow));
|
|
1094
|
+
}
|
|
1095
|
+
else {
|
|
1096
|
+
const runLength = scratch(i32Type);
|
|
1097
|
+
const k = listLocal(list, "k");
|
|
1098
|
+
const first = listLocal(list, "first");
|
|
1099
|
+
const count = listLocal(list, "count");
|
|
1100
|
+
// The position among the entries: in the first run, or the second.
|
|
1101
|
+
code.push(...get(listLocal(list, "high")), ...get(listLocal(list, "low")), op.i32Sub, ...tee(runLength), ...get(position), op.i32GtU);
|
|
1102
|
+
code.push(op.if, i32Type, ...get(listLocal(list, "low")), ...get(position), op.i32Add, op.else, ...get(listLocal(list, "second")), ...get(position), op.i32Add, ...get(runLength), op.i32Sub, op.end, ...put(position));
|
|
1103
|
+
// Outside the cursor's block: find it.
|
|
1104
|
+
code.push(...get(position), ...get(first), op.i32Sub, ...get(count), op.i32GeU, op.if, 0x40);
|
|
1105
|
+
emitBlockAt(lookup, position, k);
|
|
1106
|
+
emitPrefix(lookup, k);
|
|
1107
|
+
code.push(...put(first));
|
|
1108
|
+
code.push(...get(indexLocal(lookup, 3)), ...get(indexLocal(lookup, 2)), ...get(k), ...constant(2), op.i32Shl, op.i32Add, ...load(0), ...constant(2), op.i32Shl, op.i32Add, ...load(0), ...put(count));
|
|
1109
|
+
code.push(op.end);
|
|
1110
|
+
const entryBytes = 4 * structure.stride;
|
|
1111
|
+
code.push(...get(indexLocal(lookup, 4)), ...get(indexLocal(lookup, 2)), ...get(k), ...constant(2), op.i32Shl, op.i32Add, ...load(0), ...constant(entryBytes * 128), op.i32Mul, op.i32Add);
|
|
1112
|
+
code.push(...get(position), ...get(first), op.i32Sub, ...constant(entryBytes), op.i32Mul, op.i32Add, ...put(entry));
|
|
1113
|
+
code.push(...get(entry), ...load(4 * (structure.words + 1)), ...put(archetype), ...get(entry), ...load(4 * (structure.words + 2)), ...put(entryRow));
|
|
1114
|
+
}
|
|
1115
|
+
bindRow(row, lookup, archetype, entryRow);
|
|
1116
|
+
code.push(op.end);
|
|
1117
|
+
};
|
|
1118
|
+
const emitListRow = (row, list, index) => emitListRowAt(row, list, () => emit(index));
|
|
1119
|
+
/** Leaves 1 when a segment tree's ticks over the blocks around entry positions `low` to `high` (i32 locals) are newer than `since`. */
|
|
1120
|
+
const emitRunChanged = (lookup, tree, low, high) => {
|
|
1121
|
+
const from = scratch(i32Type);
|
|
1122
|
+
const to = scratch(i32Type);
|
|
1123
|
+
const position = scratch(i32Type);
|
|
1124
|
+
const node = scratch(i32Type);
|
|
1125
|
+
const limit = scratch(i32Type);
|
|
1126
|
+
const maximum = scratch(f64Type);
|
|
1127
|
+
const size = indexLocal(lookup, 6);
|
|
1128
|
+
const leaves = indexLocal(lookup, 8);
|
|
1129
|
+
// Clamped to the entries: max(low - 1, 0) and min(high, size - 1), then their blocks.
|
|
1130
|
+
code.push(...get(low), ...constant(1), op.i32Sub, ...tee(position), ...constant(0), ...get(position), ...constant(0), op.i32GtS, op.select, ...tee(position));
|
|
1131
|
+
code.push(...get(size), ...constant(1), op.i32Sub, ...get(position), ...get(size), ...constant(1), op.i32Sub, op.i32LtS, op.select, ...put(position));
|
|
1132
|
+
emitBlockAt(lookup, position, from);
|
|
1133
|
+
code.push(...get(high), ...get(size), ...constant(1), op.i32Sub, ...get(high), ...get(size), ...constant(1), op.i32Sub, op.i32LtS, op.select, ...put(position));
|
|
1134
|
+
emitBlockAt(lookup, position, to);
|
|
1135
|
+
code.push(op.f64Const, ...float64(0), ...put(maximum));
|
|
1136
|
+
code.push(...get(from), ...get(leaves), op.i32Add, ...put(node), ...get(to), ...get(leaves), op.i32Add, ...constant(1), op.i32Add, ...put(limit));
|
|
1137
|
+
code.push(op.block, 0x40, op.loop, 0x40);
|
|
1138
|
+
code.push(...get(node), ...get(limit), op.i32GeU, op.brIf, 1);
|
|
1139
|
+
code.push(...get(node), ...constant(1), op.i32And, op.if, 0x40);
|
|
1140
|
+
code.push(...get(maximum), ...get(tree), ...get(node), ...constant(3), op.i32Shl, op.i32Add, op.f64Load, 3, 0, op.f64Max, ...put(maximum), ...get(node), ...constant(1), op.i32Add, ...put(node));
|
|
1141
|
+
code.push(op.end);
|
|
1142
|
+
code.push(...get(limit), ...constant(1), op.i32And, op.if, 0x40);
|
|
1143
|
+
code.push(...get(limit), ...constant(1), op.i32Sub, ...tee(limit), ...constant(3), op.i32Shl, ...get(tree), op.i32Add, op.f64Load, 3, 0, ...get(maximum), op.f64Max, ...put(maximum));
|
|
1144
|
+
code.push(op.end);
|
|
1145
|
+
code.push(...get(node), ...constant(1), op.i32ShrU, ...put(node), ...get(limit), ...constant(1), op.i32ShrU, ...put(limit), op.br, 0);
|
|
1146
|
+
code.push(op.end, op.end);
|
|
1147
|
+
code.push(...get(maximum), ...get(indexLocal(lookup, 10)), op.f64Gt);
|
|
1148
|
+
};
|
|
1149
|
+
/** Whether a list changed since its system last ran, as an f64 of 0 or 1. */
|
|
1150
|
+
const emitListChanged = (list) => {
|
|
1151
|
+
const { lookup, index } = indexOf(list);
|
|
1152
|
+
if (index.kind === "hash") {
|
|
1153
|
+
const bucket = listLocal(list, "bucket");
|
|
1154
|
+
const since = indexLocal(lookup, 6);
|
|
1155
|
+
code.push(...get(bucket), ...constant(0), op.i32LtS, op.if, i32Type, ...get(indexLocal(lookup, 5)), ...get(since), op.f64Gt, op.else);
|
|
1156
|
+
code.push(...get(indexLocal(lookup, 4)), ...get(bucket), ...constant(3), op.i32Shl, op.i32Add, op.f64Load, 3, 0, ...get(since), op.f64Gt);
|
|
1157
|
+
for (let k = 0; k < index.watched; k++)
|
|
1158
|
+
code.push(...get(indexLocal(lookup, 7 + k)), ...get(bucket), ...constant(3), op.i32Shl, op.i32Add, op.f64Load, 3, 0, ...get(since), op.f64Gt, op.i32Or);
|
|
1159
|
+
code.push(op.end, op.f64ConvertI32U);
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
const trees = [indexLocal(lookup, 7), ...Array.from({ length: index.watched }, (_, k) => indexLocal(lookup, 11 + k))];
|
|
1163
|
+
code.push(...get(indexLocal(lookup, 1)), op.i32Eqz, op.if, i32Type, ...get(indexLocal(lookup, 9)), ...get(indexLocal(lookup, 10)), op.f64Gt, op.else);
|
|
1164
|
+
code.push(...constant(0));
|
|
1165
|
+
for (const tree of trees) {
|
|
1166
|
+
emitRunChanged(lookup, tree, listLocal(list, "low"), listLocal(list, "high"));
|
|
1167
|
+
code.push(op.i32Or);
|
|
1168
|
+
code.push(...get(listLocal(list, "end")), ...get(listLocal(list, "second")), op.i32GtS, op.if, i32Type);
|
|
1169
|
+
emitRunChanged(lookup, tree, listLocal(list, "second"), listLocal(list, "end"));
|
|
1170
|
+
code.push(op.else, ...constant(0), op.end, op.i32Or);
|
|
1171
|
+
}
|
|
1172
|
+
code.push(op.end, op.f64ConvertI32U);
|
|
1173
|
+
};
|
|
1174
|
+
/** A leaf of a row handle's row, through its directory record's column `word`, or NaN without a row. */
|
|
1175
|
+
const emitRecordLeaf = (handle, word, column) => {
|
|
1176
|
+
const { view, stride, offset, boolean } = column;
|
|
1177
|
+
code.push(...get(handleLocal(handle, "found")), op.if, f64Type);
|
|
1178
|
+
code.push(...get(handleLocal(handle, "record")), op.i32Load, 2, ...unsigned(4 * word));
|
|
1179
|
+
code.push(...get(handleLocal(handle, "row")), ...constant(stride), op.i32Mul, op.i32Add);
|
|
1180
|
+
const memory = (align) => [align, ...unsigned(offset)];
|
|
1181
|
+
if (boolean)
|
|
1182
|
+
code.push(view === "u8" ? op.i32Load8u : op.i32Load, ...memory(view === "u8" ? 0 : 2), op.i32Const, 0, op.i32Ne, op.f64ConvertI32U);
|
|
1183
|
+
else if (view === "f32")
|
|
1184
|
+
code.push(op.f32Load, ...memory(2), op.f64PromoteF32);
|
|
1185
|
+
else if (view === "i32")
|
|
1186
|
+
code.push(op.i32Load, ...memory(2), op.f64ConvertI32S);
|
|
1187
|
+
else if (view === "u32")
|
|
1188
|
+
code.push(op.i32Load, ...memory(2), op.f64ConvertI32U);
|
|
1189
|
+
else if (view === "u8")
|
|
1190
|
+
code.push(op.i32Load8u, ...memory(0), op.f64ConvertI32U);
|
|
1191
|
+
else
|
|
1192
|
+
code.push(op.f64Load, ...memory(3));
|
|
1193
|
+
code.push(op.else, op.f64Const, ...float64(NaN), op.end);
|
|
1194
|
+
};
|
|
1195
|
+
const emitRowLeaf = (row, leaf) => {
|
|
1196
|
+
const { index } = indexOf(row);
|
|
1197
|
+
const found = index.rowLeaf(leaf);
|
|
1198
|
+
if (found === null)
|
|
1199
|
+
throw unsupported;
|
|
1200
|
+
// Word 1 is the archetype's entities, so a read's column is at 2 + read.
|
|
1201
|
+
emitRecordLeaf(row, 2 + found.read, found.column);
|
|
1202
|
+
};
|
|
1203
|
+
const emitRowEntity = (row) => {
|
|
1204
|
+
indexOf(row);
|
|
1205
|
+
emitRecordLeaf(row, 1, { view: "f64", stride: 8, offset: 0, boolean: false });
|
|
1206
|
+
};
|
|
1207
|
+
/** Sets the chunk tick of the row `rowOffset` rows past the current one, unless every row's chunk is stamped up front. */
|
|
1208
|
+
const stampChunk = (chunks, rowOffset) => {
|
|
1209
|
+
if (everyRow.has(chunks))
|
|
1210
|
+
return;
|
|
1211
|
+
code.push(op.localGet, ...unsigned(columnParameter(chunks)), op.localGet, ...unsigned(rowLocal));
|
|
1212
|
+
if (rowOffset !== 0)
|
|
1213
|
+
code.push(op.i32Const, ...signed(rowOffset), op.i32Add);
|
|
1214
|
+
code.push(op.i32Const, ...signed(chunkShift), op.i32ShrU, op.i32Const, 3, op.i32Shl, op.i32Add, op.localGet, 2, op.f64Store, 3, 0);
|
|
1215
|
+
};
|
|
1216
|
+
const statement = (current) => {
|
|
1217
|
+
switch (current.kind) {
|
|
1218
|
+
case "set":
|
|
1219
|
+
emit(current.value);
|
|
1220
|
+
code.push(op.localSet, ...unsigned(local(current.local)));
|
|
1221
|
+
return;
|
|
1222
|
+
case "store": return store(current.column, current.value);
|
|
1223
|
+
// A chunk column stays when its row column is muted, for a component held on the GPU.
|
|
1224
|
+
case "stamp":
|
|
1225
|
+
if (columns[current.column].muted !== true)
|
|
1226
|
+
store(current.column, "tick");
|
|
1227
|
+
if (columns[current.chunks].muted === true)
|
|
1228
|
+
return;
|
|
1229
|
+
return stampChunk(current.chunks, 0);
|
|
1230
|
+
case "if":
|
|
1231
|
+
emit(current.test);
|
|
1232
|
+
emitTruthy(typeOf(current.test));
|
|
1233
|
+
code.push(op.if, 0x40);
|
|
1234
|
+
labels.push("if");
|
|
1235
|
+
for (const inner of current.consequent)
|
|
1236
|
+
statement(inner);
|
|
1237
|
+
if (current.alternate.length > 0) {
|
|
1238
|
+
code.push(op.else);
|
|
1239
|
+
for (const inner of current.alternate)
|
|
1240
|
+
statement(inner);
|
|
1241
|
+
}
|
|
1242
|
+
labels.pop();
|
|
1243
|
+
code.push(op.end);
|
|
1244
|
+
return;
|
|
1245
|
+
case "block":
|
|
1246
|
+
case "loop":
|
|
1247
|
+
code.push(current.kind === "block" ? op.block : op.loop, 0x40);
|
|
1248
|
+
labels.push("program");
|
|
1249
|
+
for (const inner of current.body)
|
|
1250
|
+
statement(inner);
|
|
1251
|
+
labels.pop();
|
|
1252
|
+
code.push(op.end);
|
|
1253
|
+
return;
|
|
1254
|
+
case "branch":
|
|
1255
|
+
code.push(op.br, ...unsigned(wasmDepth(current.depth)));
|
|
1256
|
+
return;
|
|
1257
|
+
case "branchIf":
|
|
1258
|
+
emit(current.test);
|
|
1259
|
+
emitTruthy(typeOf(current.test));
|
|
1260
|
+
code.push(op.brIf, ...unsigned(wasmDepth(current.depth)));
|
|
1261
|
+
return;
|
|
1262
|
+
case "next":
|
|
1263
|
+
code.push(op.br, ...unsigned(labels.length - 1 - labels.lastIndexOf("next")));
|
|
1264
|
+
return;
|
|
1265
|
+
case "find": return emitFind(current.handle, current.lookup, current.entity);
|
|
1266
|
+
case "probe": return emitProbe(current.list, current.first, current.probe, current.values);
|
|
1267
|
+
case "listRow": return emitListRow(current.row, current.list, current.index);
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
// ---- SIMD. Lanes compute in f32, at storage precision, so results may differ from the scalar path in the last bit. ----
|
|
1271
|
+
const v128Type = 0x7b;
|
|
1272
|
+
const simd = (operation) => [0xfd, ...unsigned(operation)];
|
|
1273
|
+
const vop = {
|
|
1274
|
+
load: 0, store: 11, const: 12, f32Splat: 19, f64Splat: 20,
|
|
1275
|
+
f32Eq: 65, f32Ne: 66, f32Lt: 67, f32Gt: 68, f32Le: 69, f32Ge: 70,
|
|
1276
|
+
f64Gt: 74, not: 77, and: 78, andNot: 79, or: 80, bitselect: 82, anyTrue: 83,
|
|
1277
|
+
store32Lane: 90, store64Lane: 91, load32Zero: 92, load64Zero: 93,
|
|
1278
|
+
f32Ceil: 103, f32Floor: 104, f32Trunc: 105, i64ExtendLowS: 199, i64ExtendHighS: 200,
|
|
1279
|
+
f32Abs: 224, f32Neg: 225, f32Sqrt: 227, f32Add: 228, f32Sub: 229, f32Mul: 230, f32Div: 231, f32Min: 232, f32Max: 233,
|
|
1280
|
+
};
|
|
1281
|
+
const float32 = (value) => [...new Uint8Array(new Float32Array([value]).buffer)];
|
|
1282
|
+
const vectorConstant = (values) => [...simd(vop.const), ...[0, 1, 2, 3].flatMap(lane => float32(values[lane] ?? 0))];
|
|
1283
|
+
const splatConstant = (value) => vectorConstant([value, value, value, value]);
|
|
1284
|
+
const arithmeticVector = { "+": vop.f32Add, "-": vop.f32Sub, "*": vop.f32Mul, "/": vop.f32Div };
|
|
1285
|
+
const unaryVector = { abs: vop.f32Abs, sqrt: vop.f32Sqrt, floor: vop.f32Floor, ceil: vop.f32Ceil, trunc: vop.f32Trunc };
|
|
1286
|
+
const isArithmetic = (operator) => operator in arithmeticVector;
|
|
1287
|
+
/** A value that's the same for every lane, splatted: demoted to f32, as a lane computes. */
|
|
1288
|
+
const emitSplat = (expression) => {
|
|
1289
|
+
emit(expression);
|
|
1290
|
+
code.push(op.f32DemoteF64, ...simd(vop.f32Splat));
|
|
1291
|
+
};
|
|
1292
|
+
/** `Math` functions with an f32x4 equivalent; `fround` is the identity in f32. */
|
|
1293
|
+
const emitVectorMath = (functionName, count) => {
|
|
1294
|
+
if (functionName === "min" || functionName === "max") {
|
|
1295
|
+
for (let i = 1; i < count; i++)
|
|
1296
|
+
code.push(...simd(functionName === "min" ? vop.f32Min : vop.f32Max));
|
|
1297
|
+
return;
|
|
1298
|
+
}
|
|
1299
|
+
const unary = unaryVector[functionName];
|
|
1300
|
+
if (unary !== undefined)
|
|
1301
|
+
code.push(...simd(unary));
|
|
1302
|
+
};
|
|
1303
|
+
const vectorMath = (functionName, count) => ((functionName === "min" || functionName === "max") && count > 0) || ((unaryVector[functionName] !== undefined || functionName === "fround") && count === 1);
|
|
1304
|
+
// ---- Across rows: four rows at a time, for straight-line programs whose columns are all dense f32. ----
|
|
1305
|
+
/** The mask of the enclosing `if`s, or null outside any. */
|
|
1306
|
+
let mask = null;
|
|
1307
|
+
const rowsLocals = [];
|
|
1308
|
+
const rowsLocal = (index) => rowsLocals[index] ??= scratch(v128Type);
|
|
1309
|
+
const denseAddress = (column) => {
|
|
1310
|
+
const { view, stride, boolean, component } = columns[column];
|
|
1311
|
+
if (view !== "f32" || stride !== 4 || boolean || component < 0)
|
|
1312
|
+
throw notVectorizable;
|
|
1313
|
+
code.push(op.localGet, ...unsigned(columnParameter(column)), op.localGet, ...unsigned(rowLocal), op.i32Const, 4, op.i32Mul, op.i32Add);
|
|
1314
|
+
};
|
|
1315
|
+
const vectorTruthy = (type) => {
|
|
1316
|
+
if (type === "boolean") {
|
|
1317
|
+
code.push(...splatConstant(0), ...simd(vop.f32Ne));
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
const value = scratch(v128Type);
|
|
1321
|
+
code.push(op.localTee, ...unsigned(value), ...splatConstant(0), ...simd(vop.f32Ne));
|
|
1322
|
+
code.push(op.localGet, ...unsigned(value), op.localGet, ...unsigned(value), ...simd(vop.f32Eq), ...simd(vop.and));
|
|
1323
|
+
};
|
|
1324
|
+
/** A lane mask as a value: 1 where set, 0 elsewhere. */
|
|
1325
|
+
const maskValue = () => {
|
|
1326
|
+
code.push(...splatConstant(1), ...simd(vop.and));
|
|
1327
|
+
};
|
|
1328
|
+
const rowsEmit = (expression) => {
|
|
1329
|
+
switch (expression.kind) {
|
|
1330
|
+
case "number":
|
|
1331
|
+
code.push(...splatConstant(expression.value));
|
|
1332
|
+
return;
|
|
1333
|
+
case "boolean":
|
|
1334
|
+
code.push(...splatConstant(expression.value ? 1 : 0));
|
|
1335
|
+
return;
|
|
1336
|
+
case "local":
|
|
1337
|
+
code.push(op.localGet, ...unsigned(rowsLocal(expression.local)));
|
|
1338
|
+
return;
|
|
1339
|
+
case "resource":
|
|
1340
|
+
case "args": return emitSplat(expression);
|
|
1341
|
+
case "column":
|
|
1342
|
+
denseAddress(expression.column);
|
|
1343
|
+
code.push(...simd(vop.load), 2, ...unsigned(columns[expression.column].offset));
|
|
1344
|
+
return;
|
|
1345
|
+
case "unary":
|
|
1346
|
+
rowsEmit(expression.operand);
|
|
1347
|
+
if (expression.operator === "-")
|
|
1348
|
+
code.push(...simd(vop.f32Neg));
|
|
1349
|
+
else if (expression.operator === "!") {
|
|
1350
|
+
vectorTruthy(typeOf(expression.operand));
|
|
1351
|
+
code.push(...simd(vop.not));
|
|
1352
|
+
maskValue();
|
|
1353
|
+
}
|
|
1354
|
+
else if (expression.operator === "~")
|
|
1355
|
+
throw notVectorizable;
|
|
1356
|
+
return;
|
|
1357
|
+
case "binary": {
|
|
1358
|
+
const { operator, left, right } = expression;
|
|
1359
|
+
if (operator === "===" || operator === "!==") {
|
|
1360
|
+
const leftType = typeOf(left);
|
|
1361
|
+
const rightType = typeOf(right);
|
|
1362
|
+
if (leftType === "mixed" || rightType === "mixed")
|
|
1363
|
+
throw unsupported;
|
|
1364
|
+
if (leftType !== rightType) {
|
|
1365
|
+
code.push(...splatConstant(operator === "===" ? 0 : 1));
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
const comparison = { "<": vop.f32Lt, ">": vop.f32Gt, "<=": vop.f32Le, ">=": vop.f32Ge, "==": vop.f32Eq, "!=": vop.f32Ne, "===": vop.f32Eq, "!==": vop.f32Ne }[operator];
|
|
1370
|
+
if (!isArithmetic(operator) && comparison === undefined)
|
|
1371
|
+
throw notVectorizable;
|
|
1372
|
+
rowsEmit(left);
|
|
1373
|
+
rowsEmit(right);
|
|
1374
|
+
if (isArithmetic(operator))
|
|
1375
|
+
code.push(...simd(arithmeticVector[operator]));
|
|
1376
|
+
else if (comparison !== undefined) {
|
|
1377
|
+
code.push(...simd(comparison));
|
|
1378
|
+
maskValue();
|
|
1379
|
+
}
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
case "logical": {
|
|
1383
|
+
const value = scratch(v128Type);
|
|
1384
|
+
rowsEmit(expression.left);
|
|
1385
|
+
code.push(op.localSet, ...unsigned(value));
|
|
1386
|
+
// bitselect(a, b, m) takes a where m is set.
|
|
1387
|
+
if (expression.operator === "&&") {
|
|
1388
|
+
rowsEmit(expression.right);
|
|
1389
|
+
code.push(op.localGet, ...unsigned(value));
|
|
1390
|
+
}
|
|
1391
|
+
else {
|
|
1392
|
+
code.push(op.localGet, ...unsigned(value));
|
|
1393
|
+
rowsEmit(expression.right);
|
|
1394
|
+
}
|
|
1395
|
+
code.push(op.localGet, ...unsigned(value));
|
|
1396
|
+
vectorTruthy(typeOf(expression.left));
|
|
1397
|
+
code.push(...simd(vop.bitselect));
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
case "conditional":
|
|
1401
|
+
rowsEmit(expression.consequent);
|
|
1402
|
+
rowsEmit(expression.alternate);
|
|
1403
|
+
rowsEmit(expression.test);
|
|
1404
|
+
vectorTruthy(typeOf(expression.test));
|
|
1405
|
+
code.push(...simd(vop.bitselect));
|
|
1406
|
+
return;
|
|
1407
|
+
case "math":
|
|
1408
|
+
if (!vectorMath(expression.name, expression.arguments.length))
|
|
1409
|
+
throw notVectorizable;
|
|
1410
|
+
for (const parameter of expression.arguments)
|
|
1411
|
+
rowsEmit(parameter);
|
|
1412
|
+
emitVectorMath(expression.name, expression.arguments.length);
|
|
1413
|
+
return;
|
|
1414
|
+
case "found":
|
|
1415
|
+
case "lookupLeaf":
|
|
1416
|
+
case "upFound":
|
|
1417
|
+
case "upLeaf":
|
|
1418
|
+
case "listLength":
|
|
1419
|
+
case "listChanged":
|
|
1420
|
+
case "rowLeaf":
|
|
1421
|
+
case "rowEntity": throw notVectorizable;
|
|
1422
|
+
}
|
|
1423
|
+
};
|
|
1424
|
+
/** Under a mask, keeps the old value (left on the stack below the new one) where the mask is clear. */
|
|
1425
|
+
const blend = () => {
|
|
1426
|
+
if (mask === null)
|
|
1427
|
+
return;
|
|
1428
|
+
code.push(op.localGet, ...unsigned(mask), ...simd(vop.bitselect));
|
|
1429
|
+
};
|
|
1430
|
+
const rowsStatement = (current) => {
|
|
1431
|
+
switch (current.kind) {
|
|
1432
|
+
case "set": {
|
|
1433
|
+
const target = rowsLocal(current.local);
|
|
1434
|
+
rowsEmit(current.value);
|
|
1435
|
+
if (mask !== null) {
|
|
1436
|
+
code.push(op.localGet, ...unsigned(target));
|
|
1437
|
+
blend();
|
|
1438
|
+
}
|
|
1439
|
+
code.push(op.localSet, ...unsigned(target));
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1442
|
+
case "store": {
|
|
1443
|
+
const value = scratch(v128Type);
|
|
1444
|
+
rowsEmit(current.value);
|
|
1445
|
+
if (mask !== null) {
|
|
1446
|
+
rowsEmit({ kind: "column", column: current.column });
|
|
1447
|
+
blend();
|
|
1448
|
+
}
|
|
1449
|
+
code.push(op.localSet, ...unsigned(value));
|
|
1450
|
+
denseAddress(current.column);
|
|
1451
|
+
code.push(op.localGet, ...unsigned(value), ...simd(vop.store), 2, ...unsigned(columns[current.column].offset));
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
case "stamp": {
|
|
1455
|
+
// Ticks are dense f64: four rows are two f64x2 stores; a chunk column stays when its row column is muted.
|
|
1456
|
+
if (columns[current.column].muted !== true) {
|
|
1457
|
+
for (let half = 0; half < 2; half++) {
|
|
1458
|
+
const address = () => { code.push(op.localGet, ...unsigned(columnParameter(current.column)), op.localGet, ...unsigned(rowLocal), op.i32Const, 3, op.i32Shl, op.i32Add); };
|
|
1459
|
+
address();
|
|
1460
|
+
code.push(op.localGet, 2, ...simd(vop.f64Splat));
|
|
1461
|
+
if (mask !== null) {
|
|
1462
|
+
address();
|
|
1463
|
+
code.push(...simd(vop.load), 3, ...unsigned(16 * half));
|
|
1464
|
+
code.push(op.localGet, ...unsigned(mask), ...simd(half === 0 ? vop.i64ExtendLowS : vop.i64ExtendHighS), ...simd(vop.bitselect));
|
|
1465
|
+
}
|
|
1466
|
+
code.push(...simd(vop.store), 3, ...unsigned(16 * half));
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
if (columns[current.chunks].muted === true)
|
|
1470
|
+
return;
|
|
1471
|
+
// The group may straddle two chunks. Under a mask this can stamp a chunk no lane changed, which only costs a scan.
|
|
1472
|
+
stampChunk(current.chunks, 0);
|
|
1473
|
+
stampChunk(current.chunks, 3);
|
|
1474
|
+
return;
|
|
1475
|
+
}
|
|
1476
|
+
case "if": {
|
|
1477
|
+
const test = scratch(v128Type);
|
|
1478
|
+
rowsEmit(current.test);
|
|
1479
|
+
vectorTruthy(typeOf(current.test));
|
|
1480
|
+
code.push(op.localSet, ...unsigned(test));
|
|
1481
|
+
const outer = mask;
|
|
1482
|
+
const branch = (statements, negate) => {
|
|
1483
|
+
if (statements.length === 0)
|
|
1484
|
+
return;
|
|
1485
|
+
const inner = scratch(v128Type);
|
|
1486
|
+
if (outer === null) {
|
|
1487
|
+
code.push(op.localGet, ...unsigned(test));
|
|
1488
|
+
if (negate)
|
|
1489
|
+
code.push(...simd(vop.not));
|
|
1490
|
+
}
|
|
1491
|
+
else {
|
|
1492
|
+
code.push(op.localGet, ...unsigned(outer), op.localGet, ...unsigned(test), ...simd(negate ? vop.andNot : vop.and));
|
|
1493
|
+
}
|
|
1494
|
+
code.push(op.localSet, ...unsigned(inner));
|
|
1495
|
+
mask = inner;
|
|
1496
|
+
for (const statement of statements)
|
|
1497
|
+
rowsStatement(statement);
|
|
1498
|
+
mask = outer;
|
|
1499
|
+
};
|
|
1500
|
+
branch(current.consequent, false);
|
|
1501
|
+
branch(current.alternate, true);
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
default: throw notVectorizable;
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
/** Rows from `start` in groups of four, up to the last whole group; leaves the row local at the first row not done. */
|
|
1508
|
+
const rowsLoop = () => {
|
|
1509
|
+
const vectorEnd = scratch(i32Type);
|
|
1510
|
+
code.push(op.localGet, 1, op.localGet, 0, op.i32Sub, op.i32Const, ...signed(-4), op.i32And, op.localGet, 0, op.i32Add, op.localSet, ...unsigned(vectorEnd));
|
|
1511
|
+
code.push(op.block, 0x40, op.loop, 0x40);
|
|
1512
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.localGet, ...unsigned(vectorEnd), op.i32GeS, op.brIf, 1);
|
|
1513
|
+
mask = null;
|
|
1514
|
+
for (const current of program.body)
|
|
1515
|
+
rowsStatement(current);
|
|
1516
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, 4, op.i32Add, op.localSet, ...unsigned(rowLocal), op.br, 0);
|
|
1517
|
+
code.push(op.end, op.end);
|
|
1518
|
+
};
|
|
1519
|
+
/** f32 leaves of one component, as consecutive lanes from the lowest offset; null if they can't be. */
|
|
1520
|
+
const windowOf = (laneColumns) => {
|
|
1521
|
+
const infos = laneColumns.map(column => columns[column]);
|
|
1522
|
+
const first = infos[0];
|
|
1523
|
+
if (first === undefined || infos.some(info => info.view !== "f32" || info.boolean || info.component !== first.component || info.component < 0))
|
|
1524
|
+
return null;
|
|
1525
|
+
const base = Math.min(...infos.map(info => info.offset));
|
|
1526
|
+
const lanes = infos.map(info => (info.offset - base) / 4);
|
|
1527
|
+
if (lanes.some(lane => lane > 3) || new Set(lanes).size !== lanes.length)
|
|
1528
|
+
return null;
|
|
1529
|
+
return { component: first.component, base, lanes: Math.max(...lanes) + 1 };
|
|
1530
|
+
};
|
|
1531
|
+
const laneIn = (window, column) => (columns[column].offset - window.base) / 4;
|
|
1532
|
+
const elementAddress = (column) => {
|
|
1533
|
+
code.push(op.localGet, ...unsigned(columnParameter(column)), op.localGet, ...unsigned(rowLocal), op.i32Const, ...signed(columns[column].stride), op.i32Mul, op.i32Add);
|
|
1534
|
+
};
|
|
1535
|
+
/**
|
|
1536
|
+
* Loads a window's lanes. Three or four lanes load 16 bytes, which can read up to 12 past the element:
|
|
1537
|
+
* columns keep `columnSlack` bytes after their last row for that. Two or one load only their lanes.
|
|
1538
|
+
*/
|
|
1539
|
+
const loadWindow = (column, { base, lanes }) => {
|
|
1540
|
+
elementAddress(column);
|
|
1541
|
+
if (lanes >= 3)
|
|
1542
|
+
return void code.push(...simd(vop.load), 2, ...unsigned(base));
|
|
1543
|
+
code.push(...simd(lanes === 1 ? vop.load32Zero : vop.load64Zero), 2, ...unsigned(base));
|
|
1544
|
+
};
|
|
1545
|
+
/** Stores a window's lanes from a v128 local, without touching the rest of the element. */
|
|
1546
|
+
const storeWindow = (column, { base, lanes }, value) => {
|
|
1547
|
+
elementAddress(column);
|
|
1548
|
+
code.push(op.localGet, ...unsigned(value));
|
|
1549
|
+
if (lanes === 4)
|
|
1550
|
+
return void code.push(...simd(vop.store), 2, ...unsigned(base));
|
|
1551
|
+
code.push(...simd(vop.store64Lane), 2, ...unsigned(base), 0);
|
|
1552
|
+
if (lanes !== 3)
|
|
1553
|
+
return;
|
|
1554
|
+
elementAddress(column);
|
|
1555
|
+
code.push(op.localGet, ...unsigned(value), ...simd(vop.store32Lane), 2, ...unsigned(base + 8), 2);
|
|
1556
|
+
};
|
|
1557
|
+
/** Plans the fusion of top-level statements. Statement index to group, and which `set`s only feed groups. */
|
|
1558
|
+
const planLanes = () => {
|
|
1559
|
+
const body = program.body;
|
|
1560
|
+
const assignments = new Map();
|
|
1561
|
+
const uses = new Map();
|
|
1562
|
+
const countExpression = (expression) => {
|
|
1563
|
+
switch (expression.kind) {
|
|
1564
|
+
case "local":
|
|
1565
|
+
uses.set(expression.local, (uses.get(expression.local) ?? 0) + 1);
|
|
1566
|
+
return;
|
|
1567
|
+
case "unary": return countExpression(expression.operand);
|
|
1568
|
+
case "binary":
|
|
1569
|
+
case "logical":
|
|
1570
|
+
countExpression(expression.left);
|
|
1571
|
+
return countExpression(expression.right);
|
|
1572
|
+
case "conditional":
|
|
1573
|
+
countExpression(expression.test);
|
|
1574
|
+
countExpression(expression.consequent);
|
|
1575
|
+
return countExpression(expression.alternate);
|
|
1576
|
+
case "math":
|
|
1577
|
+
for (const parameter of expression.arguments)
|
|
1578
|
+
countExpression(parameter);
|
|
1579
|
+
return;
|
|
1580
|
+
default: return;
|
|
1581
|
+
}
|
|
1582
|
+
};
|
|
1583
|
+
const countStatements = (statements) => {
|
|
1584
|
+
for (const statement of statements) {
|
|
1585
|
+
switch (statement.kind) {
|
|
1586
|
+
case "set":
|
|
1587
|
+
assignments.set(statement.local, (assignments.get(statement.local) ?? 0) + 1);
|
|
1588
|
+
countExpression(statement.value);
|
|
1589
|
+
break;
|
|
1590
|
+
case "store":
|
|
1591
|
+
countExpression(statement.value);
|
|
1592
|
+
break;
|
|
1593
|
+
case "branchIf":
|
|
1594
|
+
countExpression(statement.test);
|
|
1595
|
+
break;
|
|
1596
|
+
case "find":
|
|
1597
|
+
countExpression(statement.entity);
|
|
1598
|
+
break;
|
|
1599
|
+
case "if":
|
|
1600
|
+
countExpression(statement.test);
|
|
1601
|
+
countStatements(statement.consequent);
|
|
1602
|
+
countStatements(statement.alternate);
|
|
1603
|
+
break;
|
|
1604
|
+
case "block":
|
|
1605
|
+
case "loop":
|
|
1606
|
+
countStatements(statement.body);
|
|
1607
|
+
break;
|
|
1608
|
+
default: break;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
countStatements(body);
|
|
1613
|
+
// Packs: single-assignment snapshot locals of one component's leaves, with no store to it between their sets.
|
|
1614
|
+
const packOfLocal = new Map();
|
|
1615
|
+
const open = new Map();
|
|
1616
|
+
const packs = new Map();
|
|
1617
|
+
const close = (component) => {
|
|
1618
|
+
const pending = open.get(component);
|
|
1619
|
+
open.delete(component);
|
|
1620
|
+
if (pending === undefined || pending.columns.length < 2)
|
|
1621
|
+
return;
|
|
1622
|
+
const window = windowOf(pending.columns);
|
|
1623
|
+
if (window === null)
|
|
1624
|
+
return;
|
|
1625
|
+
const pack = { first: pending.first, column: pending.columns[0], window, lanes: new Map(), used: false, local: -1 };
|
|
1626
|
+
pending.locals.forEach((local, i) => {
|
|
1627
|
+
pack.lanes.set(local, laneIn(window, pending.columns[i]));
|
|
1628
|
+
packOfLocal.set(local, pack);
|
|
1629
|
+
});
|
|
1630
|
+
packs.set(pending.first, pack);
|
|
1631
|
+
};
|
|
1632
|
+
body.forEach((statement, index) => {
|
|
1633
|
+
if (statement.kind === "set" && statement.value.kind === "column" && assignments.get(statement.local) === 1) {
|
|
1634
|
+
const info = columns[statement.value.column];
|
|
1635
|
+
if (info.view === "f32" && !info.boolean && info.component >= 0) {
|
|
1636
|
+
const pending = open.get(info.component) ?? { first: index, columns: [], locals: [] };
|
|
1637
|
+
open.set(info.component, pending);
|
|
1638
|
+
pending.columns.push(statement.value.column);
|
|
1639
|
+
pending.locals.push(statement.local);
|
|
1640
|
+
return;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
if (statement.kind === "store")
|
|
1644
|
+
close(columns[statement.column].component);
|
|
1645
|
+
if (statement.kind !== "set")
|
|
1646
|
+
for (const component of [...open.keys()])
|
|
1647
|
+
close(component);
|
|
1648
|
+
});
|
|
1649
|
+
for (const component of [...open.keys()])
|
|
1650
|
+
close(component);
|
|
1651
|
+
/** Whether an expression reads a leaf (by component and offset) in `written`. */
|
|
1652
|
+
const reads = (expression, written) => {
|
|
1653
|
+
switch (expression.kind) {
|
|
1654
|
+
case "column": return written.has(`${columns[expression.column].component}:${columns[expression.column].offset}`);
|
|
1655
|
+
case "unary": return reads(expression.operand, written);
|
|
1656
|
+
case "binary":
|
|
1657
|
+
case "logical": return reads(expression.left, written) || reads(expression.right, written);
|
|
1658
|
+
case "conditional": return reads(expression.test, written) || reads(expression.consequent, written) || reads(expression.alternate, written);
|
|
1659
|
+
case "math": return expression.arguments.some(parameter => reads(parameter, written));
|
|
1660
|
+
default: return false;
|
|
1661
|
+
}
|
|
1662
|
+
};
|
|
1663
|
+
/** Fused stores read everything before writing, so no store may read a leaf an earlier one in the group wrote. */
|
|
1664
|
+
const readsEarlierStore = (stores) => {
|
|
1665
|
+
const written = new Set();
|
|
1666
|
+
for (const store of stores) {
|
|
1667
|
+
if (reads(store.value, written))
|
|
1668
|
+
return true;
|
|
1669
|
+
written.add(`${columns[store.column].component}:${columns[store.column].offset}`);
|
|
1670
|
+
}
|
|
1671
|
+
return false;
|
|
1672
|
+
};
|
|
1673
|
+
const groupUses = new Map();
|
|
1674
|
+
/** Matches one expression per lane; null if they don't line up. */
|
|
1675
|
+
const match = (lanes) => {
|
|
1676
|
+
const first = lanes[0];
|
|
1677
|
+
if (lanes.every(lane => JSON.stringify(lane) === JSON.stringify(first)))
|
|
1678
|
+
return { kind: "splat", expression: first };
|
|
1679
|
+
if (lanes.every(lane => lane.kind === "number"))
|
|
1680
|
+
return { kind: "constant", values: lanes.map(lane => lane.kind === "number" ? lane.value : 0) };
|
|
1681
|
+
if (first.kind === "local") {
|
|
1682
|
+
const pack = packOfLocal.get(first.local);
|
|
1683
|
+
if (pack !== undefined && lanes.every((lane, i) => lane.kind === "local" && packOfLocal.get(lane.local) === pack && pack.lanes.get(lane.local) === i)) {
|
|
1684
|
+
for (const lane of lanes)
|
|
1685
|
+
if (lane.kind === "local")
|
|
1686
|
+
groupUses.set(lane.local, (groupUses.get(lane.local) ?? 0) + 1);
|
|
1687
|
+
return { kind: "pack", pack };
|
|
1688
|
+
}
|
|
1689
|
+
return null;
|
|
1690
|
+
}
|
|
1691
|
+
if (first.kind === "column") {
|
|
1692
|
+
const laneColumns = lanes.flatMap(lane => lane.kind === "column" ? [lane.column] : []);
|
|
1693
|
+
const window = laneColumns.length === lanes.length ? windowOf(laneColumns) : null;
|
|
1694
|
+
return window !== null && laneColumns.every((column, i) => laneIn(window, column) === i) ? { kind: "load", column: laneColumns[0], window } : null;
|
|
1695
|
+
}
|
|
1696
|
+
if (first.kind === "binary" && isArithmetic(first.operator)) {
|
|
1697
|
+
const { operator } = first;
|
|
1698
|
+
const pairs = lanes.flatMap(lane => lane.kind === "binary" && lane.operator === operator ? [lane] : []);
|
|
1699
|
+
if (pairs.length !== lanes.length)
|
|
1700
|
+
return null;
|
|
1701
|
+
const left = match(pairs.map(pair => pair.left));
|
|
1702
|
+
const right = left === null ? null : match(pairs.map(pair => pair.right));
|
|
1703
|
+
return left === null || right === null ? null : { kind: "binary", operator, left, right };
|
|
1704
|
+
}
|
|
1705
|
+
if (first.kind === "unary" && (first.operator === "-" || first.operator === "+")) {
|
|
1706
|
+
const operator = first.operator;
|
|
1707
|
+
const operands = lanes.flatMap(lane => lane.kind === "unary" && lane.operator === operator ? [lane.operand] : []);
|
|
1708
|
+
if (operands.length !== lanes.length)
|
|
1709
|
+
return null;
|
|
1710
|
+
const operand = match(operands);
|
|
1711
|
+
return operand === null ? null : operator === "-" ? { kind: "negate", operand } : operand;
|
|
1712
|
+
}
|
|
1713
|
+
if (first.kind === "math" && vectorMath(first.name, first.arguments.length)) {
|
|
1714
|
+
const calls = lanes.flatMap(lane => lane.kind === "math" && lane.name === first.name && lane.arguments.length === first.arguments.length ? [lane] : []);
|
|
1715
|
+
if (calls.length !== lanes.length)
|
|
1716
|
+
return null;
|
|
1717
|
+
const parameters = [];
|
|
1718
|
+
for (let i = 0; i < first.arguments.length; i++) {
|
|
1719
|
+
const parameter = match(calls.map(call => call.arguments[i]));
|
|
1720
|
+
if (parameter === null)
|
|
1721
|
+
return null;
|
|
1722
|
+
parameters.push(parameter);
|
|
1723
|
+
}
|
|
1724
|
+
return { kind: "math", name: first.name, arguments: parameters };
|
|
1725
|
+
}
|
|
1726
|
+
return null;
|
|
1727
|
+
};
|
|
1728
|
+
// Groups: consecutive stores to two or more leaves of one component whose values match lane for lane.
|
|
1729
|
+
const groups = new Map();
|
|
1730
|
+
for (let index = 0; index < body.length;) {
|
|
1731
|
+
const statement = body[index];
|
|
1732
|
+
if (statement.kind !== "store") {
|
|
1733
|
+
index++;
|
|
1734
|
+
continue;
|
|
1735
|
+
}
|
|
1736
|
+
const component = columns[statement.column].component;
|
|
1737
|
+
let end = index;
|
|
1738
|
+
while (end < body.length) {
|
|
1739
|
+
const next = body[end];
|
|
1740
|
+
if (next.kind !== "store" || columns[next.column].component !== component)
|
|
1741
|
+
break;
|
|
1742
|
+
end++;
|
|
1743
|
+
}
|
|
1744
|
+
const stores = body.slice(index, end).flatMap(store => store.kind === "store" ? [store] : []);
|
|
1745
|
+
const window = stores.length >= 2 ? windowOf(stores.map(store => store.column)) : null;
|
|
1746
|
+
const lanes = [];
|
|
1747
|
+
if (window !== null && window.lanes === stores.length)
|
|
1748
|
+
for (const store of stores)
|
|
1749
|
+
lanes[laneIn(window, store.column)] = store.value;
|
|
1750
|
+
const before = new Map(groupUses);
|
|
1751
|
+
const value = window !== null && window.lanes === stores.length && !readsEarlierStore(stores) ? match(lanes) : null;
|
|
1752
|
+
if (window !== null && value !== null) {
|
|
1753
|
+
groups.set(index, { length: stores.length, column: stores[0].column, window, value });
|
|
1754
|
+
const markUsed = (expression) => {
|
|
1755
|
+
if (expression.kind === "pack")
|
|
1756
|
+
expression.pack.used = true;
|
|
1757
|
+
else if (expression.kind === "binary") {
|
|
1758
|
+
markUsed(expression.left);
|
|
1759
|
+
markUsed(expression.right);
|
|
1760
|
+
}
|
|
1761
|
+
else if (expression.kind === "negate")
|
|
1762
|
+
markUsed(expression.operand);
|
|
1763
|
+
else if (expression.kind === "math")
|
|
1764
|
+
expression.arguments.forEach(markUsed);
|
|
1765
|
+
};
|
|
1766
|
+
markUsed(value);
|
|
1767
|
+
}
|
|
1768
|
+
else {
|
|
1769
|
+
groupUses.clear();
|
|
1770
|
+
for (const [local, count] of before)
|
|
1771
|
+
groupUses.set(local, count);
|
|
1772
|
+
}
|
|
1773
|
+
index = end;
|
|
1774
|
+
}
|
|
1775
|
+
// A snapshot `set` whose local is only read through vectors needn't run as a scalar.
|
|
1776
|
+
const skipped = new Set();
|
|
1777
|
+
body.forEach((statement, index) => {
|
|
1778
|
+
if (statement.kind === "set" && packOfLocal.get(statement.local)?.used === true && (uses.get(statement.local) ?? 0) === (groupUses.get(statement.local) ?? 0))
|
|
1779
|
+
skipped.add(index);
|
|
1780
|
+
});
|
|
1781
|
+
return { groups, packs, skipped };
|
|
1782
|
+
};
|
|
1783
|
+
const emitVectorExpression = (expression) => {
|
|
1784
|
+
switch (expression.kind) {
|
|
1785
|
+
case "pack":
|
|
1786
|
+
code.push(op.localGet, ...unsigned(expression.pack.local));
|
|
1787
|
+
return;
|
|
1788
|
+
case "load": return loadWindow(expression.column, expression.window);
|
|
1789
|
+
case "constant":
|
|
1790
|
+
code.push(...vectorConstant(expression.values));
|
|
1791
|
+
return;
|
|
1792
|
+
case "splat": return emitSplat(expression.expression);
|
|
1793
|
+
case "binary":
|
|
1794
|
+
emitVectorExpression(expression.left);
|
|
1795
|
+
emitVectorExpression(expression.right);
|
|
1796
|
+
code.push(...simd(arithmeticVector[expression.operator]));
|
|
1797
|
+
return;
|
|
1798
|
+
case "negate":
|
|
1799
|
+
emitVectorExpression(expression.operand);
|
|
1800
|
+
code.push(...simd(vop.f32Neg));
|
|
1801
|
+
return;
|
|
1802
|
+
case "math":
|
|
1803
|
+
for (const parameter of expression.arguments)
|
|
1804
|
+
emitVectorExpression(parameter);
|
|
1805
|
+
emitVectorMath(expression.name, expression.arguments.length);
|
|
1806
|
+
return;
|
|
1807
|
+
}
|
|
1808
|
+
};
|
|
1809
|
+
/** The row body, with planned groups fused; returns whether anything was. */
|
|
1810
|
+
const emitLaneBody = () => {
|
|
1811
|
+
const { groups, packs, skipped } = planLanes();
|
|
1812
|
+
const body = program.body;
|
|
1813
|
+
for (let index = 0; index < body.length; index++) {
|
|
1814
|
+
const pack = packs.get(index);
|
|
1815
|
+
if (pack?.used === true) {
|
|
1816
|
+
pack.local = scratch(v128Type);
|
|
1817
|
+
loadWindow(pack.column, pack.window);
|
|
1818
|
+
code.push(op.localSet, ...unsigned(pack.local));
|
|
1819
|
+
}
|
|
1820
|
+
const group = groups.get(index);
|
|
1821
|
+
if (group !== undefined) {
|
|
1822
|
+
const value = scratch(v128Type);
|
|
1823
|
+
emitVectorExpression(group.value);
|
|
1824
|
+
code.push(op.localSet, ...unsigned(value));
|
|
1825
|
+
storeWindow(group.column, group.window, value);
|
|
1826
|
+
index += group.length - 1;
|
|
1827
|
+
continue;
|
|
1828
|
+
}
|
|
1829
|
+
if (!skipped.has(index))
|
|
1830
|
+
statement(body[index]);
|
|
1831
|
+
}
|
|
1832
|
+
return groups.size > 0;
|
|
1833
|
+
};
|
|
1834
|
+
/** Whether a value is the same for every row. */
|
|
1835
|
+
const rowIndependent = (expression) => {
|
|
1836
|
+
switch (expression.kind) {
|
|
1837
|
+
case "number":
|
|
1838
|
+
case "boolean":
|
|
1839
|
+
case "resource":
|
|
1840
|
+
case "args": return true;
|
|
1841
|
+
case "unary": return rowIndependent(expression.operand);
|
|
1842
|
+
case "binary":
|
|
1843
|
+
case "logical": return rowIndependent(expression.left) && rowIndependent(expression.right);
|
|
1844
|
+
case "conditional": return rowIndependent(expression.test) && rowIndependent(expression.consequent) && rowIndependent(expression.alternate);
|
|
1845
|
+
case "math": return expression.arguments.every(rowIndependent);
|
|
1846
|
+
default: return false;
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1849
|
+
/**
|
|
1850
|
+
* Whether the planned groups are the whole body and run unchanged on flat vectors of four rows: each group stores
|
|
1851
|
+
* whole elements and reads windows from byte 0 of components with the same stride, so lane `l` of vector `j` is the
|
|
1852
|
+
* same leaf in every operand. Snapshot sets must be skipped, and stamps run as in the across-rows loop.
|
|
1853
|
+
*/
|
|
1854
|
+
const acrossElements = ({ groups, skipped }) => {
|
|
1855
|
+
if (filters > 0 || groups.size === 0)
|
|
1856
|
+
return false;
|
|
1857
|
+
const whole = (column, window, stride) => window.base === 0 && columns[column].stride === stride;
|
|
1858
|
+
const fits = (expression, stride) => {
|
|
1859
|
+
switch (expression.kind) {
|
|
1860
|
+
case "pack": return whole(expression.pack.column, expression.pack.window, stride);
|
|
1861
|
+
case "load": return whole(expression.column, expression.window, stride);
|
|
1862
|
+
case "constant": return true;
|
|
1863
|
+
case "splat": return rowIndependent(expression.expression);
|
|
1864
|
+
case "binary": return fits(expression.left, stride) && fits(expression.right, stride);
|
|
1865
|
+
case "negate": return fits(expression.operand, stride);
|
|
1866
|
+
case "math": return expression.arguments.every(parameter => fits(parameter, stride));
|
|
1867
|
+
}
|
|
1868
|
+
};
|
|
1869
|
+
const body = program.body;
|
|
1870
|
+
for (let index = 0; index < body.length; index++) {
|
|
1871
|
+
const group = groups.get(index);
|
|
1872
|
+
if (group !== undefined) {
|
|
1873
|
+
const { stride } = columns[group.column];
|
|
1874
|
+
if (group.window.base !== 0 || group.window.lanes * 4 !== stride || !fits(group.value, stride))
|
|
1875
|
+
return false;
|
|
1876
|
+
index += group.length - 1;
|
|
1877
|
+
}
|
|
1878
|
+
else if (!skipped.has(index) && body[index].kind !== "stamp")
|
|
1879
|
+
return false;
|
|
1880
|
+
}
|
|
1881
|
+
return true;
|
|
1882
|
+
};
|
|
1883
|
+
/** Vector `vector` of an expression over four rows of `stride`-byte elements; packs are in `packVectors`. */
|
|
1884
|
+
const emitElementExpression = (expression, vector, stride, packVectors) => {
|
|
1885
|
+
switch (expression.kind) {
|
|
1886
|
+
case "pack": {
|
|
1887
|
+
// Every pack a group uses is loaded at its first set, before the group.
|
|
1888
|
+
const local = packVectors.get(expression.pack)?.[vector];
|
|
1889
|
+
if (local === undefined)
|
|
1890
|
+
throw new Error("A pack is used before it's loaded.");
|
|
1891
|
+
code.push(op.localGet, ...unsigned(local));
|
|
1892
|
+
return;
|
|
1893
|
+
}
|
|
1894
|
+
case "load":
|
|
1895
|
+
elementAddress(expression.column);
|
|
1896
|
+
code.push(...simd(vop.load), 2, ...unsigned(16 * vector));
|
|
1897
|
+
return;
|
|
1898
|
+
case "constant":
|
|
1899
|
+
code.push(...vectorConstant([0, 1, 2, 3].map(lane => expression.values[((16 * vector + 4 * lane) % stride) / 4])));
|
|
1900
|
+
return;
|
|
1901
|
+
case "splat": return emitSplat(expression.expression);
|
|
1902
|
+
case "binary":
|
|
1903
|
+
emitElementExpression(expression.left, vector, stride, packVectors);
|
|
1904
|
+
emitElementExpression(expression.right, vector, stride, packVectors);
|
|
1905
|
+
code.push(...simd(arithmeticVector[expression.operator]));
|
|
1906
|
+
return;
|
|
1907
|
+
case "negate":
|
|
1908
|
+
emitElementExpression(expression.operand, vector, stride, packVectors);
|
|
1909
|
+
code.push(...simd(vop.f32Neg));
|
|
1910
|
+
return;
|
|
1911
|
+
case "math":
|
|
1912
|
+
for (const parameter of expression.arguments)
|
|
1913
|
+
emitElementExpression(parameter, vector, stride, packVectors);
|
|
1914
|
+
emitVectorMath(expression.name, expression.arguments.length);
|
|
1915
|
+
return;
|
|
1916
|
+
}
|
|
1917
|
+
};
|
|
1918
|
+
/**
|
|
1919
|
+
* Rows from `start` in groups of four, up to the last whole group, with every group as `stride / 4` full-vector loads,
|
|
1920
|
+
* operations and stores; leaves the row local at the first row not done. Vectors stay inside the four rows' elements,
|
|
1921
|
+
* and each vector's store only touches bytes no other vector reads.
|
|
1922
|
+
*/
|
|
1923
|
+
const elementsLoop = ({ groups, packs }) => {
|
|
1924
|
+
const vectorEnd = scratch(i32Type);
|
|
1925
|
+
code.push(op.localGet, 1, op.localGet, 0, op.i32Sub, op.i32Const, ...signed(-4), op.i32And, op.localGet, 0, op.i32Add, op.localSet, ...unsigned(vectorEnd));
|
|
1926
|
+
code.push(op.block, 0x40, op.loop, 0x40);
|
|
1927
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.localGet, ...unsigned(vectorEnd), op.i32GeS, op.brIf, 1);
|
|
1928
|
+
mask = null;
|
|
1929
|
+
const packVectors = new Map();
|
|
1930
|
+
const body = program.body;
|
|
1931
|
+
for (let index = 0; index < body.length; index++) {
|
|
1932
|
+
const pack = packs.get(index);
|
|
1933
|
+
if (pack?.used === true) {
|
|
1934
|
+
const vectors = Array.from({ length: columns[pack.column].stride / 4 }, (_, vector) => {
|
|
1935
|
+
const local = scratch(v128Type);
|
|
1936
|
+
elementAddress(pack.column);
|
|
1937
|
+
code.push(...simd(vop.load), 2, ...unsigned(16 * vector), op.localSet, ...unsigned(local));
|
|
1938
|
+
return local;
|
|
1939
|
+
});
|
|
1940
|
+
packVectors.set(pack, vectors);
|
|
1941
|
+
}
|
|
1942
|
+
const group = groups.get(index);
|
|
1943
|
+
if (group !== undefined) {
|
|
1944
|
+
const { stride } = columns[group.column];
|
|
1945
|
+
for (let vector = 0; vector < stride / 4; vector++) {
|
|
1946
|
+
const value = scratch(v128Type);
|
|
1947
|
+
emitElementExpression(group.value, vector, stride, packVectors);
|
|
1948
|
+
code.push(op.localSet, ...unsigned(value));
|
|
1949
|
+
elementAddress(group.column);
|
|
1950
|
+
code.push(op.localGet, ...unsigned(value), ...simd(vop.store), 2, ...unsigned(16 * vector));
|
|
1951
|
+
}
|
|
1952
|
+
index += group.length - 1;
|
|
1953
|
+
}
|
|
1954
|
+
else if (body[index].kind === "stamp")
|
|
1955
|
+
rowsStatement(body[index]);
|
|
1956
|
+
}
|
|
1957
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, 4, op.i32Add, op.localSet, ...unsigned(rowLocal), op.br, 0);
|
|
1958
|
+
code.push(op.end, op.end);
|
|
1959
|
+
};
|
|
1960
|
+
try {
|
|
1961
|
+
const parameterCount = 4 + columns.length + 2 * filters + lookupParameters + indexParameters + upParameters;
|
|
1962
|
+
collectFinds(program.body);
|
|
1963
|
+
/** Leaves 1 if any filter's tick at `(row >> shift) * 8` in its `parameter` array is newer than `lastRun`. */
|
|
1964
|
+
const anyNewer = (parameter, shift) => {
|
|
1965
|
+
for (let filter = 0; filter < filters; filter++) {
|
|
1966
|
+
code.push(op.localGet, ...unsigned(parameter(filter)), op.localGet, ...unsigned(rowLocal));
|
|
1967
|
+
if (shift > 0)
|
|
1968
|
+
code.push(op.i32Const, ...signed(shift), op.i32ShrU);
|
|
1969
|
+
code.push(op.i32Const, 3, op.i32Shl, op.i32Add, op.f64Load, 3, 0, op.localGet, 3, op.f64Gt);
|
|
1970
|
+
if (filter > 0)
|
|
1971
|
+
code.push(op.i32Or);
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
/** At a chunk's first row, skips the whole chunk unless a filter's chunk tick is newer. */
|
|
1975
|
+
const skipChunks = () => {
|
|
1976
|
+
const next = scratch(i32Type);
|
|
1977
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.localGet, 0, op.i32Eq, op.localGet, ...unsigned(rowLocal), op.i32Const, ...signed(2 ** chunkShift - 1), op.i32And, op.i32Eqz, op.i32Or);
|
|
1978
|
+
code.push(op.if, 0x40);
|
|
1979
|
+
anyNewer(filterChunkParameter, chunkShift);
|
|
1980
|
+
code.push(op.i32Eqz, op.if, 0x40);
|
|
1981
|
+
// row = min(end, start of the next chunk)
|
|
1982
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, ...signed(chunkShift), op.i32ShrU, op.i32Const, 1, op.i32Add, op.i32Const, ...signed(chunkShift), op.i32Shl, op.localSet, ...unsigned(next));
|
|
1983
|
+
code.push(op.localGet, ...unsigned(next), op.localGet, 1, op.localGet, ...unsigned(next), op.localGet, 1, op.i32LtS, op.select, op.localSet, ...unsigned(rowLocal));
|
|
1984
|
+
code.push(op.br, 2, op.end, op.end);
|
|
1985
|
+
};
|
|
1986
|
+
/** Rows a block skip checks at once: four f64x2 loads of each filter's row ticks. */
|
|
1987
|
+
const blockRows = 8;
|
|
1988
|
+
/**
|
|
1989
|
+
* With SIMD, at a row that's a multiple of `blockRows`, skips that many rows when none passes a filter, testing
|
|
1990
|
+
* two ticks per comparison. Only aligned rows check, so rows that do pass pay one check per block.
|
|
1991
|
+
*/
|
|
1992
|
+
const skipBlocks = () => {
|
|
1993
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, blockRows - 1, op.i32And, op.i32Eqz);
|
|
1994
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, blockRows, op.i32Add, op.localGet, 1, op.i32LeS, op.i32And, op.if, 0x40);
|
|
1995
|
+
for (let filter = 0; filter < filters; filter++) {
|
|
1996
|
+
for (let pair = 0; pair < blockRows / 2; pair++) {
|
|
1997
|
+
code.push(op.localGet, ...unsigned(filterRowParameter(filter)), op.localGet, ...unsigned(rowLocal), op.i32Const, 3, op.i32Shl, op.i32Add);
|
|
1998
|
+
code.push(...simd(vop.load), 3, ...unsigned(16 * pair), op.localGet, 3, ...simd(vop.f64Splat), ...simd(vop.f64Gt));
|
|
1999
|
+
if (filter > 0 || pair > 0)
|
|
2000
|
+
code.push(...simd(vop.or));
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
code.push(...simd(vop.anyTrue), op.i32Eqz, op.if, 0x40);
|
|
2004
|
+
code.push(op.localGet, ...unsigned(rowLocal), op.i32Const, blockRows, op.i32Add, op.localSet, ...unsigned(rowLocal));
|
|
2005
|
+
code.push(op.br, 2, op.end, op.end);
|
|
2006
|
+
};
|
|
2007
|
+
// Scalars are discovered while generating, so code is generated first with locals placed after a provisional scalar count.
|
|
2008
|
+
/** `rows`: four rows at a time where every column is dense; `lanes`: fuse statements within each row. */
|
|
2009
|
+
let fused = false;
|
|
2010
|
+
const generate = (scalarCount, mode) => {
|
|
2011
|
+
code.length = 0;
|
|
2012
|
+
extraLocals.length = 0;
|
|
2013
|
+
rowsLocals.length = 0;
|
|
2014
|
+
// With reductions, the partials' address follows the scalars.
|
|
2015
|
+
const partialsParameter = parameterCount + scalarCount;
|
|
2016
|
+
localBase = partialsParameter + (accumulators.length > 0 ? 1 : 0);
|
|
2017
|
+
rowLocal = scratch(i32Type);
|
|
2018
|
+
code.push(op.localGet, 0, op.localSet, ...unsigned(rowLocal));
|
|
2019
|
+
accumulators.forEach((accumulator, k) => {
|
|
2020
|
+
code.push(op.localGet, ...unsigned(partialsParameter), op.f64Load, 3, ...unsigned(8 * k), op.localSet, ...unsigned(local(accumulator)));
|
|
2021
|
+
});
|
|
2022
|
+
// Floating-point folds wait on the one before, so consecutive rows fold into one of four lanes in turn:
|
|
2023
|
+
// the accumulator, rotated with three more starting at the identity, then combined in a fixed order.
|
|
2024
|
+
const lanes = accumulators.map((_, k) => {
|
|
2025
|
+
const operator = operators[k];
|
|
2026
|
+
const identity = rotated[operator];
|
|
2027
|
+
if (identity === undefined)
|
|
2028
|
+
return null;
|
|
2029
|
+
return [0, 1, 2].map(() => {
|
|
2030
|
+
const lane = scratch(f64Type);
|
|
2031
|
+
code.push(op.f64Const, ...float64(identity.value), op.localSet, ...unsigned(lane));
|
|
2032
|
+
return lane;
|
|
2033
|
+
});
|
|
2034
|
+
});
|
|
2035
|
+
handleLocals.clear();
|
|
2036
|
+
keyLocals.clear();
|
|
2037
|
+
if (lookupParameters > 0)
|
|
2038
|
+
convertLookupParameters();
|
|
2039
|
+
if (indexParameters > 0)
|
|
2040
|
+
convertIndexParameters();
|
|
2041
|
+
stampRangeChunks();
|
|
2042
|
+
if (mode === "rows")
|
|
2043
|
+
rowsLoop();
|
|
2044
|
+
if (mode === "lanes") {
|
|
2045
|
+
const plan = planLanes();
|
|
2046
|
+
if (acrossElements(plan))
|
|
2047
|
+
elementsLoop(plan);
|
|
2048
|
+
}
|
|
2049
|
+
// for (; row < end; row++) { block next { body } }, where with `up` the row and its parent's are rows[n] and parents[n].
|
|
2050
|
+
const slot = rowLocal;
|
|
2051
|
+
if (upMode) {
|
|
2052
|
+
rowLocal = scratch(i32Type);
|
|
2053
|
+
parentLocal = scratch(i32Type);
|
|
2054
|
+
}
|
|
2055
|
+
code.push(op.block, 0x40, op.loop, 0x40);
|
|
2056
|
+
code.push(op.localGet, ...unsigned(slot), op.localGet, 1, op.i32GeS, op.brIf, 1);
|
|
2057
|
+
if (upMode) {
|
|
2058
|
+
code.push(op.localGet, ...unsigned(upParameter(0)), op.localGet, ...unsigned(slot), op.i32Const, 2, op.i32Shl, op.i32Add, op.i32Load, 2, 0, op.localSet, ...unsigned(rowLocal));
|
|
2059
|
+
code.push(op.localGet, ...unsigned(upParameter(1)), op.localGet, ...unsigned(slot), op.i32Const, 2, op.i32Shl, op.i32Add, op.i32Load, 2, 0, op.localSet, ...unsigned(parentLocal));
|
|
2060
|
+
}
|
|
2061
|
+
if (filters > 0)
|
|
2062
|
+
skipChunks();
|
|
2063
|
+
if (filters > 0 && simdEnabled && !upMode)
|
|
2064
|
+
skipBlocks();
|
|
2065
|
+
code.push(op.block, 0x40);
|
|
2066
|
+
// A row that no filter passes goes to the next.
|
|
2067
|
+
if (filters > 0) {
|
|
2068
|
+
anyNewer(filterRowParameter, 0);
|
|
2069
|
+
code.push(op.i32Eqz, op.brIf, 0);
|
|
2070
|
+
}
|
|
2071
|
+
labels.length = 0;
|
|
2072
|
+
labels.push("next");
|
|
2073
|
+
if (mode === "lanes")
|
|
2074
|
+
fused = emitLaneBody();
|
|
2075
|
+
else
|
|
2076
|
+
for (const current of program.body)
|
|
2077
|
+
statement(current);
|
|
2078
|
+
labels.pop();
|
|
2079
|
+
code.push(op.end);
|
|
2080
|
+
accumulators.forEach((accumulator, k) => {
|
|
2081
|
+
const extra = lanes[k];
|
|
2082
|
+
if (extra === null)
|
|
2083
|
+
return;
|
|
2084
|
+
const [first, second, third] = extra;
|
|
2085
|
+
const own = unsigned(local(accumulator));
|
|
2086
|
+
code.push(op.localGet, ...own, op.localGet, ...unsigned(first), op.localSet, ...own);
|
|
2087
|
+
code.push(op.localGet, ...unsigned(second), op.localSet, ...unsigned(first), op.localGet, ...unsigned(third), op.localSet, ...unsigned(second));
|
|
2088
|
+
code.push(op.localSet, ...unsigned(third));
|
|
2089
|
+
});
|
|
2090
|
+
code.push(op.localGet, ...unsigned(slot), op.i32Const, 1, op.i32Add, op.localSet, ...unsigned(slot), op.br, 0);
|
|
2091
|
+
code.push(op.end, op.end);
|
|
2092
|
+
rowLocal = slot;
|
|
2093
|
+
accumulators.forEach((accumulator, k) => {
|
|
2094
|
+
const extra = lanes[k];
|
|
2095
|
+
if (extra === null)
|
|
2096
|
+
return;
|
|
2097
|
+
const combine = rotated[operators[k]].combine;
|
|
2098
|
+
const [first, second, third] = extra;
|
|
2099
|
+
const own = unsigned(local(accumulator));
|
|
2100
|
+
code.push(op.localGet, ...own, op.localGet, ...unsigned(first), combine, op.localGet, ...unsigned(second), op.localGet, ...unsigned(third), combine, combine, op.localSet, ...own);
|
|
2101
|
+
});
|
|
2102
|
+
accumulators.forEach((accumulator, k) => {
|
|
2103
|
+
code.push(op.localGet, ...unsigned(partialsParameter), op.localGet, ...unsigned(local(accumulator)), op.f64Store, 3, ...unsigned(8 * k));
|
|
2104
|
+
});
|
|
2105
|
+
// The function's end.
|
|
2106
|
+
code.push(op.end);
|
|
2107
|
+
};
|
|
2108
|
+
// Across-rows mode doesn't filter rows, so filtered kernels fuse within rows instead.
|
|
2109
|
+
// Accumulators carry from row to row, which neither SIMD mode keeps.
|
|
2110
|
+
// Listed rows aren't consecutive, so `up` programs run one row at a time.
|
|
2111
|
+
let mode = !simdEnabled || accumulators.length > 0 || upMode ? "scalar" : filters > 0 ? "lanes" : "rows";
|
|
2112
|
+
try {
|
|
2113
|
+
generate(0, mode);
|
|
2114
|
+
}
|
|
2115
|
+
catch (error) {
|
|
2116
|
+
if (error !== notVectorizable)
|
|
2117
|
+
throw error;
|
|
2118
|
+
mode = "lanes";
|
|
2119
|
+
generate(0, mode);
|
|
2120
|
+
}
|
|
2121
|
+
if (mode === "lanes" && !fused) {
|
|
2122
|
+
mode = "scalar";
|
|
2123
|
+
generate(0, mode);
|
|
2124
|
+
}
|
|
2125
|
+
const discovered = scalars.length;
|
|
2126
|
+
generate(discovered, mode);
|
|
2127
|
+
if (scalars.length !== discovered)
|
|
2128
|
+
throw unsupported;
|
|
2129
|
+
const vectorized = mode !== "scalar";
|
|
2130
|
+
const parameterTypes = [i32Type, i32Type, f64Type, f64Type, ...columns.map(() => i32Type), ...new Array(2 * filters).fill(i32Type), ...new Array(lookupParameters).fill(f64Type), ...new Array(indexParameters).fill(f64Type), ...new Array(upParameters).fill(i32Type), ...scalars.map(() => f64Type), ...accumulators.length > 0 ? [i32Type] : []];
|
|
2131
|
+
const localTypesList = [...new Array(program.locals).fill(f64Type)];
|
|
2132
|
+
// Locals in order: program locals, then extras in creation order; the row index was the first extra.
|
|
2133
|
+
const declared = [...localTypesList.map(type => [1, type]), ...extraLocals.map(type => [1, type])];
|
|
2134
|
+
const body = [...vector(declared.map(([count, type]) => [...unsigned(count), type])), ...code];
|
|
2135
|
+
const types = [
|
|
2136
|
+
[0x60, ...vector(parameterTypes.map(type => [type])), ...vector([])],
|
|
2137
|
+
[0x60, ...vector([[f64Type], [f64Type]]), ...vector([[f64Type]])],
|
|
2138
|
+
];
|
|
2139
|
+
const importEntries = [
|
|
2140
|
+
[...name("env"), ...name("memory"), 0x02, 0x03, ...unsigned(1), ...unsigned(65536)],
|
|
2141
|
+
...imports.map(functionName => [...name("math"), ...name(functionName), 0x00, ...unsigned(1)]),
|
|
2142
|
+
];
|
|
2143
|
+
const bytes = new Uint8Array([
|
|
2144
|
+
0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,
|
|
2145
|
+
...section(1, vector(types)),
|
|
2146
|
+
...section(2, vector(importEntries)),
|
|
2147
|
+
...section(3, vector([unsigned(0)])),
|
|
2148
|
+
...section(7, vector([[...name("run"), 0x00, ...unsigned(imports.length)]])),
|
|
2149
|
+
...section(10, vector([[...unsigned(body.length), ...body]])),
|
|
2150
|
+
]);
|
|
2151
|
+
return { bytes, scalars, imports, vectorized };
|
|
2152
|
+
}
|
|
2153
|
+
catch (error) {
|
|
2154
|
+
if (error === unsupported)
|
|
2155
|
+
return null;
|
|
2156
|
+
throw error;
|
|
2157
|
+
}
|
|
2158
|
+
};
|
|
2159
|
+
//# sourceMappingURL=wasm.js.map
|