@woosh/meep-engine 2.168.0 → 2.169.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 (295) hide show
  1. package/README.md +2 -2
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/package.json +1 -1
  4. package/src/REVIEW_2026_08_06/adv-core.md +511 -0
  5. package/src/REVIEW_2026_08_06/adv-gfx.md +480 -0
  6. package/src/REVIEW_2026_08_06/adv-view.md +446 -0
  7. package/src/REVIEW_2026_08_06/api-core.md +296 -0
  8. package/src/REVIEW_2026_08_06/api-engine.md +195 -0
  9. package/src/REVIEW_2026_08_06/bvh-phys-sound-net.md +507 -0
  10. package/src/REVIEW_2026_08_06/core-binary.md +348 -0
  11. package/src/REVIEW_2026_08_06/core-collection.md +376 -0
  12. package/src/REVIEW_2026_08_06/core-math.md +221 -0
  13. package/src/REVIEW_2026_08_06/core-process.md +266 -0
  14. package/src/REVIEW_2026_08_06/core-science.md +223 -0
  15. package/src/REVIEW_2026_08_06/engine-ai-nav.md +279 -0
  16. package/src/REVIEW_2026_08_06/engine-animation.md +167 -0
  17. package/src/REVIEW_2026_08_06/engine-asset.md +166 -0
  18. package/src/REVIEW_2026_08_06/engine-ecs.md +920 -0
  19. package/src/REVIEW_2026_08_06/engine-input.md +197 -0
  20. package/src/REVIEW_2026_08_06/engine-misc.md +248 -0
  21. package/src/REVIEW_2026_08_06/engine-terrain.md +52 -0
  22. package/src/REVIEW_2026_08_06/generation.md +176 -0
  23. package/src/REVIEW_2026_08_06/geom-2d.md +434 -0
  24. package/src/REVIEW_2026_08_06/geom-3d.md +117 -0
  25. package/src/REVIEW_2026_08_06/gfx-gi.md +143 -0
  26. package/src/REVIEW_2026_08_06/gfx-render.md +740 -0
  27. package/src/REVIEW_2026_08_06/gfx-texture.md +690 -0
  28. package/src/REVIEW_2026_08_06/prior-criticals.md +49 -0
  29. package/src/REVIEW_2026_08_06/prior-highs.md +138 -0
  30. package/src/REVIEW_2026_08_06/test-gaps.md +364 -0
  31. package/src/REVIEW_2026_08_06/view.md +667 -0
  32. package/src/REVIEW_2026_08_06.md +571 -0
  33. package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
  34. package/src/core/binary/BinaryBuffer.js +12 -1
  35. package/src/core/binary/BitImage2.d.ts +5 -1
  36. package/src/core/binary/BitImage2.d.ts.map +1 -1
  37. package/src/core/binary/BitImage2.js +5 -1
  38. package/src/core/bvh8/build/NodeProxy.d.ts.map +1 -1
  39. package/src/core/bvh8/build/NodeProxy.js +314 -308
  40. package/src/core/collection/list/List.d.ts +15 -0
  41. package/src/core/collection/list/List.d.ts.map +1 -1
  42. package/src/core/collection/list/List.js +34 -0
  43. package/src/core/collection/list/SortedListProjection.d.ts.map +1 -1
  44. package/src/core/collection/list/SortedListProjection.js +4 -1
  45. package/src/core/collection/map/BiMap.d.ts +25 -2
  46. package/src/core/collection/map/BiMap.d.ts.map +1 -1
  47. package/src/core/collection/map/BiMap.js +57 -3
  48. package/src/core/debug/matchers/IsAnything.d.ts.map +1 -1
  49. package/src/core/debug/matchers/IsAnything.js +5 -1
  50. package/src/core/events/signal/Signal.d.ts.map +1 -1
  51. package/src/core/events/signal/Signal.js +3 -1
  52. package/src/core/geom/2d/polygon/TRIANGULATION_DESIGN.md +433 -0
  53. package/src/core/geom/2d/polygon/polygon2_is_counter_clockwise.d.ts +31 -0
  54. package/src/core/geom/2d/polygon/polygon2_is_counter_clockwise.d.ts.map +1 -0
  55. package/src/core/geom/2d/polygon/polygon2_is_counter_clockwise.js +84 -0
  56. package/src/core/geom/2d/polygon/polygon2_signed_area.d.ts +24 -2
  57. package/src/core/geom/2d/polygon/polygon2_signed_area.d.ts.map +1 -1
  58. package/src/core/geom/2d/polygon/polygon2_signed_area.js +52 -34
  59. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.d.ts +28 -0
  60. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.d.ts.map +1 -0
  61. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.js +86 -0
  62. package/src/core/geom/2d/polygon/polygon2_triangulate.d.ts +40 -0
  63. package/src/core/geom/2d/polygon/polygon2_triangulate.d.ts.map +1 -0
  64. package/src/core/geom/2d/polygon/polygon2_triangulate.js +1280 -0
  65. package/src/core/geom/2d/polygon/polygon2_triangulation_deviation.d.ts +28 -0
  66. package/src/core/geom/2d/polygon/polygon2_triangulation_deviation.d.ts.map +1 -0
  67. package/src/core/geom/2d/polygon/polygon2_triangulation_deviation.js +77 -0
  68. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts +6 -3
  69. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts.map +1 -1
  70. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.js +26 -13
  71. package/src/core/geom/2d/triangle/tri2_signed_area.d.ts +17 -1
  72. package/src/core/geom/2d/triangle/tri2_signed_area.d.ts.map +1 -1
  73. package/src/core/geom/2d/triangle/tri2_signed_area.js +35 -23
  74. package/src/core/geom/2d/v2_morton_encode.d.ts +20 -0
  75. package/src/core/geom/2d/v2_morton_encode.d.ts.map +1 -0
  76. package/src/core/geom/2d/v2_morton_encode.js +23 -0
  77. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts.map +1 -1
  78. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.js +4 -1
  79. package/src/core/geom/3d/polygon/polygon3_compute_normal.d.ts +27 -0
  80. package/src/core/geom/3d/polygon/polygon3_compute_normal.d.ts.map +1 -0
  81. package/src/core/geom/3d/polygon/polygon3_compute_normal.js +60 -0
  82. package/src/core/geom/3d/polygon/polygon3_triangulate.d.ts +34 -0
  83. package/src/core/geom/3d/polygon/polygon3_triangulate.d.ts.map +1 -0
  84. package/src/core/geom/3d/polygon/polygon3_triangulate.js +94 -0
  85. package/src/core/geom/3d/quaternion/quat3_multiply.d.ts +8 -2
  86. package/src/core/geom/3d/quaternion/quat3_multiply.d.ts.map +1 -1
  87. package/src/core/geom/3d/quaternion/quat3_multiply.js +8 -2
  88. package/src/core/geom/3d/shape/ConvexHullShape3D.d.ts.map +1 -1
  89. package/src/core/geom/3d/shape/ConvexHullShape3D.js +32 -2
  90. package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.d.ts +23 -6
  91. package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.d.ts.map +1 -1
  92. package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.js +268 -124
  93. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_assert_valid.d.ts +17 -0
  94. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_assert_valid.d.ts.map +1 -0
  95. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_assert_valid.js +44 -0
  96. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_count_edge_faces.d.ts +20 -0
  97. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_count_edge_faces.d.ts.map +1 -0
  98. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_count_edge_faces.js +40 -0
  99. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_closed.d.ts +19 -0
  100. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_closed.d.ts.map +1 -0
  101. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_closed.js +34 -0
  102. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_manifold.d.ts +22 -0
  103. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_manifold.d.ts.map +1 -0
  104. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_manifold.js +37 -0
  105. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_validate.d.ts +87 -0
  106. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_validate.d.ts.map +1 -0
  107. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_validate.js +599 -0
  108. package/src/core/geom/3d/triangle/tri3_compute_signed_volume.d.ts +32 -0
  109. package/src/core/geom/3d/triangle/tri3_compute_signed_volume.d.ts.map +1 -1
  110. package/src/core/geom/3d/triangle/tri3_compute_signed_volume.js +66 -7
  111. package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.d.ts +22 -1
  112. package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.d.ts.map +1 -1
  113. package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.js +83 -38
  114. package/src/core/geom/MANIFOLD_COMPARISON_2026_08_01.md +554 -0
  115. package/src/core/geom/vec3/v3_cotangent.d.ts +6 -2
  116. package/src/core/geom/vec3/v3_cotangent.d.ts.map +1 -1
  117. package/src/core/geom/vec3/v3_cotangent.js +6 -2
  118. package/src/core/geom/vec3/v3_cross.d.ts +6 -2
  119. package/src/core/geom/vec3/v3_cross.d.ts.map +1 -1
  120. package/src/core/geom/vec3/v3_cross.js +6 -2
  121. package/src/core/geom/vec3/v3_multiply.d.ts +6 -2
  122. package/src/core/geom/vec3/v3_multiply.d.ts.map +1 -1
  123. package/src/core/geom/vec3/v3_multiply.js +6 -2
  124. package/src/core/geom/vec3/v3_subtract.d.ts +6 -2
  125. package/src/core/geom/vec3/v3_subtract.d.ts.map +1 -1
  126. package/src/core/geom/vec3/v3_subtract.js +6 -2
  127. package/src/core/localization/Localization.js +1 -1
  128. package/src/core/math/random/randomSeed.d.ts +13 -0
  129. package/src/core/math/random/randomSeed.d.ts.map +1 -0
  130. package/src/core/math/random/randomSeed.js +16 -0
  131. package/src/core/math/spline/spline3_hermite_apply_transform.d.ts +50 -0
  132. package/src/core/math/spline/spline3_hermite_apply_transform.d.ts.map +1 -0
  133. package/src/core/math/spline/spline3_hermite_apply_transform.js +107 -0
  134. package/src/core/math/spline/spline3_hermite_reverse.d.ts +34 -0
  135. package/src/core/math/spline/spline3_hermite_reverse.d.ts.map +1 -0
  136. package/src/core/math/spline/spline3_hermite_reverse.js +49 -0
  137. package/src/core/math/statistics/hammersley_sequence.d.ts +17 -4
  138. package/src/core/math/statistics/hammersley_sequence.d.ts.map +1 -1
  139. package/src/core/math/statistics/hammersley_sequence.js +25 -16
  140. package/src/core/process/Future.d.ts.map +1 -1
  141. package/src/core/process/Future.js +12 -0
  142. package/src/core/process/PromiseWatcher.d.ts.map +1 -1
  143. package/src/core/process/PromiseWatcher.js +9 -2
  144. package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
  145. package/src/core/process/executor/ConcurrentExecutor.js +12 -2
  146. package/src/core/process/worker/WorkerProxy.d.ts.map +1 -1
  147. package/src/core/process/worker/WorkerProxy.js +5 -2
  148. package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
  149. package/src/core/process/worker/extractTransferables.js +4 -1
  150. package/src/engine/Engine.d.ts +12 -12
  151. package/src/engine/Engine.d.ts.map +1 -1
  152. package/src/engine/Engine.js +149 -10
  153. package/src/engine/EngineHarness.d.ts.map +1 -1
  154. package/src/engine/EngineHarness.js +4 -1
  155. package/src/engine/asset/loaders/ArrayBufferLoader.d.ts.map +1 -1
  156. package/src/engine/asset/loaders/ArrayBufferLoader.js +7 -0
  157. package/src/engine/ecs/speaker/lines/sets/LineSetDescription.d.ts.map +1 -1
  158. package/src/engine/ecs/speaker/lines/sets/LineSetDescription.js +3 -1
  159. package/src/engine/ecs/terrain/ecs/TerrainSystem.d.ts.map +1 -1
  160. package/src/engine/ecs/terrain/ecs/TerrainSystem.js +4 -1
  161. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts +29 -0
  162. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
  163. package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +84 -23
  164. package/src/engine/graphics/CONTEXT_LOSS_RECOVERY_PLAN.md +446 -0
  165. package/src/engine/graphics/GraphicsEngine.d.ts +56 -7
  166. package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
  167. package/src/engine/graphics/GraphicsEngine.js +196 -24
  168. package/src/engine/graphics/context/WebGLContextFailureReason.d.ts +9 -0
  169. package/src/engine/graphics/context/WebGLContextFailureReason.d.ts.map +1 -0
  170. package/src/engine/graphics/context/WebGLContextFailureReason.js +17 -0
  171. package/src/engine/graphics/context/WebGLContextMonitor.d.ts +106 -0
  172. package/src/engine/graphics/context/WebGLContextMonitor.d.ts.map +1 -0
  173. package/src/engine/graphics/context/WebGLContextMonitor.js +341 -0
  174. package/src/engine/graphics/context/WebGLContextState.d.ts +14 -0
  175. package/src/engine/graphics/context/WebGLContextState.d.ts.map +1 -0
  176. package/src/engine/graphics/context/WebGLContextState.js +24 -0
  177. package/src/engine/graphics/context/testWebGLContextLoss.d.ts +2 -0
  178. package/src/engine/graphics/context/testWebGLContextLoss.d.ts.map +1 -0
  179. package/src/engine/graphics/context/testWebGLContextLoss.js +696 -0
  180. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.d.ts.map +1 -1
  181. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.js +68 -32
  182. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationUpgrader_0_1.d.ts +14 -0
  183. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationUpgrader_0_1.d.ts.map +1 -0
  184. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationUpgrader_0_1.js +41 -0
  185. package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +1 -1
  186. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
  187. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +5 -0
  188. package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts +5 -1
  189. package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts.map +1 -1
  190. package/src/engine/graphics/ecs/trail2d/Trail2D.js +15 -0
  191. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts +1 -1
  192. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts.map +1 -1
  193. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.js +2 -1
  194. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +4 -1
  195. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -1
  196. package/src/engine/graphics/ecs/trail3d/Trail3D.js +488 -476
  197. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts +1 -1
  198. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts.map +1 -1
  199. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.js +280 -253
  200. package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.d.ts.map +1 -1
  201. package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.js +3 -2
  202. package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.d.ts.map +1 -1
  203. package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.js +3 -1
  204. package/src/engine/graphics/geometry/computeMeshSurfaceArea.js +1 -1
  205. package/src/engine/graphics/load_and_set_cubemap_v0.d.ts +5 -0
  206. package/src/engine/graphics/load_and_set_cubemap_v0.d.ts.map +1 -1
  207. package/src/engine/graphics/load_and_set_cubemap_v0.js +26 -21
  208. package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts.map +1 -1
  209. package/src/engine/graphics/particles/particular/group/ParticleGroup.js +19 -8
  210. package/src/engine/graphics/particles/particular/group/optimizeCommandQueue.js +1 -1
  211. package/src/engine/graphics/texture/atlas/AtlasLookupTexture.d.ts.map +1 -1
  212. package/src/engine/graphics/texture/atlas/AtlasLookupTexture.js +10 -3
  213. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
  214. package/src/engine/graphics/texture/atlas/TextureAtlas.js +4 -1
  215. package/src/engine/graphics/texture/atlas/gpu/WebGLTextureAtlas.d.ts.map +1 -1
  216. package/src/engine/graphics/texture/atlas/gpu/WebGLTextureAtlas.js +11 -0
  217. package/src/engine/graphics/texture/cubemap/load_environment_map.d.ts.map +1 -1
  218. package/src/engine/graphics/texture/cubemap/load_environment_map.js +5 -2
  219. package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_Chamfer.d.ts.map +1 -1
  220. package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_Chamfer.js +26 -18
  221. package/src/engine/graphics/texture/sampler/filter/sampler2d_blur_gaussian.d.ts +15 -2
  222. package/src/engine/graphics/texture/sampler/filter/sampler2d_blur_gaussian.d.ts.map +1 -1
  223. package/src/engine/graphics/texture/sampler/filter/sampler2d_blur_gaussian.js +29 -3
  224. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.d.ts +11 -1
  225. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.d.ts.map +1 -1
  226. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.js +158 -171
  227. package/src/engine/graphics/texture/sampler/sampler2d_paint.js +1 -1
  228. package/src/engine/graphics/texture/sampler/util/bitSet2Sampler2D.js +2 -2
  229. package/src/engine/input/ecs/util/TopDownCameraControllerHelper.d.ts.map +1 -1
  230. package/src/engine/input/ecs/util/TopDownCameraControllerHelper.js +10 -3
  231. package/src/engine/navigation/ecs/components/PathSerializationUpgrader_2_3.d.ts +14 -0
  232. package/src/engine/navigation/ecs/components/PathSerializationUpgrader_2_3.d.ts.map +1 -0
  233. package/src/engine/navigation/ecs/components/PathSerializationUpgrader_2_3.js +38 -0
  234. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  235. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +433 -425
  236. package/src/engine/physics/constraint/solve_constraints.d.ts +4 -1
  237. package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
  238. package/src/engine/physics/constraint/solve_constraints.js +38 -13
  239. package/src/engine/physics/contact/ManifoldStore.d.ts +15 -3
  240. package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
  241. package/src/engine/physics/contact/ManifoldStore.js +15 -3
  242. package/src/engine/physics/ecs/Joint.d.ts +7 -4
  243. package/src/engine/physics/ecs/Joint.d.ts.map +1 -1
  244. package/src/engine/physics/ecs/Joint.js +7 -4
  245. package/src/engine/physics/ecs/PhysicsSystem.d.ts +14 -0
  246. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  247. package/src/engine/physics/ecs/PhysicsSystem.js +16 -0
  248. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  249. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
  250. package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts +15 -7
  251. package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts.map +1 -1
  252. package/src/engine/physics/narrowphase/convex_convex_manifold.js +33 -10
  253. package/src/engine/physics/narrowphase/refine_ray_concave.d.ts +6 -2
  254. package/src/engine/physics/narrowphase/refine_ray_concave.d.ts.map +1 -1
  255. package/src/engine/physics/narrowphase/refine_ray_concave.js +6 -2
  256. package/src/engine/physics/narrowphase/refine_ray_hit.d.ts +6 -2
  257. package/src/engine/physics/narrowphase/refine_ray_hit.d.ts.map +1 -1
  258. package/src/engine/physics/narrowphase/refine_ray_hit.js +6 -2
  259. package/src/engine/physics/queries/raycast.d.ts.map +1 -1
  260. package/src/engine/physics/queries/raycast.js +11 -4
  261. package/src/engine/save/storage/IndexedDBStorage.d.ts.map +1 -1
  262. package/src/engine/save/storage/IndexedDBStorage.js +21 -3
  263. package/src/engine/simulation/Ticker.d.ts +12 -0
  264. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  265. package/src/engine/simulation/Ticker.js +18 -0
  266. package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -1
  267. package/src/engine/sound/simulation/AcousticSimulator.js +9 -1
  268. package/src/engine/sound/simulation/core/VolumeField.d.ts +6 -2
  269. package/src/engine/sound/simulation/core/VolumeField.d.ts.map +1 -1
  270. package/src/engine/sound/simulation/core/VolumeField.js +6 -2
  271. package/src/engine/sound/simulation/probe/AcousticProbeField.d.ts +6 -2
  272. package/src/engine/sound/simulation/probe/AcousticProbeField.d.ts.map +1 -1
  273. package/src/engine/sound/simulation/probe/AcousticProbeField.js +6 -2
  274. package/src/engine/sound/simulation/probe/acoustic_probe_transfer.d.ts +6 -2
  275. package/src/engine/sound/simulation/probe/acoustic_probe_transfer.d.ts.map +1 -1
  276. package/src/engine/sound/simulation/probe/acoustic_probe_transfer.js +6 -2
  277. package/src/engine/sound/simulation/probe/bakeProbeReflectors.d.ts +3 -1
  278. package/src/engine/sound/simulation/probe/bakeProbeReflectors.d.ts.map +1 -1
  279. package/src/engine/sound/simulation/probe/bakeProbeReflectors.js +3 -1
  280. package/src/engine/ui/GUIEngine.d.ts.map +1 -1
  281. package/src/engine/ui/GUIEngine.js +8 -1
  282. package/src/generation/theme/TerrainTheme.d.ts.map +1 -1
  283. package/src/generation/theme/TerrainTheme.js +2 -1
  284. package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
  285. package/src/generation/theme/ThemeEngine.js +6 -5
  286. package/src/view/ViewGroup.d.ts.map +1 -1
  287. package/src/view/ViewGroup.js +9 -7
  288. package/src/view/graphics/WebGLContextFailureView.d.ts +19 -0
  289. package/src/view/graphics/WebGLContextFailureView.d.ts.map +1 -0
  290. package/src/view/graphics/WebGLContextFailureView.js +76 -0
  291. package/src/view/minimap/Minimap.d.ts +8 -0
  292. package/src/view/minimap/Minimap.d.ts.map +1 -1
  293. package/src/view/minimap/Minimap.js +16 -3
  294. package/src/view/minimap/dom/MinimapMarkerView.d.ts.map +1 -1
  295. package/src/view/minimap/dom/MinimapMarkerView.js +3 -1
@@ -0,0 +1,480 @@
1
+ # Adversarial verification — gfx-texture / engine-ecs / gfx-gi / engine-asset / gfx-render / geom-3d
2
+
3
+ Method: every CRITICAL re-checked, plus every MAJOR whose claim was "never works" / "always throws" /
4
+ "is never called" / "is always wrong". Where the module runs in node, findings were reproduced by
5
+ executing throwaway jest specs (`H:/git/moh` + `jest.conf.json`); those specs have been deleted.
6
+ GPU/shader claims were checked against the installed `H:/git/moh/node_modules/three` (r136) sources,
7
+ not from memory.
8
+
9
+ Pre-confirmed by the lead reviewer and NOT re-checked: `GFXR-11`, `GEOM3-1`, `ASSET-4`.
10
+
11
+ ---
12
+
13
+ ## gfx-texture
14
+
15
+ ### GFXT-1
16
+ - **Verdict**: CONFIRMED
17
+ - **Evidence**: `sampler2d_paint.js:68` reads `Math.round(x + sourceY)`. Executed: 4x1 RGBA source with
18
+ red = 10/20/30/40 per column, `sampler2d_paint(dst, src, /*sourceX*/2, /*sourceY*/0, 0,0, 1,1)`
19
+ wrote `[10,0,0,255]` — column 0, not column 2.
20
+
21
+ ### GFXT-2
22
+ - **Verdict**: CONFIRMED
23
+ - **Evidence**: `Sampler2D.js` defines `read(x,y,result)` at :499 and `write(x,y,texel)` at :518; there is no
24
+ `set` member (`grep '\bset\b'` yields only `result.set(x,y)` and `newData.set(...)` call sites).
25
+ Executed: `typeof Sampler2D.uint8(4,8,8).set === 'undefined'`, and `bitSet2Sampler2D` throws.
26
+
27
+ ### GFXT-3
28
+ - **Verdict**: CONFIRMED
29
+ - **Evidence**: forward/backward passes read `const v = getD(x,y)` once and compare all four candidates
30
+ against that stale value. Executed on a 4x3 source with a single differing pixel at (1,0):
31
+ cell (3,1) came out `2` where the correct chamfer value is `1.414` (the `v0 = 0 + d2` write is
32
+ overwritten by the later `v1 = 1 + d1` and `v3 = 1 + d1` writes). Cell (0,2) came out `2.414`
33
+ where the correct value is `1.414`.
34
+
35
+ ### GFXT-4
36
+ - **Verdict**: CONFIRMED
37
+ - **Evidence**: `sampler2d_ensure_uint8_RGBA` returns `input` unchanged for itemSize 4 + Uint8Array
38
+ (`:10-15`), and `data_texture_to_sampler`'s dimension check compares against `_width/_height`
39
+ that default to the image's own dimensions. Executed with a 2x2 RGBA8 `DataTexture`:
40
+ before `[1,1,1,255, 2,2,2,255, 3,3,3,255, 4,4,4,255]`, after `convertTexture2Sampler2D(tex)` the
41
+ **texture's own** `image.data` was `[3,3,3,255, 4,4,4,255, 1,1,1,255, 2,2,2,255]` — rows swapped in place.
42
+
43
+ ### GFXT-23
44
+ - **Verdict**: CONFIRMED
45
+ - **Evidence**: `TextureAtlas.js:362` is literally `patch.clearFlag(AtlasPatchFlag.Packed | AtlasPatchFlag.Packed)`.
46
+ `AtlasPatchFlag` has `Packed: 1, Painted: 2, Attached: 4` — distinct values, so `Painted` survives.
47
+ `paint()` (`:497`) only repaints on `!Painted || last_painted_version !== sampler.version`; `pack()`
48
+ (`:470-477`) re-places and calls `updatePositionFromPacking` without erasing or marking for repaint.
49
+ The `remove()` path two blocks above clears `Attached | Packed | Painted` correctly, confirming the typo.
50
+
51
+ ### GFXT-24
52
+ - **Verdict**: CONFIRMED
53
+ - **Evidence**: `AtlasLookupTexture.js:58` gates only on `image.height < expected_row_count`. Executed with
54
+ 10 patches: after `update()` the texture image was still `width 1, height 1, data.length 4`. Writes for
55
+ patches 1..9 land at indices 4..39 on a 4-element `Uint16Array` and are silently dropped.
56
+
57
+ ### GFXT-25
58
+ - **Verdict**: CONFIRMED
59
+ - **Evidence**: `WebGLTextureAtlas.add()` (`:93-108`) only accumulates `__total_area`; it never writes
60
+ `patch.packing` or `patch.size`. `AtlasPatch` defaults are `position = Vector2(0,0)`, `size = Vector2(0,0)`,
61
+ `packing = new AABB2()` (zero extent). `layout()` (`:110-147`) packs those zero-area boxes and never calls
62
+ `updatePositionFromPacking`, so `patch.position` stays `(0,0)` and `build()` copies every source to the
63
+ origin. `power = Math.ceil(Math.log2(this.__total_area))` treats an area as a side length (`:112`).
64
+ `build()` also indexes `this.__sources[i]` while `add()` stores at `this.__sources[id]`.
65
+
66
+ ### GFXT-32
67
+ - **Verdict**: CONFIRMED-BUT-DOWNGRADED
68
+ - **Corrected severity**: MAJOR
69
+ - **Evidence**: `BILLBOARD_PARTICLE_SPECIFICATION.js:23` really does register `color` with `itemSize: 1`
70
+ while `ParticleBillboardMaterial.js:123` declares `attribute vec4 color;`. Both consequences follow.
71
+ - **Reason** (downgrade, ground 5 — blast radius): the *shader* is the production shader
72
+ (`ShaderManager.buildMaterial:253`), but the production **pool** is built from
73
+ `PARTICULAR_PARTICLE_SPECIFICATION` (itemSize 4, correct). The only consumer of the broken spec in the
74
+ whole tree is `renderers/billboard/prototypeBillboardRenderer.js`, which is out of review scope by the
75
+ repo's own `prototype*.js` convention. No shipping render path is affected; this is a broken
76
+ public-surface export, not a live rendering defect.
77
+
78
+ ### GFXT-40
79
+ - **Verdict**: CONFIRMED
80
+ - **Evidence**: `computeMeshSurfaceArea.js:40` is `const y2 = points[c3 + 2];`. Executed with the triangle
81
+ `A=(0,0,0) B=(1,0,0) C=(0,1,0)` (true area 0.5) — the function returned `0`.
82
+
83
+ ### GFXT-5
84
+ - **Verdict**: CONFIRMED
85
+ - **Evidence**: `sampler2d_combine.js:52` — the input1 read loop is `for (j = 0; j < itemSize0; j++)`
86
+ while indexing `data1[j + i * itemSize1]`. `itemSize1` is computed at :34 and never used for reads.
87
+
88
+ ### GFXT-6
89
+ - **Verdict**: CONFIRMED
90
+ - **Evidence**: `sampler2d_compute_texel_value_conversion_scale_to_uint8.js:44` is
91
+ `max = max2(min, sampler2d_channel_compute_max(sampler, i).value)` — `min`, not `max`.
92
+
93
+ ### GFXT-7
94
+ - **Verdict**: CONFIRMED
95
+ - **Evidence**: producer returns `offset = min` (`:51`); consumer `sampler2d_to_html_canvas.js:61,81`
96
+ computes `(source_value + offset) * scale`. Executed on `Float32` `[10,11,12,13]`: producer returned
97
+ `{scale: 85, offset: 10}` → texel 0 maps to `(10+10)*85 = 1700`, saturating to 255 (correct: 0).
98
+ `sampler2d_to_data_url.js:16-18` composes exactly these two.
99
+
100
+ ### GFXT-10
101
+ - **Verdict**: CONFIRMED
102
+ - **Evidence**: `Sampler2DSerializationAdapter.js:26` is `if (value.data instanceof Uint8Array)`, else
103
+ `throw new TypeError('Unsupported data type')`. `Uint8ClampedArray` is not an `instanceof Uint8Array`
104
+ (separate constructor, both descend from `%TypedArray%`). `deserialize` always allocates `Uint8Array`,
105
+ so a clamped sampler cannot round-trip.
106
+
107
+ ### GFXT-17
108
+ - **Verdict**: CONFIRMED
109
+ - **Evidence**: executed `cubic2(0, 0, 1) === 24` (must be 1) and `cubic2(1.5, 0, 1) === 1059`
110
+ (must be -0.125); `cubic2.support === undefined`, so
111
+ `sampler2d_scale_down_generic(..., cubic2)` computes `ceil(ratio * undefined / 2) = NaN`.
112
+
113
+ ### GFXT-26
114
+ - **Verdict**: CONFIRMED
115
+ - **Evidence**: `AtlasLookupTexture.js:27-32` sets `format = RGBAIntegerFormat` (→ GL `RGBA_INTEGER`),
116
+ `type = UnsignedShortType`, `internalFormat = 'RGB16UI'`. three r136 `WebGLTextures` resolves a string
117
+ `internalFormat` straight to `_gl[name]`, so the upload is
118
+ `texImage2D(…, RGB16UI, …, RGBA_INTEGER, UNSIGNED_SHORT, data)`. GLES 3.0 table 3.2 pairs `RGB16UI`
119
+ only with `RGB_INTEGER`; the combination is `INVALID_OPERATION`. (Not executed — no GL context.)
120
+
121
+ ### GFXT-30
122
+ - **Verdict**: CONFIRMED
123
+ - **Evidence**: read `sampler2d_copy_with_margins.js`. `sItemSize` is bound at :29 and used only for
124
+ `_itemSize` and `sRowSize`; every source column offset is `… * dItemSize`
125
+ (`sOffset = sourceY * sRowSize + sourceX * dItemSize` at :45, `sOffset = sA + (x + sourceX) * dItemSize`
126
+ at :66, and the same shape at the other cited lines). `_itemSize = Math.min(dItemSize, sItemSize)`
127
+ proves differing channel counts are an intended input.
128
+
129
+ ### GFXT-33
130
+ - **Verdict**: CONFIRMED
131
+ - **Evidence**: `ParticularEngine.js:155-167` — `const step = steps[type]` is one shared object per
132
+ `SimulationStepType`, and `step.layer_parameters[j] = stepDefinition.parameters` overwrites on a second
133
+ definition of the same type for the same layer `j`. The execution loop at :171+ walks `steps` by index
134
+ (enum order), not authored order.
135
+
136
+ ### GFXT-34
137
+ - **Verdict**: CONFIRMED
138
+ - **Evidence**: `core/math/lookup/ParameterLookupTable.js:110` — `Math.log2(itemCount)` used as a bit width;
139
+ `log2(256) === 8 <= 8` selects the 1-byte class and `writeUint8(256)` wraps to 0, while 768+256 floats are
140
+ still written. The `@deprecated` tag does **not** rescue it: `ParameterLookupTableSerializationAdapter.js:17,26`
141
+ is the live adapter and calls `toBinaryBuffer`/`fromBinaryBuffer` directly.
142
+
143
+ ### GFXT-35
144
+ - **Verdict**: CONFIRMED
145
+ - **Evidence**: `addValue` (`:303-340`) ends at the `Array.prototype.splice.apply(this.data, …)` with no
146
+ `computeStatistics()`; `write()` (`:298`) calls it.
147
+
148
+ ### GFXT-36
149
+ - **Verdict**: CONFIRMED
150
+ - **Evidence**: `distrubuteParticlesOnMesh.js:157-159` — `const r0 = random(); const r1 = random() * (1 - r0);`
151
+ under a comment citing the triangle-point-picking reference (which describes the reflect method).
152
+ Joint density ∝ 1/(1−r0), not uniform.
153
+
154
+ ### GFXT-37
155
+ - **Verdict**: CONFIRMED
156
+ - **Evidence**: `ParticleVolume.js:353-359` — the `attribute_object === undefined` branch contains only the
157
+ `console.warn`; execution falls through to `attribute_object.fromJSON(attribute_json)`.
158
+
159
+ ### GFXT-41
160
+ - **Verdict**: CONFIRMED
161
+ - **Evidence**: `bvh32_geometry_raycast.js:124` sets `hit_found = true;` immediately after
162
+ `if (!triangle_hit_found) continue;`, i.e. before the `if (distance_sqr < best_distance_sqr)` block that
163
+ is the only writer of `result`.
164
+
165
+ ### GFXT-42
166
+ - **Verdict**: CONFIRMED
167
+ - **Evidence**: executed — `decode_attribute_value(255, BinaryDataType.Uint8, true)`,
168
+ `(127, Int8, true)` and `(32767, Int16, true)` all throw; the `Uint16` control returns ~1.0.
169
+
170
+ ### GFXT-43
171
+ - **Verdict**: CONFIRMED
172
+ - **Evidence**: `computeSkinnedMeshVertices.js:24-26` reads `attributes.position.array` /
173
+ `skinIndex.array` / `skinWeight.array` raw and hands them to `mesh_apply_skeletal_vertex_skinning`,
174
+ which indexes at a hard-coded stride of 3 (`index*3`) and 4 (`index*bones_per_vertex + i`) with no
175
+ offset/stride/normalized handling. In three r136 `InterleavedBufferAttribute.array` is a getter for
176
+ `this.data.array` (the whole interleaved buffer).
177
+
178
+ ### GFXT-44
179
+ - **Verdict**: CONFIRMED
180
+ - **Evidence**: `computeGeometryBoundingSphereMiniball.js:10` is
181
+ `const vertexData = geometry.attributes.position.array;` fed straight into
182
+ `computeBoundingSphereFromVertexData`; no deinterleave, no denormalize, no use of `attribute.count`.
183
+
184
+ ### GFXT-45
185
+ - **Verdict**: CONFIRMED
186
+ - **Evidence**: `geometry_compute_vertex_normals_indexed.js:28-37` accumulates the output of
187
+ `geometry_construct_triangle_normal`, which is a thin wrapper delegating straight to
188
+ `tri3_compute_normal` — whose `(0,1,0)` degenerate sentinel is already confirmed (GEOM3-1). The
189
+ accumulation is a full-magnitude unit vector, so a collapsed triangle contributes a fabricated +Y.
190
+
191
+ ### GFXT-46
192
+ - **Verdict**: CONFIRMED
193
+ - **Corrected severity**: (unchanged, MAJOR) — confidence upgraded from "Likely" to Confirmed
194
+ - **Evidence**: `mesh_apply_skeletal_vertex_skinning` applies `bindMatrix`, then the world bone matrices
195
+ (`bone.matrixWorld · boneInverse`, built in `computeSkinnedMeshVertices:39`), then `bindMatrixInverse` —
196
+ exactly three's `skinning_vertex` chunk, i.e. mesh-local `transformed`. `meshFromSkinnedMesh.js:25-36`
197
+ then copies `position/rotation/scale` onto the new `Mesh` **and** bakes `inverse(matrixWorld)` into the
198
+ positions, so the source transform is applied once forward and once inverted.
199
+
200
+ ---
201
+
202
+ ## engine-ecs
203
+
204
+ ### ECS-1
205
+ - **Verdict**: CONFIRMED
206
+ - **Evidence**: `Entity.js:508-525` sets `EntityFlags.Built` and binds the reference but registers no
207
+ `EventType.EntityRemoved` listener, unlike `build()` at :487-489. Reproduced verbatim: id 0 removed,
208
+ `createEntity()` recycled id 0, `e.isBuilt === true`, `e.add(new B())` wrote B onto the recycled entity,
209
+ and `e.destroy()` destroyed it (`entityExists(0) === false`).
210
+
211
+ ### ECS-14
212
+ - **Verdict**: CONFIRMED
213
+ - **Evidence**: `TerrainTileManager.js:462,471` — the point is packed `Float32Array.of(x, 0, y)` (top-down Y
214
+ at index 2) and then passed as `this.getRawTileByPosition(v3[0], v3[1])`. With an identity transform
215
+ `v3[1]` is the literal `0`, so `getRawTileByPosition` computes `tileY = floor(0 / tileSize.y) = 0` for
216
+ every input. `getRawTileByPosition` also divides by `tileSize` (grid units) without dividing out
217
+ `this.scale`, as claimed.
218
+
219
+ ### ECS-40
220
+ - **Verdict**: CONFIRMED
221
+ - **Evidence**: `LineSetDescription.js:56` reads `const sets = this.sets;` inside the loop over the popped
222
+ `set`. Reproduced with `R{lines:[l-root], sets:[C]}`, `C{lines:[l-child]}` behind a write-count guard:
223
+ output was `l-root, l-child, l-child, l-child, …` until the 500-element guard tripped.
224
+
225
+ ### ECS-9
226
+ - **Verdict**: CONFIRMED
227
+ - **Evidence**: `FogOfWarSystem.js:162-215` registers three anonymous `function (renderer, camera, scene)`
228
+ closures on `graphics.on.preRender` / `.buffersRendered` / `.postRender`; `shutdown` (`:217-219`) is a
229
+ one-liner that only removes `this.compositLayer`. No reference to the closures is retained anywhere.
230
+
231
+ ### ECS-15
232
+ - **Verdict**: CONFIRMED
233
+ - **Evidence**: `TerrainSystem.js:265-290` — `let tile_count = 0;` is passed as the `result_offset` on every
234
+ frustum iteration and never advanced, while `found_tiles += bvh_query_user_data_intersects_frustum(...)`
235
+ accumulates; the consumer loop runs `for (i = 0; i < found_tiles; i++)`.
236
+
237
+ ### ECS-16
238
+ - **Verdict**: CONFIRMED
239
+ - **Evidence**: `TerrainOverlay.js:321` passes `this` (the `TerrainOverlay`) as the destination sampler.
240
+ `TerrainOverlay` has no `width`/`height` fields (pixel data lives on `this.sampler`), so
241
+ `sampler2d_paint`'s `_w = Math.min(width, source.width - 0, undefined - dx)` and `_h` are both `NaN`
242
+ and both loops (`for (y = _y0; y < _h; …)`) execute zero iterations. Silent no-op, `needsUpdate` still set.
243
+
244
+ ### ECS-21
245
+ - **Verdict**: CONFIRMED-BUT-DOWNGRADED
246
+ - **Corrected severity**: MINOR
247
+ - **Evidence**: `HeightSampler2NormalSamplerSoft.js:54-56` writes `_x = dX / magnitude`, `_y = dY / magnitude`
248
+ with no negation. For `h(x,y) = x` this yields `(+0.998, 0, +0.0624)` where the geometric surface normal
249
+ is `(-0.998, 0, +0.0624)`.
250
+ - **Reason** (ground 5): the maths is as described, but this is a `convertHeightMap2NormalMap` **texture**
251
+ producer with no in-repo consumer, and the sign of both tangent axes in a height→normal bake is a
252
+ well-known convention split (OpenGL vs DirectX green, and u/v handedness). Calling it "MAJOR / always
253
+ wrong" over-states it; the same file's `z = 0.5 / magnitude` "strength" choice is equally
254
+ convention-driven. Real, worth fixing, but not a MAJOR correctness defect on any live path.
255
+
256
+ ### ECS-26
257
+ - **Verdict**: CONFIRMED
258
+ - **Evidence**: `AnimationOptimizer.js:111-112` assigns `this.times` / `this.values` on the optimizer.
259
+ Executed on a `VectorKeyframeTrack` with 5 keys (3 redundant): after `optimize(clip)` the track still had
260
+ `times.length === 5` (`[0,1,2,3,4]`) while `optimizer.times` held the compacted `[0,1,3,4]`.
261
+
262
+ ### ECS-28
263
+ - **Verdict**: CONFIRMED
264
+ - **Evidence**: `DynamicRuleDescription.js:55` is `return this.id.equals(other.id);` and `id` is a primitive
265
+ string field. Executed: `a.equals(b)` throws `TypeError: this.id.equals is not a function`.
266
+
267
+ ### ECS-31
268
+ - **Verdict**: CONFIRMED
269
+ - **Evidence**: `PointFitnessGaussianBlur.from` (`:38-53`) consumes `quality` only to compute
270
+ `samples_x/y/z`; there is no `r.quality = …` and no `quality` class field.
271
+ `serializeToJSON_PointFitnessFunction.js:61` writes `quality: value.quality` (→ `undefined`, dropped by
272
+ `JSON.stringify`), and `deserializeFromJSON_PointFitnessFunction.js:45,51` destructures it with no
273
+ default and forwards it, so `from()`'s own `quality = 5` applies.
274
+
275
+ ### ECS-36
276
+ - **Verdict**: CONFIRMED
277
+ - **Evidence**: `BinaryObjectSerializationAdapter2.js:416` calls
278
+ `this.#schema_table.getRecord(schema_address)`. `getRecord(schema)` (`:124-125`) reads `#schema_map`,
279
+ populated by `#schema_map.set(record.schema, record)` (`:148`) — keyed by the schema **object**. The
280
+ address-keyed map is `#address_map`, reachable only through `getSchemaAt(address)` (`:115-116`).
281
+ A numeric address can never be a key of `#schema_map`, so `record` is `undefined` and `record.typeName`
282
+ at :419 throws. The `HEADER_TAG_REF_SCHEMA` branch has no other exit.
283
+
284
+ ### ECS-37
285
+ - **Verdict**: CONFIRMED
286
+ - **Evidence**: `BinaryBufferSerializer.js:26-34` — `if (smComponentIndex === -1) { return false; }` sits
287
+ *above* the `componentInstance[COMPONENT_SERIALIZATION_TRANSIENT_FIELD] === true` check.
288
+
289
+ ### ECS-38
290
+ - **Verdict**: CONFIRMED
291
+ - **Evidence**: `BinaryObjectSerializationAdapter.js:59-61` uses a plain `Klass.typeName` static lookup,
292
+ which walks the prototype chain. The v2 writer (`BinaryObjectSerializer.js:270`) explicitly guards this
293
+ with `Object.prototype.hasOwnProperty.call(ctor, "typeName")`, so the divergence is real.
294
+
295
+ ### ECS-41
296
+ - **Verdict**: CONFIRMED
297
+ - **Evidence**: `GUIElementSystem.js:248` subscribes with a fresh object-literal context
298
+ (`{el, system, entity}`); `:261` calls `component.visible.onChanged.remove(handleComponentVisibilityChange)`
299
+ with no second argument. `Signal.remove(h, thisArg)` (`core/events/signal/Signal.js:194-220`) matches on
300
+ `n.handle === h && n.context === thisArg`, so `undefined !== {…}` never matches and it returns `false`.
301
+
302
+ ### ECS-43
303
+ - **Verdict**: CONFIRMED
304
+ - **Evidence**: executed. `toJSON()` emitted
305
+ `{"worldOffset":…,"transformWorldOffset":true,"transformPerspectiveRotation":true}` from a component with
306
+ `flags === 3`; `fromJSON` on a fresh component produced `flags === 1` and
307
+ `getFlag(PerspectiveRotation) === false`.
308
+
309
+ ---
310
+
311
+ ## gfx-gi
312
+
313
+ ### GFXG-1
314
+ - **Verdict**: CONFIRMED
315
+ - **Evidence**: `node_modules/three/src/renderers/shaders/ShaderChunk/worldpos_vertex.glsl.js` (r136) wraps
316
+ the entire declaration in `#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )`.
317
+ `sh3/gi/material/space_fragment/build_vertex_shader.js:16-24` unconditionally injects
318
+ `vWorldPosition = worldPosition.xyz;` after `#include <fog_vertex>` (which follows `worldpos_vertex` in
319
+ three's vertex shaders), with no matching `#if` and no local fallback. The newer LPG builder computes
320
+ the world position locally, as the report says.
321
+
322
+ ### GFXG-2
323
+ - **Verdict**: CONFIRMED
324
+ - **Evidence**: `prepare_bake_material.js` supplies 1x1 fallbacks for diffuse/roughness/metalness/occlusion/
325
+ emissive (`:57-75`) but `texture_normal` (`:25`, `:33`) is left `null` and assigned straight to
326
+ `target_uniforms.tNormal.value` at :100 — the `if (t === null) return;` in the anisotropy loop at :86
327
+ exists precisely because it can be null. `BakeShaderStandard.js:124` then does
328
+ `texture_supersample_4(tNormal, …).rgb * 2.0 - 1.0`; three r136 binds `emptyTexture` for a null
329
+ `sampler2D` uniform, which samples black → `(-1,-1,-1)`.
330
+
331
+ ### GFXG-3
332
+ - **Verdict**: REFUTED
333
+ - **Reason** (grounds 1 + 2): the finding's premise — "ShaderMaterial's `fog` defaults to `true` and
334
+ `SplatMaterial` does not turn it off" — is factually wrong for the pinned three.
335
+ `node_modules/three/src/materials/ShaderMaterial.js:41` is `this.fog = false; // set to use scene fog`
336
+ (it overrides `Material.js:20`'s `true`). `SplatMaterial.js:103-120` constructs the terrain
337
+ `ShaderMaterial` without a `fog` parameter and never assigns `sm.fog`; a repo-wide grep for
338
+ `.fog = true` / `fog: true` finds only the two impostor shaders. `WebGLProgram.js:442` emits
339
+ `#define USE_FOG` only when `parameters.useFog` (= `material.fog`) is true, so the `#ifdef USE_FOG`
340
+ block containing `fogDepth` (`TerrainShader.js:359-366`) is unreachable dead code. The stale symbol
341
+ should still be renamed, but the claimed failure — terrain failing to compile the moment `scene.fog`
342
+ is set — cannot occur. At most MINOR (latent).
343
+
344
+ ### GFXG-4
345
+ - **Verdict**: REFUTED
346
+ - **Reason** (ground 1): `computeMaterialEquality` does not stop at the generic flags. After the flag
347
+ block it dispatches on material type — `isMeshStandardMaterial` / `isMeshDepthMaterial` /
348
+ `isMeshMatcapMaterial` — and the final `else` is `//TODO implement other material types; return false;`.
349
+ A `ShaderMaterial` matches none of the three, so the function returns **false** for every pair of
350
+ distinct shader materials. Executed: two `ShaderMaterial`s with different sources/defines/uniforms →
351
+ `computeMaterialEquality === false`; two *byte-identical* `ShaderMaterial`s → also `false` (their
352
+ hashes do collide at `157685845`, but `HashMap` resolves by equality, so a bucket collision only costs a
353
+ comparison). `MaterialManager.obtain()` therefore cannot hand caller B caller A's material. No
354
+ in-repo material sets `isMeshStandardMaterial` on a shader material (only
355
+ `WebGLCubeProbeRenderer.js:78` reads the flag). The "both trails render smoke.png" scenario does not happen.
356
+
357
+ ### GFXG-5
358
+ - **Verdict**: CONFIRMED
359
+ - **Evidence**: `sh3/shader/visualize.frag.js:19,21,25,27` use `result -=` for coefficients 1, 3, 5 and 7.
360
+ `node_modules/three/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js:18-27` is all-`+=`, and
361
+ `core/geom/3d/sphere/harmonics/sh3_basis_at.js:29-37` — the projection basis every bake uses — is
362
+ all-positive. The visualiser is the only evaluator with the opposite convention.
363
+
364
+ ### GFXG-6
365
+ - **Verdict**: CONFIRMED
366
+ - **Evidence**: `ImpostorShaderLitV0.js:225` and `VoxelImpostorShaderLitV0.js:97` declare
367
+ `vec4 worldPosition = …` inline; neither file contains the string `#include <worldpos_vertex>`.
368
+ Both set `lights: true` (`:747` / `:227`), so `isLitMaterial` selects them and
369
+ `render/forward_plus/plugin/MaterialTransformer.js:68` runs `fp_build_vertex_shader`, whose sole
370
+ vertex injection is `insert_after(a, '#include <worldpos_vertex>', …)`.
371
+ `core/primitives/strings/insert_after.js:9-13` `console.warn`s and returns the source unchanged when the
372
+ term is absent, while the preamble still declares `varying vec3 v_world_position;` — so the varying is
373
+ declared and never written.
374
+
375
+ ### GFXG-8
376
+ - **Verdict**: CONFIRMED
377
+ - **Evidence**: `DenoiseShader.js` — the fragment reads `float bSigma = sigmas.y;` and uses it in
378
+ `normpdf3(rgba.rgb - pixel.rgb, bSigma)`, but the JS initialiser is
379
+ `sigmas: { type: "v2", value: new Vector2(sigma, sigma) }`. `filterSmoothness` reaches only `bZnorm`,
380
+ which multiplies `factor` uniformly and therefore cancels in `accumulatedColor / accumulatedFactor`.
381
+
382
+ ### GFXG-7 / GFXG-9
383
+ - **Verdict**: CONFIRMED (spot-checked, both are single-line reads)
384
+ - **Evidence**: `BakeShaderStandard.js:38` is `vec3 T = normalize(vec3(modelViewMatrix * tangent) );`
385
+ with `tangent` a `vec4` and `defaultAttributeValues.tangent = [1,0,0,1]` at :192-194 — the translation
386
+ column is folded in. `:95` is `vec4 col;` with no initialiser, followed by four `col += texture(...)`.
387
+
388
+ ---
389
+
390
+ ## engine-asset
391
+
392
+ ### ASSET-1
393
+ - **Verdict**: CONFIRMED
394
+ - **Evidence**: `PNGReader.js:497` allocates `new Uint8Array(width * bytes_per_pixel)` while `:523` uses
395
+ `line_offset = (y % 2) * passLineBytes`, and pass 7 has `pass_width === width` so
396
+ `passLineBytes === width * bytes_per_pixel` — the entire buffer. Reproduced by calling
397
+ `interlaceAdam7` directly on a hand-built 2x4 8-bit grayscale Adam7 stream for pixels
398
+ `[10,11, 20,21, 30,31, 40,41]`: the function returned `[10,11, 20,21, 30,31, 0,0]` — the last row lost.
399
+
400
+ ### ASSET-2
401
+ - **Verdict**: CONFIRMED
402
+ - **Evidence**: `ArrayBufferLoader.js:45-61` — `reader.read().then(({done, value}) => {…})` has no second
403
+ argument and no `.catch`. On a body-stream error the wrapper `ReadableStream` controller is never
404
+ `close()`d or `error()`d, so the `new Response(stream)` at :77 never completes and
405
+ `await response.arrayBuffer()` at :154 never settles; `load()` neither calls `success`/`failure` nor
406
+ rejects, and the read rejection surfaces as an unhandled rejection. The stream prototype also defines
407
+ no `cancel`.
408
+
409
+ ### ASSET-7
410
+ - **Verdict**: CONFIRMED
411
+ - **Evidence**: `PNG.js:216-221` — `a = this.transparency_lookup[pixels[i]]` with no bounds test.
412
+ Executed on a colour-type-3 PNG with a 3-entry palette and a 2-entry `tRNS`, pixel index 2:
413
+ `getPixel` returned `[200, 100, 50, undefined]`. Into a `Uint8Array` destination (the
414
+ `getRGBA8Array_generic` path) `undefined` stores as 0 → fully transparent, where the spec requires 255.
415
+ `getUint8Data_case3` (`:369-377`) implements the bounded rule correctly, confirming intent.
416
+
417
+ ---
418
+
419
+ ## gfx-render
420
+
421
+ ### GFXR-1
422
+ - **Verdict**: CONFIRMED
423
+ - **Evidence**: `Camera.js:279` is `const near = scratch_frustum.planes[0];` with
424
+ `const scratch_frustum = new Frustum()` (`:303`, `Frustum` imported from `'three'` at :1), filled through
425
+ `frustum_from_camera` → `result.setFromProjectionMatrix(...)`. three r136
426
+ `Frustum.js:54-59` orders the planes right / left / bottom / top / far / near, so index 0 is the RIGHT
427
+ plane and near is index 5. `pp/PerfectPanner.js:9-10` states the correct indices.
428
+
429
+ ### GFXR-5
430
+ - **Verdict**: CONFIRMED
431
+ - **Evidence**: `loadCubeTexture.js:27` calls `ImageUtils.loadTextureCube(urls)`.
432
+ `node_modules/three/src/extras/ImageUtils.js` (r136) declares exactly one member,
433
+ `static getDataURL(image)`. The call throws `TypeError` for any input.
434
+
435
+ ### GFXR-13
436
+ - **Verdict**: CONFIRMED
437
+ - **Evidence**: `BoneMapping.js:13-15` `byDistance` returns `b.distance - a.distance` (descending) and
438
+ `:61` consumes with `matches.pop()` — the tail, i.e. the smallest distance.
439
+ `core/primitives/strings/string_compute_similarity.js` is `string_jaro_winkler` with the JSDoc
440
+ "Higher value means string are more similar", so the least-similar pair is committed first and its
441
+ bone/name slots are then evicted for every remaining candidate.
442
+
443
+ ### GFXR-14
444
+ - **Verdict**: CONFIRMED
445
+ - **Evidence**: `SGMeshAnimationControllerSystem.js:159-167` — `const entity = this.#queue.pop();` inside a
446
+ fixed `for (let i = 0; i < 1000; i++)`; `#enqueue` (`:90-92`) is `this.#queue.push(entity);`.
447
+ `#process` re-enqueues synchronously before its first `await` when `mesh.node === null` (`:65-68`),
448
+ so the same entity is popped and pushed back to the same end 1000 times per tick.
449
+
450
+ ### GFXR-15
451
+ - **Verdict**: CONFIRMED
452
+ - **Evidence**: `QueryShader.js:108` reads
453
+ `float n2 = textureLod(utDepth, vec2(n_max.y, n_min.y), float(mip_to_use)).x;` — `n_max.y` in the x slot,
454
+ while the three sibling taps are `n_min.xy`, `vec2(n_min.x, n_max.y)` and `n_max.xy`.
455
+
456
+ ### GFXR-22
457
+ - **Verdict**: CONFIRMED
458
+ - **Evidence**: `LightSerializationAdapter.js` — `value.distance.toBinaryBuffer(buffer)` and its read
459
+ counterpart both sit inside `if (value.type.getValue() === LightType.SPOT)`. `maxShadowDistance` does not
460
+ appear in the file at all.
461
+
462
+ ### GFXR-25
463
+ - **Verdict**: CONFIRMED
464
+ - **Evidence**: `fp_build_vertex_lighting_shared.js:26` is `insert_after(result, 'void main() {', accumulation_pars)`
465
+ and `accumulation_pars` (`:9-13`) opens with
466
+ `vec3 fp_normalized_screen_position = ((gl_Position.xyz / gl_Position.w)+vec3(1.0))*0.5;` — read at the
467
+ top of `main`, before `#include <project_vertex>` assigns `gl_Position`. Reached whenever
468
+ `shader.defines.LIGHTING_VERTEX_ONLY === true` (`plugin/MaterialTransformer.js:63-64`).
469
+
470
+ ### GFXR-27
471
+ - **Verdict**: CONFIRMED
472
+ - **Evidence**: `LightManager.js:771-796` — the visibility dispatch is
473
+ `if (light.isDecal === true) {…} else if (light.isPointLight === true) {…}` with no trailing branch and
474
+ no diagnostic. A `forward_plus/model/SpotLight` accepted by `addLight` is never binned.
475
+
476
+ ---
477
+
478
+ ## Not re-checked (pre-confirmed by the lead)
479
+
480
+ `GFXR-11`, `GEOM3-1`, `ASSET-4`.