@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.
Files changed (382) hide show
  1. package/README.md +36 -22
  2. package/compiled/Dist/ConwayGeomWasmNode.js +0 -0
  3. package/compiled/Dist/ConwayGeomWasmNodeMT.js +0 -0
  4. package/compiled/Dist/ConwayGeomWasmWeb.js +0 -0
  5. package/compiled/Dist/ConwayGeomWasmWebMT.js +1 -1
  6. package/compiled/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  7. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNode.js +0 -0
  8. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmNodeMT.js +0 -0
  9. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWeb.js +0 -0
  10. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.js +1 -1
  11. package/compiled/dependencies/conway-geom/Dist/ConwayGeomWasmWebMT.wasm +0 -0
  12. package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts +19 -0
  13. package/compiled/dependencies/conway-geom/interface/conway_geometry.d.ts.map +1 -1
  14. package/compiled/dependencies/conway-geom/interface/conway_geometry.js +17 -0
  15. package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts +6 -0
  16. package/compiled/dependencies/conway-geom/interface/parameters/surface_object.d.ts.map +1 -1
  17. package/compiled/examples/browser-bundled.cjs +1569 -51
  18. package/compiled/examples/cli-bundled.cjs +2790 -436
  19. package/compiled/examples/cli-step-bundled.cjs +1904 -229
  20. package/compiled/examples/validator-bundled.cjs +1569 -51
  21. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts +2 -2
  22. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.d.ts.map +1 -1
  23. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_curve.gen.js +2 -2
  24. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts +3 -3
  25. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.d.ts.map +1 -1
  26. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/b_spline_surface.gen.js +3 -3
  27. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts +1 -1
  28. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.d.ts.map +1 -1
  29. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/composite_curve.gen.js +1 -1
  30. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts +1 -1
  31. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.d.ts.map +1 -1
  32. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_2d.gen.js +1 -1
  33. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts +1 -1
  34. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.d.ts.map +1 -1
  35. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_curve_3d.gen.js +1 -1
  36. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts +1 -1
  37. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.d.ts.map +1 -1
  38. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/offset_surface.gen.js +1 -1
  39. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.d.ts.map +1 -1
  40. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/presentation_style_assignment.gen.js +2 -2
  41. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/schema_ap214.gen.js +11 -11
  42. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts +1 -1
  43. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.d.ts.map +1 -1
  44. package/compiled/src/AP214E3_2010/AP214E3_2010_gen/shape_aspect.gen.js +1 -1
  45. package/compiled/src/AP214E3_2010/ap214_command_line_main.js +7 -3
  46. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts +181 -7
  47. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
  48. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +906 -137
  49. package/compiled/src/AP214E3_2010/ap214_geometry_extraction.test.js +10 -2
  50. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts +2 -0
  51. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.d.ts.map +1 -0
  52. package/compiled/src/AP214E3_2010/ap214_logical_attribute.test.js +114 -0
  53. package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts +6 -0
  54. package/compiled/src/AP214E3_2010/ap214_model_geometry.d.ts.map +1 -1
  55. package/compiled/src/AP214E3_2010/ap214_model_geometry.js +9 -0
  56. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts +2 -0
  57. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.d.ts.map +1 -0
  58. package/compiled/src/AP214E3_2010/ap214_pcurve_basis_surfaces.test.js +233 -0
  59. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts +2 -0
  60. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.d.ts.map +1 -0
  61. package/compiled/src/AP214E3_2010/ap214_sphere_vertex_loop.test.js +147 -0
  62. package/compiled/src/AP214E3_2010/ap214_step_model.d.ts +2 -1
  63. package/compiled/src/AP214E3_2010/ap214_step_model.d.ts.map +1 -1
  64. package/compiled/src/AP214E3_2010/ap214_step_model.js +1 -1
  65. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts +2 -0
  66. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.d.ts.map +1 -0
  67. package/compiled/src/AP214E3_2010/ap214_typed_select_enum.test.js +65 -0
  68. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts +2 -0
  69. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.d.ts.map +1 -0
  70. package/compiled/src/AP214E3_2010/ap214_unit_scale.test.js +111 -0
  71. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts +2 -0
  72. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.d.ts.map +1 -0
  73. package/compiled/src/compat/web-ifc/ap214_streamed_open.test.js +190 -0
  74. package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts +2 -0
  75. package/compiled/src/compat/web-ifc/coordination_export_order.test.d.ts.map +1 -0
  76. package/compiled/src/compat/web-ifc/coordination_export_order.test.js +110 -0
  77. package/compiled/src/compat/web-ifc/coordination_f64.d.ts +165 -0
  78. package/compiled/src/compat/web-ifc/coordination_f64.d.ts.map +1 -0
  79. package/compiled/src/compat/web-ifc/coordination_f64.js +286 -0
  80. package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts +2 -0
  81. package/compiled/src/compat/web-ifc/coordination_f64.test.d.ts.map +1 -0
  82. package/compiled/src/compat/web-ifc/coordination_f64.test.js +225 -0
  83. package/compiled/src/compat/web-ifc/ifc_api.d.ts +154 -0
  84. package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
  85. package/compiled/src/compat/web-ifc/ifc_api.js +211 -3
  86. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts +2 -0
  87. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.d.ts.map +1 -0
  88. package/compiled/src/compat/web-ifc/ifc_api_deferred_open.test.js +288 -0
  89. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts +39 -0
  90. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough.d.ts.map +1 -1
  91. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +30 -0
  92. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
  93. package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +83 -0
  94. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts +2 -0
  95. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.d.ts.map +1 -0
  96. package/compiled/src/compat/web-ifc/ifc_api_preview_channel.test.js +383 -0
  97. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts +2 -0
  98. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.d.ts.map +1 -0
  99. package/compiled/src/compat/web-ifc/ifc_api_preview_coordination.test.js +124 -0
  100. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts +132 -0
  101. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
  102. package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +488 -92
  103. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +268 -0
  104. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
  105. package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +996 -149
  106. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts +2 -0
  107. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.d.ts.map +1 -0
  108. package/compiled/src/compat/web-ifc/ifc_api_streamed_open.test.js +129 -0
  109. package/compiled/src/compat/web-ifc/spatial_imposter.d.ts +134 -0
  110. package/compiled/src/compat/web-ifc/spatial_imposter.d.ts.map +1 -0
  111. package/compiled/src/compat/web-ifc/spatial_imposter.js +933 -0
  112. package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts +2 -0
  113. package/compiled/src/compat/web-ifc/spatial_imposter.test.d.ts.map +1 -0
  114. package/compiled/src/compat/web-ifc/spatial_imposter.test.js +467 -0
  115. package/compiled/src/compat/web-ifc/store_preview_channel.d.ts +187 -0
  116. package/compiled/src/compat/web-ifc/store_preview_channel.d.ts.map +1 -0
  117. package/compiled/src/compat/web-ifc/store_preview_channel.js +524 -0
  118. package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts +2 -0
  119. package/compiled/src/compat/web-ifc/store_preview_channel.test.d.ts.map +1 -0
  120. package/compiled/src/compat/web-ifc/store_preview_channel.test.js +234 -0
  121. package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts +306 -0
  122. package/compiled/src/compat/web-ifc/streamed_preview_channel.d.ts.map +1 -0
  123. package/compiled/src/compat/web-ifc/streamed_preview_channel.js +580 -0
  124. package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts +2 -0
  125. package/compiled/src/compat/web-ifc/web_wasm_directory.test.d.ts.map +1 -0
  126. package/compiled/src/compat/web-ifc/web_wasm_directory.test.js +22 -0
  127. package/compiled/src/core/composed_model_skeleton.d.ts +63 -0
  128. package/compiled/src/core/composed_model_skeleton.d.ts.map +1 -0
  129. package/compiled/src/core/composed_model_skeleton.js +66 -0
  130. package/compiled/src/core/composed_model_skeleton.test.d.ts +2 -0
  131. package/compiled/src/core/composed_model_skeleton.test.d.ts.map +1 -0
  132. package/compiled/src/core/composed_model_skeleton.test.js +69 -0
  133. package/compiled/src/core/demand_geometry_queue.d.ts +147 -0
  134. package/compiled/src/core/demand_geometry_queue.d.ts.map +1 -0
  135. package/compiled/src/core/demand_geometry_queue.js +223 -0
  136. package/compiled/src/core/demand_geometry_queue.test.d.ts +2 -0
  137. package/compiled/src/core/demand_geometry_queue.test.d.ts.map +1 -0
  138. package/compiled/src/core/demand_geometry_queue.test.js +133 -0
  139. package/compiled/src/core/demand_residency_pump.d.ts +93 -0
  140. package/compiled/src/core/demand_residency_pump.d.ts.map +1 -0
  141. package/compiled/src/core/demand_residency_pump.js +120 -0
  142. package/compiled/src/core/demand_residency_pump.test.d.ts +2 -0
  143. package/compiled/src/core/demand_residency_pump.test.d.ts.map +1 -0
  144. package/compiled/src/core/demand_residency_pump.test.js +148 -0
  145. package/compiled/src/core/geometry_tile_bindings.d.ts +110 -0
  146. package/compiled/src/core/geometry_tile_bindings.d.ts.map +1 -0
  147. package/compiled/src/core/geometry_tile_bindings.js +76 -0
  148. package/compiled/src/core/geometry_tile_bindings.test.d.ts +2 -0
  149. package/compiled/src/core/geometry_tile_bindings.test.d.ts.map +1 -0
  150. package/compiled/src/core/geometry_tile_bindings.test.js +211 -0
  151. package/compiled/src/core/geometry_tile_pool.d.ts +99 -0
  152. package/compiled/src/core/geometry_tile_pool.d.ts.map +1 -0
  153. package/compiled/src/core/geometry_tile_pool.js +104 -0
  154. package/compiled/src/core/geometry_tile_pool.test.d.ts +2 -0
  155. package/compiled/src/core/geometry_tile_pool.test.d.ts.map +1 -0
  156. package/compiled/src/core/geometry_tile_pool.test.js +180 -0
  157. package/compiled/src/core/mem/chunked_pool.d.ts +116 -0
  158. package/compiled/src/core/mem/chunked_pool.d.ts.map +1 -0
  159. package/compiled/src/core/mem/chunked_pool.js +149 -0
  160. package/compiled/src/core/mem/chunked_pool.test.d.ts +2 -0
  161. package/compiled/src/core/mem/chunked_pool.test.d.ts.map +1 -0
  162. package/compiled/src/core/mem/chunked_pool.test.js +63 -0
  163. package/compiled/src/core/mem/shared_asset_pool.d.ts +82 -0
  164. package/compiled/src/core/mem/shared_asset_pool.d.ts.map +1 -0
  165. package/compiled/src/core/mem/shared_asset_pool.js +113 -0
  166. package/compiled/src/core/mem/shared_asset_pool.test.d.ts +2 -0
  167. package/compiled/src/core/mem/shared_asset_pool.test.d.ts.map +1 -0
  168. package/compiled/src/core/mem/shared_asset_pool.test.js +49 -0
  169. package/compiled/src/core/model_registry.d.ts +87 -0
  170. package/compiled/src/core/model_registry.d.ts.map +1 -0
  171. package/compiled/src/core/model_registry.js +101 -0
  172. package/compiled/src/core/model_registry.test.d.ts +2 -0
  173. package/compiled/src/core/model_registry.test.d.ts.map +1 -0
  174. package/compiled/src/core/model_registry.test.js +60 -0
  175. package/compiled/src/core/model_uri.d.ts +57 -0
  176. package/compiled/src/core/model_uri.d.ts.map +1 -0
  177. package/compiled/src/core/model_uri.js +101 -0
  178. package/compiled/src/core/model_uri.test.d.ts +2 -0
  179. package/compiled/src/core/model_uri.test.d.ts.map +1 -0
  180. package/compiled/src/core/model_uri.test.js +49 -0
  181. package/compiled/src/core/progress.d.ts +16 -2
  182. package/compiled/src/core/progress.d.ts.map +1 -1
  183. package/compiled/src/core/progress.js +31 -5
  184. package/compiled/src/core/progress.test.js +11 -2
  185. package/compiled/src/core/progress_log.d.ts +1 -0
  186. package/compiled/src/core/progress_log.d.ts.map +1 -1
  187. package/compiled/src/core/progress_log.js +7 -2
  188. package/compiled/src/core/progress_log.test.js +21 -0
  189. package/compiled/src/core/shared_byte_budget.d.ts +60 -0
  190. package/compiled/src/core/shared_byte_budget.d.ts.map +1 -0
  191. package/compiled/src/core/shared_byte_budget.js +85 -0
  192. package/compiled/src/core/shared_byte_budget.test.d.ts +2 -0
  193. package/compiled/src/core/shared_byte_budget.test.d.ts.map +1 -0
  194. package/compiled/src/core/shared_byte_budget.test.js +55 -0
  195. package/compiled/src/core/wasm_heap.d.ts +208 -0
  196. package/compiled/src/core/wasm_heap.d.ts.map +1 -0
  197. package/compiled/src/core/wasm_heap.js +417 -0
  198. package/compiled/src/core/wasm_heap.test.d.ts +2 -0
  199. package/compiled/src/core/wasm_heap.test.d.ts.map +1 -0
  200. package/compiled/src/core/wasm_heap.test.js +546 -0
  201. package/compiled/src/demand/index.d.ts +23 -0
  202. package/compiled/src/demand/index.d.ts.map +1 -0
  203. package/compiled/src/demand/index.js +22 -0
  204. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts +1 -1
  205. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.d.ts.map +1 -1
  206. package/compiled/src/ifc/ifc4_gen/IfcLogical.gen.js +1 -1
  207. package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.d.ts.map +1 -1
  208. package/compiled/src/ifc/ifc4_gen/IfcPresentationStyleAssignment.gen.js +2 -2
  209. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts +1 -1
  210. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.d.ts.map +1 -1
  211. package/compiled/src/ifc/ifc4_gen/IfcRelInterferesElements.gen.js +1 -1
  212. package/compiled/src/ifc/ifc4_gen/schema_ifc.gen.js +2 -2
  213. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts +2 -0
  214. package/compiled/src/ifc/ifc_demand_extraction.test.d.ts.map +1 -0
  215. package/compiled/src/ifc/ifc_demand_extraction.test.js +251 -0
  216. package/compiled/src/ifc/ifc_geometry_extraction.d.ts +367 -6
  217. package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
  218. package/compiled/src/ifc/ifc_geometry_extraction.js +1322 -389
  219. package/compiled/src/ifc/ifc_grid_placement.test.d.ts +2 -0
  220. package/compiled/src/ifc/ifc_grid_placement.test.d.ts.map +1 -0
  221. package/compiled/src/ifc/ifc_grid_placement.test.js +261 -0
  222. package/compiled/src/ifc/ifc_model_geometry.d.ts +12 -0
  223. package/compiled/src/ifc/ifc_model_geometry.d.ts.map +1 -1
  224. package/compiled/src/ifc/ifc_model_geometry.js +15 -0
  225. package/compiled/src/ifc/ifc_regression_batch_main.js +210 -12
  226. package/compiled/src/ifc/ifc_spatial_skeleton.d.ts +145 -0
  227. package/compiled/src/ifc/ifc_spatial_skeleton.d.ts.map +1 -0
  228. package/compiled/src/ifc/ifc_spatial_skeleton.js +266 -0
  229. package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts +2 -0
  230. package/compiled/src/ifc/ifc_spatial_skeleton.test.d.ts.map +1 -0
  231. package/compiled/src/ifc/ifc_spatial_skeleton.test.js +199 -0
  232. package/compiled/src/ifc/ifc_step_model.d.ts +6 -2
  233. package/compiled/src/ifc/ifc_step_model.d.ts.map +1 -1
  234. package/compiled/src/ifc/ifc_step_model.js +6 -4
  235. package/compiled/src/ifc/ifc_step_parser.d.ts +58 -0
  236. package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
  237. package/compiled/src/ifc/ifc_step_parser.js +64 -0
  238. package/compiled/src/ifc/ifc_stream_model.test.d.ts +2 -0
  239. package/compiled/src/ifc/ifc_stream_model.test.d.ts.map +1 -0
  240. package/compiled/src/ifc/ifc_stream_model.test.js +70 -0
  241. package/compiled/src/ifc/ifc_stream_open.d.ts +131 -0
  242. package/compiled/src/ifc/ifc_stream_open.d.ts.map +1 -0
  243. package/compiled/src/ifc/ifc_stream_open.js +116 -0
  244. package/compiled/src/ifc/ifc_stream_open.test.d.ts +2 -0
  245. package/compiled/src/ifc/ifc_stream_open.test.d.ts.map +1 -0
  246. package/compiled/src/ifc/ifc_stream_open.test.js +230 -0
  247. package/compiled/src/ifc/ifc_tile_extractor.d.ts +84 -0
  248. package/compiled/src/ifc/ifc_tile_extractor.d.ts.map +1 -0
  249. package/compiled/src/ifc/ifc_tile_extractor.js +134 -0
  250. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts +2 -0
  251. package/compiled/src/ifc/ifc_tile_extractor.test.d.ts.map +1 -0
  252. package/compiled/src/ifc/ifc_tile_extractor.test.js +118 -0
  253. package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts +2 -0
  254. package/compiled/src/ifc/ifc_typed_select_enum.test.d.ts.map +1 -0
  255. package/compiled/src/ifc/ifc_typed_select_enum.test.js +60 -0
  256. package/compiled/src/index.d.ts +21 -1
  257. package/compiled/src/index.d.ts.map +1 -1
  258. package/compiled/src/index.js +28 -1
  259. package/compiled/src/logging/logger.d.ts +16 -2
  260. package/compiled/src/logging/logger.d.ts.map +1 -1
  261. package/compiled/src/logging/logger.js +34 -7
  262. package/compiled/src/logging/logger.test.js +30 -0
  263. package/compiled/src/mem/index.d.ts +17 -0
  264. package/compiled/src/mem/index.d.ts.map +1 -0
  265. package/compiled/src/mem/index.js +16 -0
  266. package/compiled/src/namespace_surface.test.d.ts +2 -0
  267. package/compiled/src/namespace_surface.test.d.ts.map +1 -0
  268. package/compiled/src/namespace_surface.test.js +43 -0
  269. package/compiled/src/parsing/parsing_buffer.d.ts +23 -0
  270. package/compiled/src/parsing/parsing_buffer.d.ts.map +1 -1
  271. package/compiled/src/parsing/parsing_buffer.js +31 -0
  272. package/compiled/src/scripts/model_report_displacement.test.d.ts +2 -0
  273. package/compiled/src/scripts/model_report_displacement.test.d.ts.map +1 -0
  274. package/compiled/src/scripts/model_report_displacement.test.js +104 -0
  275. package/compiled/src/scripts/render_glb_paths.test.d.ts +2 -0
  276. package/compiled/src/scripts/render_glb_paths.test.d.ts.map +1 -0
  277. package/compiled/src/scripts/render_glb_paths.test.js +115 -0
  278. package/compiled/src/step/indexing/step_type_indexer.d.ts +20 -0
  279. package/compiled/src/step/indexing/step_type_indexer.d.ts.map +1 -1
  280. package/compiled/src/step/indexing/step_type_indexer.js +67 -0
  281. package/compiled/src/step/parsing/byte_source.d.ts +153 -0
  282. package/compiled/src/step/parsing/byte_source.d.ts.map +1 -0
  283. package/compiled/src/step/parsing/byte_source.js +106 -0
  284. package/compiled/src/step/parsing/byte_source.test.d.ts +2 -0
  285. package/compiled/src/step/parsing/byte_source.test.d.ts.map +1 -0
  286. package/compiled/src/step/parsing/byte_source.test.js +47 -0
  287. package/compiled/src/step/parsing/byte_source_node.d.ts +41 -0
  288. package/compiled/src/step/parsing/byte_source_node.d.ts.map +1 -0
  289. package/compiled/src/step/parsing/byte_source_node.js +54 -0
  290. package/compiled/src/step/parsing/columnar_index.d.ts +103 -0
  291. package/compiled/src/step/parsing/columnar_index.d.ts.map +1 -0
  292. package/compiled/src/step/parsing/columnar_index.js +224 -0
  293. package/compiled/src/step/parsing/columnar_index.test.d.ts +2 -0
  294. package/compiled/src/step/parsing/columnar_index.test.d.ts.map +1 -0
  295. package/compiled/src/step/parsing/columnar_index.test.js +155 -0
  296. package/compiled/src/step/parsing/cross_reference_registry.d.ts +95 -0
  297. package/compiled/src/step/parsing/cross_reference_registry.d.ts.map +1 -0
  298. package/compiled/src/step/parsing/cross_reference_registry.js +91 -0
  299. package/compiled/src/step/parsing/cross_reference_registry.test.d.ts +2 -0
  300. package/compiled/src/step/parsing/cross_reference_registry.test.d.ts.map +1 -0
  301. package/compiled/src/step/parsing/cross_reference_registry.test.js +66 -0
  302. package/compiled/src/step/parsing/decode_utf8.d.ts +15 -0
  303. package/compiled/src/step/parsing/decode_utf8.d.ts.map +1 -1
  304. package/compiled/src/step/parsing/decode_utf8.js +28 -0
  305. package/compiled/src/step/parsing/express_ref_scan.d.ts +20 -0
  306. package/compiled/src/step/parsing/express_ref_scan.d.ts.map +1 -0
  307. package/compiled/src/step/parsing/express_ref_scan.js +91 -0
  308. package/compiled/src/step/parsing/express_ref_scan.test.d.ts +2 -0
  309. package/compiled/src/step/parsing/express_ref_scan.test.d.ts.map +1 -0
  310. package/compiled/src/step/parsing/express_ref_scan.test.js +28 -0
  311. package/compiled/src/step/parsing/index_sidecar.d.ts +81 -0
  312. package/compiled/src/step/parsing/index_sidecar.d.ts.map +1 -0
  313. package/compiled/src/step/parsing/index_sidecar.js +283 -0
  314. package/compiled/src/step/parsing/index_sidecar.test.d.ts +2 -0
  315. package/compiled/src/step/parsing/index_sidecar.test.d.ts.map +1 -0
  316. package/compiled/src/step/parsing/index_sidecar.test.js +122 -0
  317. package/compiled/src/step/parsing/inf_recovery_index.test.d.ts +2 -0
  318. package/compiled/src/step/parsing/inf_recovery_index.test.d.ts.map +1 -0
  319. package/compiled/src/step/parsing/inf_recovery_index.test.js +108 -0
  320. package/compiled/src/step/parsing/prefix_type_index.d.ts +124 -0
  321. package/compiled/src/step/parsing/prefix_type_index.d.ts.map +1 -0
  322. package/compiled/src/step/parsing/prefix_type_index.js +207 -0
  323. package/compiled/src/step/parsing/prefix_type_index.test.d.ts +2 -0
  324. package/compiled/src/step/parsing/prefix_type_index.test.d.ts.map +1 -0
  325. package/compiled/src/step/parsing/prefix_type_index.test.js +298 -0
  326. package/compiled/src/step/parsing/range_byte_source.d.ts +69 -0
  327. package/compiled/src/step/parsing/range_byte_source.d.ts.map +1 -0
  328. package/compiled/src/step/parsing/range_byte_source.js +78 -0
  329. package/compiled/src/step/parsing/range_byte_source.test.d.ts +2 -0
  330. package/compiled/src/step/parsing/range_byte_source.test.d.ts.map +1 -0
  331. package/compiled/src/step/parsing/range_byte_source.test.js +70 -0
  332. package/compiled/src/step/parsing/record_event.d.ts +23 -0
  333. package/compiled/src/step/parsing/record_event.d.ts.map +1 -0
  334. package/compiled/src/step/parsing/record_event.js +1 -0
  335. package/compiled/src/step/parsing/record_field_cursor.d.ts +94 -0
  336. package/compiled/src/step/parsing/record_field_cursor.d.ts.map +1 -0
  337. package/compiled/src/step/parsing/record_field_cursor.js +189 -0
  338. package/compiled/src/step/parsing/step_deserialization_functions.d.ts +29 -0
  339. package/compiled/src/step/parsing/step_deserialization_functions.d.ts.map +1 -1
  340. package/compiled/src/step/parsing/step_deserialization_functions.js +45 -0
  341. package/compiled/src/step/parsing/step_deserialization_functions.test.js +59 -1
  342. package/compiled/src/step/parsing/step_parser.d.ts +66 -1
  343. package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
  344. package/compiled/src/step/parsing/step_parser.js +164 -10
  345. package/compiled/src/step/parsing/step_string_parser.js +8 -8
  346. package/compiled/src/step/parsing/streaming_index_builder.d.ts +141 -0
  347. package/compiled/src/step/parsing/streaming_index_builder.d.ts.map +1 -0
  348. package/compiled/src/step/parsing/streaming_index_builder.js +280 -0
  349. package/compiled/src/step/parsing/streaming_index_builder.test.d.ts +2 -0
  350. package/compiled/src/step/parsing/streaming_index_builder.test.d.ts.map +1 -0
  351. package/compiled/src/step/parsing/streaming_index_builder.test.js +107 -0
  352. package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts +2 -0
  353. package/compiled/src/step/parsing/streaming_index_builder_async.test.d.ts.map +1 -0
  354. package/compiled/src/step/parsing/streaming_index_builder_async.test.js +109 -0
  355. package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts +71 -0
  356. package/compiled/src/step/parsing/streaming_record_dispatcher.d.ts.map +1 -0
  357. package/compiled/src/step/parsing/streaming_record_dispatcher.js +88 -0
  358. package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts +2 -0
  359. package/compiled/src/step/parsing/streaming_record_dispatcher.test.d.ts.map +1 -0
  360. package/compiled/src/step/parsing/streaming_record_dispatcher.test.js +66 -0
  361. package/compiled/src/step/parsing/uint32_sink.d.ts +72 -0
  362. package/compiled/src/step/parsing/uint32_sink.d.ts.map +1 -0
  363. package/compiled/src/step/parsing/uint32_sink.js +180 -0
  364. package/compiled/src/step/parsing/uint32_sink.test.d.ts +2 -0
  365. package/compiled/src/step/parsing/uint32_sink.test.d.ts.map +1 -0
  366. package/compiled/src/step/parsing/uint32_sink.test.js +199 -0
  367. package/compiled/src/step/step_buffer_provider.d.ts +48 -3
  368. package/compiled/src/step/step_buffer_provider.d.ts.map +1 -1
  369. package/compiled/src/step/step_buffer_provider.js +60 -11
  370. package/compiled/src/step/step_buffer_provider.test.js +14 -0
  371. package/compiled/src/step/step_entity_base.d.ts +65 -3
  372. package/compiled/src/step/step_entity_base.d.ts.map +1 -1
  373. package/compiled/src/step/step_entity_base.js +135 -3
  374. package/compiled/src/step/step_model_base.d.ts +221 -8
  375. package/compiled/src/step/step_model_base.d.ts.map +1 -1
  376. package/compiled/src/step/step_model_base.js +542 -7
  377. package/compiled/src/stream/index.d.ts +34 -0
  378. package/compiled/src/stream/index.d.ts.map +1 -0
  379. package/compiled/src/stream/index.js +32 -0
  380. package/compiled/src/version/version.js +1 -1
  381. package/compiled/tsconfig.tsbuildinfo +1 -1
  382. package/package.json +16 -1
@@ -39,6 +39,36 @@ describe("Logger levels + sink", () => {
39
39
  expect(entry?.count).toBe(3);
40
40
  expect(entry?.expressIDs.size).toBe(3);
41
41
  });
42
+ // The whole point of the parameter: an ID written into the message text
43
+ // makes every occurrence its own entry, and `count` then reports 1 for a
44
+ // problem that hit hundreds of records. One AP242 model in the regression
45
+ // corpus produced 272 such rows before this.
46
+ test("the expressID argument dedupes where interpolating the ID does not", () => {
47
+ // Deliberately mixed: the parameter takes an express ID as a number and a
48
+ // local ID as an already-formatted string, and both must key the same way.
49
+ const numericRecord = 11;
50
+ const records = [numericRecord, "22", "33"];
51
+ for (const record of records) {
52
+ Logger.error("boom", record);
53
+ }
54
+ const entries = Logger.getErrors();
55
+ expect(entries.length).toBe(1);
56
+ expect(entries[0].count).toBe(records.length);
57
+ expect(entries[0].expressIDs).toEqual(new Set(records.map((record) => `${record}`)));
58
+ // ...and the ID never reaches the buffered message, so the CSV cell is the
59
+ // family rather than one instance of it.
60
+ expect(entries[0].message).toBe("boom");
61
+ // The console echo still carries it, though. Only the buffer needs the ID
62
+ // out of the way, and a console line read once by a person should not lose
63
+ // its only pointer to the record.
64
+ expect(echoed).toEqual([["error", `boom expressID: ${numericRecord}`]]);
65
+ });
66
+ test("the argument wins over an in-message expressID suffix", () => {
67
+ Logger.error("clash expressID: 1", 2);
68
+ const entries = Logger.getErrors();
69
+ expect(entries[0].message).toBe("clash");
70
+ expect(entries[0].expressIDs).toEqual(new Set(["2"]));
71
+ });
42
72
  test("isLevelEnabled matches the threshold ordering", () => {
43
73
  Logger.setLogLevel(LogLevel.WARNING);
44
74
  expect(Logger.isLevelEnabled(LogLevel.DEBUG)).toBe(false);
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `@bldrs-ai/conway/mem` — the general memory system (src/core/mem;
3
+ * design/new/streaming-federated-loader.md, resident-memory design).
4
+ *
5
+ * Domain-neutral primitives for explicitly budgeted residency:
6
+ * {@link ChunkedPool} (accounting-only fixed-chunk freelist),
7
+ * {@link SharedAssetPool} (refcounted instance⇄asset sharing), and
8
+ * {@link SharedByteBudget} (a byte budget shareable across consumers).
9
+ * The geometry narrowing over these lives in `@bldrs-ai/conway/demand`
10
+ * ({@link import('../core/geometry_tile_pool').GeometryTilePool}); other
11
+ * asset domains (textures, property blocks) are expected to narrow the
12
+ * same way.
13
+ */
14
+ export { ChunkedPool, ChunkSpan } from "../core/mem/chunked_pool.js";
15
+ export { SharedAssetPool } from "../core/mem/shared_asset_pool.js";
16
+ export { SharedByteBudget } from "../core/shared_byte_budget.js";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mem/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `@bldrs-ai/conway/mem` — the general memory system (src/core/mem;
3
+ * design/new/streaming-federated-loader.md, resident-memory design).
4
+ *
5
+ * Domain-neutral primitives for explicitly budgeted residency:
6
+ * {@link ChunkedPool} (accounting-only fixed-chunk freelist),
7
+ * {@link SharedAssetPool} (refcounted instance⇄asset sharing), and
8
+ * {@link SharedByteBudget} (a byte budget shareable across consumers).
9
+ * The geometry narrowing over these lives in `@bldrs-ai/conway/demand`
10
+ * ({@link import('../core/geometry_tile_pool').GeometryTilePool}); other
11
+ * asset domains (textures, property blocks) are expected to narrow the
12
+ * same way.
13
+ */
14
+ export { ChunkedPool } from "../core/mem/chunked_pool.js";
15
+ export { SharedAssetPool } from "../core/mem/shared_asset_pool.js";
16
+ export { SharedByteBudget } from "../core/shared_byte_budget.js";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=namespace_surface.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace_surface.test.d.ts","sourceRoot":"","sources":["../../src/namespace_surface.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ // Pins the conway-native plane namespaces (`@bldrs-ai/conway/stream`,
2
+ // `/demand`, `/mem`): each module must expose its plane's key runtime
3
+ // symbols. Guards the packaging contract — a refactor that moves or
4
+ // renames an export breaks embedders through these subpaths first.
5
+ import { describe, expect, test } from "@jest/globals";
6
+ import * as demand from "./demand/index.js";
7
+ import * as mem from "./mem/index.js";
8
+ import * as stream from "./stream/index.js";
9
+ describe("plane namespace surface", () => {
10
+ test("stream exposes the fixed-memory open plane", () => {
11
+ expect(typeof stream.openStreamedIfcModel).toBe("function");
12
+ expect(typeof stream.openStreamedIfcModelFromStore).toBe("function");
13
+ expect(typeof stream.BufferByteSource).toBe("function");
14
+ expect(typeof stream.StoreByteSource).toBe("function");
15
+ expect(typeof stream.SyncAccessHandleByteSource).toBe("function");
16
+ expect(typeof stream.InMemoryStepByteStore).toBe("function");
17
+ expect(typeof stream.WindowedStepBufferProvider).toBe("function");
18
+ expect(typeof stream.serializeIndexSidecarFromColumns).toBe("function");
19
+ expect(typeof stream.deserializeIndexSidecarToColumns).toBe("function");
20
+ expect(typeof stream.sidecarMatchesSource).toBe("function");
21
+ expect(typeof stream.hashSource).toBe("function");
22
+ expect(typeof stream.StreamingRecordDispatcher).toBe("function");
23
+ expect(typeof stream.PrefixTypeIndex).toBe("function");
24
+ expect(typeof stream.ColumnarIndexSink).toBe("function");
25
+ expect(typeof stream.StepTypeIndexer).toBe("function");
26
+ expect(typeof stream.ifcPrefixTypeIndex).toBe("function");
27
+ expect(typeof stream.RecordFieldCursor).toBe("function");
28
+ expect(typeof stream.IfcSpatialSkeleton).toBe("function");
29
+ });
30
+ test("demand exposes the residency/extraction plane", () => {
31
+ expect(typeof demand.DemandGeometryQueue).toBe("function");
32
+ expect(typeof demand.DemandResidencyPump).toBe("function");
33
+ expect(typeof demand.GeometryTilePool).toBe("function");
34
+ expect(typeof demand.createWasmTileBackend).toBe("function");
35
+ expect(typeof demand.readGeometryTilePayload).toBe("function");
36
+ expect(typeof demand.IfcTileAssetExtractor).toBe("function");
37
+ });
38
+ test("mem exposes the general pool primitives", () => {
39
+ expect(typeof mem.ChunkedPool).toBe("function");
40
+ expect(typeof mem.SharedAssetPool).toBe("function");
41
+ expect(typeof mem.SharedByteBudget).toBe("function");
42
+ });
43
+ });
@@ -61,6 +61,29 @@ export default class ParsingBuffer {
61
61
  * of the buffer.
62
62
  */
63
63
  reinit(buffer: Uint8Array, initialOffset: number, endOffset: number): void;
64
+ /**
65
+ * Streaming support: repoint this buffer at a fresh window over the same
66
+ * logical stream while keeping `address` file-absolute.
67
+ *
68
+ * A moving-window parse holds only a slice of the source in memory at a
69
+ * time. Between top-level records (where the rewind stack is empty) the
70
+ * driver slides the window forward: it copies the unconsumed tail to the
71
+ * front of a reused buffer, appends freshly-read bytes, and calls this to
72
+ * repoint the parser. `addressBase` is the file offset that window index 0
73
+ * now corresponds to; we store it as a negative initial offset so
74
+ * `address` ( = cursor − initialOffset ) stays the file-absolute value the
75
+ * non-streaming parse would have produced.
76
+ *
77
+ * Must only be called with the rewind stack empty (i.e. at a record
78
+ * boundary) — the stack holds window-relative cursors that a slide would
79
+ * invalidate. Throws otherwise.
80
+ *
81
+ * @param buffer The new window buffer.
82
+ * @param cursorInWindow The cursor position within the new window.
83
+ * @param endInWindow The count of valid bytes in the new window.
84
+ * @param addressBase The file offset that window index 0 maps to.
85
+ */
86
+ rebaseWindow(buffer: Uint8Array, cursorInWindow: number, endInWindow: number, addressBase: number): void;
64
87
  /**
65
88
  * Construct this with a buffer, initial offset into the buffer and an end offset.
66
89
  *
@@ -1 +1 @@
1
- {"version":3,"file":"parsing_buffer.d.ts","sourceRoot":"","sources":["../../../src/parsing/parsing_buffer.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"parsing_buffer.d.ts","sourceRoot":"","sources":["../../../src/parsing/parsing_buffer.ts"],"names":[],"mappings":"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"}
@@ -86,6 +86,37 @@ export default class ParsingBuffer {
86
86
  this.buffer = buffer;
87
87
  this.end = endOffset;
88
88
  }
89
+ /**
90
+ * Streaming support: repoint this buffer at a fresh window over the same
91
+ * logical stream while keeping `address` file-absolute.
92
+ *
93
+ * A moving-window parse holds only a slice of the source in memory at a
94
+ * time. Between top-level records (where the rewind stack is empty) the
95
+ * driver slides the window forward: it copies the unconsumed tail to the
96
+ * front of a reused buffer, appends freshly-read bytes, and calls this to
97
+ * repoint the parser. `addressBase` is the file offset that window index 0
98
+ * now corresponds to; we store it as a negative initial offset so
99
+ * `address` ( = cursor − initialOffset ) stays the file-absolute value the
100
+ * non-streaming parse would have produced.
101
+ *
102
+ * Must only be called with the rewind stack empty (i.e. at a record
103
+ * boundary) — the stack holds window-relative cursors that a slide would
104
+ * invalidate. Throws otherwise.
105
+ *
106
+ * @param buffer The new window buffer.
107
+ * @param cursorInWindow The cursor position within the new window.
108
+ * @param endInWindow The count of valid bytes in the new window.
109
+ * @param addressBase The file offset that window index 0 maps to.
110
+ */
111
+ rebaseWindow(buffer, cursorInWindow, endInWindow, addressBase) {
112
+ if (this.rewindStack_.length !== 0) {
113
+ throw Error("rebaseWindow called mid-transaction (rewind stack non-empty)");
114
+ }
115
+ this.buffer = buffer;
116
+ this.cursor_ = cursorInWindow;
117
+ this.initialOffset_ = -addressBase;
118
+ this.end = endInWindow;
119
+ }
89
120
  /**
90
121
  * Construct this with a buffer, initial offset into the buffer and an end offset.
91
122
  *
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=model_report_displacement.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model_report_displacement.test.d.ts","sourceRoot":"","sources":["../../../src/scripts/model_report_displacement.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,104 @@
1
+ import { describe, expect, test } from '@jest/globals';
2
+ // @ts-expect-error -- an untyped .mjs helper beside the CLI it serves.
3
+ import { localCentre, placeCentre, robustCentre } from '../../../scripts/debug/displacement.mjs';
4
+ /* eslint-disable no-magic-numbers -- these are synthetic coordinates and
5
+ distances chosen to mirror the real model in conway#456. Naming each one
6
+ would obscure the shape the cases exist to express: a tight cluster near
7
+ the site origin plus one part flung far away. */
8
+ /**
9
+ * The scoring behind model_report.mjs's `displacement` stage (conway#456).
10
+ *
11
+ * The stage answers "which parts are flung away from where they belong",
12
+ * which the `mesh` stage cannot: `mesh` measures extent in MESH-LOCAL
13
+ * coordinates, so on an export that writes geometry directly in site
14
+ * coordinates every honest part looks displaced by its distance from the
15
+ * file origin.
16
+ *
17
+ * These cases use synthetic centres rather than a model, because the
18
+ * motivating file is 256 MB and private. What is worth pinning is the
19
+ * scoring, and the scoring is pure — which is why it lives in
20
+ * displacement.mjs rather than in the CLI script, whose module body runs
21
+ * the whole tool on import.
22
+ */
23
+ /**
24
+ * Column-major 4x4 translation, matching the walk tuple's layout.
25
+ *
26
+ * @param x Translation along x.
27
+ * @param y Translation along y.
28
+ * @param z Translation along z.
29
+ * @return The 16-element matrix.
30
+ */
31
+ function translation(x, y, z) {
32
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1];
33
+ }
34
+ /**
35
+ * A stub geometry over a fixed point list.
36
+ *
37
+ * @param points One [x, y, z] per vertex.
38
+ * @return Something with the getPoint() shape worldCentre reads.
39
+ */
40
+ function geometryOf(points) {
41
+ return {
42
+ getPoint: (i) => ({ x: points[i][0], y: points[i][1], z: points[i][2] }),
43
+ };
44
+ }
45
+ describe('displacement scoring', () => {
46
+ test('the robust centre ignores outliers rather than chasing them', () => {
47
+ // Nine parts clustered near the site origin, one flung far away — the
48
+ // shape of the motivating model, scaled down.
49
+ const centres = [
50
+ ...Array.from({ length: 9 }, (_, i) => [578 + i, 763, 3]),
51
+ [-751, 1075, 1377],
52
+ ];
53
+ const centre = robustCentre(centres);
54
+ // A MEAN would sit ~130 units off in x and ~137 in z, dragged by the
55
+ // single outlier; every honest part would then score as displaced and
56
+ // the outlier's own score would shrink. That inversion is the reason
57
+ // this is a median.
58
+ expect(centre[0]).toBeGreaterThan(577);
59
+ expect(centre[0]).toBeLessThan(587);
60
+ expect(centre[2]).toBeCloseTo(3, 6);
61
+ const distances = centres.map((each) => Math.hypot(each[0] - centre[0], each[1] - centre[1], each[2] - centre[2]));
62
+ const cluster = distances.slice(0, 9);
63
+ const outlier = distances[9];
64
+ // The signal the stage's `factor x median` threshold consumes: the
65
+ // outlier has to clear 8x the median by a wide margin, or it would be
66
+ // reported as ordinary.
67
+ const median = [...cluster].sort((a, b) => a - b)[Math.floor(cluster.length / 2)];
68
+ expect(outlier).toBeGreaterThan(median * 8);
69
+ });
70
+ test('a mesh centre is placed by its transform, not left local', () => {
71
+ // The defect this stage exists to fix in one assertion: identical local
72
+ // geometry at two different placements must score differently. Reading
73
+ // local coordinates would make these indistinguishable.
74
+ const unitBox = [[-1, -1, -1], [1, 1, 1]];
75
+ const local = localCentre(geometryOf(unitBox), 2);
76
+ const atOrigin = placeCentre(local, translation(0, 0, 0));
77
+ const farAway = placeCentre(local, translation(1000, 0, 0));
78
+ expect(atOrigin).toEqual([0, 0, 0]);
79
+ expect(farAway).toEqual([1000, 0, 0]);
80
+ });
81
+ test('an undefined transform means identity, not a skipped mesh', () => {
82
+ expect(placeCentre(localCentre(geometryOf([[2, 4, 6], [4, 8, 12]]), 2), undefined))
83
+ .toEqual([3, 6, 9]);
84
+ });
85
+ test('a wrong walk-tuple index throws rather than scoring NaN', () => {
86
+ // conway#456 names the transform as walked[1]; it is walked[0].
87
+ // Following the issue verbatim handed this an object, every
88
+ // multiplication produced NaN, Stage.record silently discarded every
89
+ // non-finite value, and the stage reported "N calls, 0 measured" — a
90
+ // clean-looking result manufactured by a bug. That is hazard 1 from the
91
+ // script's own header, so it has to be loud.
92
+ const notATransform = { someObject: true };
93
+ expect(() => placeCentre([0, 0, 0], notATransform)).toThrow(/walk tuple index/);
94
+ });
95
+ test('non-finite vertex data yields no centre rather than a NaN score', () => {
96
+ expect(localCentre(geometryOf([[0, 0, 0], [NaN, 0, 0]]), 2)).toBeUndefined();
97
+ });
98
+ test('a right-shaped transform holding NaN drops the mesh, and does not throw', () => {
99
+ // Data, not a programming error: one unusable placement must not take
100
+ // down the whole run and discard the other stages' reports.
101
+ const nanTransform = translation(NaN, 0, 0);
102
+ expect(placeCentre([1, 1, 1], nanTransform)).toBeUndefined();
103
+ });
104
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=render_glb_paths.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render_glb_paths.test.d.ts","sourceRoot":"","sources":["../../../src/scripts/render_glb_paths.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,115 @@
1
+ import fs from 'fs';
2
+ import os from 'os';
3
+ import path from 'path';
4
+ import { execFileSync } from 'child_process';
5
+ import { describe, expect, test, beforeAll, afterAll } from '@jest/globals';
6
+ import { createRequire } from 'module';
7
+ /* eslint-disable @typescript-eslint/no-explicit-any -- render_glb.cjs is an
8
+ untyped CommonJS CLI script, loaded here through createRequire. */
9
+ /**
10
+ * Path resolution in scripts/render_glb.cjs (conway#457).
11
+ *
12
+ * The script accepts a comma-joined chunk list, and used to split on comma
13
+ * unconditionally — which tore a real path containing a comma into fragments
14
+ * and reported the first fragment as missing. Several models we ship are
15
+ * named that way, and `-g` keeps the source basename, so following
16
+ * scripts/debug/README.md on one of them failed.
17
+ */
18
+ const require_ = createRequire(import.meta.url);
19
+ // Resolved from the repo root rather than relative to this file: the test
20
+ // runs from compiled/src/scripts, where a relative hop would land in
21
+ // compiled/scripts, which does not exist (scripts/ is not part of the tsc
22
+ // build). Jest's rootDir is the repo root.
23
+ const { resolveGlbPaths } = require_(path.resolve(process.cwd(), 'scripts/render_glb.cjs'));
24
+ let workDir;
25
+ /** A name in the shape that broke: a comma inside a single real filename. */
26
+ const COMMA_NAME = 'Wiesenplatz 7, 4057 Basel_test0.glb';
27
+ beforeAll(() => {
28
+ workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'render-glb-paths-'));
29
+ fs.writeFileSync(path.join(workDir, COMMA_NAME), 'not-a-real-glb');
30
+ fs.writeFileSync(path.join(workDir, 'chunk0.glb'), 'not-a-real-glb');
31
+ fs.writeFileSync(path.join(workDir, 'chunk1.glb'), 'not-a-real-glb');
32
+ });
33
+ afterAll(() => {
34
+ fs.rmSync(workDir, { recursive: true, force: true });
35
+ });
36
+ describe('render_glb path resolution', () => {
37
+ test('a real path containing a comma resolves to itself (issue #457)', () => {
38
+ const target = path.join(workDir, COMMA_NAME);
39
+ // The regression: this used to come back as ['<dir>/Wiesenplatz 7',
40
+ // ' 4057 Basel_test0.glb'] and fail on the first, which reads as a
41
+ // missing file rather than as a parsing decision.
42
+ expect(resolveGlbPaths(target)).toEqual([target]);
43
+ });
44
+ test('a genuine chunk list still splits', () => {
45
+ const chunks = [
46
+ path.join(workDir, 'chunk0.glb'),
47
+ path.join(workDir, 'chunk1.glb'),
48
+ ];
49
+ expect(resolveGlbPaths(chunks.join(','))).toEqual(chunks);
50
+ });
51
+ test('a JSON array resolves chunks whose names contain commas', () => {
52
+ // The case the literal-path rule alone cannot reach: a comma-named model
53
+ // large enough that the CLI splits it, so no single file bears the name.
54
+ // visual_diff_report.cjs passes this form.
55
+ const chunks = [
56
+ path.join(workDir, COMMA_NAME),
57
+ path.join(workDir, 'chunk0.glb'),
58
+ ];
59
+ expect(resolveGlbPaths(JSON.stringify(chunks))).toEqual(chunks);
60
+ });
61
+ test('a JSON array with a missing member fails rather than rendering part', () => {
62
+ const chunks = [path.join(workDir, 'chunk0.glb'), path.join(workDir, 'gone.glb')];
63
+ expect(() => resolveGlbPaths(JSON.stringify(chunks))).toThrow(/gone\.glb/);
64
+ });
65
+ test('a trailing comma from a shell-built list still resolves', () => {
66
+ const target = path.join(workDir, 'chunk0.glb');
67
+ expect(resolveGlbPaths(`${target},`)).toEqual([target]);
68
+ });
69
+ test('a missing path names both readings rather than one fragment', () => {
70
+ const missing = path.join(workDir, 'Nowhere 1, 2345 Somewhere.glb');
71
+ // What the error says is the whole point of the issue: the old failure
72
+ // surfaced as ENOENT on "Nowhere 1", a string the caller never typed.
73
+ expect(() => resolveGlbPaths(missing)).toThrow(/No such GLB/);
74
+ expect(() => resolveGlbPaths(missing)).toThrow(/2-chunk list/);
75
+ });
76
+ test('a CLI failure surfaces its own message to visual_diff_report', () => {
77
+ // This contract spans two files and has no other guard. render_glb.cjs
78
+ // prints "Error: <message>"; visual_diff_report.cjs's
79
+ // childFailureDiagnostic picks the FIRST stderr line matching its regex
80
+ // and puts it in the PR comment's table cell. Letting Node throw
81
+ // uncaught instead degrades every render-failure cell to a source code
82
+ // frame, with the whole suite otherwise green.
83
+ //
84
+ // Scope, honestly: this pins the END-TO-END result, not each mechanism.
85
+ // Removing the "Error:" prefix alone keeps it passing, because the stack
86
+ // printed after the message opens with an "Error:" line that matches the
87
+ // same regex. Both are kept because a non-Error throw has no stack.
88
+ const script = path.resolve(process.cwd(), 'scripts/render_glb.cjs');
89
+ const missing = path.join(workDir, 'Nowhere 1, 2345 Somewhere.glb');
90
+ let stderr = '';
91
+ try {
92
+ execFileSync(process.execPath, [script, missing, path.join(workDir, 'out.png')], { stdio: 'pipe' });
93
+ }
94
+ catch (err) {
95
+ stderr = (err.stderr ?? '').toString();
96
+ }
97
+ // The regex is copied from visual_diff_report.cjs:138 deliberately — the
98
+ // point is to fail here if either side drifts.
99
+ const picked = stderr.split('\n').filter(Boolean).find((line) => /error|cannot|not found|bad option|unexpected/i.test(line));
100
+ expect(picked).toMatch(/No such GLB/);
101
+ expect(picked).toContain('Nowhere 1, 2345 Somewhere.glb');
102
+ // And the stack still reaches the job log, which is a separate consumer.
103
+ expect(stderr).toMatch(/at resolveGlbPaths/);
104
+ });
105
+ test('a chunk list with one missing member does not silently render the rest', () => {
106
+ const spec = [
107
+ path.join(workDir, 'chunk0.glb'),
108
+ path.join(workDir, 'absent.glb'),
109
+ ].join(',');
110
+ // Rendering the surviving chunk would drop part of the model and look
111
+ // like a geometry regression in the visual diff, which is worse than
112
+ // failing.
113
+ expect(() => resolveGlbPaths(spec)).toThrow(/absent\.glb/);
114
+ });
115
+ });
@@ -1,4 +1,5 @@
1
1
  import { MultiIndexSet } from "../../indexing/multi_index_set.js";
2
+ import { StepIndexColumns } from "../parsing/columnar_index.js";
2
3
  import { StepIndexEntry } from "../parsing/step_parser.js";
3
4
  /**
4
5
  * Indexes STEP by type so that it can be searched by type.
@@ -11,6 +12,25 @@ export declare class StepTypeIndexer<TypeIDType extends number> {
11
12
  * @param typeCount The number of types that will be indexed.
12
13
  */
13
14
  constructor(typeCount: number);
15
+ /**
16
+ * Create a type index from either index form — the parsed object array or
17
+ * the columnar index (M7).
18
+ *
19
+ * @param index The element index, object or columnar.
20
+ * @return {MultiIndexSet} The created multi-set index.
21
+ */
22
+ createFor(index: StepIndexEntry<TypeIDType>[] | StepIndexColumns<TypeIDType>): MultiIndexSet<TypeIDType>;
23
+ /**
24
+ * Create a type index straight from the columnar index — the same
25
+ * membership `create` produces from the unfolded object array: every row's
26
+ * concrete type (top-level + inline; −1 rows skipped) plus the
27
+ * multi-mapping subtypes of retained complex entries at their parent's
28
+ * dense index.
29
+ *
30
+ * @param columns The columnar index.
31
+ * @return {MultiIndexSet} The created multi-set index.
32
+ */
33
+ createFromColumns(columns: StepIndexColumns<TypeIDType>): MultiIndexSet<TypeIDType>;
14
34
  /**
15
35
  * Create a type index from a set of parsed STEP elements.
16
36
  *
@@ -1 +1 @@
1
- {"version":3,"file":"step_type_indexer.d.ts","sourceRoot":"","sources":["../../../../src/step/indexing/step_type_indexer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD;;GAEG;AACH,qBAAa,eAAe,CAAE,UAAU,SAAS,MAAM;IACrD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAY;IAE5C;;;;OAIG;gBACiB,SAAS,EAAE,MAAM;IAIrC;;;;;OAKG;IACI,MAAM,CAAE,QAAQ,EAAE,cAAc,CAAE,UAAU,CAAE,EAAE,GAAI,aAAa,CAAE,UAAU,CAAE;CA8FvF"}
1
+ {"version":3,"file":"step_type_indexer.d.ts","sourceRoot":"","sources":["../../../../src/step/indexing/step_type_indexer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD;;GAEG;AACH,qBAAa,eAAe,CAAE,UAAU,SAAS,MAAM;IACrD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAY;IAE5C;;;;OAIG;gBACiB,SAAS,EAAE,MAAM;IAIrC;;;;;;OAMG;IACI,SAAS,CACZ,KAAK,EAAE,cAAc,CAAE,UAAU,CAAE,EAAE,GAAG,gBAAgB,CAAE,UAAU,CAAE,GACtE,aAAa,CAAE,UAAU,CAAE;IAK/B;;;;;;;;;OASG;IACI,iBAAiB,CACpB,OAAO,EAAE,gBAAgB,CAAE,UAAU,CAAE,GAAI,aAAa,CAAE,UAAU,CAAE;IAwE1E;;;;;OAKG;IACI,MAAM,CAAE,QAAQ,EAAE,cAAc,CAAE,UAAU,CAAE,EAAE,GAAI,aAAa,CAAE,UAAU,CAAE;CA8FvF"}
@@ -12,6 +12,73 @@ export class StepTypeIndexer {
12
12
  constructor(typeCount) {
13
13
  this.elementCounter_ = new Int32Array(typeCount << 1);
14
14
  }
15
+ /**
16
+ * Create a type index from either index form — the parsed object array or
17
+ * the columnar index (M7).
18
+ *
19
+ * @param index The element index, object or columnar.
20
+ * @return {MultiIndexSet} The created multi-set index.
21
+ */
22
+ createFor(index) {
23
+ return Array.isArray(index) ? this.create(index) : this.createFromColumns(index);
24
+ }
25
+ /**
26
+ * Create a type index straight from the columnar index — the same
27
+ * membership `create` produces from the unfolded object array: every row's
28
+ * concrete type (top-level + inline; −1 rows skipped) plus the
29
+ * multi-mapping subtypes of retained complex entries at their parent's
30
+ * dense index.
31
+ *
32
+ * @param columns The columnar index.
33
+ * @return {MultiIndexSet} The created multi-set index.
34
+ */
35
+ createFromColumns(columns) {
36
+ for (let where = 0, end = this.elementCounter_.length; where < end; where += 2) {
37
+ initCountCompactedElements32State(this.elementCounter_, where);
38
+ }
39
+ const elementCounter = this.elementCounter_;
40
+ const prefixSum = new Uint32Array((this.elementCounter_.length >>> 1) + 1);
41
+ const typeIDs = columns.typeID;
42
+ const count = columns.count;
43
+ // Walk retained complex entries alongside the rows (their keys ascend in
44
+ // localID order) so multi-mapping subtypes interleave at their parent's
45
+ // dense index — the object path's exact output order.
46
+ const walkRows = (addOne) => {
47
+ const complexIterator = columns.complexEntries?.entries();
48
+ let nextComplex = complexIterator?.next();
49
+ for (let denseIndex = 0; denseIndex < count; ++denseIndex) {
50
+ const typeID = typeIDs[denseIndex];
51
+ if (typeID >= 0) {
52
+ addOne(denseIndex, typeID);
53
+ }
54
+ if (nextComplex !== void 0 && !nextComplex.done &&
55
+ nextComplex.value[0] === denseIndex) {
56
+ for (const subElement of nextComplex.value[1].multiMapping ?? []) {
57
+ const subTypeID = subElement.typeID;
58
+ if (subTypeID !== void 0) {
59
+ addOne(denseIndex, subTypeID);
60
+ }
61
+ }
62
+ nextComplex = complexIterator.next();
63
+ }
64
+ }
65
+ };
66
+ walkRows((denseIndex, typeID) => {
67
+ prefixSum[typeID + 1] =
68
+ addCompactedElementCount32State(denseIndex, elementCounter, typeID << 1);
69
+ });
70
+ for (let prefixSumIndex = 2, prefixSumEnd = prefixSum.length; prefixSumIndex < prefixSumEnd; ++prefixSumIndex) {
71
+ prefixSum[prefixSumIndex] += prefixSum[prefixSumIndex - 1];
72
+ }
73
+ for (let where = 0, end = this.elementCounter_.length; where < end; where += 2) {
74
+ initCountCompactedElements32State(this.elementCounter_, where);
75
+ }
76
+ const indexOutput = new Uint32Array(prefixSum[prefixSum.length - 1] << 1);
77
+ walkRows((denseIndex, typeID) => {
78
+ addCompactedElement32State(denseIndex, elementCounter, indexOutput, typeID << 1, prefixSum[typeID] << 1);
79
+ });
80
+ return new MultiIndexSet(prefixSum, indexOutput);
81
+ }
15
82
  /**
16
83
  * Create a type index from a set of parsed STEP elements.
17
84
  *