@oasys/oecs 0.5.3 → 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 +1399 -276
- package/README.md +327 -169
- package/dist/core/ecs/access_check.d.cts +31 -31
- package/dist/core/ecs/access_check.d.ts +31 -31
- package/dist/core/ecs/access_check.d.ts.map +1 -1
- package/dist/core/ecs/archetype.d.cts +273 -205
- package/dist/core/ecs/archetype.d.ts +273 -205
- 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 +34 -34
- package/dist/core/ecs/archetype_graph.d.ts +34 -34
- 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 +30 -30
- package/dist/core/ecs/command_log.d.ts +30 -30
- package/dist/core/ecs/command_log.d.ts.map +1 -1
- package/dist/core/ecs/component.d.cts +45 -44
- package/dist/core/ecs/component.d.ts +45 -44
- 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 +337 -276
- package/dist/core/ecs/ecs.d.ts +337 -276
- 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 +24 -22
- package/dist/core/ecs/entity_allocator.d.ts +24 -22
- package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
- package/dist/core/ecs/event.d.cts +37 -23
- package/dist/core/ecs/event.d.ts +37 -23
- 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 +34 -34
- package/dist/core/ecs/frame_trace.d.ts +34 -34
- package/dist/core/ecs/frame_trace.d.ts.map +1 -1
- package/dist/core/ecs/host_commands.d.cts +107 -89
- package/dist/core/ecs/host_commands.d.ts +107 -89
- package/dist/core/ecs/host_commands.d.ts.map +1 -1
- package/dist/core/ecs/index.d.cts +22 -12
- package/dist/core/ecs/index.d.ts +22 -12
- package/dist/core/ecs/index.d.ts.map +1 -1
- package/dist/core/ecs/observer.d.cts +41 -122
- package/dist/core/ecs/observer.d.ts +41 -122
- 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 +219 -568
- package/dist/core/ecs/query.d.ts +219 -568
- 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 +129 -16
- package/dist/core/ecs/ref.d.ts +129 -16
- package/dist/core/ecs/ref.d.ts.map +1 -1
- package/dist/core/ecs/relation.d.cts +105 -186
- package/dist/core/ecs/relation.d.ts +105 -186
- package/dist/core/ecs/relation.d.ts.map +1 -1
- package/dist/core/ecs/resource.d.cts +14 -14
- package/dist/core/ecs/resource.d.ts +14 -14
- package/dist/core/ecs/resource_registry.d.cts +6 -6
- package/dist/core/ecs/resource_registry.d.ts +6 -6
- 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 +98 -114
- package/dist/core/ecs/schedule.d.ts +98 -114
- 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 +110 -53
- package/dist/core/ecs/sparse_store.d.ts +110 -53
- package/dist/core/ecs/sparse_store.d.ts.map +1 -1
- package/dist/core/ecs/store.d.cts +644 -511
- package/dist/core/ecs/store.d.ts +644 -511
- package/dist/core/ecs/store.d.ts.map +1 -1
- package/dist/core/ecs/store_layout_listener.d.cts +8 -8
- package/dist/core/ecs/store_layout_listener.d.ts +8 -8
- 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 +151 -66
- package/dist/core/ecs/system.d.ts +151 -66
- 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 +87 -4
- package/dist/core/ecs/utils/error.d.ts +87 -4
- 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 +48 -49
- package/dist/core/store/action_ring.d.ts +48 -49
- package/dist/core/store/action_ring.d.ts.map +1 -1
- package/dist/core/store/allocator.d.cts +166 -114
- package/dist/core/store/allocator.d.ts +166 -114
- package/dist/core/store/allocator.d.ts.map +1 -1
- package/dist/core/store/buffer_backed_column.d.cts +21 -22
- package/dist/core/store/buffer_backed_column.d.ts +21 -22
- package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
- package/dist/core/store/column_store.d.cts +138 -100
- package/dist/core/store/column_store.d.ts +138 -100
- 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 +41 -45
- package/dist/core/store/command_ring.d.ts +41 -45
- package/dist/core/store/command_ring.d.ts.map +1 -1
- package/dist/core/store/descriptor.d.cts +35 -18
- package/dist/core/store/descriptor.d.ts +35 -18
- 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 +40 -42
- package/dist/core/store/event_ring.d.ts +40 -42
- package/dist/core/store/event_ring.d.ts.map +1 -1
- package/dist/core/store/extend.d.cts +15 -9
- package/dist/core/store/extend.d.ts +15 -9
- package/dist/core/store/extend.d.ts.map +1 -1
- package/dist/core/store/grow.d.cts +3 -3
- package/dist/core/store/grow.d.ts +3 -3
- package/dist/core/store/grow.d.ts.map +1 -1
- package/dist/core/store/header.d.cts +37 -33
- package/dist/core/store/header.d.ts +37 -33
- 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 +72 -63
- package/dist/core/store/layout_ops.d.ts +72 -63
- 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 +14 -14
- package/dist/core/store/state_hash.d.ts +14 -14
- 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 +16 -11
- package/dist/index.d.ts +16 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.development.cjs +1 -1
- package/dist/index.development.js +6709 -5729
- package/dist/index.js +5664 -4743
- 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 +56 -56
- package/dist/{extensions → plugins}/editor/editor.d.ts +56 -56
- package/dist/plugins/editor/editor.d.ts.map +1 -0
- package/dist/{extensions → plugins}/editor/field_handle.d.cts +13 -13
- package/dist/{extensions → plugins}/editor/field_handle.d.ts +13 -13
- 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} +83 -66
- package/dist/{extensions/editor/index.js → plugins/editor.js} +83 -66
- 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 +93 -105
- package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +93 -105
- 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 +18 -17
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +18 -17
- 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 +4 -4
- package/dist/version.d.ts +4 -4
- 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-3jyFfWNg.js +0 -2326
- package/dist/host_commands-DNf0f6ko.cjs +0 -1
- package/dist/internal-C9jjL90H.js +0 -2485
- package/dist/internal-RZN14uMw.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-9S1pY_Iw.js +0 -159
- package/dist/shallow-C5YmTbtb.cjs +0 -1
- package/dist/shallow-DQ8aG51_.cjs +0 -1
- package/dist/shallow-DfnAm9vG.js +0 -150
- package/dist/shared-BMXh9hxm.cjs +0 -1
- package/dist/shared-DQKK0i-E.js +0 -109
- package/dist/topological_sort-BDvEyb9W.cjs +0 -1
- package/dist/topological_sort-DK6EjpWa.js +0 -135
- package/dist/typed_arrays-BcXcnzB4.js +0 -258
- package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
|
@@ -1,95 +1,112 @@
|
|
|
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
|
-
*
|
|
7
|
-
* `WebAssembly.Memory.buffer` so
|
|
6
|
+
* A WASM backend needs the SAB to optionally be backed by a
|
|
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
|
-
* The only allocator shape a **live `Store`** accepts
|
|
71
|
-
* "a live Store is backed by an in-place allocator" a correctness invariant
|
|
85
|
+
* The only allocator shape a **live `Store`** accepts. The engine makes
|
|
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
|
-
* with the caller's declared sizing intent attached
|
|
109
|
+
* with the caller's declared sizing intent attached without ever
|
|
93
110
|
* catching-to-recover.
|
|
94
111
|
*/
|
|
95
112
|
export declare class StoreCapExceededError extends Error {
|
|
@@ -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,131 +133,166 @@ 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
|
|
136
|
-
* physical pages fault in lazily as the SAB actually grows.
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* gains are ~10 µs/Store-construction by staying under 256 MB.
|
|
164
|
+
* Sizing: `maxBytes` is committed *virtual* memory, not resident ram,
|
|
165
|
+
* physical pages fault in lazily as the SAB actually grows. A larger cap costs
|
|
166
|
+
* more time per allocation than a smaller one, because V8 does per-byte
|
|
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
|
|
145
|
-
* grow-beyond-cap fallback or compaction pass (see
|
|
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
|
|
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
|
-
* Cited verification
|
|
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
|
|
186
|
-
*
|
|
187
|
-
* (COOP
|
|
204
|
+
* pure-TS **heap profile**, the oecs default: no `SharedArrayBuffer`,
|
|
205
|
+
* hence no cross-origin isolation
|
|
206
|
+
* (COOP and COEP) requirement, and no worker or WASM transfer (single-process worlds
|
|
188
207
|
* only).
|
|
189
208
|
*
|
|
190
|
-
*
|
|
191
|
-
* element-access path for TypedArray views over a **resizable
|
|
192
|
-
* `ArrayBuffer
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* regressed all iteration-bound systems ~5× (the cross-library `packed_5`
|
|
198
|
-
* scenario: 0.5.2 ~86k op/s → 0.5.3 ~420k). A fixed buffer restores the fast path.
|
|
209
|
+
* Why fixed, not resizable (the 0.5.3 iteration-perf fix): V8 has no fast
|
|
210
|
+
* element-access path for TypedArray views over a **resizable or growable**
|
|
211
|
+
* `ArrayBuffer`, because each `col[i]` reads the mutable length again. Thus a
|
|
212
|
+
* loop over a column is much slower than the same loop over a fixed buffer.
|
|
213
|
+
* Version 0.3.x gave each column its own fixed buffer. The change in 0.5.0 to
|
|
214
|
+
* one resizable arena made every iteration-bound system slower, and it gave no
|
|
215
|
+
* signal. A fixed buffer restores the fast path.
|
|
199
216
|
*
|
|
200
217
|
* How growth still works in place: the cap is reserved as one fixed buffer at
|
|
201
218
|
* construction. A resizable buffer was originally chosen so `.resize()` could
|
|
202
|
-
* grow in place without moving views
|
|
203
|
-
* 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
|
|
204
221
|
* (`copyWithin`), so the buffer object and every existing view stay valid.
|
|
205
|
-
* `isInPlace: true` therefore still holds, and
|
|
222
|
+
* `isInPlace: true` therefore still holds, and the
|
|
206
223
|
* entity-index-hoist-across-grow invariant is preserved. The store keys its
|
|
207
|
-
* tail cursor off the header `capacity` (the logical high-water),
|
|
208
|
-
* `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
|
|
209
226
|
* wasm page-rounded allocator already relied on).
|
|
210
227
|
*
|
|
211
228
|
* - Memory cost is unchanged: a fixed `ArrayBuffer(maxBytes)` faults pages in
|
|
212
229
|
* lazily (untouched pages cost no RSS), exactly like the resizable buffer's
|
|
213
|
-
* `maxByteLength` reservation
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* past `maxBytes` throws `StoreCapExceededError` — runaway growth signal,
|
|
230
|
+
* `maxByteLength` reservation. A large reservation on a small world stays
|
|
231
|
+
* small in resident memory, the same as the old resizable buffer.
|
|
232
|
+
* - same 256 MiB default cap with hard-ceiling semantics: a request
|
|
233
|
+
* past `maxBytes` throws `StoreCapExceededError`, runaway growth signal,
|
|
218
234
|
* not a limit to route around.
|
|
219
235
|
*
|
|
220
236
|
* Why a non-shared buffer suffices: `Atomics` live only on the cross-thread
|
|
221
|
-
* command
|
|
222
|
-
* 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
|
|
223
239
|
* column bytes is backing-agnostic.
|
|
224
240
|
*/
|
|
225
|
-
export declare function
|
|
241
|
+
export declare function heapArrayBufferAllocator(maxBytes?: number): InPlaceBufferAllocator;
|
|
226
242
|
/**
|
|
227
|
-
* 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
|
|
228
272
|
* live SAB *be* a WASM module's `WebAssembly.Memory`. Grows the memory in
|
|
229
273
|
* 64 KiB page increments when `bytes` exceeds the current buffer.
|
|
230
274
|
*
|
|
231
|
-
* This is
|
|
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
|
+
*
|
|
283
|
+
* This is the **opt-in storage backing for the WASM path**. A consumer
|
|
232
284
|
* that attaches a WASM `ComputeBackend` passes
|
|
233
|
-
* `bufferAllocator: wasmMemoryAllocator(memory)` so the
|
|
234
|
-
* the same bytes the host's columns live in
|
|
235
|
-
*
|
|
236
|
-
* gets the default
|
|
237
|
-
* alloc
|
|
238
|
-
*
|
|
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
|
|
239
291
|
* property the WASM backend opts into, paid for only when WASM is in use.
|
|
240
292
|
*
|
|
241
293
|
* After `memory.grow()` on a *shared* memory, `memory.buffer` returns a
|
|
242
294
|
* new `SharedArrayBuffer` reference, but **TypedArrays and DataViews
|
|
243
|
-
* built over the previous reference remain valid
|
|
295
|
+
* built over the previous reference remain valid**. V8 keeps the
|
|
244
296
|
* underlying linear memory mapped at the same address, so reads and
|
|
245
297
|
* writes through old views land on the same bytes the new buffer
|
|
246
298
|
* exposes. This is why `isInPlace: true` is safe here (verified
|
|
@@ -251,7 +303,7 @@ export declare function heapArraybufferAllocator(maxBytes?: number): InPlaceBuff
|
|
|
251
303
|
* construct a fresh DataView over the post-grow buffer (the SAB-layer
|
|
252
304
|
* extend path does this).
|
|
253
305
|
*
|
|
254
|
-
* Throws if `memory` was not constructed with `shared: true
|
|
306
|
+
* Throws if `memory` was not constructed with `shared: true`, the SAB
|
|
255
307
|
* contract requires `SharedArrayBuffer`-backed memory. Throws a contextual
|
|
256
308
|
* error if a needed grow fails (cap reached or host refusal): the JS API's
|
|
257
309
|
* `memory.grow` throws a RangeError on cap overrun rather than returning the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allocator.d.ts","sourceRoot":"","sources":["../../../src/core/store/allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;8BAO0B;IAC1B,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"allocator.d.ts","sourceRoot":"","sources":["../../../src/core/store/allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;;8BAO0B;IAC1B,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC;AAEpF;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;aAG9B,cAAc,EAAE,MAAM;IACtC;6DACyD;aACzC,QAAQ,EAAE,MAAM,GAAG,IAAI;gBAJvC,OAAO,EAAE,MAAM,EACC,cAAc,EAAE,MAAM;IACtC;6DACyD;IACzC,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvC,OAAO,CAAC,EAAE,YAAY;CAKvB;AAED;;;;;;oEAMoE;AACpE,qBAAa,mBAAoB,SAAQ,KAAK;;CAe7C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,eAGnC,CAAC;AAsEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,MAA0B,GAAG,sBAAsB,CA6BjG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,wBAAwB,CACvC,QAAQ,GAAE,MAA0B,GAClC,sBAAsB,CAuBxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAA0B,GAAG,sBAAsB,CAqB9F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,sBAAsB,CA4DtF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ColumnBacking } from '../../type_primitives/index.cjs';
|
|
2
2
|
import { AnyTypedArray } from './column_store.cjs';
|
|
3
|
-
/** Thrown when an operation would grow a fixed-capacity SAB column. The
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
/** Thrown when an operation would grow a fixed-capacity SAB column. The column
|
|
4
|
+
* does not own its buffer, so it cannot grow. The store's grow path
|
|
5
|
+
* (`growColumnStore`, then `refreshView`) is the only way capacity rises, and
|
|
6
|
+
* this throw makes a missed grow surface at once rather than corrupt state. */
|
|
7
7
|
export declare class StoreColumnOverflowError extends Error {
|
|
8
8
|
readonly capacity: number;
|
|
9
9
|
readonly requested: number;
|
|
@@ -13,25 +13,25 @@ export declare class BufferBackedColumn<T extends AnyTypedArray> implements Colu
|
|
|
13
13
|
private _buf;
|
|
14
14
|
private _capacity;
|
|
15
15
|
private _len;
|
|
16
|
-
/** `view`
|
|
16
|
+
/** `view` must be a TypedArray constructed over a SAB at the correct
|
|
17
17
|
* stride alignment (see `createColumnStore`). The column treats
|
|
18
|
-
* `view.length` as the immutable capacity for the lifetime of this view
|
|
18
|
+
* `view.length` as the immutable capacity for the lifetime of this view,
|
|
19
19
|
* call `refreshView` after a SAB realloc to point at the new view. */
|
|
20
20
|
constructor(view: T);
|
|
21
21
|
/** Swap the backing view to one over a freshly-grown SAB. The caller is
|
|
22
22
|
* responsible for having copied the first `length` elements into
|
|
23
23
|
* `newView` already (`growColumnStore` does this). The logical length is
|
|
24
|
-
* preserved across the swap
|
|
24
|
+
* preserved across the swap. Capacity becomes `newView.length`.
|
|
25
25
|
*
|
|
26
|
-
* Used to honour the `view_stamp` invariant after a host-side SAB realloc
|
|
27
|
-
*
|
|
28
|
-
* the next read
|
|
26
|
+
* Used to honour the `view_stamp` invariant after a host-side SAB realloc:
|
|
27
|
+
* every cached column view must be rebuilt before
|
|
28
|
+
* the next read or write. */
|
|
29
29
|
refreshView(newView: T): void;
|
|
30
30
|
get length(): number;
|
|
31
31
|
get capacity(): number;
|
|
32
32
|
push(value: number): void;
|
|
33
33
|
pop(): number;
|
|
34
|
-
|
|
34
|
+
getAt(i: number): number;
|
|
35
35
|
setAt(i: number, value: number): void;
|
|
36
36
|
/** Move the last element into slot `i`, decrement length. Returns the
|
|
37
37
|
* value previously at slot `i`. Matches `GrowableTypedArray.swapRemove`. */
|
|
@@ -39,24 +39,23 @@ export declare class BufferBackedColumn<T extends AnyTypedArray> implements Colu
|
|
|
39
39
|
clear(): void;
|
|
40
40
|
/** Set the logical length directly, declaring that `[0, len)` of the backing
|
|
41
41
|
* SAB view already holds valid data. The snapshot-mount path
|
|
42
|
-
* (`Archetype.restoreHostRows
|
|
43
|
-
* logical length with the restored `Archetype.length
|
|
42
|
+
* (`Archetype.restoreHostRows`) uses this to re-sync the column's
|
|
43
|
+
* logical length with the restored `Archetype.length`, the bytes come from
|
|
44
44
|
* the restored SAB, but `_len` is host state. Throws on overrun (cannot grow
|
|
45
|
-
* a fixed SAB view here
|
|
45
|
+
* a fixed SAB view here, the mount already adopted the restored capacity). */
|
|
46
46
|
setLength(len: number): void;
|
|
47
|
-
/** Raw backing view. Stable for the lifetime of the SAB
|
|
47
|
+
/** Raw backing view. Stable for the lifetime of the SAB. Views over a
|
|
48
48
|
* SAB do not invalidate the way a `GrowableTypedArray`'s `buf` does
|
|
49
|
-
* after a grow. (`view_stamp`
|
|
50
|
-
* once #171 §6.1.4 lands.) */
|
|
49
|
+
* after a grow. (`view_stamp` signals "underlying SAB swapped".) */
|
|
51
50
|
get buf(): T;
|
|
52
51
|
/** Zero-copy subarray of valid data (`0..length-1`). */
|
|
53
52
|
view(): T;
|
|
54
53
|
[Symbol.iterator](): Iterator<number>;
|
|
55
|
-
/** Throw if the
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
|
|
54
|
+
/** Throw if the view cannot hold `capacity` elements. The column does not own
|
|
55
|
+
* its buffer, so it cannot grow: a grow reallocates the store buffer and
|
|
56
|
+
* rebuilds the views of every archetype, which is the republish invariant.
|
|
57
|
+
* The allocator drives that path, and this method refuses it. */
|
|
58
|
+
reserve(capacity: number): void;
|
|
60
59
|
/** Append `count` elements from `src[srcOffset..srcOffset+count]`.
|
|
61
60
|
* Throws on overrun. */
|
|
62
61
|
bulkAppend(src: T, srcOffset: number, count: number): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ColumnBacking } from '../../type_primitives/index.js';
|
|
2
2
|
import { AnyTypedArray } from './column_store.js';
|
|
3
|
-
/** Thrown when an operation would grow a fixed-capacity SAB column. The
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
/** Thrown when an operation would grow a fixed-capacity SAB column. The column
|
|
4
|
+
* does not own its buffer, so it cannot grow. The store's grow path
|
|
5
|
+
* (`growColumnStore`, then `refreshView`) is the only way capacity rises, and
|
|
6
|
+
* this throw makes a missed grow surface at once rather than corrupt state. */
|
|
7
7
|
export declare class StoreColumnOverflowError extends Error {
|
|
8
8
|
readonly capacity: number;
|
|
9
9
|
readonly requested: number;
|
|
@@ -13,25 +13,25 @@ export declare class BufferBackedColumn<T extends AnyTypedArray> implements Colu
|
|
|
13
13
|
private _buf;
|
|
14
14
|
private _capacity;
|
|
15
15
|
private _len;
|
|
16
|
-
/** `view`
|
|
16
|
+
/** `view` must be a TypedArray constructed over a SAB at the correct
|
|
17
17
|
* stride alignment (see `createColumnStore`). The column treats
|
|
18
|
-
* `view.length` as the immutable capacity for the lifetime of this view
|
|
18
|
+
* `view.length` as the immutable capacity for the lifetime of this view,
|
|
19
19
|
* call `refreshView` after a SAB realloc to point at the new view. */
|
|
20
20
|
constructor(view: T);
|
|
21
21
|
/** Swap the backing view to one over a freshly-grown SAB. The caller is
|
|
22
22
|
* responsible for having copied the first `length` elements into
|
|
23
23
|
* `newView` already (`growColumnStore` does this). The logical length is
|
|
24
|
-
* preserved across the swap
|
|
24
|
+
* preserved across the swap. Capacity becomes `newView.length`.
|
|
25
25
|
*
|
|
26
|
-
* Used to honour the `view_stamp` invariant after a host-side SAB realloc
|
|
27
|
-
*
|
|
28
|
-
* the next read
|
|
26
|
+
* Used to honour the `view_stamp` invariant after a host-side SAB realloc:
|
|
27
|
+
* every cached column view must be rebuilt before
|
|
28
|
+
* the next read or write. */
|
|
29
29
|
refreshView(newView: T): void;
|
|
30
30
|
get length(): number;
|
|
31
31
|
get capacity(): number;
|
|
32
32
|
push(value: number): void;
|
|
33
33
|
pop(): number;
|
|
34
|
-
|
|
34
|
+
getAt(i: number): number;
|
|
35
35
|
setAt(i: number, value: number): void;
|
|
36
36
|
/** Move the last element into slot `i`, decrement length. Returns the
|
|
37
37
|
* value previously at slot `i`. Matches `GrowableTypedArray.swapRemove`. */
|
|
@@ -39,24 +39,23 @@ export declare class BufferBackedColumn<T extends AnyTypedArray> implements Colu
|
|
|
39
39
|
clear(): void;
|
|
40
40
|
/** Set the logical length directly, declaring that `[0, len)` of the backing
|
|
41
41
|
* SAB view already holds valid data. The snapshot-mount path
|
|
42
|
-
* (`Archetype.restoreHostRows
|
|
43
|
-
* logical length with the restored `Archetype.length
|
|
42
|
+
* (`Archetype.restoreHostRows`) uses this to re-sync the column's
|
|
43
|
+
* logical length with the restored `Archetype.length`, the bytes come from
|
|
44
44
|
* the restored SAB, but `_len` is host state. Throws on overrun (cannot grow
|
|
45
|
-
* a fixed SAB view here
|
|
45
|
+
* a fixed SAB view here, the mount already adopted the restored capacity). */
|
|
46
46
|
setLength(len: number): void;
|
|
47
|
-
/** Raw backing view. Stable for the lifetime of the SAB
|
|
47
|
+
/** Raw backing view. Stable for the lifetime of the SAB. Views over a
|
|
48
48
|
* SAB do not invalidate the way a `GrowableTypedArray`'s `buf` does
|
|
49
|
-
* after a grow. (`view_stamp`
|
|
50
|
-
* once #171 §6.1.4 lands.) */
|
|
49
|
+
* after a grow. (`view_stamp` signals "underlying SAB swapped".) */
|
|
51
50
|
get buf(): T;
|
|
52
51
|
/** Zero-copy subarray of valid data (`0..length-1`). */
|
|
53
52
|
view(): T;
|
|
54
53
|
[Symbol.iterator](): Iterator<number>;
|
|
55
|
-
/** Throw if the
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
|
|
54
|
+
/** Throw if the view cannot hold `capacity` elements. The column does not own
|
|
55
|
+
* its buffer, so it cannot grow: a grow reallocates the store buffer and
|
|
56
|
+
* rebuilds the views of every archetype, which is the republish invariant.
|
|
57
|
+
* The allocator drives that path, and this method refuses it. */
|
|
58
|
+
reserve(capacity: number): void;
|
|
60
59
|
/** Append `count` elements from `src[srcOffset..srcOffset+count]`.
|
|
61
60
|
* Throws on overrun. */
|
|
62
61
|
bulkAppend(src: T, srcOffset: number, count: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer_backed_column.d.ts","sourceRoot":"","sources":["../../../src/core/store/buffer_backed_column.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"buffer_backed_column.d.ts","sourceRoot":"","sources":["../../../src/core/store/buffer_backed_column.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;+EAG+E;AAC/E,qBAAa,wBAAyB,SAAQ,KAAK;IAClD,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;gBAEtB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAQ/C;AAED,qBAAa,kBAAkB,CAAC,CAAC,SAAS,aAAa,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACnF,OAAO,CAAC,IAAI,CAAI;IAChB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,IAAI,CAAK;IAEjB;;;0EAGsE;gBAC1D,IAAI,EAAE,CAAC;IAKnB;;;;;;;iCAO6B;IACtB,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI;IAQpC,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAEM,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOzB,GAAG,IAAI,MAAM;IAIb,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAIxB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI5C;gFAC4E;IACrE,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAM7B,KAAK,IAAI,IAAI;IAIpB;;;;;kFAK8E;IACvE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAOnC;;wEAEoE;IACpE,IAAW,GAAG,IAAI,CAAC,CAElB;IAED,wDAAwD;IACjD,IAAI,IAAI,CAAC;IAQhB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC;IAYrC;;;qEAGiE;IAC1D,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMtC;4BACwB;IACjB,UAAU,CAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAQjE,gDAAgD;IACzC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM5C;gEAC4D;IACrD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAK1D"}
|