@woosh/meep-engine 3.22.0 → 3.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/package.json +1 -1
  2. package/src/core/geom/3d/hash-grid/PointHashGrid3.d.ts +118 -0
  3. package/src/core/geom/3d/hash-grid/PointHashGrid3.d.ts.map +1 -0
  4. package/src/core/geom/3d/hash-grid/PointHashGrid3.js +283 -0
  5. package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -1
  6. package/src/core/geom/3d/shape/BoxShape3D.js +6 -17
  7. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
  8. package/src/core/geom/3d/shape/CapsuleShape3D.js +3 -14
  9. package/src/core/geom/3d/shape/CylinderShape3D.d.ts.map +1 -1
  10. package/src/core/geom/3d/shape/CylinderShape3D.js +3 -21
  11. package/src/core/geom/3d/shape/PlaneShape3D.d.ts +105 -0
  12. package/src/core/geom/3d/shape/PlaneShape3D.d.ts.map +1 -0
  13. package/src/core/geom/3d/shape/PlaneShape3D.js +251 -0
  14. package/src/core/geom/3d/shape/SphereShape3D.js +3 -3
  15. package/src/core/geom/3d/shape/json/shape_to_type.d.ts.map +1 -1
  16. package/src/core/geom/3d/shape/json/shape_to_type.js +3 -0
  17. package/src/core/geom/3d/shape/json/type_adapters.d.ts +14 -0
  18. package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
  19. package/src/core/geom/3d/shape/json/type_adapters.js +15 -0
  20. package/src/core/geom/3d/shape/sdf/sdf3_box.d.ts +51 -0
  21. package/src/core/geom/3d/shape/sdf/sdf3_box.d.ts.map +1 -0
  22. package/src/core/geom/3d/shape/sdf/sdf3_box.js +113 -0
  23. package/src/core/geom/3d/shape/sdf/sdf3_capsule.d.ts +46 -0
  24. package/src/core/geom/3d/shape/sdf/sdf3_capsule.d.ts.map +1 -0
  25. package/src/core/geom/3d/shape/sdf/sdf3_capsule.js +82 -0
  26. package/src/core/geom/3d/shape/sdf/sdf3_cylinder.d.ts +60 -0
  27. package/src/core/geom/3d/shape/sdf/sdf3_cylinder.d.ts.map +1 -0
  28. package/src/core/geom/3d/shape/sdf/sdf3_cylinder.js +126 -0
  29. package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.d.ts +50 -0
  30. package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.d.ts.map +1 -0
  31. package/src/core/geom/3d/shape/sdf/sdf3_degenerate_normal.js +53 -0
  32. package/src/core/geom/3d/shape/sdf/sdf3_plane.d.ts +52 -0
  33. package/src/core/geom/3d/shape/sdf/sdf3_plane.d.ts.map +1 -0
  34. package/src/core/geom/3d/shape/sdf/sdf3_plane.js +61 -0
  35. package/src/core/geom/3d/shape/sdf/sdf3_sphere.d.ts +41 -0
  36. package/src/core/geom/3d/shape/sdf/sdf3_sphere.d.ts.map +1 -0
  37. package/src/core/geom/3d/shape/sdf/sdf3_sphere.js +71 -0
  38. package/src/core/process/ConcurrencyGate.d.ts +103 -0
  39. package/src/core/process/ConcurrencyGate.d.ts.map +1 -0
  40. package/src/core/process/ConcurrencyGate.js +207 -0
  41. package/src/engine/asset/AssetManager.d.ts +10 -0
  42. package/src/engine/asset/AssetManager.d.ts.map +1 -1
  43. package/src/engine/asset/AssetManager.js +10 -0
  44. package/src/engine/graphics/CONTEXT_LOSS_RECOVERY_PLAN.md +30 -13
  45. package/src/engine/graphics3/pose/collect_entity_playbacks.d.ts +26 -0
  46. package/src/engine/graphics3/pose/collect_entity_playbacks.d.ts.map +1 -0
  47. package/src/engine/graphics3/pose/collect_entity_playbacks.js +40 -0
  48. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
  49. package/src/engine/graphics3/pose/query_entity_node_world_pose.js +74 -101
  50. package/src/engine/physics/cloth/MEASUREMENTS.md +1287 -4
  51. package/src/engine/physics/cloth/PLAN.md +1967 -1581
  52. package/src/engine/physics/cloth/build/ClothProxy.d.ts +147 -0
  53. package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -0
  54. package/src/engine/physics/cloth/build/ClothProxy.js +207 -0
  55. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +70 -0
  56. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -0
  57. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +256 -0
  58. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts +176 -0
  59. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts.map +1 -0
  60. package/src/engine/physics/cloth/collider/ClothColliderIndex.js +435 -0
  61. package/src/engine/physics/cloth/collider/ClothColliderKind.d.ts +12 -0
  62. package/src/engine/physics/cloth/collider/ClothColliderKind.d.ts.map +1 -0
  63. package/src/engine/physics/cloth/collider/ClothColliderKind.js +38 -0
  64. package/src/engine/physics/cloth/collider/ClothColliderRecord.d.ts +120 -0
  65. package/src/engine/physics/cloth/collider/ClothColliderRecord.d.ts.map +1 -0
  66. package/src/engine/physics/cloth/collider/ClothColliderRecord.js +137 -0
  67. package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts +25 -0
  68. package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts.map +1 -0
  69. package/src/engine/physics/cloth/collider/cloth_collider_bounds.js +190 -0
  70. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts +44 -0
  71. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts.map +1 -0
  72. package/src/engine/physics/cloth/collider/cloth_collider_pack.js +173 -0
  73. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +94 -0
  74. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts.map +1 -0
  75. package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +275 -0
  76. package/src/engine/physics/cloth/ecs/ClothCollider.d.ts +126 -0
  77. package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -0
  78. package/src/engine/physics/cloth/ecs/ClothCollider.js +199 -0
  79. package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts +9 -0
  80. package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts.map +1 -0
  81. package/src/engine/physics/cloth/ecs/ClothColliderFlags.js +32 -0
  82. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +114 -0
  83. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -0
  84. package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +243 -0
  85. package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +66 -57
  86. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +109 -1
  87. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  88. package/src/engine/physics/cloth/ecs/ClothInstance.js +479 -363
  89. package/src/engine/physics/cloth/ecs/ClothRig.d.ts +95 -0
  90. package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -0
  91. package/src/engine/physics/cloth/ecs/ClothRig.js +140 -0
  92. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +30 -1
  93. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  94. package/src/engine/physics/cloth/ecs/ClothSystem.js +1021 -773
  95. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +90 -0
  96. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -0
  97. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +374 -0
  98. package/src/engine/physics/cloth/ecs/cloth_dynamics_library.d.ts +32 -3
  99. package/src/engine/physics/cloth/ecs/cloth_dynamics_library.d.ts.map +1 -1
  100. package/src/engine/physics/cloth/ecs/cloth_dynamics_library.js +283 -254
  101. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +59 -0
  102. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -0
  103. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +328 -0
  104. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +13 -0
  105. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -0
  106. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +288 -0
  107. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +58 -0
  108. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -0
  109. package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +199 -0
  110. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +8 -63
  111. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
  112. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +317 -645
  113. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +61 -0
  114. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
  115. package/src/engine/physics/cloth/ecs/cloth_write_back.js +212 -449
  116. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts +49 -0
  117. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -0
  118. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +115 -0
  119. package/src/engine/physics/cloth/playground/README.md +155 -1
  120. package/src/engine/physics/cloth/playground/collide.html +178 -0
  121. package/src/engine/physics/cloth/playground/collide_build.d.ts +95 -0
  122. package/src/engine/physics/cloth/playground/collide_build.d.ts.map +1 -0
  123. package/src/engine/physics/cloth/playground/collide_build.js +315 -0
  124. package/src/engine/physics/cloth/playground/collide_main.d.ts +2 -0
  125. package/src/engine/physics/cloth/playground/collide_main.d.ts.map +1 -0
  126. package/src/engine/physics/cloth/playground/collide_main.js +720 -0
  127. package/src/engine/physics/cloth/playground/garment.html +182 -0
  128. package/src/engine/physics/cloth/playground/garment_build.d.ts +78 -0
  129. package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -0
  130. package/src/engine/physics/cloth/playground/garment_build.js +359 -0
  131. package/src/engine/physics/cloth/playground/garment_main.d.ts +2 -0
  132. package/src/engine/physics/cloth/playground/garment_main.d.ts.map +1 -0
  133. package/src/engine/physics/cloth/playground/garment_main.js +633 -0
  134. package/src/engine/physics/cloth/solver/ClothState.d.ts +208 -5
  135. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  136. package/src/engine/physics/cloth/solver/ClothState.js +302 -8
  137. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +87 -0
  138. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -0
  139. package/src/engine/physics/cloth/solver/cloth_contact_find.js +343 -0
  140. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +112 -0
  141. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -0
  142. package/src/engine/physics/cloth/solver/cloth_self_find.js +448 -0
  143. package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts +4 -1
  144. package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts.map +1 -1
  145. package/src/engine/physics/cloth/solver/cloth_solve_vertex.js +16 -1
  146. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +112 -5
  147. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  148. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +117 -6
  149. package/src/engine/physics/cloth/solver/cloth_step.d.ts +40 -9
  150. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  151. package/src/engine/physics/cloth/solver/cloth_step.js +122 -10
  152. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts +95 -0
  153. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts.map +1 -0
  154. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js +285 -0
  155. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +129 -0
  156. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -0
  157. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +501 -0
  158. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +75 -0
  159. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -0
  160. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +202 -0
  161. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  162. package/src/shade/playground/vgeo_viewer/README.md +18 -0
  163. package/src/shade/playground/vgeo_viewer/main.js +87 -50
  164. package/src/shade/renderer/buffer/table/GPUDatabase.d.ts.map +1 -1
  165. package/src/shade/renderer/buffer/table/GPUDatabase.js +191 -62
  166. package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts +94 -2
  167. package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts.map +1 -1
  168. package/src/shade/renderer/buffer/table/GPUTypedTable.js +414 -2
  169. package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.d.ts +14 -0
  170. package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.d.ts.map +1 -0
  171. package/src/shade/renderer/buffer/table/GPU_TABLE_PARTIAL_UPLOAD_DESCRIPTOR_WORDS.js +13 -0
  172. package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.d.ts +17 -0
  173. package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.d.ts.map +1 -0
  174. package/src/shade/renderer/buffer/table/gpu_table_partial_upload_shader.js +116 -0
  175. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +9 -4
  176. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
  177. package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +843 -734
  178. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +12 -0
  179. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
  180. package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +13 -0
  181. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts +17 -0
  182. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts.map +1 -1
  183. package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.js +185 -30
  184. package/src/shade/renderer/geometry/virtual/MICRON_COMPARISON_2026_08_20.md +17 -0
  185. package/src/shade/renderer/geometry/virtual/VGEO_FORMAT.md +141 -24
  186. package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_DESIGN.md +204 -64
  187. package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_PLAN.md +110 -10
  188. package/src/shade/renderer/geometry/virtual/VK_LOD_CLUSTERS_COMPARISON_2026_08_20.md +19 -0
  189. package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.d.ts +19 -6
  190. package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.d.ts.map +1 -1
  191. package/src/shade/renderer/geometry/virtual/format/read/VGeoByteSource.js +26 -7
  192. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +173 -14
  193. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
  194. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +458 -51
  195. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +49 -13
  196. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
  197. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +52 -14
  198. package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.d.ts +20 -0
  199. package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.d.ts.map +1 -0
  200. package/src/shade/renderer/geometry/virtual/format/read/tool/VGEO_MAX_AUDIT_BYTES.js +19 -0
  201. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.d.ts +27 -0
  202. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.d.ts.map +1 -0
  203. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_audit_container.js +48 -0
  204. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.d.ts +29 -0
  205. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.d.ts.map +1 -0
  206. package/src/shade/renderer/geometry/virtual/format/read/tool/vgeo_install_all_pages.js +60 -0
  207. package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.d.ts +8 -1
  208. package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.d.ts.map +1 -1
  209. package/src/shade/renderer/geometry/virtual/format/read/vgeo_fetch_byte_source.js +32 -2
  210. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.d.ts +258 -0
  211. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.d.ts.map +1 -0
  212. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.js +723 -0
  213. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.d.ts +49 -0
  214. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.d.ts.map +1 -0
  215. package/src/shade/renderer/geometry/virtual/residency/VGeoResidencyOptions.js +50 -0
  216. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  217. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  218. package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.d.ts +3 -0
  219. package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.d.ts.map +1 -1
  220. package/src/shade/renderer/texture/bindless/GPUBindlessTextureManager.js +121 -21
  221. package/src/shade/renderer/texture/virtual/README.md +6 -4
  222. package/src/shade/renderer/texture/virtual/VirtualTextureManager.d.ts.map +1 -1
  223. package/src/shade/renderer/texture/virtual/VirtualTextureManager.js +7 -0
  224. package/src/shade/renderer/texture/virtual/source/VTSourceTiled.d.ts +3 -3
  225. package/src/shade/renderer/texture/virtual/source/VTSourceTiled.js +3 -3
  226. package/src/engine/ecs/system/SystemExecutionPhase.d.ts +0 -9
  227. package/src/engine/ecs/system/SystemExecutionPhase.d.ts.map +0 -1
  228. package/src/engine/graphics/texture/virtual/NOTES.md +0 -128
  229. package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.d.ts +0 -6
  230. package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.d.ts.map +0 -1
  231. package/src/engine/graphics/texture/virtual/VT_DEFAULT_PAGE_RESOLUTION.js +0 -5
  232. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts +0 -49
  233. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts.map +0 -1
  234. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.js +0 -264
  235. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts +0 -44
  236. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts.map +0 -1
  237. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.js +0 -228
  238. package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.d.ts +0 -3
  239. package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.d.ts.map +0 -1
  240. package/src/engine/graphics/texture/virtual/VirtualTextureUsageShader.js +0 -73
  241. package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.d.ts +0 -14
  242. package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.d.ts.map +0 -1
  243. package/src/engine/graphics/texture/virtual/debug/ResidencyDebugView.js +0 -85
  244. package/src/engine/graphics/texture/virtual/debug/UsageDebugView.d.ts +0 -12
  245. package/src/engine/graphics/texture/virtual/debug/UsageDebugView.d.ts.map +0 -1
  246. package/src/engine/graphics/texture/virtual/debug/UsageDebugView.js +0 -63
  247. package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.d.ts +0 -12
  248. package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.d.ts.map +0 -1
  249. package/src/engine/graphics/texture/virtual/debug/UsagePyramidDebugView.js +0 -243
  250. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts +0 -30
  251. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts.map +0 -1
  252. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js +0 -39
  253. package/src/engine/graphics/texture/virtual/tile/compose_finger_print.d.ts +0 -9
  254. package/src/engine/graphics/texture/virtual/tile/compose_finger_print.d.ts.map +0 -1
  255. package/src/engine/graphics/texture/virtual/tile/compose_finger_print.js +0 -24
  256. package/src/engine/graphics/texture/virtual/tile/compose_tile_address.d.ts +0 -9
  257. package/src/engine/graphics/texture/virtual/tile/compose_tile_address.d.ts.map +0 -1
  258. package/src/engine/graphics/texture/virtual/tile/compose_tile_address.js +0 -26
  259. package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.d.ts +0 -11
  260. package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.d.ts.map +0 -1
  261. package/src/engine/graphics/texture/virtual/tile/decompose_finger_print.js +0 -12
  262. package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.d.ts +0 -7
  263. package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.d.ts.map +0 -1
  264. package/src/engine/graphics/texture/virtual/tile/finger_print_to_tile_address.js +0 -16
  265. package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.d.ts +0 -7
  266. package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.d.ts.map +0 -1
  267. package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.js +0 -35
@@ -0,0 +1,258 @@
1
+ /**
2
+ * The budget owner: what may be resident, what may be in flight, and what gets dropped.
3
+ *
4
+ * `VGeoContainerReader` is mechanics — it fetches a page, decodes it, keeps the activation counters
5
+ * straight, and reports what it holds. It decides none of the questions that only make sense across
6
+ * readers, and `VGEO_FORMAT.md` §10 says so deliberately, requirement by requirement: the eviction
7
+ * *rule* is spelled out there and the *choice* of which page to drop is left to "whatever owns the
8
+ * budget". This is that. Nothing here reaches inside a reader; it is written entirely against the
9
+ * reader's public surface, which is the test that the split is real.
10
+ *
11
+ * Three things live here because none of them can live below:
12
+ *
13
+ * - **A byte budget across every reader.** A reader reports `resident_bytes` and enforces nothing;
14
+ * at a thousand assets of several gigabytes each, the resident set has to be a small fraction of
15
+ * *one* asset and no reader can know that. {@link install_wants} admits a want against the budget
16
+ * before it is fetched, using the `decoded_size` the child table already told the traversal, and
17
+ * {@link evict_to_budget} is what makes room.
18
+ * - **A shared fetch cap and a global priority order.** Per-reader caps do not compose: eight
19
+ * readers at `max_concurrent_fetches = 6` were measured issuing 48 concurrent range requests.
20
+ * One {@link ConcurrencyGate} holds the total, and holds it as one priority queue so that the
21
+ * most visibly coarse page wins wherever it came from. That is meaningful only because a want's
22
+ * priority is pixels of projected error past the threshold, which is comparable across assets by
23
+ * construction; a per-reader queue could not say it however truthfully the numbers compared.
24
+ * - **Eviction, on §10's rule and design §6's order.** A page is evictable only while it has no
25
+ * resident child pages (leaves-first falls out of that), the root page is never evictable, and
26
+ * among the rest the oldest **last-touched** stamp goes first with a protect window no shorter
27
+ * than feedback latency. LRU on last-*wanted* would freeze stamps at fetch time and evict what is
28
+ * on screen.
29
+ *
30
+ * **Two of those three are the third implementation in this engine, and that is the honest way to
31
+ * read them.** `VTPhysicalCache` is the near-identical precedent for eviction: a `#last_touch`
32
+ * `Uint32Array` per slot, `touch(slot, frame)` and `last_touch(slot)`, a per-slot lock flag for
33
+ * slots that must never be evicted — the analogue of pinning the root page here — and
34
+ * `find_eviction_candidate(current_frame, protect_window)`, whose own doc justifies the window the
35
+ * same way this class does: feedback readback runs a couple of frames behind, so recently touched
36
+ * really means probably on screen. That convergence is neither coincidence nor independent
37
+ * invention — design §6 pinned the rule and wrote "the VT system already keys on touch for this
38
+ * reason" while doing it. The one thing that cache does differently is worth copying if this ever
39
+ * gets hot: it picks by linear scan, on the argument that at ≤ ~1k slots a scan beats maintaining
40
+ * a heap. For the fetch cap, `AssetManager.load_concurrency` and
41
+ * `VirtualTextureManager.max_concurrent_loads` both predate it — being the third place to want it
42
+ * is why the gate is now {@link ConcurrencyGate}, in `core/process/`, whose own doc says where it
43
+ * repeats those two and why neither of them adopted it.
44
+ *
45
+ * **The first bullet is what has no precedent here.** Neither of those budgets *bytes* across
46
+ * *several* readers. `VTPhysicalCache` budgets a count of fixed-size slots, which is the whole
47
+ * reason its eviction can be a scan over a flat array; `AssetManager` budgets nothing at all —
48
+ * `remove` and `clear` are manual and there is no eviction policy to compare against. Admitting a
49
+ * page against a byte budget *before* the fetch, out of the `decoded_size` its parent's child
50
+ * table already carries, is the part of this that had nothing to borrow from. So are the two
51
+ * failure behaviours below: bounded retry with backoff into per-page quarantine, where
52
+ * `AssetManager` only records a failure and lets a *new* `get` retry it, and per-fetch
53
+ * `AbortSignal` cancellation, which neither precedent has.
54
+ *
55
+ * **Why these pages are not simply `AssetManager`'s problem**, given how much of this it already
56
+ * does: an `AssetDescription` is a path and a type, two strings, one entry per thing loaded. A VG
57
+ * page is a byte range inside a container that the format gives no global identifier at all — a
58
+ * cluster is a page plus an index within it — and containers here run to 4,000 and 20,000 pages
59
+ * apiece against a thousand open assets. The unit is wrong by orders of magnitude before anything
60
+ * about the cache itself is considered.
61
+ *
62
+ * **What it does not do.** It does not decide what to want — that is the cut's job, and the wants
63
+ * arrive here already ranked. It does not know about VRAM: design §6's third tier is a separate
64
+ * budget over a separate pool, and this is the RAM tier. And it does not make a dropped page
65
+ * incorrect: everything it evicts, the clamped cut covers with a coarser ancestor that is still
66
+ * selectable, which is why a budget can be enforced at all.
67
+ *
68
+ * A runtime registering a reader should also set `VGeoReadOptions.verify_frames` on it. §10 requires
69
+ * frame verification of a runtime reader and the reader defaults it off, because a tool reading a
70
+ * file it just built is not defending against a network — but a manager holding a thousand streamed
71
+ * assets is exactly the case the requirement is about, and verification is what lets the retries and
72
+ * the quarantine below see corruption rather than only outages.
73
+ *
74
+ * @author Alex Goldring
75
+ * @copyright Company Named Limited (c) 2026
76
+ */
77
+ export class VGeoResidencyManager {
78
+ /**
79
+ * @param {VGeoResidencyOptions} [options]
80
+ * @param {ConcurrencyGate} [scheduler] one is built from {@link options} when it is left out;
81
+ * pass one to share a cap with something else that fetches
82
+ */
83
+ constructor(options?: VGeoResidencyOptions, scheduler?: ConcurrencyGate);
84
+ /**
85
+ * @returns {VGeoResidencyOptions}
86
+ */
87
+ get options(): VGeoResidencyOptions;
88
+ /**
89
+ * @returns {ConcurrencyGate}
90
+ */
91
+ get scheduler(): ConcurrencyGate;
92
+ /**
93
+ * @returns {number}
94
+ */
95
+ get reader_count(): number;
96
+ /**
97
+ * @returns {number}
98
+ */
99
+ get frame(): number;
100
+ /**
101
+ * Decoded page bytes held by every registered reader together — the number the budget is spent
102
+ * against.
103
+ * @returns {number}
104
+ */
105
+ get resident_bytes(): number;
106
+ /**
107
+ * @returns {number}
108
+ */
109
+ get budget_bytes(): number;
110
+ /**
111
+ * @returns {number}
112
+ */
113
+ get resident_page_count(): number;
114
+ /**
115
+ * How many pages this manager has dropped. Telemetry, and the thing to watch when a scene is
116
+ * thrashing: a page count that climbs faster than the frame count is a budget too small for the
117
+ * cut being asked for.
118
+ * @returns {number}
119
+ */
120
+ get evicted_page_count(): number;
121
+ /**
122
+ * How many wants were refused because nothing could be evicted to make room for them.
123
+ *
124
+ * Not an error: a refused want is a page the next traversal will want again, from a cut that is
125
+ * correct without it. A number that stays high is the budget saying it cannot hold the cut being
126
+ * asked for, which is a τ or a budget decision and not a streaming one.
127
+ *
128
+ * @returns {number}
129
+ */
130
+ get refused_want_count(): number;
131
+ /**
132
+ * Take a reader under the budget.
133
+ *
134
+ * @param {VGeoContainerReader} reader
135
+ * @returns {VGeoContainerReader} the same reader, so this can wrap an `open`
136
+ */
137
+ register(reader: VGeoContainerReader): VGeoContainerReader;
138
+ /**
139
+ * Stop counting a reader's pages against the budget.
140
+ *
141
+ * The reader keeps whatever it holds — dropping it is the caller's business, and a reader being
142
+ * unregistered is usually one about to be discarded whole.
143
+ *
144
+ * @param {VGeoContainerReader} reader
145
+ * @returns {boolean} whether it was registered
146
+ */
147
+ unregister(reader: VGeoContainerReader): boolean;
148
+ /**
149
+ * @param {VGeoContainerReader} reader
150
+ * @returns {boolean}
151
+ */
152
+ is_registered(reader: VGeoContainerReader): boolean;
153
+ /**
154
+ * Advance the frame counter, and reconcile the byte total with what the readers actually hold.
155
+ *
156
+ * Call it once a frame. The reconciliation is what keeps the budget honest when something
157
+ * installed or evicted without going through here — which a tool, a test, or a playground
158
+ * button all legitimately do.
159
+ *
160
+ * @returns {number} the new frame number
161
+ */
162
+ advance_frame(): number;
163
+ /**
164
+ * Re-read every registered reader's `resident_bytes`, and forget touch stamps for pages that are
165
+ * no longer resident.
166
+ *
167
+ * @returns {number} the reconciled total
168
+ */
169
+ resync(): number;
170
+ /**
171
+ * Record that a page was selected from this frame — design §6's touch, which is what eviction
172
+ * orders on.
173
+ *
174
+ * @param {VGeoContainerReader} reader
175
+ * @param {number} page_index
176
+ */
177
+ touch(reader: VGeoContainerReader, page_index: number): void;
178
+ /**
179
+ * Record every page of a cut as touched.
180
+ *
181
+ * @param {VGeoContainerReader} reader
182
+ * @param {Iterable<number>} page_indices
183
+ */
184
+ touch_all(reader: VGeoContainerReader, page_indices: Iterable<number>): void;
185
+ /**
186
+ * The frame a page was last touched on, or `-1` for one nothing has reported.
187
+ *
188
+ * @param {VGeoContainerReader} reader
189
+ * @param {number} page_index
190
+ * @returns {number}
191
+ */
192
+ last_touched(reader: VGeoContainerReader, page_index: number): number;
193
+ /**
194
+ * Whether a page may be dropped right now — §10's eviction rule, plus design §6's protect
195
+ * window.
196
+ *
197
+ * @param {VGeoContainerReader} reader
198
+ * @param {number} page_index
199
+ * @returns {boolean}
200
+ */
201
+ evictable(reader: VGeoContainerReader, page_index: number): boolean;
202
+ /**
203
+ * Drop pages until the budget has room for `headroom` more bytes.
204
+ *
205
+ * Oldest touch first, and only pages the rule allows — so the first pass finds leaves, dropping
206
+ * them makes their parents evictable, and the next pass finds those. Dropping a page can only
207
+ * ever make another page *more* evictable, never less, which is what lets each pass reuse the
208
+ * ordering it built.
209
+ *
210
+ * @param {number} [headroom] bytes to leave room for on top of the budget's own limit
211
+ * @returns {number} pages dropped
212
+ */
213
+ evict_to_budget(headroom?: number): number;
214
+ /**
215
+ * Install a reader's wants, under the shared fetch cap and the shared byte budget.
216
+ *
217
+ * This is the runtime's entry point, and what it does that `VGeoContainerReader.install_wants`
218
+ * cannot: every fetch queues on one scheduler shared with every other reader, so priority is
219
+ * compared across assets and the in-flight total is bounded; and every page is admitted against
220
+ * the budget *before* it is fetched, out of the `decoded_size` its parent's child table already
221
+ * carries — so a page that will not fit is never paid for.
222
+ *
223
+ * A want that cannot be admitted is dropped, not queued. It is not a failure: the cut that
224
+ * produced it is correct without the page, and the next traversal will want it again — by which
225
+ * time something may have gone cold enough to evict. {@link refused_want_count} counts them.
226
+ *
227
+ * A want with no `decoded_size` is admitted blind and the budget is enforced after the fact, at
228
+ * the end of this call. Wants that came from a cut always carry it.
229
+ *
230
+ * @param {VGeoContainerReader} reader must be registered
231
+ * @param {VGeoPageWant[]} wants
232
+ * @param {number} [limit] most pages to install this call
233
+ * @param {AbortSignal} [signal] stops admitting, and abandons what this reader has in flight
234
+ * @returns {Promise<VGeoPage[]>} the pages installed, in completion order
235
+ */
236
+ install_wants(reader: VGeoContainerReader, wants: VGeoPageWant[], limit?: number, signal?: AbortSignal): Promise<VGeoPage[]>;
237
+ /**
238
+ * Let every quarantined page of every registered reader be asked for again.
239
+ *
240
+ * The policy half of §10's quarantine, and the reason it is here rather than on the reader: a
241
+ * reader that failed three fetches of one page cannot tell an unreachable CDN from a corrupt
242
+ * frame, and a manager that has watched other pages of other assets arrive since can. A caller
243
+ * that has just come back online, or that is retrying a whole scene, calls this; nothing calls it
244
+ * on a timer, because a checksum that failed once will fail again and the retry costs a fetch.
245
+ *
246
+ * @returns {number} how many pages were released, across every reader
247
+ */
248
+ clear_quarantines(): number;
249
+ /**
250
+ * How many pages are quarantined across every registered reader.
251
+ * @returns {number}
252
+ */
253
+ get quarantined_page_count(): number;
254
+ #private;
255
+ }
256
+ import { VGeoResidencyOptions } from "./VGeoResidencyOptions.js";
257
+ import { ConcurrencyGate } from "../../../../../core/process/ConcurrencyGate.js";
258
+ //# sourceMappingURL=VGeoResidencyManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VGeoResidencyManager.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/residency/VGeoResidencyManager.js"],"names":[],"mappings":"AAqCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH;IAsCI;;;;OAIG;IACH,sBAJW,oBAAoB,cACpB,eAAe,EAMzB;IAED;;OAEG;IACH,oCAEC;IAED;;OAEG;IACH,iCAEC;IAED;;OAEG;IACH,2BAEC;IAED;;OAEG;IACH,oBAEC;IAED;;;;OAIG;IACH,6BAEC;IAED;;OAEG;IACH,2BAEC;IAED;;OAEG;IACH,kCAQC;IAED;;;;;OAKG;IACH,iCAEC;IAED;;;;;;;;OAQG;IACH,iCAEC;IAED;;;;;OAKG;IACH,2DAmBC;IAED;;;;;;;;OAQG;IACH,yCAFa,OAAO,CAcnB;IAED;;;OAGG;IACH,4CAFa,OAAO,CAInB;IAED;;;;;;;;OAQG;IACH,iBAFa,MAAM,CAQlB;IAED;;;;;OAKG;IACH,UAFa,MAAM,CAsBlB;IAED;;;;;;OAMG;IACH,+CAFW,MAAM,QAUhB;IAED;;;;;OAKG;IACH,qDAFW,SAAS,MAAM,CAAC,QAY1B;IAED;;;;;;OAMG;IACH,sDAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,mDAHW,MAAM,GACJ,OAAO,CA4BnB;IAED;;;;;;;;;;OAUG;IACH,2BAHW,MAAM,GACJ,MAAM,CAyClB;IA4DD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,kDALW,cAAc,UACd,MAAM,WACN,WAAW,GACT,QAAQ,UAAU,CAAC,CAyD/B;IA2ED;;;;;;;;;;OAUG;IACH,qBAFa,MAAM,CAUlB;IAED;;;OAGG;IACH,qCAQC;;CACJ;qCAhtBoC,2BAA2B;gCADhC,gDAAgD"}