@bldrs-ai/conway 1.389.1221 → 1.394.1504
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -22
- package/compiled/Dist/ConwayGeomWasmNode.js +0 -0
- package/compiled/Dist/ConwayGeomWasmNodeMT.js +0 -0
- package/compiled/Dist/ConwayGeomWasmWeb.js +0 -0
- package/compiled/Dist/ConwayGeomWasmWebMT.js +1 -1
- package/compiled/Dist/ConwayGeomWasmWebMT.wasm +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +0 -0
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.js +1 -1
- package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
- package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts +19 -0
- package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts.map +1 -1
- package/compiled/dependencies/conway-geom/interface/conway_geometry.js +17 -0
- package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts +6 -0
- package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts.map +1 -1
- package/compiled/examples/browser-bundled.cjs +1569 -51
- package/compiled/examples/cli-bundled.cjs +2790 -436
- package/compiled/examples/cli-step-bundled.cjs +1904 -229
- package/compiled/examples/validator-bundled.cjs +1569 -51
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.js +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts +3 -3
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.js +3 -3
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.js +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.js +2 -2
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/schema_ap214.gen.js +11 -11
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.js +1 -1
- package/compiled/src/AP214E3_2010/ap214_command_line_main.js +7 -3
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +181 -7
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +906 -137
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.test.js +10 -2
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.js +114 -0
- package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts +6 -0
- package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_model_geometry.js +9 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.js +233 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.js +147 -0
- package/compiled/src/AP214E3_2010/ap214_step_model.d.ts +2 -1
- package/compiled/src/AP214E3_2010/ap214_step_model.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_step_model.js +1 -1
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.js +65 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_unit_scale.test.js +111 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ap214_streamed_open.test.js +190 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_export_order.test.js +110 -0
- package/compiled/src/compat/web-ifc/coordination_f64.d.ts +165 -0
- package/compiled/src/compat/web-ifc/coordination_f64.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_f64.js +286 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/coordination_f64.test.js +225 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +154 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +211 -3
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +288 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +39 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +30 -0
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +83 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +383 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.js +124 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +132 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +488 -92
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +268 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +996 -149
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.js +129 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.d.ts +134 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.js +933 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/spatial_imposter.test.js +467 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.d.ts +187 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.js +524 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/store_preview_channel.test.js +234 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +306 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/streamed_preview_channel.js +580 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts +2 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts.map +1 -0
- package/compiled/src/compat/web-ifc/web_wasm_directory.test.js +22 -0
- package/compiled/src/core/composed_model_skeleton.d.ts +63 -0
- package/compiled/src/core/composed_model_skeleton.d.ts.map +1 -0
- package/compiled/src/core/composed_model_skeleton.js +66 -0
- package/compiled/src/core/composed_model_skeleton.test.d.ts +2 -0
- package/compiled/src/core/composed_model_skeleton.test.d.ts.map +1 -0
- package/compiled/src/core/composed_model_skeleton.test.js +69 -0
- package/compiled/src/core/demand_geometry_queue.d.ts +147 -0
- package/compiled/src/core/demand_geometry_queue.d.ts.map +1 -0
- package/compiled/src/core/demand_geometry_queue.js +223 -0
- package/compiled/src/core/demand_geometry_queue.test.d.ts +2 -0
- package/compiled/src/core/demand_geometry_queue.test.d.ts.map +1 -0
- package/compiled/src/core/demand_geometry_queue.test.js +133 -0
- package/compiled/src/core/demand_residency_pump.d.ts +93 -0
- package/compiled/src/core/demand_residency_pump.d.ts.map +1 -0
- package/compiled/src/core/demand_residency_pump.js +120 -0
- package/compiled/src/core/demand_residency_pump.test.d.ts +2 -0
- package/compiled/src/core/demand_residency_pump.test.d.ts.map +1 -0
- package/compiled/src/core/demand_residency_pump.test.js +148 -0
- package/compiled/src/core/geometry_tile_bindings.d.ts +110 -0
- package/compiled/src/core/geometry_tile_bindings.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_bindings.js +76 -0
- package/compiled/src/core/geometry_tile_bindings.test.d.ts +2 -0
- package/compiled/src/core/geometry_tile_bindings.test.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_bindings.test.js +211 -0
- package/compiled/src/core/geometry_tile_pool.d.ts +99 -0
- package/compiled/src/core/geometry_tile_pool.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_pool.js +104 -0
- package/compiled/src/core/geometry_tile_pool.test.d.ts +2 -0
- package/compiled/src/core/geometry_tile_pool.test.d.ts.map +1 -0
- package/compiled/src/core/geometry_tile_pool.test.js +180 -0
- package/compiled/src/core/mem/chunked_pool.d.ts +116 -0
- package/compiled/src/core/mem/chunked_pool.d.ts.map +1 -0
- package/compiled/src/core/mem/chunked_pool.js +149 -0
- package/compiled/src/core/mem/chunked_pool.test.d.ts +2 -0
- package/compiled/src/core/mem/chunked_pool.test.d.ts.map +1 -0
- package/compiled/src/core/mem/chunked_pool.test.js +63 -0
- package/compiled/src/core/mem/shared_asset_pool.d.ts +82 -0
- package/compiled/src/core/mem/shared_asset_pool.d.ts.map +1 -0
- package/compiled/src/core/mem/shared_asset_pool.js +113 -0
- package/compiled/src/core/mem/shared_asset_pool.test.d.ts +2 -0
- package/compiled/src/core/mem/shared_asset_pool.test.d.ts.map +1 -0
- package/compiled/src/core/mem/shared_asset_pool.test.js +49 -0
- package/compiled/src/core/model_registry.d.ts +87 -0
- package/compiled/src/core/model_registry.d.ts.map +1 -0
- package/compiled/src/core/model_registry.js +101 -0
- package/compiled/src/core/model_registry.test.d.ts +2 -0
- package/compiled/src/core/model_registry.test.d.ts.map +1 -0
- package/compiled/src/core/model_registry.test.js +60 -0
- package/compiled/src/core/model_uri.d.ts +57 -0
- package/compiled/src/core/model_uri.d.ts.map +1 -0
- package/compiled/src/core/model_uri.js +101 -0
- package/compiled/src/core/model_uri.test.d.ts +2 -0
- package/compiled/src/core/model_uri.test.d.ts.map +1 -0
- package/compiled/src/core/model_uri.test.js +49 -0
- package/compiled/src/core/progress.d.ts +16 -2
- package/compiled/src/core/progress.d.ts.map +1 -1
- package/compiled/src/core/progress.js +31 -5
- package/compiled/src/core/progress.test.js +11 -2
- package/compiled/src/core/progress_log.d.ts +1 -0
- package/compiled/src/core/progress_log.d.ts.map +1 -1
- package/compiled/src/core/progress_log.js +7 -2
- package/compiled/src/core/progress_log.test.js +21 -0
- package/compiled/src/core/shared_byte_budget.d.ts +60 -0
- package/compiled/src/core/shared_byte_budget.d.ts.map +1 -0
- package/compiled/src/core/shared_byte_budget.js +85 -0
- package/compiled/src/core/shared_byte_budget.test.d.ts +2 -0
- package/compiled/src/core/shared_byte_budget.test.d.ts.map +1 -0
- package/compiled/src/core/shared_byte_budget.test.js +55 -0
- package/compiled/src/core/wasm_heap.d.ts +208 -0
- package/compiled/src/core/wasm_heap.d.ts.map +1 -0
- package/compiled/src/core/wasm_heap.js +417 -0
- package/compiled/src/core/wasm_heap.test.d.ts +2 -0
- package/compiled/src/core/wasm_heap.test.d.ts.map +1 -0
- package/compiled/src/core/wasm_heap.test.js +546 -0
- package/compiled/src/demand/index.d.ts +23 -0
- package/compiled/src/demand/index.d.ts.map +1 -0
- package/compiled/src/demand/index.js +22 -0
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.js +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.js +2 -2
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts.map +1 -1
- package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.js +1 -1
- package/compiled/src/ifc/ifc4_gen/schema_ifc.gen.js +2 -2
- package/compiled/src/ifc/ifc_demand_extraction.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_demand_extraction.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_demand_extraction.test.js +251 -0
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +367 -6
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +1322 -389
- package/compiled/src/ifc/ifc_grid_placement.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_grid_placement.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_grid_placement.test.js +261 -0
- package/compiled/src/ifc/ifc_model_geometry.d.ts +12 -0
- package/compiled/src/ifc/ifc_model_geometry.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_model_geometry.js +15 -0
- package/compiled/src/ifc/ifc_regression_batch_main.js +210 -12
- package/compiled/src/ifc/ifc_spatial_skeleton.d.ts +145 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.js +266 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_spatial_skeleton.test.js +199 -0
- package/compiled/src/ifc/ifc_step_model.d.ts +6 -2
- package/compiled/src/ifc/ifc_step_model.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_model.js +6 -4
- package/compiled/src/ifc/ifc_step_parser.d.ts +58 -0
- package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_parser.js +64 -0
- package/compiled/src/ifc/ifc_stream_model.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_stream_model.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_model.test.js +70 -0
- package/compiled/src/ifc/ifc_stream_open.d.ts +131 -0
- package/compiled/src/ifc/ifc_stream_open.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_open.js +116 -0
- package/compiled/src/ifc/ifc_stream_open.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_stream_open.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_stream_open.test.js +230 -0
- package/compiled/src/ifc/ifc_tile_extractor.d.ts +84 -0
- package/compiled/src/ifc/ifc_tile_extractor.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_tile_extractor.js +134 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_tile_extractor.test.js +118 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts +2 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts.map +1 -0
- package/compiled/src/ifc/ifc_typed_select_enum.test.js +60 -0
- package/compiled/src/index.d.ts +21 -1
- package/compiled/src/index.d.ts.map +1 -1
- package/compiled/src/index.js +28 -1
- package/compiled/src/logging/logger.d.ts +16 -2
- package/compiled/src/logging/logger.d.ts.map +1 -1
- package/compiled/src/logging/logger.js +34 -7
- package/compiled/src/logging/logger.test.js +30 -0
- package/compiled/src/mem/index.d.ts +17 -0
- package/compiled/src/mem/index.d.ts.map +1 -0
- package/compiled/src/mem/index.js +16 -0
- package/compiled/src/namespace_surface.test.d.ts +2 -0
- package/compiled/src/namespace_surface.test.d.ts.map +1 -0
- package/compiled/src/namespace_surface.test.js +43 -0
- package/compiled/src/parsing/parsing_buffer.d.ts +23 -0
- package/compiled/src/parsing/parsing_buffer.d.ts.map +1 -1
- package/compiled/src/parsing/parsing_buffer.js +31 -0
- package/compiled/src/scripts/model_report_displacement.test.d.ts +2 -0
- package/compiled/src/scripts/model_report_displacement.test.d.ts.map +1 -0
- package/compiled/src/scripts/model_report_displacement.test.js +104 -0
- package/compiled/src/scripts/render_glb_paths.test.d.ts +2 -0
- package/compiled/src/scripts/render_glb_paths.test.d.ts.map +1 -0
- package/compiled/src/scripts/render_glb_paths.test.js +115 -0
- package/compiled/src/step/indexing/step_type_indexer.d.ts +20 -0
- package/compiled/src/step/indexing/step_type_indexer.d.ts.map +1 -1
- package/compiled/src/step/indexing/step_type_indexer.js +67 -0
- package/compiled/src/step/parsing/byte_source.d.ts +153 -0
- package/compiled/src/step/parsing/byte_source.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source.js +106 -0
- package/compiled/src/step/parsing/byte_source.test.d.ts +2 -0
- package/compiled/src/step/parsing/byte_source.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source.test.js +47 -0
- package/compiled/src/step/parsing/byte_source_node.d.ts +41 -0
- package/compiled/src/step/parsing/byte_source_node.d.ts.map +1 -0
- package/compiled/src/step/parsing/byte_source_node.js +54 -0
- package/compiled/src/step/parsing/columnar_index.d.ts +103 -0
- package/compiled/src/step/parsing/columnar_index.d.ts.map +1 -0
- package/compiled/src/step/parsing/columnar_index.js +224 -0
- package/compiled/src/step/parsing/columnar_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/columnar_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/columnar_index.test.js +155 -0
- package/compiled/src/step/parsing/cross_reference_registry.d.ts +95 -0
- package/compiled/src/step/parsing/cross_reference_registry.d.ts.map +1 -0
- package/compiled/src/step/parsing/cross_reference_registry.js +91 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.d.ts +2 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/cross_reference_registry.test.js +66 -0
- package/compiled/src/step/parsing/decode_utf8.d.ts +15 -0
- package/compiled/src/step/parsing/decode_utf8.d.ts.map +1 -1
- package/compiled/src/step/parsing/decode_utf8.js +28 -0
- package/compiled/src/step/parsing/express_ref_scan.d.ts +20 -0
- package/compiled/src/step/parsing/express_ref_scan.d.ts.map +1 -0
- package/compiled/src/step/parsing/express_ref_scan.js +91 -0
- package/compiled/src/step/parsing/express_ref_scan.test.d.ts +2 -0
- package/compiled/src/step/parsing/express_ref_scan.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/express_ref_scan.test.js +28 -0
- package/compiled/src/step/parsing/index_sidecar.d.ts +81 -0
- package/compiled/src/step/parsing/index_sidecar.d.ts.map +1 -0
- package/compiled/src/step/parsing/index_sidecar.js +283 -0
- package/compiled/src/step/parsing/index_sidecar.test.d.ts +2 -0
- package/compiled/src/step/parsing/index_sidecar.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/index_sidecar.test.js +122 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/inf_recovery_index.test.js +108 -0
- package/compiled/src/step/parsing/prefix_type_index.d.ts +124 -0
- package/compiled/src/step/parsing/prefix_type_index.d.ts.map +1 -0
- package/compiled/src/step/parsing/prefix_type_index.js +207 -0
- package/compiled/src/step/parsing/prefix_type_index.test.d.ts +2 -0
- package/compiled/src/step/parsing/prefix_type_index.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/prefix_type_index.test.js +298 -0
- package/compiled/src/step/parsing/range_byte_source.d.ts +69 -0
- package/compiled/src/step/parsing/range_byte_source.d.ts.map +1 -0
- package/compiled/src/step/parsing/range_byte_source.js +78 -0
- package/compiled/src/step/parsing/range_byte_source.test.d.ts +2 -0
- package/compiled/src/step/parsing/range_byte_source.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/range_byte_source.test.js +70 -0
- package/compiled/src/step/parsing/record_event.d.ts +23 -0
- package/compiled/src/step/parsing/record_event.d.ts.map +1 -0
- package/compiled/src/step/parsing/record_event.js +1 -0
- package/compiled/src/step/parsing/record_field_cursor.d.ts +94 -0
- package/compiled/src/step/parsing/record_field_cursor.d.ts.map +1 -0
- package/compiled/src/step/parsing/record_field_cursor.js +189 -0
- package/compiled/src/step/parsing/step_deserialization_functions.d.ts +29 -0
- package/compiled/src/step/parsing/step_deserialization_functions.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_deserialization_functions.js +45 -0
- package/compiled/src/step/parsing/step_deserialization_functions.test.js +59 -1
- package/compiled/src/step/parsing/step_parser.d.ts +66 -1
- package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_parser.js +164 -10
- package/compiled/src/step/parsing/step_string_parser.js +8 -8
- package/compiled/src/step/parsing/streaming_index_builder.d.ts +141 -0
- package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder.js +280 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder.test.js +107 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_index_builder_async.test.js +109 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts +71 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.js +88 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts +2 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/streaming_record_dispatcher.test.js +66 -0
- package/compiled/src/step/parsing/uint32_sink.d.ts +72 -0
- package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -0
- package/compiled/src/step/parsing/uint32_sink.js +180 -0
- package/compiled/src/step/parsing/uint32_sink.test.d.ts +2 -0
- package/compiled/src/step/parsing/uint32_sink.test.d.ts.map +1 -0
- package/compiled/src/step/parsing/uint32_sink.test.js +199 -0
- package/compiled/src/step/step_buffer_provider.d.ts +48 -3
- package/compiled/src/step/step_buffer_provider.d.ts.map +1 -1
- package/compiled/src/step/step_buffer_provider.js +60 -11
- package/compiled/src/step/step_buffer_provider.test.js +14 -0
- package/compiled/src/step/step_entity_base.d.ts +65 -3
- package/compiled/src/step/step_entity_base.d.ts.map +1 -1
- package/compiled/src/step/step_entity_base.js +135 -3
- package/compiled/src/step/step_model_base.d.ts +221 -8
- package/compiled/src/step/step_model_base.d.ts.map +1 -1
- package/compiled/src/step/step_model_base.js +542 -7
- package/compiled/src/stream/index.d.ts +34 -0
- package/compiled/src/stream/index.d.ts.map +1 -0
- package/compiled/src/stream/index.js +32 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress_log.d.ts","sourceRoot":"","sources":["../../../src/core/progress_log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"progress_log.d.ts","sourceRoot":"","sources":["../../../src/core/progress_log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAqBD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAE,KAAK,EAAE,MAAM,GAAI,MAAM,CAQlD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAE,OAAO,CAAC,EAAE,MAAM,GAAI,MAAM,CASpD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAE,YAAY,EAAE,MAAM,GAAI,MAAM,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAE,SAAS,EAAE,MAAM,GAAI,MAAM,CAEpD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAE,IAAI,EAAE,SAAS,GAAI,MAAM,CA0BzD;AA6DD;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAE7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,eAAe,CAAoB;IAC3C,OAAO,CAAC,cAAc,CAAY;IAClC,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,UAAU,CAAoB;IAEtC;;;;;OAKG;IACI,YAAY,CAAE,IAAI,EAAE,SAAS,GAAI,MAAM;IAM9C;;;;;;OAMG;IACI,UAAU,CAAE,KAAK,EAAE,iBAAiB,GAAI,MAAM,GAAG,SAAS;IAiDjE;;;;;;;;OAQG;IACI,iBAAiB,CAAE,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAI,MAAM,GAAG,SAAS;IAuBzF;;;;OAIG;IACI,WAAW,IAAI,MAAM,GAAG,SAAS;IAQxC;;;;OAIG;IACI,aAAa,IAAI,MAAM,EAAE;IAIhC;;;;;OAKG;IACI,SAAS,IAAI,MAAM;IAY1B;;;;;OAKG;IACI,QAAQ,IAAI,MAAM,EAAE;CAY5B"}
|
|
@@ -143,14 +143,16 @@ function heapDeltaSuffix(state) {
|
|
|
143
143
|
function formatStageLine(state, final) {
|
|
144
144
|
const duration = state.lastElapsedMs - state.startElapsedMs;
|
|
145
145
|
const heap = heapDeltaSuffix(state);
|
|
146
|
+
const window = state.residentSourceMb !== void 0 ?
|
|
147
|
+
`, window=${formatMb(state.residentSourceMb)} MB` : '';
|
|
146
148
|
const determinate = state.percent !== void 0;
|
|
147
149
|
// Completed: no bar, colon-separated. A determinate stage that stopped
|
|
148
150
|
// short of 100% is a failure — keep its bar to show the reach.
|
|
149
151
|
if (final && !(determinate && state.percent < PERCENT)) {
|
|
150
|
-
return `${state.label}: ${formatSeconds(duration)}${heap}`;
|
|
152
|
+
return `${state.label}: ${formatSeconds(duration)}${heap}${window}`;
|
|
151
153
|
}
|
|
152
154
|
const bar = formatBar(determinate ? state.percent : void 0);
|
|
153
|
-
return `${state.label} ${bar} ${formatSeconds(duration)}${heap}`;
|
|
155
|
+
return `${state.label} ${bar} ${formatSeconds(duration)}${heap}${window}`;
|
|
154
156
|
}
|
|
155
157
|
/**
|
|
156
158
|
* Accumulates progress events into the normalized text report: a live
|
|
@@ -211,6 +213,9 @@ export class LoadLogAccumulator {
|
|
|
211
213
|
current.startHeapMb ??= event.memoryMb;
|
|
212
214
|
current.lastHeapMb = event.memoryMb;
|
|
213
215
|
}
|
|
216
|
+
if (event.residentSourceMb !== void 0) {
|
|
217
|
+
current.residentSourceMb = event.residentSourceMb;
|
|
218
|
+
}
|
|
214
219
|
if (event.total !== void 0 && event.total > 0) {
|
|
215
220
|
current.percent = (event.completed / event.total) * PERCENT;
|
|
216
221
|
}
|
|
@@ -76,6 +76,27 @@ describe("LoadLogAccumulator", () => {
|
|
|
76
76
|
expect(log.finishedLines()[0]).toBe("Geometry: 16.500s, +220.000000 MB heap");
|
|
77
77
|
expect(log.totalLine()).toBe("Total: 16.500s, 500.000000 \u2192 720.000000 MB heap");
|
|
78
78
|
});
|
|
79
|
+
test("appends window residency on the Geometry line when provided", () => {
|
|
80
|
+
const log = new LoadLogAccumulator();
|
|
81
|
+
log.onProgress({
|
|
82
|
+
phase: "geometry",
|
|
83
|
+
completed: 0,
|
|
84
|
+
total: 10,
|
|
85
|
+
elapsedMs: 0,
|
|
86
|
+
memoryMb: 100,
|
|
87
|
+
residentSourceMb: 64,
|
|
88
|
+
});
|
|
89
|
+
log.onProgress({
|
|
90
|
+
phase: "geometry",
|
|
91
|
+
completed: 10,
|
|
92
|
+
total: 10,
|
|
93
|
+
elapsedMs: 1000,
|
|
94
|
+
memoryMb: 120,
|
|
95
|
+
residentSourceMb: 64,
|
|
96
|
+
});
|
|
97
|
+
log.closeCurrentStage();
|
|
98
|
+
expect(log.finishedLines()[0]).toBe("Geometry: 1.000s, +20.000000 MB heap, window=64.000000 MB");
|
|
99
|
+
});
|
|
79
100
|
test("handles indeterminate stages and missing memory", () => {
|
|
80
101
|
const log = new LoadLogAccumulator();
|
|
81
102
|
log.onProgress({ phase: "geometry", completed: 0, elapsedMs: 0 });
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A byte budget shared across many models (M5 / design S3).
|
|
3
|
+
*
|
|
4
|
+
* The federation invariant: budgets must be **per browser, not per model**, or
|
|
5
|
+
* opening N cross-referenced files re-introduces O(N) memory. This is the one
|
|
6
|
+
* accounting primitive that enforces it — every model's demand-geometry queue
|
|
7
|
+
* and window pool draws from a single {@link SharedByteBudget}, so the total
|
|
8
|
+
* resident footprint across all open models is bounded no matter how many are
|
|
9
|
+
* federated in.
|
|
10
|
+
*
|
|
11
|
+
* It owns only the accounting (reserve / release / availability); the eviction
|
|
12
|
+
* policy that frees bytes when a reservation can't be met stays with each
|
|
13
|
+
* model's scheduler (M3's {@link DemandGeometryQueue}) — the budget just tells
|
|
14
|
+
* a caller how much it must evict first via {@link overageFor}.
|
|
15
|
+
*/
|
|
16
|
+
export declare class SharedByteBudget {
|
|
17
|
+
private readonly totalBytes_;
|
|
18
|
+
private used_;
|
|
19
|
+
/**
|
|
20
|
+
* @param totalBytes_ The global ceiling shared across all models.
|
|
21
|
+
*/
|
|
22
|
+
constructor(totalBytes_: number);
|
|
23
|
+
/**
|
|
24
|
+
* @return {number} The global ceiling.
|
|
25
|
+
*/
|
|
26
|
+
get total(): number;
|
|
27
|
+
/**
|
|
28
|
+
* @return {number} Bytes currently reserved across all models.
|
|
29
|
+
*/
|
|
30
|
+
get used(): number;
|
|
31
|
+
/**
|
|
32
|
+
* @return {number} Bytes still reservable without eviction.
|
|
33
|
+
*/
|
|
34
|
+
get available(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Try to reserve `bytes` against the shared ceiling. Succeeds (and charges
|
|
37
|
+
* the budget) only if it fits without exceeding the total; otherwise makes
|
|
38
|
+
* no change and returns false, leaving the caller to evict and retry.
|
|
39
|
+
*
|
|
40
|
+
* @param bytes The bytes to reserve (≥ 0).
|
|
41
|
+
* @return {boolean} True if reserved.
|
|
42
|
+
*/
|
|
43
|
+
reserve(bytes: number): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Release previously reserved bytes back to the shared budget.
|
|
46
|
+
*
|
|
47
|
+
* @param bytes The bytes to release (≥ 0). Clamped so `used` never goes
|
|
48
|
+
* negative — a double-release is a no-op past zero, not a corruption.
|
|
49
|
+
*/
|
|
50
|
+
release(bytes: number): void;
|
|
51
|
+
/**
|
|
52
|
+
* How many bytes a caller must evict (anywhere, across any model) before a
|
|
53
|
+
* reservation of `bytes` would fit. Zero when it already fits.
|
|
54
|
+
*
|
|
55
|
+
* @param bytes The desired reservation.
|
|
56
|
+
* @return {number} The bytes of eviction required (≥ 0).
|
|
57
|
+
*/
|
|
58
|
+
overageFor(bytes: number): number;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=shared_byte_budget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared_byte_budget.d.ts","sourceRoot":"","sources":["../../../src/core/shared_byte_budget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gBAAgB;IAOd,OAAO,CAAC,QAAQ,CAAC,WAAW;IALzC,OAAO,CAAC,KAAK,CAAI;IAEjB;;OAEG;gBAC2B,WAAW,EAAE,MAAM;IAOjD;;OAEG;IACH,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED;;;;;;;OAOG;IACI,OAAO,CAAE,KAAK,EAAE,MAAM,GAAI,OAAO;IAexC;;;;;OAKG;IACI,OAAO,CAAE,KAAK,EAAE,MAAM,GAAI,IAAI;IASrC;;;;;;OAMG;IACI,UAAU,CAAE,KAAK,EAAE,MAAM,GAAI,MAAM;CAG3C"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A byte budget shared across many models (M5 / design S3).
|
|
3
|
+
*
|
|
4
|
+
* The federation invariant: budgets must be **per browser, not per model**, or
|
|
5
|
+
* opening N cross-referenced files re-introduces O(N) memory. This is the one
|
|
6
|
+
* accounting primitive that enforces it — every model's demand-geometry queue
|
|
7
|
+
* and window pool draws from a single {@link SharedByteBudget}, so the total
|
|
8
|
+
* resident footprint across all open models is bounded no matter how many are
|
|
9
|
+
* federated in.
|
|
10
|
+
*
|
|
11
|
+
* It owns only the accounting (reserve / release / availability); the eviction
|
|
12
|
+
* policy that frees bytes when a reservation can't be met stays with each
|
|
13
|
+
* model's scheduler (M3's {@link DemandGeometryQueue}) — the budget just tells
|
|
14
|
+
* a caller how much it must evict first via {@link overageFor}.
|
|
15
|
+
*/
|
|
16
|
+
export class SharedByteBudget {
|
|
17
|
+
/**
|
|
18
|
+
* @param totalBytes_ The global ceiling shared across all models.
|
|
19
|
+
*/
|
|
20
|
+
constructor(totalBytes_) {
|
|
21
|
+
this.totalBytes_ = totalBytes_;
|
|
22
|
+
this.used_ = 0;
|
|
23
|
+
if (totalBytes_ <= 0) {
|
|
24
|
+
throw new Error(`Invalid totalBytes ${totalBytes_}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @return {number} The global ceiling.
|
|
29
|
+
*/
|
|
30
|
+
get total() {
|
|
31
|
+
return this.totalBytes_;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @return {number} Bytes currently reserved across all models.
|
|
35
|
+
*/
|
|
36
|
+
get used() {
|
|
37
|
+
return this.used_;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @return {number} Bytes still reservable without eviction.
|
|
41
|
+
*/
|
|
42
|
+
get available() {
|
|
43
|
+
return this.totalBytes_ - this.used_;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Try to reserve `bytes` against the shared ceiling. Succeeds (and charges
|
|
47
|
+
* the budget) only if it fits without exceeding the total; otherwise makes
|
|
48
|
+
* no change and returns false, leaving the caller to evict and retry.
|
|
49
|
+
*
|
|
50
|
+
* @param bytes The bytes to reserve (≥ 0).
|
|
51
|
+
* @return {boolean} True if reserved.
|
|
52
|
+
*/
|
|
53
|
+
reserve(bytes) {
|
|
54
|
+
if (bytes < 0) {
|
|
55
|
+
throw new Error(`Cannot reserve negative bytes ${bytes}`);
|
|
56
|
+
}
|
|
57
|
+
if (bytes > this.available) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
this.used_ += bytes;
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Release previously reserved bytes back to the shared budget.
|
|
65
|
+
*
|
|
66
|
+
* @param bytes The bytes to release (≥ 0). Clamped so `used` never goes
|
|
67
|
+
* negative — a double-release is a no-op past zero, not a corruption.
|
|
68
|
+
*/
|
|
69
|
+
release(bytes) {
|
|
70
|
+
if (bytes < 0) {
|
|
71
|
+
throw new Error(`Cannot release negative bytes ${bytes}`);
|
|
72
|
+
}
|
|
73
|
+
this.used_ = Math.max(0, this.used_ - bytes);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* How many bytes a caller must evict (anywhere, across any model) before a
|
|
77
|
+
* reservation of `bytes` would fit. Zero when it already fits.
|
|
78
|
+
*
|
|
79
|
+
* @param bytes The desired reservation.
|
|
80
|
+
* @return {number} The bytes of eviction required (≥ 0).
|
|
81
|
+
*/
|
|
82
|
+
overageFor(bytes) {
|
|
83
|
+
return Math.max(0, bytes - this.available);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared_byte_budget.test.d.ts","sourceRoot":"","sources":["../../../src/core/shared_byte_budget.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* eslint-disable no-magic-numbers */
|
|
2
|
+
// M5: the per-browser shared budget is what keeps federation from re-growing
|
|
3
|
+
// memory O(N) with the number of open models — reservations across all models
|
|
4
|
+
// draw from one ceiling.
|
|
5
|
+
import { describe, expect, test } from "@jest/globals";
|
|
6
|
+
import { SharedByteBudget } from "./shared_byte_budget.js";
|
|
7
|
+
describe("SharedByteBudget", () => {
|
|
8
|
+
test("reserves up to the ceiling and refuses to overcommit", () => {
|
|
9
|
+
const budget = new SharedByteBudget(1000);
|
|
10
|
+
expect(budget.reserve(600)).toBe(true);
|
|
11
|
+
expect(budget.reserve(300)).toBe(true);
|
|
12
|
+
expect(budget.used).toBe(900);
|
|
13
|
+
expect(budget.available).toBe(100);
|
|
14
|
+
// 200 doesn't fit in the remaining 100 — refused, no change.
|
|
15
|
+
expect(budget.reserve(200)).toBe(false);
|
|
16
|
+
expect(budget.used).toBe(900);
|
|
17
|
+
});
|
|
18
|
+
test("releasing frees room for later reservations", () => {
|
|
19
|
+
const budget = new SharedByteBudget(1000);
|
|
20
|
+
budget.reserve(800);
|
|
21
|
+
expect(budget.reserve(300)).toBe(false);
|
|
22
|
+
budget.release(500);
|
|
23
|
+
expect(budget.used).toBe(300);
|
|
24
|
+
expect(budget.reserve(300)).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
test("release clamps at zero (a double release is not corruption)", () => {
|
|
27
|
+
const budget = new SharedByteBudget(1000);
|
|
28
|
+
budget.reserve(100);
|
|
29
|
+
budget.release(100);
|
|
30
|
+
budget.release(100);
|
|
31
|
+
expect(budget.used).toBe(0);
|
|
32
|
+
});
|
|
33
|
+
test("overageFor reports how much must be evicted before a reservation fits", () => {
|
|
34
|
+
const budget = new SharedByteBudget(1000);
|
|
35
|
+
budget.reserve(700);
|
|
36
|
+
// 500 wanted, 300 available → must evict 200.
|
|
37
|
+
expect(budget.overageFor(500)).toBe(200);
|
|
38
|
+
// 200 wanted, 300 available → fits, no eviction.
|
|
39
|
+
expect(budget.overageFor(200)).toBe(0);
|
|
40
|
+
});
|
|
41
|
+
test("the ceiling is shared: two models cannot each spend the whole budget", () => {
|
|
42
|
+
const budget = new SharedByteBudget(1000);
|
|
43
|
+
// "Model A" and "model B" both draw from the same budget.
|
|
44
|
+
expect(budget.reserve(700)).toBe(true); // A
|
|
45
|
+
expect(budget.reserve(700)).toBe(false); // B — only 300 left
|
|
46
|
+
expect(budget.reserve(300)).toBe(true); // B fits in the remainder
|
|
47
|
+
expect(budget.used).toBe(budget.total);
|
|
48
|
+
});
|
|
49
|
+
test("rejects an invalid ceiling and negative amounts", () => {
|
|
50
|
+
expect(() => new SharedByteBudget(0)).toThrow();
|
|
51
|
+
const budget = new SharedByteBudget(10);
|
|
52
|
+
expect(() => budget.reserve(-1)).toThrow();
|
|
53
|
+
expect(() => budget.release(-1)).toThrow();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading and writing the wasm heap from JS, through views that are known to
|
|
3
|
+
* belong to the heap as it is RIGHT NOW.
|
|
4
|
+
*
|
|
5
|
+
* This lives in one place because the two geometry extractors had a copy each,
|
|
6
|
+
* and the copies had drifted: one honoured the source view's window and the
|
|
7
|
+
* other did not, and neither checked what _malloc returned. The failure modes
|
|
8
|
+
* are quiet enough to be worth naming here.
|
|
9
|
+
*
|
|
10
|
+
* See bldrs-ai/conway#485 for what an uninstrumented failure on this path
|
|
11
|
+
* costs: `Invalid typed array length: 80`, no context, and two sightings
|
|
12
|
+
* across two models before it could even be located.
|
|
13
|
+
*
|
|
14
|
+
* The confirmed mechanism behind #485
|
|
15
|
+
* -----------------------------------
|
|
16
|
+
* conway's MT builds create their memory as
|
|
17
|
+
* `new WebAssembly.Memory({ initial, maximum: 65536, shared: true })` with no
|
|
18
|
+
* `maxByteLength`, so `wasmMemory.buffer` is a **non-extensible**
|
|
19
|
+
* SharedArrayBuffer - `growable === false`, `maxByteLength === byteLength`
|
|
20
|
+
* (verified against Dist/ConwayGeomWasmNodeMT.js and by inspecting a live
|
|
21
|
+
* module). A non-extensible buffer cannot grow in place, so
|
|
22
|
+
* `WebAssembly.Memory.grow()` materialises a NEW SharedArrayBuffer, which the
|
|
23
|
+
* `.buffer` getter hands out from then on.
|
|
24
|
+
*
|
|
25
|
+
* emscripten rebuilds `Module.HEAPU8` and friends over that new buffer in
|
|
26
|
+
* `updateMemoryViews()` - but only on the thread that did the growing, and
|
|
27
|
+
* only when its own glue passes through `growMemViews()`. Growth driven by a
|
|
28
|
+
* pthread runs `updateMemoryViews()` in the WORKER's JS scope; the main
|
|
29
|
+
* thread's `Module.HEAPU8` stays bound to the pre-growth buffer until some
|
|
30
|
+
* main-thread glue call happens to run `growMemViews()`. `_malloc` is a raw
|
|
31
|
+
* wasm export, so it is not one of those calls: it can hand back an address in
|
|
32
|
+
* the newly added region while the JS-side view still ends before it. That is
|
|
33
|
+
* exactly the state #498's diagnostic captured in CI - view length equal to
|
|
34
|
+
* its own buffer's byteLength (so not stale relative to that buffer),
|
|
35
|
+
* `extensible false` (so that buffer never grew), and the pointer past the end
|
|
36
|
+
* of both.
|
|
37
|
+
*
|
|
38
|
+
* Which is why every view here is built through wasmHeapView(): it re-reads
|
|
39
|
+
* the module's view, reconciles it against the pointer, and only then
|
|
40
|
+
* constructs.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* What the wasm module exposes that this needs. Deliberately narrow.
|
|
44
|
+
*
|
|
45
|
+
* Everything past `HEAPU8` is a refresh route that MAY be present; see
|
|
46
|
+
* refreshHeapViews for what each one is worth and which of them conway's
|
|
47
|
+
* current builds actually have.
|
|
48
|
+
*/
|
|
49
|
+
export interface WasmHeapModule {
|
|
50
|
+
_malloc(bytes: number): number;
|
|
51
|
+
_free(pointer: number): void;
|
|
52
|
+
HEAPU8: Uint8Array;
|
|
53
|
+
/**
|
|
54
|
+
* emscripten's own view rebuilder, if the build exports it. Not exported by
|
|
55
|
+
* any conway build today.
|
|
56
|
+
*/
|
|
57
|
+
updateMemoryViews?: () => void;
|
|
58
|
+
/**
|
|
59
|
+
* The live `WebAssembly.Memory`, if the build exposes it. Its `.buffer`
|
|
60
|
+
* getter always yields the current buffer, which makes staleness
|
|
61
|
+
* unrepresentable. Not exposed by any conway build today.
|
|
62
|
+
*/
|
|
63
|
+
wasmMemory?: {
|
|
64
|
+
readonly buffer: ArrayBufferLike;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* embind's `std::vector<std::string>`. Present on every conway-geom build;
|
|
68
|
+
* used as a refresh route of last resort (see refreshHeapViews).
|
|
69
|
+
*/
|
|
70
|
+
stringVector?: new () => {
|
|
71
|
+
push_back(value: string): void;
|
|
72
|
+
delete(): void;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export type CopyableArray = Float32Array | Float64Array | Uint32Array;
|
|
76
|
+
/**
|
|
77
|
+
* The part of a typed-array constructor wasmHeapView needs: build over a
|
|
78
|
+
* buffer at a byte offset, and say how wide an element is.
|
|
79
|
+
*/
|
|
80
|
+
export interface WasmHeapArrayConstructor<TArray> {
|
|
81
|
+
new (buffer: ArrayBufferLike, byteOffset: number, length: number): TArray;
|
|
82
|
+
readonly BYTES_PER_ELEMENT: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Build a typed-array view over a region of the wasm heap.
|
|
86
|
+
*
|
|
87
|
+
* Every view onto the heap in this repo goes through here, because the
|
|
88
|
+
* property that makes a view safe - that its buffer is the heap's CURRENT
|
|
89
|
+
* buffer - is not something a caller can check by looking at its own code. It
|
|
90
|
+
* depends on whether some other thread grew the heap between the call that
|
|
91
|
+
* produced `pointer` and this line.
|
|
92
|
+
*
|
|
93
|
+
* Two things beyond the reconcile are worth knowing:
|
|
94
|
+
*
|
|
95
|
+
* - The pointer is normalised to unsigned. Pointers reaching JS from raw i32
|
|
96
|
+
* wasm exports arrive NEGATIVE once the heap passes 2GB, and every target
|
|
97
|
+
* builds with `maximum: 65536` pages (4GB), so that is a reachable state and
|
|
98
|
+
* not a theoretical one. (This build's `applySignatureConversions` already
|
|
99
|
+
* wraps `_malloc` as `a0 => f(a0) >>> 0`; pointers from other exports and
|
|
100
|
+
* from other builds are not covered by that, so it is done here too.)
|
|
101
|
+
* - A view is CONSTRUCTED rather than `subarray`d off the module's view.
|
|
102
|
+
* `subarray` silently clamps an out-of-range window, which turns "the heap
|
|
103
|
+
* moved" into a short view and then into a copy that lands somewhere else
|
|
104
|
+
* entirely; the constructor throws instead, and by then the reconcile has
|
|
105
|
+
* already made throwing the right answer.
|
|
106
|
+
*
|
|
107
|
+
* @param wasmModule The module owning the heap.
|
|
108
|
+
* @param arrayType The typed-array constructor for the element type wanted.
|
|
109
|
+
* @param pointer Byte address in the heap, signed or unsigned.
|
|
110
|
+
* @param elementCount How many elements the view spans.
|
|
111
|
+
* @return {TArray} A view over the live heap. Do not retain it across any
|
|
112
|
+
* further call into wasm.
|
|
113
|
+
*/
|
|
114
|
+
export declare function wasmHeapView<TArray>(wasmModule: WasmHeapModule, arrayType: WasmHeapArrayConstructor<TArray>, pointer: number, elementCount: number): TArray;
|
|
115
|
+
/**
|
|
116
|
+
* How many bytes of wasm heap there currently are.
|
|
117
|
+
*
|
|
118
|
+
* Refreshes first, unconditionally - which is the opposite of what
|
|
119
|
+
* wasmHeapView does, and deliberate. There is nothing to compare a size
|
|
120
|
+
* against, so lag here cannot be detected the way an out-of-range pointer can;
|
|
121
|
+
* and `HEAPU8.length` on its own under-reports by a whole growth step whenever
|
|
122
|
+
* the module's views are behind (see this file's header), which is the one
|
|
123
|
+
* thing a high-water figure must not do. This is a reporting call - a line at
|
|
124
|
+
* the end of a run - so paying microseconds for a true answer is the right
|
|
125
|
+
* trade. Do not put it in a loop.
|
|
126
|
+
*
|
|
127
|
+
* That the refresh cannot throw (see refreshHeapViews) matters more here than
|
|
128
|
+
* at the other call site: this figure's only consumer is the AP214 CLI's
|
|
129
|
+
* high-water log line, so an embind failure escaping would abort an otherwise
|
|
130
|
+
* complete extraction from a log statement. A lagging number is the right
|
|
131
|
+
* answer there.
|
|
132
|
+
*
|
|
133
|
+
* @param wasmModule The module to measure.
|
|
134
|
+
* @return {number} The heap's size in bytes, or 0 if it has no heap yet.
|
|
135
|
+
*/
|
|
136
|
+
export declare function wasmHeapByteLength(wasmModule: WasmHeapModule): number;
|
|
137
|
+
/**
|
|
138
|
+
* Copy an array into a fresh wasm heap allocation.
|
|
139
|
+
*
|
|
140
|
+
* @param wasmModule The module to allocate in.
|
|
141
|
+
* @param array The data to copy. May be a view into a larger buffer.
|
|
142
|
+
* @return {number} Pointer to the copy, owned by the caller.
|
|
143
|
+
*/
|
|
144
|
+
export declare function arrayToWasmHeap(wasmModule: WasmHeapModule, array: CopyableArray): number;
|
|
145
|
+
/**
|
|
146
|
+
* Copy several arrays into the wasm heap, all or nothing.
|
|
147
|
+
*
|
|
148
|
+
* arrayToWasmHeap throws on a failed allocation, which is the right thing on
|
|
149
|
+
* its own but turns a caller that allocates N buffers before freeing any into
|
|
150
|
+
* a leak: the throw on buffer 2 strands buffer 1, the per-record catch
|
|
151
|
+
* upstream moves to the next record, and the leak repeats - accelerating the
|
|
152
|
+
* exhaustion being reported. Callers that hold several at once use this
|
|
153
|
+
* instead, which frees what it took before letting the error out.
|
|
154
|
+
*
|
|
155
|
+
* @param wasmModule The module to allocate in.
|
|
156
|
+
* @param arrays The data to copy, in order.
|
|
157
|
+
* @return {number[]} Pointers in the same order, owned by the caller.
|
|
158
|
+
*/
|
|
159
|
+
export declare function arraysToWasmHeap(wasmModule: WasmHeapModule, arrays: readonly CopyableArray[]): number[];
|
|
160
|
+
/**
|
|
161
|
+
* Run a resource release so it cannot replace an exception already in flight.
|
|
162
|
+
*
|
|
163
|
+
* Releases here re-enter the wasm runtime - _free, embind delete(), returning
|
|
164
|
+
* a pooled buffer - and they run from finally blocks that may be unwinding
|
|
165
|
+
* because that runtime just failed. A throw from one of them would REPLACE the
|
|
166
|
+
* original error, so the caller upstream would see a generic teardown failure
|
|
167
|
+
* instead of the diagnostic that says what actually went wrong. Losing the
|
|
168
|
+
* cause is strictly worse than failing to reclaim memory on a path where the
|
|
169
|
+
* heap is already lost.
|
|
170
|
+
*
|
|
171
|
+
* Reported at debug rather than swallowed outright, so it is still findable
|
|
172
|
+
* with -vv, and NOT at warning/error: this runs during teardown of an already
|
|
173
|
+
* failing record, where a second message would be noise on top of the one that
|
|
174
|
+
* matters.
|
|
175
|
+
*
|
|
176
|
+
* @param release The release step to run.
|
|
177
|
+
*/
|
|
178
|
+
export declare function releaseQuietly(release: () => void): void;
|
|
179
|
+
/**
|
|
180
|
+
* Run `body`, then release - propagating a release failure on success, and
|
|
181
|
+
* suppressing it only when something is already being unwound.
|
|
182
|
+
*
|
|
183
|
+
* That asymmetry is the point. releaseQuietly on its own is right during
|
|
184
|
+
* unwinding and wrong otherwise: on the success path a teardown failure is a
|
|
185
|
+
* real fault with nothing competing to report it, and swallowing it would let
|
|
186
|
+
* a record be reported COMPLETE while its resources were never reclaimed. So
|
|
187
|
+
* the quiet treatment applies to exactly the case it was argued for.
|
|
188
|
+
*
|
|
189
|
+
* @param body The work that needs the resource.
|
|
190
|
+
* @param release How to give the resource back.
|
|
191
|
+
* @return {T} Whatever body returned.
|
|
192
|
+
*/
|
|
193
|
+
export declare function withRelease<T>(body: () => T, release: () => void): T;
|
|
194
|
+
/**
|
|
195
|
+
* Free several pointers, independently.
|
|
196
|
+
*
|
|
197
|
+
* One failing free must not abandon the rest - batching them into a single
|
|
198
|
+
* statement means the first failure strands every pointer after it - and it
|
|
199
|
+
* must not be lost either, so the first error is re-thrown once they have all
|
|
200
|
+
* been attempted. Combined with withRelease that gives the wanted behaviour on
|
|
201
|
+
* both paths: everything is freed either way, and the failure surfaces on the
|
|
202
|
+
* success path while staying quiet during unwinding.
|
|
203
|
+
*
|
|
204
|
+
* @param wasmModule The module the pointers belong to.
|
|
205
|
+
* @param pointers The allocations to release.
|
|
206
|
+
*/
|
|
207
|
+
export declare function freeAll(wasmModule: WasmHeapModule, pointers: readonly number[]): void;
|
|
208
|
+
//# sourceMappingURL=wasm_heap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm_heap.d.ts","sourceRoot":"","sources":["../../../src/core/wasm_heap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAKH;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAE,KAAK,EAAE,MAAM,GAAI,MAAM,CAAA;IAChC,KAAK,CAAE,OAAO,EAAE,MAAM,GAAI,IAAI,CAAA;IAC9B,MAAM,EAAE,UAAU,CAAA;IAElB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;IAE9B;;;;OAIG;IACH,UAAU,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;KAAE,CAAA;IAEjD;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU;QAAE,SAAS,CAAE,KAAK,EAAE,MAAM,GAAI,IAAI,CAAC;QAAC,MAAM,IAAI,IAAI,CAAA;KAAE,CAAA;CAC9E;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,CAAA;AAMrE;;;GAGG;AACH,MAAM,WAAW,wBAAwB,CAAE,MAAM;IAC/C,KAAM,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,MAAM,CAAA;IAC3E,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;CACnC;AA6MD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,YAAY,CAAE,MAAM,EAChC,UAAU,EAAE,cAAc,EAC1B,SAAS,EAAE,wBAAwB,CAAE,MAAM,CAAE,EAC7C,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GAAI,MAAM,CASjC;AAGD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAE,UAAU,EAAE,cAAc,GAAI,MAAM,CAKvE;AAGD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,GAAI,MAAM,CA8C7D;AAGD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC5B,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,SAAS,aAAa,EAAE,GAAI,MAAM,EAAE,CAqB/C;AAGD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAE,OAAO,EAAE,MAAM,IAAI,GAAI,IAAI,CAW1D;AAGD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAG,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,IAAI,GAAI,CAAC,CAiBtE;AAGD;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CACnB,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAI,IAAI,CAkBlE"}
|