@oasys/oecs 0.5.4 → 0.6.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/CHANGELOG.md +1223 -266
- package/README.md +217 -112
- package/dist/core/ecs/access_check.d.cts +29 -29
- package/dist/core/ecs/access_check.d.ts +29 -29
- package/dist/core/ecs/access_check.d.ts.map +1 -1
- package/dist/core/ecs/archetype.d.cts +217 -209
- package/dist/core/ecs/archetype.d.ts +217 -209
- package/dist/core/ecs/archetype.d.ts.map +1 -1
- package/dist/core/ecs/archetype_closure.d.cts +23 -0
- package/dist/core/ecs/archetype_closure.d.ts +23 -0
- package/dist/core/ecs/archetype_closure.d.ts.map +1 -0
- package/dist/core/ecs/archetype_graph.d.cts +33 -33
- package/dist/core/ecs/archetype_graph.d.ts +33 -33
- package/dist/core/ecs/archetype_graph.d.ts.map +1 -1
- package/dist/core/ecs/archetype_types.d.cts +55 -0
- package/dist/core/ecs/archetype_types.d.ts +55 -0
- package/dist/core/ecs/archetype_types.d.ts.map +1 -0
- package/dist/core/ecs/change_feed.d.cts +53 -0
- package/dist/core/ecs/change_feed.d.ts +53 -0
- package/dist/core/ecs/change_feed.d.ts.map +1 -0
- package/dist/core/ecs/changed_query.d.cts +36 -0
- package/dist/core/ecs/changed_query.d.ts +36 -0
- package/dist/core/ecs/changed_query.d.ts.map +1 -0
- package/dist/core/ecs/chunk_columns.d.cts +49 -0
- package/dist/core/ecs/chunk_columns.d.ts +49 -0
- package/dist/core/ecs/chunk_columns.d.ts.map +1 -0
- package/dist/core/ecs/command_log.d.cts +26 -26
- package/dist/core/ecs/command_log.d.ts +26 -26
- package/dist/core/ecs/command_log.d.ts.map +1 -1
- package/dist/core/ecs/component.d.cts +43 -42
- package/dist/core/ecs/component.d.ts +43 -42
- package/dist/core/ecs/component.d.ts.map +1 -1
- package/dist/core/ecs/component_registry.d.cts +53 -0
- package/dist/core/ecs/component_registry.d.ts +53 -0
- package/dist/core/ecs/component_registry.d.ts.map +1 -0
- package/dist/core/ecs/compute_backend.d.cts +18 -7
- package/dist/core/ecs/compute_backend.d.ts +18 -7
- package/dist/core/ecs/compute_backend.d.ts.map +1 -1
- package/dist/core/ecs/deferred_commands.d.cts +15 -14
- package/dist/core/ecs/deferred_commands.d.ts +15 -14
- package/dist/core/ecs/deferred_commands.d.ts.map +1 -1
- package/dist/core/ecs/dispatch_trace.d.cts +32 -31
- package/dist/core/ecs/dispatch_trace.d.ts +32 -31
- package/dist/core/ecs/dispatch_trace.d.ts.map +1 -1
- package/dist/core/ecs/ecs.d.cts +289 -270
- package/dist/core/ecs/ecs.d.ts +289 -270
- package/dist/core/ecs/ecs.d.ts.map +1 -1
- package/dist/core/ecs/ecs_memory.d.cts +134 -136
- package/dist/core/ecs/ecs_memory.d.ts +134 -136
- package/dist/core/ecs/ecs_memory.d.ts.map +1 -1
- package/dist/core/ecs/ecs_options.d.cts +89 -0
- package/dist/core/ecs/ecs_options.d.ts +89 -0
- package/dist/core/ecs/ecs_options.d.ts.map +1 -0
- package/dist/core/ecs/entity.d.cts +4 -4
- package/dist/core/ecs/entity.d.ts +4 -4
- package/dist/core/ecs/entity_allocator.d.cts +20 -18
- package/dist/core/ecs/entity_allocator.d.ts +20 -18
- package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
- package/dist/core/ecs/event.d.cts +36 -22
- package/dist/core/ecs/event.d.ts +36 -22
- package/dist/core/ecs/event.d.ts.map +1 -1
- package/dist/core/ecs/facades.d.cts +12 -126
- package/dist/core/ecs/facades.d.ts +12 -126
- package/dist/core/ecs/facades.d.ts.map +1 -1
- package/dist/core/ecs/frame_stepper.d.cts +12 -12
- package/dist/core/ecs/frame_stepper.d.ts +12 -12
- package/dist/core/ecs/frame_stepper.d.ts.map +1 -1
- package/dist/core/ecs/frame_trace.d.cts +32 -32
- package/dist/core/ecs/frame_trace.d.ts +32 -32
- package/dist/core/ecs/frame_trace.d.ts.map +1 -1
- package/dist/core/ecs/host_commands.d.cts +103 -85
- package/dist/core/ecs/host_commands.d.ts +103 -85
- package/dist/core/ecs/host_commands.d.ts.map +1 -1
- package/dist/core/ecs/index.d.cts +21 -11
- package/dist/core/ecs/index.d.ts +21 -11
- package/dist/core/ecs/index.d.ts.map +1 -1
- package/dist/core/ecs/observer.d.cts +39 -120
- package/dist/core/ecs/observer.d.ts +39 -120
- package/dist/core/ecs/observer.d.ts.map +1 -1
- package/dist/core/ecs/phase.d.cts +79 -0
- package/dist/core/ecs/phase.d.ts +79 -0
- package/dist/core/ecs/phase.d.ts.map +1 -0
- package/dist/core/ecs/plugin.d.cts +125 -0
- package/dist/core/ecs/plugin.d.ts +125 -0
- package/dist/core/ecs/plugin.d.ts.map +1 -0
- package/dist/core/ecs/plugin_slots.d.cts +26 -0
- package/dist/core/ecs/plugin_slots.d.ts +26 -0
- package/dist/core/ecs/plugin_slots.d.ts.map +1 -0
- package/dist/core/ecs/query.d.cts +208 -578
- package/dist/core/ecs/query.d.ts +208 -578
- package/dist/core/ecs/query.d.ts.map +1 -1
- package/dist/core/ecs/query_cache.d.cts +130 -0
- package/dist/core/ecs/query_cache.d.ts +130 -0
- package/dist/core/ecs/query_cache.d.ts.map +1 -0
- package/dist/core/ecs/query_registry.d.cts +47 -0
- package/dist/core/ecs/query_registry.d.ts +47 -0
- package/dist/core/ecs/query_registry.d.ts.map +1 -0
- package/dist/core/ecs/query_terms.d.cts +126 -0
- package/dist/core/ecs/query_terms.d.ts +126 -0
- package/dist/core/ecs/query_terms.d.ts.map +1 -0
- package/dist/core/ecs/ref.d.cts +100 -39
- package/dist/core/ecs/ref.d.ts +100 -39
- package/dist/core/ecs/ref.d.ts.map +1 -1
- package/dist/core/ecs/relation.d.cts +101 -182
- package/dist/core/ecs/relation.d.ts +101 -182
- package/dist/core/ecs/relation.d.ts.map +1 -1
- package/dist/core/ecs/resource.d.cts +13 -13
- package/dist/core/ecs/resource.d.ts +13 -13
- package/dist/core/ecs/resource_registry.d.cts +5 -5
- package/dist/core/ecs/resource_registry.d.ts +5 -5
- package/dist/core/ecs/resource_registry.d.ts.map +1 -1
- package/dist/core/ecs/row_kinds.d.cts +24 -0
- package/dist/core/ecs/row_kinds.d.ts +24 -0
- package/dist/core/ecs/row_kinds.d.ts.map +1 -0
- package/dist/core/ecs/run_condition.d.cts +23 -23
- package/dist/core/ecs/run_condition.d.ts +23 -23
- package/dist/core/ecs/run_condition.d.ts.map +1 -1
- package/dist/core/ecs/schedule.d.cts +91 -120
- package/dist/core/ecs/schedule.d.ts +91 -120
- package/dist/core/ecs/schedule.d.ts.map +1 -1
- package/dist/core/ecs/schedule_plan.d.cts +33 -0
- package/dist/core/ecs/schedule_plan.d.ts +33 -0
- package/dist/core/ecs/schedule_plan.d.ts.map +1 -0
- package/dist/core/ecs/snapshot.d.cts +77 -0
- package/dist/core/ecs/snapshot.d.ts +77 -0
- package/dist/core/ecs/snapshot.d.ts.map +1 -0
- package/dist/core/ecs/snapshot_mount.d.cts +42 -0
- package/dist/core/ecs/snapshot_mount.d.ts +42 -0
- package/dist/core/ecs/snapshot_mount.d.ts.map +1 -0
- package/dist/core/ecs/sparse_store.d.cts +108 -51
- package/dist/core/ecs/sparse_store.d.ts +108 -51
- package/dist/core/ecs/sparse_store.d.ts.map +1 -1
- package/dist/core/ecs/store.d.cts +527 -473
- package/dist/core/ecs/store.d.ts +527 -473
- package/dist/core/ecs/store.d.ts.map +1 -1
- package/dist/core/ecs/store_layout_listener.d.cts +6 -6
- package/dist/core/ecs/store_layout_listener.d.ts +6 -6
- package/dist/core/ecs/store_types.d.cts +122 -0
- package/dist/core/ecs/store_types.d.ts +122 -0
- package/dist/core/ecs/store_types.d.ts.map +1 -0
- package/dist/core/ecs/system.d.cts +146 -61
- package/dist/core/ecs/system.d.ts +146 -61
- package/dist/core/ecs/system.d.ts.map +1 -1
- package/dist/core/ecs/system_context.d.cts +296 -0
- package/dist/core/ecs/system_context.d.ts +296 -0
- package/dist/core/ecs/system_context.d.ts.map +1 -0
- package/dist/core/ecs/system_set.d.cts +48 -0
- package/dist/core/ecs/system_set.d.ts +48 -0
- package/dist/core/ecs/system_set.d.ts.map +1 -0
- package/dist/core/ecs/utils/arrays.d.cts +15 -1
- package/dist/core/ecs/utils/arrays.d.ts +15 -1
- package/dist/core/ecs/utils/arrays.d.ts.map +1 -1
- package/dist/core/ecs/utils/error.d.cts +82 -6
- package/dist/core/ecs/utils/error.d.ts +82 -6
- package/dist/core/ecs/utils/error.d.ts.map +1 -1
- package/dist/core/ecs/utils/plugin_error.d.cts +10 -0
- package/dist/core/ecs/utils/plugin_error.d.ts +10 -0
- package/dist/core/ecs/utils/plugin_error.d.ts.map +1 -0
- package/dist/core/restore_errors.d.cts +30 -0
- package/dist/core/restore_errors.d.ts +30 -0
- package/dist/core/restore_errors.d.ts.map +1 -0
- package/dist/core/store/action_ring.d.cts +44 -44
- package/dist/core/store/action_ring.d.ts +44 -44
- package/dist/core/store/action_ring.d.ts.map +1 -1
- package/dist/core/store/allocator.d.cts +149 -95
- package/dist/core/store/allocator.d.ts +149 -95
- package/dist/core/store/allocator.d.ts.map +1 -1
- package/dist/core/store/buffer_backed_column.d.cts +17 -17
- package/dist/core/store/buffer_backed_column.d.ts +17 -17
- package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
- package/dist/core/store/column_store.d.cts +124 -86
- package/dist/core/store/column_store.d.ts +124 -86
- package/dist/core/store/column_store.d.ts.map +1 -1
- package/dist/core/store/command_dispatch.d.cts +14 -15
- package/dist/core/store/command_dispatch.d.ts +14 -15
- package/dist/core/store/command_dispatch.d.ts.map +1 -1
- package/dist/core/store/command_ring.d.cts +36 -39
- package/dist/core/store/command_ring.d.ts +36 -39
- package/dist/core/store/command_ring.d.ts.map +1 -1
- package/dist/core/store/descriptor.d.cts +34 -17
- package/dist/core/store/descriptor.d.ts +34 -17
- package/dist/core/store/descriptor.d.ts.map +1 -1
- package/dist/core/store/entity_index.d.cts +34 -35
- package/dist/core/store/entity_index.d.ts +34 -35
- package/dist/core/store/entity_index.d.ts.map +1 -1
- package/dist/core/store/event_ring.d.cts +36 -38
- package/dist/core/store/event_ring.d.ts +36 -38
- package/dist/core/store/event_ring.d.ts.map +1 -1
- package/dist/core/store/extend.d.cts +13 -7
- package/dist/core/store/extend.d.ts +13 -7
- package/dist/core/store/extend.d.ts.map +1 -1
- package/dist/core/store/grow.d.cts +2 -2
- package/dist/core/store/grow.d.ts +2 -2
- package/dist/core/store/grow.d.ts.map +1 -1
- package/dist/core/store/header.d.cts +31 -27
- package/dist/core/store/header.d.ts +31 -27
- package/dist/core/store/header.d.ts.map +1 -1
- package/dist/core/store/index.d.cts +10 -10
- package/dist/core/store/index.d.ts +10 -10
- package/dist/core/store/index.d.ts.map +1 -1
- package/dist/core/store/layout_ops.d.cts +71 -62
- package/dist/core/store/layout_ops.d.ts +71 -62
- package/dist/core/store/layout_ops.d.ts.map +1 -1
- package/dist/core/store/region_table.d.cts +28 -21
- package/dist/core/store/region_table.d.ts +28 -21
- package/dist/core/store/region_table.d.ts.map +1 -1
- package/dist/core/store/snapshot.d.cts +31 -16
- package/dist/core/store/snapshot.d.ts +31 -16
- package/dist/core/store/snapshot.d.ts.map +1 -1
- package/dist/core/store/state_hash.d.cts +12 -12
- package/dist/core/store/state_hash.d.ts +12 -12
- package/dist/core/store/state_hash.d.ts.map +1 -1
- package/dist/core/store/store_regions.d.cts +10 -10
- package/dist/core/store/store_regions.d.ts +10 -10
- package/dist/core/store/store_regions.d.ts.map +1 -1
- package/dist/core/store/vendored_abi/abi.d.cts +27 -2
- package/dist/core/store/vendored_abi/abi.d.ts +27 -2
- package/dist/core/store/vendored_abi/abi.d.ts.map +1 -1
- package/dist/host_commands-B2KMx8O2.cjs +1 -0
- package/dist/host_commands-ClVPvhSa.cjs +2 -0
- package/dist/host_commands-CwxVQS1z.js +1524 -0
- package/dist/host_commands-nJvTy88E.js +1667 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -10
- package/dist/index.d.ts +15 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.development.cjs +1 -1
- package/dist/index.development.js +5804 -5203
- package/dist/index.js +5323 -4764
- package/dist/internal.cjs +2 -2
- package/dist/internal.d.cts +5 -2
- package/dist/internal.d.ts +5 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.development.cjs +1 -1
- package/dist/internal.development.js +70 -20
- package/dist/internal.js +138 -83
- package/dist/plugins/abi-D3V-QUSf.cjs +1 -0
- package/dist/plugins/abi-NP8pNxpd.js +42 -0
- package/dist/plugins/arrays-Dr_1hCjL.js +28 -0
- package/dist/plugins/arrays-Dt-Joc4i.cjs +1 -0
- package/dist/plugins/assertions-gtDVfbnQ.js +6 -0
- package/dist/plugins/assertions-z5GQd_bB.cjs +1 -0
- package/dist/{extensions → plugins}/editor/editor.d.cts +54 -54
- package/dist/{extensions → plugins}/editor/editor.d.ts +54 -54
- package/dist/plugins/editor/editor.d.ts.map +1 -0
- package/dist/{extensions → plugins}/editor/field_handle.d.cts +12 -12
- package/dist/{extensions → plugins}/editor/field_handle.d.ts +12 -12
- package/dist/plugins/editor/field_handle.d.ts.map +1 -0
- package/dist/plugins/editor/index.d.cts +22 -0
- package/dist/plugins/editor/index.d.ts +22 -0
- package/dist/plugins/editor/index.d.ts.map +1 -0
- package/dist/plugins/editor.cjs +1 -0
- package/dist/plugins/editor.d.cts +1 -0
- package/dist/plugins/editor.d.ts +1 -0
- package/dist/plugins/editor.development.cjs +1 -0
- package/dist/{extensions/editor/index.development.js → plugins/editor.development.js} +81 -64
- package/dist/{extensions/editor/index.js → plugins/editor.js} +81 -64
- package/dist/plugins/events/event_channel.d.cts +13 -0
- package/dist/plugins/events/event_channel.d.ts +13 -0
- package/dist/plugins/events/event_channel.d.ts.map +1 -0
- package/dist/plugins/events/event_registry.d.cts +22 -0
- package/dist/plugins/events/event_registry.d.ts +22 -0
- package/dist/plugins/events/event_registry.d.ts.map +1 -0
- package/dist/plugins/events/facade.d.cts +26 -0
- package/dist/plugins/events/facade.d.ts +26 -0
- package/dist/plugins/events/facade.d.ts.map +1 -0
- package/dist/plugins/events/index.d.cts +10 -0
- package/dist/plugins/events/index.d.ts +10 -0
- package/dist/plugins/events/index.d.ts.map +1 -0
- package/dist/plugins/events.cjs +1 -0
- package/dist/plugins/events.d.cts +1 -0
- package/dist/plugins/events.d.ts +1 -0
- package/dist/plugins/events.development.cjs +1 -0
- package/dist/plugins/events.development.js +174 -0
- package/dist/plugins/events.js +159 -0
- package/dist/plugins/observers/index.d.cts +23 -0
- package/dist/plugins/observers/index.d.ts +23 -0
- package/dist/plugins/observers/index.d.ts.map +1 -0
- package/dist/plugins/observers/observer_registry.d.cts +101 -0
- package/dist/plugins/observers/observer_registry.d.ts +101 -0
- package/dist/plugins/observers/observer_registry.d.ts.map +1 -0
- package/dist/plugins/observers.cjs +1 -0
- package/dist/plugins/observers.d.cts +1 -0
- package/dist/plugins/observers.d.ts +1 -0
- package/dist/plugins/observers.development.cjs +1 -0
- package/dist/plugins/observers.development.js +431 -0
- package/dist/plugins/observers.js +403 -0
- package/dist/plugins/relation_store-BsoegrZh.js +313 -0
- package/dist/plugins/relation_store-DQKSnxsm.cjs +1 -0
- package/dist/plugins/relation_store-RBhpcE28.cjs +1 -0
- package/dist/plugins/relation_store-RqW5Snx6.js +328 -0
- package/dist/plugins/relations/builtin_relations.d.cts +48 -0
- package/dist/plugins/relations/builtin_relations.d.ts +48 -0
- package/dist/plugins/relations/builtin_relations.d.ts.map +1 -0
- package/dist/plugins/relations/facade.d.cts +73 -0
- package/dist/plugins/relations/facade.d.ts +73 -0
- package/dist/plugins/relations/facade.d.ts.map +1 -0
- package/dist/plugins/relations/index.d.cts +11 -0
- package/dist/plugins/relations/index.d.ts +11 -0
- package/dist/plugins/relations/index.d.ts.map +1 -0
- package/dist/{core/ecs → plugins/relations}/relation_service.d.cts +85 -97
- package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +85 -97
- package/dist/plugins/relations/relation_service.d.ts.map +1 -0
- package/dist/plugins/relations/relation_store.d.cts +177 -0
- package/dist/plugins/relations/relation_store.d.ts +177 -0
- package/dist/plugins/relations/relation_store.d.ts.map +1 -0
- package/dist/plugins/relations.cjs +1 -0
- package/dist/plugins/relations.d.cts +1 -0
- package/dist/plugins/relations.d.ts +1 -0
- package/dist/plugins/relations.development.cjs +1 -0
- package/dist/plugins/relations.development.js +603 -0
- package/dist/plugins/relations.js +553 -0
- package/dist/plugins/snapshots/index.d.cts +33 -0
- package/dist/plugins/snapshots/index.d.ts +33 -0
- package/dist/plugins/snapshots/index.d.ts.map +1 -0
- package/dist/plugins/snapshots/resume.d.cts +57 -0
- package/dist/plugins/snapshots/resume.d.ts +57 -0
- package/dist/plugins/snapshots/resume.d.ts.map +1 -0
- package/dist/plugins/snapshots/snapshot_service.d.cts +59 -0
- package/dist/plugins/snapshots/snapshot_service.d.ts +59 -0
- package/dist/plugins/snapshots/snapshot_service.d.ts.map +1 -0
- package/dist/plugins/snapshots.cjs +1 -0
- package/dist/plugins/snapshots.d.cts +1 -0
- package/dist/plugins/snapshots.d.ts +1 -0
- package/dist/plugins/snapshots.development.cjs +1 -0
- package/dist/plugins/snapshots.development.js +737 -0
- package/dist/plugins/snapshots.js +737 -0
- package/dist/plugins/solid/index.d.cts +8 -0
- package/dist/plugins/solid/index.d.ts +8 -0
- package/dist/plugins/solid/index.d.ts.map +1 -0
- package/dist/plugins/solid/solid.d.cts +97 -0
- package/dist/plugins/solid/solid.d.ts +97 -0
- package/dist/plugins/solid/solid.d.ts.map +1 -0
- package/dist/plugins/solid.cjs +1 -0
- package/dist/plugins/solid.d.cts +1 -0
- package/dist/plugins/solid.d.ts +1 -0
- package/dist/plugins/solid.development.cjs +1 -0
- package/dist/plugins/solid.development.js +319 -0
- package/dist/plugins/solid.js +319 -0
- package/dist/plugins/workers/index.d.cts +75 -0
- package/dist/plugins/workers/index.d.ts +75 -0
- package/dist/plugins/workers/index.d.ts.map +1 -0
- package/dist/plugins/workers/node_threads.d.cts +25 -0
- package/dist/plugins/workers/node_threads.d.ts +25 -0
- package/dist/plugins/workers/node_threads.d.ts.map +1 -0
- package/dist/plugins/workers/plan.d.cts +61 -0
- package/dist/plugins/workers/plan.d.ts +61 -0
- package/dist/plugins/workers/plan.d.ts.map +1 -0
- package/dist/plugins/workers/pool.d.cts +144 -0
- package/dist/plugins/workers/pool.d.ts +144 -0
- package/dist/plugins/workers/pool.d.ts.map +1 -0
- package/dist/plugins/workers/protocol.d.cts +112 -0
- package/dist/plugins/workers/protocol.d.ts +112 -0
- package/dist/plugins/workers/protocol.d.ts.map +1 -0
- package/dist/plugins/workers/worker_bind.d.cts +64 -0
- package/dist/plugins/workers/worker_bind.d.ts +64 -0
- package/dist/plugins/workers/worker_bind.d.ts.map +1 -0
- package/dist/plugins/workers/worker_loop.d.cts +14 -0
- package/dist/plugins/workers/worker_loop.d.ts +14 -0
- package/dist/plugins/workers/worker_loop.d.ts.map +1 -0
- package/dist/plugins/workers.cjs +1 -0
- package/dist/plugins/workers.d.cts +1 -0
- package/dist/plugins/workers.d.ts +1 -0
- package/dist/plugins/workers.development.cjs +1 -0
- package/dist/plugins/workers.development.js +596 -0
- package/dist/plugins/workers.js +474 -0
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.d.cts +4 -4
- package/dist/primitives.d.ts +4 -4
- package/dist/primitives.development.cjs +1 -1
- package/dist/primitives.development.js +66 -22
- package/dist/primitives.js +66 -22
- package/dist/shared-BKl12xF1.js +132 -0
- package/dist/shared-Dk-pACZT.cjs +1 -0
- package/dist/shared.cjs +1 -1
- package/dist/shared.d.cts +7 -7
- package/dist/shared.d.ts +7 -7
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.development.cjs +1 -1
- package/dist/shared.development.js +4 -3
- package/dist/shared.js +4 -3
- package/dist/topological_sort-Cc_yXqPT.js +346 -0
- package/dist/topological_sort-vp1imU6D.cjs +1 -0
- package/dist/type_primitives/assertions.d.cts +12 -16
- package/dist/type_primitives/assertions.d.ts +12 -16
- package/dist/type_primitives/assertions.d.ts.map +1 -1
- package/dist/type_primitives/binary_heap/binary_heap.d.cts +2 -6
- package/dist/type_primitives/binary_heap/binary_heap.d.ts +2 -6
- package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
- package/dist/type_primitives/bitset/bitset.d.cts +7 -11
- package/dist/type_primitives/bitset/bitset.d.ts +7 -11
- package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
- package/dist/type_primitives/brand.d.cts +2 -7
- package/dist/type_primitives/brand.d.ts +2 -7
- package/dist/type_primitives/brand.d.ts.map +1 -1
- package/dist/type_primitives/error.d.cts +1 -2
- package/dist/type_primitives/error.d.ts +1 -2
- package/dist/type_primitives/error.d.ts.map +1 -1
- package/dist/type_primitives/index.d.cts +1 -1
- package/dist/type_primitives/index.d.ts +1 -1
- package/dist/type_primitives/sparse_map/sparse_map.d.cts +3 -7
- package/dist/type_primitives/sparse_map/sparse_map.d.ts +3 -7
- package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
- package/dist/type_primitives/sparse_set/sparse_set.d.cts +2 -6
- package/dist/type_primitives/sparse_set/sparse_set.d.ts +2 -6
- package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
- package/dist/type_primitives/topological_sort/topological_sort.d.cts +1 -5
- package/dist/type_primitives/topological_sort/topological_sort.d.ts +1 -5
- package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
- package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +16 -15
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +16 -15
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/version.d.cts +3 -3
- package/dist/version.d.ts +3 -3
- package/dist/worker.cjs +1 -0
- package/dist/worker.d.cts +17 -0
- package/dist/worker.d.ts +17 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.development.cjs +1 -0
- package/dist/worker.development.js +253 -0
- package/dist/worker.js +253 -0
- package/package.json +363 -191
- package/dist/core/ecs/builtin_relations.d.cts +0 -43
- package/dist/core/ecs/builtin_relations.d.ts +0 -43
- package/dist/core/ecs/builtin_relations.d.ts.map +0 -1
- package/dist/core/ecs/event_registry.d.cts +0 -22
- package/dist/core/ecs/event_registry.d.ts +0 -22
- package/dist/core/ecs/event_registry.d.ts.map +0 -1
- package/dist/core/ecs/relation_service.d.ts.map +0 -1
- package/dist/core/ecs/resume.d.cts +0 -85
- package/dist/core/ecs/resume.d.ts +0 -85
- package/dist/core/ecs/resume.d.ts.map +0 -1
- package/dist/core/ecs/snapshot_service.d.cts +0 -94
- package/dist/core/ecs/snapshot_service.d.ts +0 -94
- package/dist/core/ecs/snapshot_service.d.ts.map +0 -1
- package/dist/extensions/editor/editor.d.ts.map +0 -1
- package/dist/extensions/editor/field_handle.d.ts.map +0 -1
- package/dist/extensions/editor/index.cjs +0 -1
- package/dist/extensions/editor/index.d.cts +0 -21
- package/dist/extensions/editor/index.d.ts +0 -21
- package/dist/extensions/editor/index.d.ts.map +0 -1
- package/dist/extensions/editor/index.development.cjs +0 -1
- package/dist/extensions/reactive/ecs_sync.d.cts +0 -214
- package/dist/extensions/reactive/ecs_sync.d.ts +0 -214
- package/dist/extensions/reactive/ecs_sync.d.ts.map +0 -1
- package/dist/extensions/reactive/index.cjs +0 -1
- package/dist/extensions/reactive/index.d.cts +0 -23
- package/dist/extensions/reactive/index.d.ts +0 -23
- package/dist/extensions/reactive/index.d.ts.map +0 -1
- package/dist/extensions/reactive/index.development.cjs +0 -1
- package/dist/extensions/reactive/index.development.js +0 -215
- package/dist/extensions/reactive/index.js +0 -215
- package/dist/extensions/solid/index.cjs +0 -1
- package/dist/extensions/solid/index.d.cts +0 -6
- package/dist/extensions/solid/index.d.ts +0 -6
- package/dist/extensions/solid/index.d.ts.map +0 -1
- package/dist/extensions/solid/index.development.cjs +0 -1
- package/dist/extensions/solid/index.development.js +0 -40
- package/dist/extensions/solid/index.js +0 -36
- package/dist/extensions/solid/kernel_solid.d.cts +0 -45
- package/dist/extensions/solid/kernel_solid.d.ts +0 -45
- package/dist/extensions/solid/kernel_solid.d.ts.map +0 -1
- package/dist/host_commands-BlR3oZ3x.js +0 -2406
- package/dist/host_commands-C2cpU3yC.cjs +0 -1
- package/dist/internal-BoxWl4dG.js +0 -2565
- package/dist/internal-CGBEwfeB.cjs +0 -2
- package/dist/interop-CT-REx0W.cjs +0 -1
- package/dist/interop-CcY6ASQc.js +0 -18
- package/dist/interop-DqxleBo7.js +0 -18
- package/dist/interop-T1HZ-Dpa.cjs +0 -1
- package/dist/kernel-Cz2Kxlwl.js +0 -240
- package/dist/kernel-DgyrLFjW.js +0 -227
- package/dist/kernel-sw7ScKWu.cjs +0 -1
- package/dist/kernel-yWV3XnAb.cjs +0 -1
- package/dist/reactive/array.d.cts +0 -24
- package/dist/reactive/array.d.ts +0 -24
- package/dist/reactive/array.d.ts.map +0 -1
- package/dist/reactive/index.cjs +0 -1
- package/dist/reactive/index.d.cts +0 -11
- package/dist/reactive/index.d.ts +0 -11
- package/dist/reactive/index.d.ts.map +0 -1
- package/dist/reactive/index.development.cjs +0 -1
- package/dist/reactive/index.development.js +0 -18
- package/dist/reactive/index.js +0 -18
- package/dist/reactive/interop.d.cts +0 -19
- package/dist/reactive/interop.d.ts +0 -19
- package/dist/reactive/interop.d.ts.map +0 -1
- package/dist/reactive/kernel.d.cts +0 -73
- package/dist/reactive/kernel.d.ts +0 -73
- package/dist/reactive/kernel.d.ts.map +0 -1
- package/dist/reactive/map.d.cts +0 -16
- package/dist/reactive/map.d.ts +0 -16
- package/dist/reactive/map.d.ts.map +0 -1
- package/dist/reactive/shallow.d.cts +0 -11
- package/dist/reactive/shallow.d.ts +0 -11
- package/dist/reactive/shallow.d.ts.map +0 -1
- package/dist/reactive/struct.d.cts +0 -10
- package/dist/reactive/struct.d.ts +0 -10
- package/dist/reactive/struct.d.ts.map +0 -1
- package/dist/shallow-Bs39EPh1.js +0 -150
- package/dist/shallow-C5YmTbtb.cjs +0 -1
- package/dist/shallow-CiFC70Dz.js +0 -159
- package/dist/shallow-DQ8aG51_.cjs +0 -1
- package/dist/shared-B4v0L1cw.js +0 -109
- package/dist/shared-DU78k0pU.cjs +0 -1
- package/dist/topological_sort-BDvEyb9W.cjs +0 -1
- package/dist/topological_sort-DK6EjpWa.js +0 -135
- package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
- package/dist/typed_arrays-DIVwVy5_.js +0 -258
|
@@ -1,93 +1,110 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* BufferAllocator
|
|
2
|
+
* BufferAllocator, pluggable buffer source for the SAB layer.
|
|
3
3
|
*
|
|
4
4
|
* The engine has historically allocated its SAB as a fresh
|
|
5
5
|
* `new SharedArrayBuffer(totalBytes)` inside `createColumnStore`.
|
|
6
6
|
* A WASM backend needs the SAB to optionally be backed by a
|
|
7
|
-
* `WebAssembly.Memory.buffer` instead, so
|
|
7
|
+
* `WebAssembly.Memory.buffer` instead, so a compute backend can read and write the live
|
|
8
8
|
* ECS columns through its own memory handle. This module abstracts the
|
|
9
9
|
* "where does the buffer come from" decision behind a single function
|
|
10
10
|
* type.
|
|
11
11
|
*
|
|
12
12
|
* Contract for every `BufferAllocator`:
|
|
13
13
|
* - Returns a `SharedArrayBuffer` of byteLength >= `bytes`.
|
|
14
|
-
* -
|
|
14
|
+
* - May detach any prior buffer the implementation has handed out
|
|
15
15
|
* (e.g., `WebAssembly.Memory.grow` detaches existing typed-array
|
|
16
|
-
* views into the previous buffer). Callers
|
|
17
|
-
* they need to preserve
|
|
18
|
-
* - Returned buffers
|
|
16
|
+
* views into the previous buffer). Callers must snapshot any data
|
|
17
|
+
* they need to preserve before invoking the allocator.
|
|
18
|
+
* - Returned buffers may be larger than `bytes` (e.g., wasm-memory
|
|
19
19
|
* rounds up to 64 KiB page boundaries). Callers must rely on the
|
|
20
|
-
* SAB header
|
|
20
|
+
* SAB header and descriptor for the canonical layout, not on
|
|
21
21
|
* `buffer.byteLength`.
|
|
22
22
|
*
|
|
23
|
-
* The default `DEFAULT_SAB_ALLOCATOR` does `new SharedArrayBuffer(bytes)
|
|
24
|
-
*
|
|
23
|
+
* The default `DEFAULT_SAB_ALLOCATOR` does `new SharedArrayBuffer(bytes)`,
|
|
24
|
+
* fast, allocation-per-call, prior buffers untouched. Production code
|
|
25
25
|
* paths that don't care about wasm interop stay on this.
|
|
26
26
|
*
|
|
27
27
|
* `wasmMemoryAllocator(memory)` returns an allocator that grows the
|
|
28
28
|
* given `WebAssembly.Memory` (in 64 KiB page increments) as needed and
|
|
29
29
|
* returns its current buffer. Used by a host so the
|
|
30
|
-
* engine's SAB
|
|
30
|
+
* engine's SAB is the module's own memory.
|
|
31
31
|
*/
|
|
32
32
|
/**
|
|
33
33
|
* Source of `SharedArrayBuffer`s for the SAB layer. See the file header
|
|
34
|
-
* for the contract
|
|
34
|
+
* for the contract, in particular, the detachment caveat for in-place
|
|
35
35
|
* implementations.
|
|
36
36
|
*
|
|
37
37
|
* The optional `isInPlace` marker tells the SAB layer that
|
|
38
38
|
* **TypedArray and DataView views built over a returned buffer remain
|
|
39
|
-
* valid after a subsequent allocator call
|
|
39
|
+
* valid after a subsequent allocator call**, reads and writes through
|
|
40
40
|
* the old views land on the same underlying memory the new buffer
|
|
41
41
|
* exposes. The `extendColumnStore` fast path uses this hint to skip the
|
|
42
42
|
* snapshot+restore + view-rebuild work that's only necessary when the
|
|
43
43
|
* memory actually moves.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
45
|
+
* `isInPlace` does not promise the SAB *reference* stays
|
|
46
46
|
* identical. `growableSabAllocator` happens to return the same SAB
|
|
47
47
|
* instance every time (`SharedArrayBuffer.prototype.grow` resizes in
|
|
48
|
-
* place)
|
|
48
|
+
* place). `wasmMemoryAllocator` on shared `WebAssembly.Memory`
|
|
49
49
|
* returns a *new* SAB ref after `memory.grow()`, but old views built
|
|
50
|
-
* over the previous ref keep working
|
|
51
|
-
* memory mapped at the same address. Verified empirically
|
|
52
|
-
*
|
|
50
|
+
* over the previous ref keep working. V8 keeps the underlying linear
|
|
51
|
+
* memory mapped at the same address. Verified empirically on Bun and V8:
|
|
52
|
+
* writes via an old `Int32Array(old_ref, off, len)` after
|
|
53
53
|
* `memory.grow()` are visible through a fresh view over the new ref,
|
|
54
|
-
* and vice versa. Default allocator omits the marker
|
|
54
|
+
* and vice versa. Default allocator omits the marker
|
|
55
55
|
* `growableSabAllocator` and `wasmMemoryAllocator` set it.
|
|
56
56
|
*/
|
|
57
57
|
export interface BufferAllocator {
|
|
58
58
|
/** Returns a buffer of byteLength >= `bytes`. The historical name is
|
|
59
|
-
* "SAB", but the return is `ArrayBufferLike
|
|
59
|
+
* "SAB", but the return is `ArrayBufferLike`. `growableSabAllocator` and
|
|
60
60
|
* `wasmMemoryAllocator` produce a `SharedArrayBuffer` (the SAB profile),
|
|
61
|
-
* while `
|
|
62
|
-
* `ArrayBuffer` reserved at the cap (the pure-TS heap profile
|
|
61
|
+
* while `heapArrayBufferAllocator` produces a plain fixed (non-resizable)
|
|
62
|
+
* `ArrayBuffer` reserved at the cap (the pure-TS heap profile, no
|
|
63
63
|
* cross-origin isolation required). The store layer treats the backing
|
|
64
|
-
* uniformly
|
|
64
|
+
* uniformly. Only the WASM or worker boundary narrows back to
|
|
65
65
|
* `SharedArrayBuffer`. */
|
|
66
66
|
(bytes: number): ArrayBufferLike;
|
|
67
67
|
readonly isInPlace?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The allocator reserves the whole cap in one buffer at the first call, and
|
|
70
|
+
* the buffer never grows.
|
|
71
|
+
*
|
|
72
|
+
* `byteLength` then holds the cap and not the used size, so the tail cursor
|
|
73
|
+
* for a new column region must come from the header `capacity` instead. See
|
|
74
|
+
* `tailCursorBytes`. An allocator that grows its buffer to the live extent
|
|
75
|
+
* omits this marker, because for it `byteLength` is the tail.
|
|
76
|
+
*
|
|
77
|
+
* This is a property of the allocator and not of the buffer class. The heap
|
|
78
|
+
* profile reserves a fixed `ArrayBuffer`, and `fixedSabAllocator` reserves a
|
|
79
|
+
* fixed `SharedArrayBuffer` for the same reason. Both need the same tail
|
|
80
|
+
* rule.
|
|
81
|
+
*/
|
|
82
|
+
readonly reservedAtCap?: boolean;
|
|
68
83
|
}
|
|
69
84
|
/**
|
|
70
85
|
* The only allocator shape a **live `Store`** accepts. The engine makes
|
|
71
|
-
* "a live Store is backed by an in-place allocator" a correctness invariant
|
|
86
|
+
* "a live Store is backed by an in-place allocator" a correctness invariant,
|
|
72
87
|
* the flush loops hoist entity-index views across grows. This brand moves
|
|
73
|
-
* that invariant from runtime convention to the type
|
|
74
|
-
* `growableSabAllocator
|
|
75
|
-
* return it
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
88
|
+
* that invariant from runtime convention to the type and construction boundary.
|
|
89
|
+
* `growableSabAllocator`, `wasmMemoryAllocator` and `heapArrayBufferAllocator`
|
|
90
|
+
* return it. `DEFAULT_SAB_ALLOCATOR` keeps the wide `BufferAllocator` type, so
|
|
91
|
+
* it cannot typecheck where a live-Store backing is required. An allocator that
|
|
92
|
+
* is not in-place stays valid for snapshot or test sizing only.
|
|
93
|
+
*
|
|
94
|
+
* The brand says nothing about *shared* against *heap* backing.
|
|
95
|
+
* `heapArrayBufferAllocator`'s fixed `ArrayBuffer` is as in-place as a growable
|
|
96
|
+
* SAB. It is reserved at the full cap up front and never moves, so grow and
|
|
97
|
+
* extend relocate columns *within* it (`copyWithin`) rather than resizing the
|
|
98
|
+
* buffer. Existing views stay valid, the same guarantee
|
|
99
|
+
* `SharedArrayBuffer.prototype.grow` gives by resizing in place.
|
|
83
100
|
*/
|
|
84
101
|
export type InPlaceBufferAllocator = BufferAllocator & {
|
|
85
102
|
readonly isInPlace: true;
|
|
86
103
|
};
|
|
87
104
|
/**
|
|
88
105
|
* Thrown when an allocator cannot satisfy a request because its by-design
|
|
89
|
-
* byte ceiling is reached
|
|
90
|
-
*
|
|
106
|
+
* byte ceiling is reached. The cap is a runaway-growth signal, not a limit to
|
|
107
|
+
* paper over, so there is deliberately no grow-beyond-cap fallback.
|
|
91
108
|
* Typed so `Store`'s grow handler can recognise the cap case and re-throw
|
|
92
109
|
* with the caller's declared sizing intent attached without ever
|
|
93
110
|
* catching-to-recover.
|
|
@@ -105,8 +122,8 @@ export declare class StoreCapExceededError extends Error {
|
|
|
105
122
|
/** Thrown when a **SAB-producing** allocator runs in an environment that
|
|
106
123
|
* doesn't expose `SharedArrayBuffer`. The fix is environment-level (the host
|
|
107
124
|
* must serve the page cross-origin isolated, or be a runtime like Bun that
|
|
108
|
-
* exposes SAB unconditionally)
|
|
109
|
-
* (`memory: {
|
|
125
|
+
* exposes SAB unconditionally). Or choose the pure-TS heap profile
|
|
126
|
+
* (`memory: { backing: "heap" }`, `heapArrayBufferAllocator`), which needs no SAB
|
|
110
127
|
* and no cross-origin isolation. Lives on the allocator (not the store)
|
|
111
128
|
* because the allocator is the only thing that constructs a SAB. */
|
|
112
129
|
export declare class SabUnavailableError extends Error {
|
|
@@ -116,78 +133,80 @@ export declare class SabUnavailableError extends Error {
|
|
|
116
133
|
* Allocate a fresh `SharedArrayBuffer` per call. Prior buffers are
|
|
117
134
|
* untouched and remain valid for as long as the caller holds references.
|
|
118
135
|
* This is the default used by `createColumnStore` when no allocator is
|
|
119
|
-
* provided. Throws `SabUnavailableError` in a runtime without SAB
|
|
136
|
+
* provided. Throws `SabUnavailableError` in a runtime without SAB, the
|
|
120
137
|
* availability check lives here (the SAB-producing seam), not in
|
|
121
138
|
* `createColumnStore`, so a heap allocator never trips it.
|
|
122
139
|
*/
|
|
123
140
|
export declare const DEFAULT_SAB_ALLOCATOR: BufferAllocator;
|
|
124
141
|
/**
|
|
125
142
|
* Allocator that backs the SAB by a single growable `SharedArrayBuffer`
|
|
126
|
-
* (created with `{ maxByteLength: maxBytes }`).
|
|
127
|
-
*
|
|
143
|
+
* (created with `{ maxByteLength: maxBytes }`). The first call allocates. A
|
|
144
|
+
* later call grows the existing buffer and returns it.
|
|
145
|
+
*
|
|
146
|
+
* JavaScriptCore pays for the growth. It has no fast store path for a
|
|
147
|
+
* TypedArray view over a growable `SharedArrayBuffer`. A column read costs what
|
|
148
|
+
* a fixed buffer costs, but every column write costs far more. A system that
|
|
149
|
+
* writes a column in a loop is thus much slower here than the same system on
|
|
150
|
+
* the heap profile. The cost is per access and not per byte, so a small world
|
|
151
|
+
* pays the same penalty as a large one. V8 shows no such difference at the time
|
|
152
|
+
* of measurement. Safari and Bun are JavaScriptCore.
|
|
153
|
+
*
|
|
154
|
+
* Use `fixedSabAllocator` if you need a shared buffer and your code runs on
|
|
155
|
+
* JavaScriptCore. It reserves the cap at construction and keeps the fast store
|
|
156
|
+
* path on both engine families. It gives up the growth, and nothing else.
|
|
128
157
|
*
|
|
129
158
|
* The `isInPlace` marker is set so `extendColumnStore` knows it can
|
|
130
|
-
* reuse the buffer rather than allocating fresh and copying data
|
|
159
|
+
* reuse the buffer rather than allocating fresh and copying data,
|
|
131
160
|
* existing typed-array views built with explicit `(byteOffset, length)`
|
|
132
161
|
* stay valid after `.grow()` in Bun + V8 (the underlying mapping extends
|
|
133
162
|
* in place rather than relocating).
|
|
134
163
|
*
|
|
135
|
-
* Sizing: `maxBytes` is committed *virtual* memory, not resident
|
|
164
|
+
* Sizing: `maxBytes` is committed *virtual* memory, not resident ram,
|
|
136
165
|
* physical pages fault in lazily as the SAB actually grows. A larger cap costs
|
|
137
166
|
* more time per allocation than a smaller one, because V8 does per-byte
|
|
138
|
-
* bookkeeping when it constructs the buffer.
|
|
139
|
-
* a
|
|
140
|
-
*
|
|
141
|
-
* stays under the 256 MiB default keeps the quicker Store construction.
|
|
167
|
+
* bookkeeping when it constructs the buffer. A caller with a bigger world can
|
|
168
|
+
* pass a larger cap. A caller that stays under the 256 MiB default keeps the
|
|
169
|
+
* quicker Store construction.
|
|
142
170
|
*
|
|
143
|
-
*
|
|
144
|
-
* exceeding it is
|
|
171
|
+
* The 256 MiB default is a hard design ceiling, not a soft target, and
|
|
172
|
+
* exceeding it is intended to be fatal. There is deliberately no
|
|
145
173
|
* grow-beyond-cap fallback or compaction pass (see the loud
|
|
146
174
|
* note at the `bytes > maxBytes` throw below). If you are here because
|
|
147
175
|
* a workload died at the cap and you are tempted to add a fresh-allocator
|
|
148
|
-
* realloc fallback: don't
|
|
149
|
-
*
|
|
176
|
+
* realloc fallback: don't. The cap is structurally out of reach for a real
|
|
177
|
+
* workload.
|
|
150
178
|
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* ~1000-row budget, so the doubling + in-place hole tax never fires on
|
|
163
|
-
* the hot path.
|
|
164
|
-
* The entity-ID space itself caps total live entities at `1<<20` ≈ 1M
|
|
165
|
-
* (20-bit index in `EntityID`). Even at that absolute ceiling — ~1M rows
|
|
166
|
-
* × 49 B × ~3 (post-double capacity + abandoned holes) ≈ ~150 MiB columns
|
|
167
|
-
* + 12 MiB index — the workload still lands under 256 MiB. You cannot reach
|
|
168
|
-
* the cap without first exhausting the entity-ID space. Hitting it
|
|
169
|
-
* therefore signals a real defect upstream (runaway entity creation), not
|
|
170
|
-
* a sizing shortfall to paper over.
|
|
179
|
+
* Why it is out of reach. The entity-index region dominates the footprint, and
|
|
180
|
+
* it is a virtual reservation of `ENTITY_INDEX_DEFAULT_CAPACITY` (1<<20) slots
|
|
181
|
+
* of `ENTITY_INDEX_BYTES_PER_SLOT` each, of which only the touched pages are
|
|
182
|
+
* resident. Live column data is a small part beside it, because an archetype
|
|
183
|
+
* is prewarmed at `DEFAULT_COLUMN_CAPACITY` rows and a real world stays inside
|
|
184
|
+
* that, so a column grow never fires on the hot path. The entity-id space caps
|
|
185
|
+
* live entities at `1<<20` (the 20-bit index in `EntityID`). Even at that
|
|
186
|
+
* ceiling, the columns plus the index still land under the default cap. You
|
|
187
|
+
* cannot reach the cap without first exhausting the entity-id space. Hitting
|
|
188
|
+
* it therefore signals a real defect upstream (runaway entity creation), not a
|
|
189
|
+
* sizing shortfall to paper over.
|
|
171
190
|
*
|
|
172
191
|
* Cited verification: a Bun runtime check
|
|
173
192
|
* confirms `new Int32Array(buffer, off, len)` retains identical byteOffset,
|
|
174
|
-
* length, and stored values after `.grow()
|
|
193
|
+
* length, and stored values after `.grow()`. DataView byteLength
|
|
175
194
|
* auto-tracks the grown buffer.
|
|
176
195
|
*
|
|
177
196
|
* Used by the `extendColumnStore` fast path during lazy archetype
|
|
178
|
-
* registration
|
|
197
|
+
* registration, keeps existing column views valid so
|
|
179
198
|
* `refreshViews` is a no-op for old archetypes.
|
|
180
199
|
*/
|
|
181
200
|
export declare function growableSabAllocator(maxBytes?: number): InPlaceBufferAllocator;
|
|
182
201
|
/**
|
|
183
202
|
* Allocator that backs the store by a single **fixed (non-resizable) plain
|
|
184
203
|
* `ArrayBuffer`** reserved at the full `maxBytes` cap up front. This is the
|
|
185
|
-
* pure-TS **heap profile
|
|
204
|
+
* pure-TS **heap profile**, the oecs default: no `SharedArrayBuffer`,
|
|
186
205
|
* hence no cross-origin isolation
|
|
187
|
-
* (COOP
|
|
206
|
+
* (COOP and COEP) requirement, and no worker or WASM transfer (single-process worlds
|
|
188
207
|
* only).
|
|
189
208
|
*
|
|
190
|
-
*
|
|
209
|
+
* Why fixed, not resizable (the 0.5.3 iteration-perf fix): V8 has no fast
|
|
191
210
|
* element-access path for TypedArray views over a **resizable or growable**
|
|
192
211
|
* `ArrayBuffer`, because each `col[i]` reads the mutable length again. Thus a
|
|
193
212
|
* loop over a column is much slower than the same loop over a fixed buffer.
|
|
@@ -197,48 +216,83 @@ export declare function growableSabAllocator(maxBytes?: number): InPlaceBufferAl
|
|
|
197
216
|
*
|
|
198
217
|
* How growth still works in place: the cap is reserved as one fixed buffer at
|
|
199
218
|
* construction. A resizable buffer was originally chosen so `.resize()` could
|
|
200
|
-
* grow in place without moving views
|
|
201
|
-
* store's grow
|
|
219
|
+
* grow in place without moving views. A fixed buffer never moves either, the
|
|
220
|
+
* store's grow and extend relocate columns to the tail *within* this buffer
|
|
202
221
|
* (`copyWithin`), so the buffer object and every existing view stay valid.
|
|
203
222
|
* `isInPlace: true` therefore still holds, and the
|
|
204
223
|
* entity-index-hoist-across-grow invariant is preserved. The store keys its
|
|
205
|
-
* tail cursor off the header `capacity` (the logical high-water),
|
|
206
|
-
* `buffer.byteLength
|
|
224
|
+
* tail cursor off the header `capacity` (the logical high-water), not
|
|
225
|
+
* `buffer.byteLength`, which is now always `maxBytes` (the same decoupling the
|
|
207
226
|
* wasm page-rounded allocator already relied on).
|
|
208
227
|
*
|
|
209
228
|
* - Memory cost is unchanged: a fixed `ArrayBuffer(maxBytes)` faults pages in
|
|
210
229
|
* lazily (untouched pages cost no RSS), exactly like the resizable buffer's
|
|
211
|
-
* `maxByteLength` reservation
|
|
212
|
-
*
|
|
213
|
-
* resizable buffer).
|
|
230
|
+
* `maxByteLength` reservation. A large reservation on a small world stays
|
|
231
|
+
* small in resident memory, the same as the old resizable buffer.
|
|
214
232
|
* - same 256 MiB default cap with hard-ceiling semantics: a request
|
|
215
|
-
* past `maxBytes` throws `StoreCapExceededError
|
|
233
|
+
* past `maxBytes` throws `StoreCapExceededError`, runaway growth signal,
|
|
216
234
|
* not a limit to route around.
|
|
217
235
|
*
|
|
218
236
|
* Why a non-shared buffer suffices: `Atomics` live only on the cross-thread
|
|
219
|
-
* command
|
|
220
|
-
* world needs no sharing. `stateHash` determinism works here too
|
|
237
|
+
* command, event and action rings, never on the core store path, so a single-process
|
|
238
|
+
* world needs no sharing. `stateHash` determinism works here too. FNV1a over
|
|
221
239
|
* column bytes is backing-agnostic.
|
|
222
240
|
*/
|
|
223
|
-
export declare function
|
|
241
|
+
export declare function heapArrayBufferAllocator(maxBytes?: number): InPlaceBufferAllocator;
|
|
224
242
|
/**
|
|
225
|
-
* Allocator that backs the
|
|
243
|
+
* Allocator that backs the store by a single **fixed (non-growable)
|
|
244
|
+
* `SharedArrayBuffer`** reserved at the full `maxBytes` cap up front. This is
|
|
245
|
+
* the shared profile without the growth, and it exists for one measured
|
|
246
|
+
* reason.
|
|
247
|
+
*
|
|
248
|
+
* Why fixed, not growable: JavaScriptCore has no fast store path for a
|
|
249
|
+
* TypedArray view over a **growable** `SharedArrayBuffer`. A column read there
|
|
250
|
+
* costs what a fixed buffer costs, but every column write costs far
|
|
251
|
+
* more, so an iteration-bound system that updates a column is far slower on
|
|
252
|
+
* JavaScriptCore than the same system on the heap profile. Safari and Bun are
|
|
253
|
+
* JavaScriptCore. V8 shows no such difference at the time of measurement, so
|
|
254
|
+
* this is one engine family paying and the other not. A fixed buffer restores
|
|
255
|
+
* the fast store path on both.
|
|
256
|
+
*
|
|
257
|
+
* This is `heapArrayBufferAllocator` with a `SharedArrayBuffer` in place of the
|
|
258
|
+
* `ArrayBuffer`, and it keeps every property the shared profile needs: the
|
|
259
|
+
* buffer is shared, so a worker or a WASM module reads the same bytes, and it
|
|
260
|
+
* never moves, so views built over it stay valid. Growth still works the way
|
|
261
|
+
* the heap profile's does, the store relocates columns to the tail *within*
|
|
262
|
+
* the reserved buffer, and the tail comes from the header `capacity` because
|
|
263
|
+
* `reservedAtCap` says `byteLength` is the cap.
|
|
264
|
+
*
|
|
265
|
+
* The trade: the cap is reserved at construction instead of growing into. That
|
|
266
|
+
* is address space and not resident memory, the same as the heap profile's
|
|
267
|
+
* reservation.
|
|
268
|
+
*/
|
|
269
|
+
export declare function fixedSabAllocator(maxBytes?: number): InPlaceBufferAllocator;
|
|
270
|
+
/**
|
|
271
|
+
* Allocator that backs the SAB by `memory.buffer`, i.e. makes the engine's
|
|
226
272
|
* live SAB *be* a WASM module's `WebAssembly.Memory`. Grows the memory in
|
|
227
273
|
* 64 KiB page increments when `bytes` exceeds the current buffer.
|
|
228
274
|
*
|
|
275
|
+
* This backing is growable by nature. A shared `WebAssembly.Memory` gives a
|
|
276
|
+
* growable `SharedArrayBuffer` and can give nothing else. That looks like the
|
|
277
|
+
* shape `growableSabAllocator` warns about, and it is not. A probe measured a
|
|
278
|
+
* column write through a shared `WebAssembly.Memory` against the growable
|
|
279
|
+
* `SharedArrayBuffer` on JavaScriptCore and found no such cost. A WASM-backed
|
|
280
|
+
* world costs what the heap profile costs on every runtime tested, so
|
|
281
|
+
* `fixedSabAllocator` is no remedy here and none is needed.
|
|
282
|
+
*
|
|
229
283
|
* This is the **opt-in storage backing for the WASM path**. A consumer
|
|
230
284
|
* that attaches a WASM `ComputeBackend` passes
|
|
231
|
-
* `bufferAllocator: wasmMemoryAllocator(memory)` so the
|
|
232
|
-
* the same bytes the host's columns live in
|
|
233
|
-
*
|
|
234
|
-
* gets the default
|
|
235
|
-
* alloc
|
|
236
|
-
*
|
|
285
|
+
* `bufferAllocator: wasmMemoryAllocator(memory)` so the module's systems read
|
|
286
|
+
* and write the same bytes the host's columns live in, zero-copy across the FFI
|
|
287
|
+
* boundary. A pure-TS world omits `bufferAllocator`
|
|
288
|
+
* and gets the default, `DEFAULT_SAB_ALLOCATOR`, a fresh `SharedArrayBuffer`
|
|
289
|
+
* per alloc. Or it opts into `growableSabAllocator` for the in-place fast path,
|
|
290
|
+
* with no WASM module at all. "The SAB is the WebAssembly.Memory" is thus a
|
|
237
291
|
* property the WASM backend opts into, paid for only when WASM is in use.
|
|
238
292
|
*
|
|
239
293
|
* After `memory.grow()` on a *shared* memory, `memory.buffer` returns a
|
|
240
294
|
* new `SharedArrayBuffer` reference, but **TypedArrays and DataViews
|
|
241
|
-
* built over the previous reference remain valid
|
|
295
|
+
* built over the previous reference remain valid**. V8 keeps the
|
|
242
296
|
* underlying linear memory mapped at the same address, so reads and
|
|
243
297
|
* writes through old views land on the same bytes the new buffer
|
|
244
298
|
* exposes. This is why `isInPlace: true` is safe here (verified
|
|
@@ -249,7 +303,7 @@ export declare function heapArraybufferAllocator(maxBytes?: number): InPlaceBuff
|
|
|
249
303
|
* construct a fresh DataView over the post-grow buffer (the SAB-layer
|
|
250
304
|
* extend path does this).
|
|
251
305
|
*
|
|
252
|
-
* Throws if `memory` was not constructed with `shared: true
|
|
306
|
+
* Throws if `memory` was not constructed with `shared: true`, the SAB
|
|
253
307
|
* contract requires `SharedArrayBuffer`-backed memory. Throws a contextual
|
|
254
308
|
* error if a needed grow fails (cap reached or host refusal): the JS API's
|
|
255
309
|
* `memory.grow` throws a RangeError on cap overrun rather than returning the
|