@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
@@ -1 +1 @@
1
- {"version":3,"file":"IfcRelInterferesElements.gen.d.ts","sourceRoot":"","sources":["../../../../src/ifc/ifc4_gen/IfcRelInterferesElements.gen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAI/C,OAAO,cAAc,MAAM,wBAAwB,CAAA;AACnD,OAAO,2BAA2B,MAAM,2CAA2C,CAAA;AACnF,OAAO,cAAc,MAAM,6BAA6B,CAAA;AACxD,OAAO,aAAa,MAAM,4BAA4B,CAAA;AAItD,qBAAc,wBAAyB,SAAQ,cAAc;IAC3D,IAAW,IAAI,IAAI,cAAc,CAEhC;IACD,OAAO,CAAC,gBAAgB,CAAC,CAAa;IACtC,OAAO,CAAC,eAAe,CAAC,CAAa;IACrC,OAAO,CAAC,qBAAqB,CAAC,CAA+B;IAC7D,OAAO,CAAC,iBAAiB,CAAC,CAAgB;IAC1C,OAAO,CAAC,aAAa,CAAC,CAAU;IAEhC,IAAW,eAAe,IAAK,UAAU,CAMxC;IAED,IAAW,cAAc,IAAK,UAAU,CAMvC;IAED,IAAW,oBAAoB,IAAK,qBAAqB,GAAG,IAAI,CAM/D;IAED,IAAW,gBAAgB,IAAK,MAAM,GAAG,IAAI,CAM5C;IAED,IAAW,YAAY,IAAK,OAAO,CAMlC;gBAEC,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,2BAA2B,CAAE,cAAc,CAAE,EAChE,KAAK,EAAE,aAAa,CAAE,cAAc,EAAE,cAAc,CAAE,cAAc,CAAE,CAAE,EACxE,cAAc,CAAC,EAAE,2BAA2B,CAAE,cAAc,CAAE,EAAE;IAKlE,gBAAuB,KAAK,mBACiB;IAE7C,gBAAuB,YAAY,EAAE,cAAc,CACV;CAC1C"}
1
+ {"version":3,"file":"IfcRelInterferesElements.gen.d.ts","sourceRoot":"","sources":["../../../../src/ifc/ifc4_gen/IfcRelInterferesElements.gen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAI/C,OAAO,cAAc,MAAM,wBAAwB,CAAA;AACnD,OAAO,2BAA2B,MAAM,2CAA2C,CAAA;AACnF,OAAO,cAAc,MAAM,6BAA6B,CAAA;AACxD,OAAO,aAAa,MAAM,4BAA4B,CAAA;AAItD,qBAAc,wBAAyB,SAAQ,cAAc;IAC3D,IAAW,IAAI,IAAI,cAAc,CAEhC;IACD,OAAO,CAAC,gBAAgB,CAAC,CAAa;IACtC,OAAO,CAAC,eAAe,CAAC,CAAa;IACrC,OAAO,CAAC,qBAAqB,CAAC,CAA+B;IAC7D,OAAO,CAAC,iBAAiB,CAAC,CAAgB;IAC1C,OAAO,CAAC,aAAa,CAAC,CAAiB;IAEvC,IAAW,eAAe,IAAK,UAAU,CAMxC;IAED,IAAW,cAAc,IAAK,UAAU,CAMvC;IAED,IAAW,oBAAoB,IAAK,qBAAqB,GAAG,IAAI,CAM/D;IAED,IAAW,gBAAgB,IAAK,MAAM,GAAG,IAAI,CAM5C;IAED,IAAW,YAAY,IAAK,OAAO,GAAG,IAAI,CAMzC;gBAEC,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,2BAA2B,CAAE,cAAc,CAAE,EAChE,KAAK,EAAE,aAAa,CAAE,cAAc,EAAE,cAAc,CAAE,cAAc,CAAE,CAAE,EACxE,cAAc,CAAC,EAAE,2BAA2B,CAAE,cAAc,CAAE,EAAE;IAKlE,gBAAuB,KAAK,mBACiB;IAE7C,gBAAuB,YAAY,EAAE,cAAc,CACV;CAC1C"}
@@ -35,7 +35,7 @@ export class IfcRelInterferesElements extends IfcRelConnects {
35
35
  }
36
36
  get ImpliedOrder() {
37
37
  if (this.ImpliedOrder_ === void 0) {
38
- this.ImpliedOrder_ = this.extractBoolean(8, 4, 3, false);
38
+ this.ImpliedOrder_ = this.extractLogical(8, 4, 3, false);
39
39
  }
40
40
  return this.ImpliedOrder_;
41
41
  }
@@ -29290,7 +29290,7 @@ let descriptions = [
29290
29290
  },
29291
29291
  ImpliedOrder: {
29292
29292
  kind: f.BOOLEAN,
29293
- optional: false,
29293
+ optional: true,
29294
29294
  derived: false,
29295
29295
  offset: 8,
29296
29296
  },
@@ -34262,7 +34262,7 @@ let descriptions = [
34262
34262
  fields: {
34263
34263
  Value: {
34264
34264
  kind: f.BOOLEAN,
34265
- optional: false,
34265
+ optional: true,
34266
34266
  derived: false,
34267
34267
  offset: 0,
34268
34268
  },
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ifc_demand_extraction.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ifc_demand_extraction.test.d.ts","sourceRoot":"","sources":["../../../src/ifc/ifc_demand_extraction.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,251 @@
1
+ /* eslint-disable no-magic-numbers, @typescript-eslint/no-explicit-any */
2
+ // Phase B2: per-product demand extraction must produce the same meshes the
3
+ // whole-model walk produces — same products with geometry, same vertex and
4
+ // index counts per product — since both now run the same deduplicated
5
+ // per-product body (extractProductGeometry).
6
+ import fs from "fs";
7
+ import { beforeAll, describe, expect, test } from "@jest/globals";
8
+ import { IfcGeometryExtraction } from "./ifc_geometry_extraction.js";
9
+ import { ParseResult } from "../step/parsing/step_parser.js";
10
+ import IfcStepParser from "./ifc_step_parser.js";
11
+ import IfcStepModel from "./ifc_step_model.js";
12
+ import ParsingBuffer from "../parsing/parsing_buffer.js";
13
+ import { ConwayGeometry } from "../../dependencies/conway-geom/index.js";
14
+ import { ExtractResult } from "../core/shared_constants.js";
15
+ import { IfcProduct, IfcStyledItem } from "./ifc4_gen/index.js";
16
+ import EntityTypesIfc from "./ifc4_gen/entity_types_ifc.gen.js";
17
+ import { openStreamedIfcModelFromStore } from "./ifc_stream_open.js";
18
+ import { InMemoryStepByteStore, WindowedStepBufferProvider, } from "../step/step_buffer_provider.js";
19
+ let conwayGeometry;
20
+ /**
21
+ * Parse a fresh model from index.ifc (models are stateful; each extraction
22
+ * mode gets its own).
23
+ *
24
+ * @return {IfcStepModel} The parsed model.
25
+ */
26
+ function freshModel() {
27
+ const bytes = fs.readFileSync("data/index.ifc");
28
+ const input = new ParsingBuffer(bytes);
29
+ expect(IfcStepParser.Instance.parseHeader(input)[1])
30
+ .toBe(ParseResult.COMPLETE);
31
+ const [, model] = IfcStepParser.Instance.parseDataToModel(input);
32
+ expect(model).toBeDefined();
33
+ return model;
34
+ }
35
+ /**
36
+ * Collect per-localID mesh signatures (vertex + triangle counts) from a
37
+ * model's extracted geometry.
38
+ *
39
+ * @param extraction The extraction whose model geometry to summarise.
40
+ * @return {Map<number, string>} localID → "vertexCount/triangleCount".
41
+ */
42
+ function meshSignatures(extraction) {
43
+ const signatures = new Map();
44
+ for (const mesh of extraction.model.geometry) {
45
+ const geometry = mesh.geometry;
46
+ if (geometry === void 0 || typeof geometry.getVertexCount !== "function") {
47
+ continue;
48
+ }
49
+ signatures.set(mesh.localID, `${geometry.getVertexCount()}/${geometry.getTriangleCount()}`);
50
+ }
51
+ return signatures;
52
+ }
53
+ beforeAll(async () => {
54
+ conwayGeometry = new ConwayGeometry();
55
+ expect(await conwayGeometry.initialize()).toBe(true);
56
+ });
57
+ describe("per-product demand extraction (Phase B2)", () => {
58
+ test("demand extraction over all products matches the whole-model walk", () => {
59
+ // Whole-model walk (the CI-anchored path).
60
+ const wholeExtraction = new IfcGeometryExtraction(conwayGeometry, freshModel());
61
+ expect(wholeExtraction.extractIFCGeometryData()[0])
62
+ .toBe(ExtractResult.COMPLETE);
63
+ const wholeSignatures = meshSignatures(wholeExtraction);
64
+ expect(wholeSignatures.size).toBeGreaterThan(0);
65
+ // Demand path: prepare once, then extract every product individually.
66
+ const demandModel = freshModel();
67
+ const demandExtraction = new IfcGeometryExtraction(conwayGeometry, demandModel);
68
+ demandExtraction.prepareDemandExtraction();
69
+ let extractedProducts = 0;
70
+ for (const product of demandModel.types(IfcProduct)) {
71
+ if (demandExtraction.extractProductGeometryByLocalID(product.localID)) {
72
+ ++extractedProducts;
73
+ }
74
+ }
75
+ expect(extractedProducts).toBeGreaterThan(0);
76
+ const demandSignatures = meshSignatures(demandExtraction);
77
+ // Same set of products with geometry, same mesh shape per product.
78
+ expect(demandSignatures).toEqual(wholeSignatures);
79
+ });
80
+ test("a single product extracts on demand without the whole-model walk", () => {
81
+ // Whole-model reference signatures (mesh localIDs key representation
82
+ // items, not products — so parity is checked per matching key).
83
+ const reference = new IfcGeometryExtraction(conwayGeometry, freshModel());
84
+ reference.extractIFCGeometryData();
85
+ const referenceSignatures = meshSignatures(reference);
86
+ const model = freshModel();
87
+ const extraction = new IfcGeometryExtraction(conwayGeometry, model);
88
+ // Extract single products on the fresh model until one yields a mesh —
89
+ // proving a lone product materialises without the whole-model walk.
90
+ let produced = 0;
91
+ for (const product of model.types(IfcProduct)) {
92
+ extraction.extractProductGeometryByLocalID(product.localID);
93
+ produced = meshSignatures(extraction).size;
94
+ if (produced > 0) {
95
+ break;
96
+ }
97
+ }
98
+ expect(produced).toBeGreaterThan(0);
99
+ expect(produced).toBeLessThan(referenceSignatures.size);
100
+ // Every mesh the single extraction produced matches the reference's
101
+ // mesh for the same key exactly.
102
+ for (const [localID, signature] of meshSignatures(extraction)) {
103
+ expect(referenceSignatures.get(localID)).toBe(signature);
104
+ }
105
+ });
106
+ test("a non-product local ID is refused", () => {
107
+ const model = freshModel();
108
+ const extraction = new IfcGeometryExtraction(conwayGeometry, model);
109
+ // localID 0 in index.ifc is not an IfcProduct (first record is a root
110
+ // non-product entity in this fixture; the assertion below guards that).
111
+ const first = model.getElementByLocalID(0);
112
+ expect(first instanceof IfcProduct).toBe(false);
113
+ expect(extraction.extractProductGeometryByLocalID(0)).toBe(false);
114
+ });
115
+ test("styled-item Item local IDs resolve without hydrating the item", () => {
116
+ const model = freshModel();
117
+ let checked = 0;
118
+ for (const styledItem of model.types(IfcStyledItem)) {
119
+ const viaIndex = styledItem.extractReferenceLocalID(0, 0, 1, true);
120
+ const viaItem = styledItem.Item?.localID ?? null;
121
+ expect(viaIndex).toBe(viaItem);
122
+ ++checked;
123
+ }
124
+ expect(checked).toBeGreaterThan(0);
125
+ });
126
+ });
127
+ // conway#526. `extractGeometryBatchAsync` prefetches a batch of products
128
+ // through one Promise.all over ONE shared `seen` set, so the closure walk
129
+ // skips any record a sibling product already claimed — that sibling has
130
+ // pinned the range, but a pin reserves a chunk against eviction, it does
131
+ // not make it resident, and its read may still be in flight. The faceset
132
+ // payload pass then scanned the shared set and synchronously acquired a
133
+ // record nobody had finished reading:
134
+ //
135
+ // StepBufferNotResidentError: STEP source range [164128495, 164187850)
136
+ // is not resident — call ensureResident before synchronous extraction
137
+ //
138
+ // which escaped the prefetch and aborted the whole load on a large model.
139
+ describe("concurrent windowed product prefetch (conway#526)", () => {
140
+ const CHUNK = 4 * 1024;
141
+ /**
142
+ * A store-backed model over a deliberately cramped window: 4 KiB
143
+ * chunks with 2 resident, so a sibling's chunks are gone by the time
144
+ * anyone else looks for them.
145
+ *
146
+ * @param store The backing store.
147
+ * @return {Promise<IfcStepModel>} The windowed model.
148
+ */
149
+ async function windowedModel(store) {
150
+ const open = await openStreamedIfcModelFromStore(store, { pool: CHUNK });
151
+ expect(open.model).toBeDefined();
152
+ return new IfcStepModel(void 0, open.columns, new WindowedStepBufferProvider(store, CHUNK, 2));
153
+ }
154
+ test("a shared seen set does not make one product read records it never paged", async () => {
155
+ const store = new InMemoryStepByteStore(new Uint8Array(fs.readFileSync("data/index.ifc")));
156
+ const model = await windowedModel(store);
157
+ const extraction = new IfcGeometryExtraction(conwayGeometry, model);
158
+ extraction.quietRecoverableLogging = true;
159
+ extraction.deferDanglingPlacements = true;
160
+ const prepPins = await extraction.ensureResidentForDemandPrep();
161
+ try {
162
+ extraction.prepareDemandExtraction(true);
163
+ }
164
+ finally {
165
+ model.releaseSourceViews(prepPins);
166
+ model.unpinLocalIDs(prepPins);
167
+ }
168
+ const products = [...model.types(IfcProduct)].map((p) => p.localID);
169
+ expect(products.length).toBeGreaterThan(1);
170
+ // The pump's shape: one shared pin set across the batch.
171
+ const pins = new Set();
172
+ const leafSpans = [];
173
+ // Seed the shared set until it holds facesets — not every
174
+ // product carries tessellated geometry, and the payload pass is
175
+ // what this is about.
176
+ let seeded = 0;
177
+ let claimedFacesets = [];
178
+ while (seeded < products.length && claimedFacesets.length === 0) {
179
+ await extraction.ensureResidentForProductExtract(products[seeded++], pins, leafSpans);
180
+ claimedFacesets = [...pins].filter((id) => model.typeIDOf(id) === EntityTypesIfc.IFCPOLYGONALFACESET);
181
+ }
182
+ expect(claimedFacesets.length).toBeGreaterThan(0);
183
+ expect(seeded).toBeLessThan(products.length);
184
+ // Now force the state the production race produced by timing:
185
+ // records that are IN the shared set but NOT resident from the
186
+ // next caller's point of view. Dropping the pins and filling the
187
+ // 2-chunk window with an unrelated range evicts them, which is
188
+ // the same invariant violation as a sibling's read still being
189
+ // in flight — and unlike the race, it happens every run.
190
+ model.releaseSourceViews(pins);
191
+ model.unpinLocalIDs(pins);
192
+ for (const span of leafSpans) {
193
+ model.unpinAddressRange(span.address, span.length);
194
+ }
195
+ leafSpans.length = 0;
196
+ const facesetAt = model.recordAddress(claimedFacesets[0]);
197
+ const far = facesetAt >= CHUNK * 4 ? 0 : store.byteLength - CHUNK * 2;
198
+ await model.ensureResidentRange(far, CHUNK * 2);
199
+ // Pre-#526 the payload pass walked the shared set, synchronously
200
+ // acquired those evicted facesets and threw
201
+ // StepBufferNotResidentError out of the prefetch, killing the load.
202
+ await expect(Promise.all(products.slice(seeded).map((localID) => extraction.ensureResidentForProductExtract(localID, pins, leafSpans)))).resolves.toBeDefined();
203
+ expect(pins.size).toBeGreaterThan(0);
204
+ model.releaseSourceViews(pins);
205
+ model.unpinLocalIDs(pins);
206
+ for (const span of leafSpans) {
207
+ model.unpinAddressRange(span.address, span.length);
208
+ }
209
+ }, 120000);
210
+ test("the closure walk reports only what THIS call claimed", async () => {
211
+ const model = await windowedModel(new InMemoryStepByteStore(new Uint8Array(fs.readFileSync("data/index.ifc"))));
212
+ const products = [...model.types(IfcProduct)].map((p) => p.localID);
213
+ expect(products.length).toBeGreaterThan(1);
214
+ // The invariant the payload pass now rests on: with a shared set,
215
+ // a second walk claims only what the first left unclaimed, so
216
+ // `claimed` is what this call has actually awaited residency for.
217
+ const shared = new Set();
218
+ const firstClaimed = new Set();
219
+ const secondClaimed = new Set();
220
+ await model.ensureResidentClosureByLocalID(products[0], void 0, shared, void 0, void 0, void 0, firstClaimed);
221
+ await model.ensureResidentClosureByLocalID(products[0], void 0, shared, void 0, void 0, void 0, secondClaimed);
222
+ expect(firstClaimed.size).toBeGreaterThan(0);
223
+ expect(secondClaimed.size).toBe(0);
224
+ for (const id of firstClaimed) {
225
+ expect(shared.has(id)).toBe(true);
226
+ }
227
+ model.unpinLocalIDs(shared);
228
+ }, 120000);
229
+ test("a product whose paging fails is skipped, not fatal to the batch", async () => {
230
+ const model = await windowedModel(new InMemoryStepByteStore(new Uint8Array(fs.readFileSync("data/index.ifc"))));
231
+ const extraction = new IfcGeometryExtraction(conwayGeometry, model);
232
+ const products = [...model.types(IfcProduct)].map((p) => p.localID);
233
+ const failing = products[0];
234
+ // A store read that rejects for one product's closure must not take
235
+ // the batch — the pump's Promise.all would otherwise reject and the
236
+ // load dies where a missing product would do.
237
+ const realEnsure = model.ensureResidentClosureByLocalID.bind(model);
238
+ model.ensureResidentClosureByLocalID =
239
+ (localID, ...rest) => {
240
+ if (localID === failing) {
241
+ return Promise.reject(new Error("simulated store read failure"));
242
+ }
243
+ return realEnsure(localID, ...rest);
244
+ };
245
+ const pins = new Set();
246
+ await expect(Promise.all(products.slice(0, 4).map((localID) => extraction.ensureResidentForProductExtract(localID, pins)))).resolves.toBeDefined();
247
+ model.ensureResidentClosureByLocalID = realEnsure;
248
+ model.releaseSourceViews(pins);
249
+ model.unpinLocalIDs(pins);
250
+ }, 120000);
251
+ });